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
45 #define GPIO_MASK 0x03
47 /* extra amp-initialization sequence types */
57 ALC_HEADSET_MODE_UNKNOWN
,
58 ALC_HEADSET_MODE_UNPLUGGED
,
59 ALC_HEADSET_MODE_HEADSET
,
61 ALC_HEADSET_MODE_HEADPHONE
,
65 ALC_HEADSET_TYPE_UNKNOWN
,
66 ALC_HEADSET_TYPE_CTIA
,
67 ALC_HEADSET_TYPE_OMTP
,
71 ALC_KEY_MICMUTE_INDEX
,
74 struct alc_customize_define
{
76 unsigned char port_connectivity
;
77 unsigned char check_sum
;
78 unsigned char customization
;
79 unsigned char external_amp
;
80 unsigned int enable_pcbeep
:1;
81 unsigned int platform_type
:1;
83 unsigned int override
:1;
84 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
88 struct hda_gen_spec gen
; /* must be at head */
90 /* codec parameterization */
91 const struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
92 unsigned int num_mixers
;
93 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
95 struct alc_customize_define cdefine
;
96 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
98 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
99 int mute_led_polarity
;
100 hda_nid_t mute_led_nid
;
101 hda_nid_t cap_mute_led_nid
;
103 unsigned int gpio_led
; /* used for alc269_fixup_hp_gpio_led() */
104 unsigned int gpio_mute_led_mask
;
105 unsigned int gpio_mic_led_mask
;
107 hda_nid_t headset_mic_pin
;
108 hda_nid_t headphone_mic_pin
;
109 int current_headset_mode
;
110 int current_headset_type
;
113 void (*init_hook
)(struct hda_codec
*codec
);
115 void (*power_hook
)(struct hda_codec
*codec
);
117 void (*shutup
)(struct hda_codec
*codec
);
118 void (*reboot_notify
)(struct hda_codec
*codec
);
121 int codec_variant
; /* flag for other variants */
122 unsigned int has_alc5505_dsp
:1;
123 unsigned int no_depop_delay
:1;
127 unsigned int pll_coef_idx
, pll_coef_bit
;
129 struct input_dev
*kb_dev
;
130 u8 alc_mute_keycode_map
[1];
134 * COEF access helper functions
137 static int alc_read_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
138 unsigned int coef_idx
)
142 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
143 val
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
147 #define alc_read_coef_idx(codec, coef_idx) \
148 alc_read_coefex_idx(codec, 0x20, coef_idx)
150 static void alc_write_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
151 unsigned int coef_idx
, unsigned int coef_val
)
153 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
154 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PROC_COEF
, coef_val
);
157 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
158 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
160 static void alc_update_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
161 unsigned int coef_idx
, unsigned int mask
,
162 unsigned int bits_set
)
164 unsigned int val
= alc_read_coefex_idx(codec
, nid
, coef_idx
);
167 alc_write_coefex_idx(codec
, nid
, coef_idx
,
168 (val
& ~mask
) | bits_set
);
171 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
172 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
174 /* a special bypass for COEF 0; read the cached value at the second time */
175 static unsigned int alc_get_coef0(struct hda_codec
*codec
)
177 struct alc_spec
*spec
= codec
->spec
;
180 spec
->coef0
= alc_read_coef_idx(codec
, 0);
184 /* coef writes/updates batch */
192 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
193 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
194 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
195 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
196 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
198 static void alc_process_coef_fw(struct hda_codec
*codec
,
199 const struct coef_fw
*fw
)
201 for (; fw
->nid
; fw
++) {
202 if (fw
->mask
== (unsigned short)-1)
203 alc_write_coefex_idx(codec
, fw
->nid
, fw
->idx
, fw
->val
);
205 alc_update_coefex_idx(codec
, fw
->nid
, fw
->idx
,
211 * Append the given mixer and verb elements for the later use
212 * The mixer array is referred in build_controls(), and init_verbs are
215 static void add_mixer(struct alc_spec
*spec
, const struct snd_kcontrol_new
*mix
)
217 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
219 spec
->mixers
[spec
->num_mixers
++] = mix
;
223 * GPIO setup tables, used in initialization
225 /* Enable GPIO mask and set output */
226 static const struct hda_verb alc_gpio1_init_verbs
[] = {
227 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
228 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
229 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
233 static const struct hda_verb alc_gpio2_init_verbs
[] = {
234 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
235 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
236 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
240 static const struct hda_verb alc_gpio3_init_verbs
[] = {
241 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
242 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
243 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
248 * Fix hardware PLL issue
249 * On some codecs, the analog PLL gating control must be off while
250 * the default value is 1.
252 static void alc_fix_pll(struct hda_codec
*codec
)
254 struct alc_spec
*spec
= codec
->spec
;
257 alc_update_coefex_idx(codec
, spec
->pll_nid
, spec
->pll_coef_idx
,
258 1 << spec
->pll_coef_bit
, 0);
261 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
262 unsigned int coef_idx
, unsigned int coef_bit
)
264 struct alc_spec
*spec
= codec
->spec
;
266 spec
->pll_coef_idx
= coef_idx
;
267 spec
->pll_coef_bit
= coef_bit
;
271 /* update the master volume per volume-knob's unsol event */
272 static void alc_update_knob_master(struct hda_codec
*codec
,
273 struct hda_jack_callback
*jack
)
276 struct snd_kcontrol
*kctl
;
277 struct snd_ctl_elem_value
*uctl
;
279 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
282 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
285 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
286 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
287 val
&= HDA_AMP_VOLMASK
;
288 uctl
->value
.integer
.value
[0] = val
;
289 uctl
->value
.integer
.value
[1] = val
;
290 kctl
->put(kctl
, uctl
);
294 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
296 /* For some reason, the res given from ALC880 is broken.
297 Here we adjust it properly. */
298 snd_hda_jack_unsol_event(codec
, res
>> 2);
301 /* Change EAPD to verb control */
302 static void alc_fill_eapd_coef(struct hda_codec
*codec
)
306 coef
= alc_get_coef0(codec
);
308 switch (codec
->core
.vendor_id
) {
310 alc_update_coef_idx(codec
, 0x7, 0, 1<<5);
314 alc_update_coef_idx(codec
, 0x7, 0, 1<<13);
317 if ((coef
& 0x00f0) == 0x0010)
318 alc_update_coef_idx(codec
, 0xd, 0, 1<<14);
319 if ((coef
& 0x00f0) == 0x0020)
320 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
321 if ((coef
& 0x00f0) == 0x0030)
322 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
328 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
343 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
347 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
355 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
358 if ((coef
& 0x00f0) == 0x0030)
359 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
368 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
371 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
374 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
377 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
378 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
381 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
385 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
390 /* additional initialization for ALC888 variants */
391 static void alc888_coef_init(struct hda_codec
*codec
)
393 switch (alc_get_coef0(codec
) & 0x00f0) {
398 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
403 /* turn on/off EAPD control (only if available) */
404 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
406 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
408 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
409 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
413 /* turn on/off EAPD controls of the codec */
414 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
416 /* We currently only handle front, HP */
417 static hda_nid_t pins
[] = {
418 0x0f, 0x10, 0x14, 0x15, 0x17, 0
421 for (p
= pins
; *p
; p
++)
422 set_eapd(codec
, *p
, on
);
425 /* generic shutup callback;
426 * just turning off EPAD and a little pause for avoiding pop-noise
428 static void alc_eapd_shutup(struct hda_codec
*codec
)
430 struct alc_spec
*spec
= codec
->spec
;
432 alc_auto_setup_eapd(codec
, false);
433 if (!spec
->no_depop_delay
)
435 snd_hda_shutup_pins(codec
);
438 /* generic EAPD initialization */
439 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
441 alc_fill_eapd_coef(codec
);
442 alc_auto_setup_eapd(codec
, true);
445 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
448 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
451 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
453 case ALC_INIT_DEFAULT
:
454 switch (codec
->core
.vendor_id
) {
456 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
462 alc_update_coef_idx(codec
, 7, 0, 0x2030);
465 alc888_coef_init(codec
);
474 * Realtek SSID verification
477 /* Could be any non-zero and even value. When used as fixup, tells
478 * the driver to ignore any present sku defines.
480 #define ALC_FIXUP_SKU_IGNORE (2)
482 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
483 const struct hda_fixup
*fix
, int action
)
485 struct alc_spec
*spec
= codec
->spec
;
486 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
487 spec
->cdefine
.fixup
= 1;
488 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
492 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
493 const struct hda_fixup
*fix
, int action
)
495 struct alc_spec
*spec
= codec
->spec
;
497 if (action
== HDA_FIXUP_ACT_PROBE
) {
498 spec
->no_depop_delay
= 1;
499 codec
->depop_delay
= 0;
503 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
505 unsigned int ass
, tmp
, i
;
507 struct alc_spec
*spec
= codec
->spec
;
509 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
511 if (spec
->cdefine
.fixup
) {
512 ass
= spec
->cdefine
.sku_cfg
;
513 if (ass
== ALC_FIXUP_SKU_IGNORE
)
518 if (!codec
->bus
->pci
)
520 ass
= codec
->core
.subsystem_id
& 0xffff;
521 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
525 if (codec
->core
.vendor_id
== 0x10ec0260)
527 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
530 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
531 codec
->core
.chip_name
, ass
);
537 for (i
= 1; i
< 16; i
++) {
541 if (((ass
>> 16) & 0xf) != tmp
)
544 spec
->cdefine
.port_connectivity
= ass
>> 30;
545 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
546 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
547 spec
->cdefine
.customization
= ass
>> 8;
549 spec
->cdefine
.sku_cfg
= ass
;
550 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
551 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
552 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
553 spec
->cdefine
.override
= ass
& 0x1;
555 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
556 nid
, spec
->cdefine
.sku_cfg
);
557 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
558 spec
->cdefine
.port_connectivity
);
559 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
560 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
561 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
562 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
563 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
564 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
565 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
570 /* return the position of NID in the list, or -1 if not found */
571 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
574 for (i
= 0; i
< nums
; i
++)
579 /* return true if the given NID is found in the list */
580 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
582 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
585 /* check subsystem ID and set up device-specific initialization;
586 * return 1 if initialized, 0 if invalid SSID
588 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
589 * 31 ~ 16 : Manufacture ID
591 * 7 ~ 0 : Assembly ID
592 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
594 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
596 unsigned int ass
, tmp
, i
;
598 struct alc_spec
*spec
= codec
->spec
;
600 if (spec
->cdefine
.fixup
) {
601 ass
= spec
->cdefine
.sku_cfg
;
602 if (ass
== ALC_FIXUP_SKU_IGNORE
)
607 ass
= codec
->core
.subsystem_id
& 0xffff;
608 if (codec
->bus
->pci
&&
609 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
612 /* invalid SSID, check the special NID pin defcfg instead */
614 * 31~30 : port connectivity
617 * 19~16 : Check sum (15:1)
622 if (codec
->core
.vendor_id
== 0x10ec0260)
624 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
626 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
630 if ((ass
>> 30) != 1) /* no physical connection */
635 for (i
= 1; i
< 16; i
++) {
639 if (((ass
>> 16) & 0xf) != tmp
)
642 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
643 ass
& 0xffff, codec
->core
.vendor_id
);
647 * 2 : 0 --> Desktop, 1 --> Laptop
648 * 3~5 : External Amplifier control
651 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
654 spec
->init_amp
= ALC_INIT_GPIO1
;
657 spec
->init_amp
= ALC_INIT_GPIO2
;
660 spec
->init_amp
= ALC_INIT_GPIO3
;
664 spec
->init_amp
= ALC_INIT_DEFAULT
;
668 /* is laptop or Desktop and enable the function "Mute internal speaker
669 * when the external headphone out jack is plugged"
674 * 10~8 : Jack location
675 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
677 * 15 : 1 --> enable the function "Mute internal speaker
678 * when the external headphone out jack is plugged"
680 if (!spec
->gen
.autocfg
.hp_pins
[0] &&
681 !(spec
->gen
.autocfg
.line_out_pins
[0] &&
682 spec
->gen
.autocfg
.line_out_type
== AUTO_PIN_HP_OUT
)) {
684 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
686 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
687 spec
->gen
.autocfg
.line_outs
))
689 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
694 /* Check the validity of ALC subsystem-id
695 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
696 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
698 if (!alc_subsystem_id(codec
, ports
)) {
699 struct alc_spec
*spec
= codec
->spec
;
701 "realtek: Enable default setup for auto mode as fallback\n");
702 spec
->init_amp
= ALC_INIT_DEFAULT
;
709 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
710 const struct hda_fixup
*fix
, int action
)
712 struct alc_spec
*spec
= codec
->spec
;
714 spec
->gen
.inv_dmic_split
= 1;
718 #ifdef CONFIG_SND_HDA_INPUT_BEEP
719 /* additional beep mixers; the actual parameters are overwritten at build */
720 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
721 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
722 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
727 static int alc_build_controls(struct hda_codec
*codec
)
729 struct alc_spec
*spec
= codec
->spec
;
732 err
= snd_hda_gen_build_controls(codec
);
736 for (i
= 0; i
< spec
->num_mixers
; i
++) {
737 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
742 #ifdef CONFIG_SND_HDA_INPUT_BEEP
743 /* create beep controls if needed */
744 if (spec
->beep_amp
) {
745 const struct snd_kcontrol_new
*knew
;
746 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
747 struct snd_kcontrol
*kctl
;
748 kctl
= snd_ctl_new1(knew
, codec
);
751 kctl
->private_value
= spec
->beep_amp
;
752 err
= snd_hda_ctl_add(codec
, 0, kctl
);
759 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
768 static int alc_init(struct hda_codec
*codec
)
770 struct alc_spec
*spec
= codec
->spec
;
773 spec
->init_hook(codec
);
775 spec
->gen
.skip_verbs
= 1; /* applied in below */
776 snd_hda_gen_init(codec
);
778 alc_auto_init_amp(codec
, spec
->init_amp
);
779 snd_hda_apply_verbs(codec
); /* apply verbs here after own init */
781 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
786 static inline void alc_shutup(struct hda_codec
*codec
)
788 struct alc_spec
*spec
= codec
->spec
;
790 if (spec
&& spec
->shutup
)
793 snd_hda_shutup_pins(codec
);
796 static void alc_reboot_notify(struct hda_codec
*codec
)
798 struct alc_spec
*spec
= codec
->spec
;
800 if (spec
&& spec
->reboot_notify
)
801 spec
->reboot_notify(codec
);
806 /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
807 static void alc_d3_at_reboot(struct hda_codec
*codec
)
809 snd_hda_codec_set_power_to_all(codec
, codec
->core
.afg
, AC_PWRST_D3
);
810 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
811 AC_VERB_SET_POWER_STATE
, AC_PWRST_D3
);
815 #define alc_free snd_hda_gen_free
818 static void alc_power_eapd(struct hda_codec
*codec
)
820 alc_auto_setup_eapd(codec
, false);
823 static int alc_suspend(struct hda_codec
*codec
)
825 struct alc_spec
*spec
= codec
->spec
;
827 if (spec
&& spec
->power_hook
)
828 spec
->power_hook(codec
);
834 static int alc_resume(struct hda_codec
*codec
)
836 struct alc_spec
*spec
= codec
->spec
;
838 if (!spec
->no_depop_delay
)
839 msleep(150); /* to avoid pop noise */
840 codec
->patch_ops
.init(codec
);
841 regcache_sync(codec
->core
.regmap
);
842 hda_call_check_power_status(codec
, 0x01);
849 static const struct hda_codec_ops alc_patch_ops
= {
850 .build_controls
= alc_build_controls
,
851 .build_pcms
= snd_hda_gen_build_pcms
,
854 .unsol_event
= snd_hda_jack_unsol_event
,
856 .resume
= alc_resume
,
857 .suspend
= alc_suspend
,
858 .check_power_status
= snd_hda_gen_check_power_status
,
860 .reboot_notify
= alc_reboot_notify
,
864 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
867 * Rename codecs appropriately from COEF value or subvendor id
869 struct alc_codec_rename_table
{
870 unsigned int vendor_id
;
871 unsigned short coef_mask
;
872 unsigned short coef_bits
;
876 struct alc_codec_rename_pci_table
{
877 unsigned int codec_vendor_id
;
878 unsigned short pci_subvendor
;
879 unsigned short pci_subdevice
;
883 static struct alc_codec_rename_table rename_tbl
[] = {
884 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
885 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
886 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
887 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
888 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
889 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
890 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
891 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
892 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
893 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
894 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
895 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
896 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
897 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
898 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
899 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
900 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
904 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
905 { 0x10ec0280, 0x1028, 0, "ALC3220" },
906 { 0x10ec0282, 0x1028, 0, "ALC3221" },
907 { 0x10ec0283, 0x1028, 0, "ALC3223" },
908 { 0x10ec0288, 0x1028, 0, "ALC3263" },
909 { 0x10ec0292, 0x1028, 0, "ALC3226" },
910 { 0x10ec0293, 0x1028, 0, "ALC3235" },
911 { 0x10ec0255, 0x1028, 0, "ALC3234" },
912 { 0x10ec0668, 0x1028, 0, "ALC3661" },
913 { 0x10ec0275, 0x1028, 0, "ALC3260" },
914 { 0x10ec0899, 0x1028, 0, "ALC3861" },
915 { 0x10ec0298, 0x1028, 0, "ALC3266" },
916 { 0x10ec0236, 0x1028, 0, "ALC3204" },
917 { 0x10ec0256, 0x1028, 0, "ALC3246" },
918 { 0x10ec0225, 0x1028, 0, "ALC3253" },
919 { 0x10ec0295, 0x1028, 0, "ALC3254" },
920 { 0x10ec0299, 0x1028, 0, "ALC3271" },
921 { 0x10ec0670, 0x1025, 0, "ALC669X" },
922 { 0x10ec0676, 0x1025, 0, "ALC679X" },
923 { 0x10ec0282, 0x1043, 0, "ALC3229" },
924 { 0x10ec0233, 0x1043, 0, "ALC3236" },
925 { 0x10ec0280, 0x103c, 0, "ALC3228" },
926 { 0x10ec0282, 0x103c, 0, "ALC3227" },
927 { 0x10ec0286, 0x103c, 0, "ALC3242" },
928 { 0x10ec0290, 0x103c, 0, "ALC3241" },
929 { 0x10ec0668, 0x103c, 0, "ALC3662" },
930 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
931 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
935 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
937 const struct alc_codec_rename_table
*p
;
938 const struct alc_codec_rename_pci_table
*q
;
940 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
941 if (p
->vendor_id
!= codec
->core
.vendor_id
)
943 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
944 return alc_codec_rename(codec
, p
->name
);
947 if (!codec
->bus
->pci
)
949 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
950 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
952 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
954 if (!q
->pci_subdevice
||
955 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
956 return alc_codec_rename(codec
, q
->name
);
964 * Digital-beep handlers
966 #ifdef CONFIG_SND_HDA_INPUT_BEEP
967 #define set_beep_amp(spec, nid, idx, dir) \
968 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
970 static const struct snd_pci_quirk beep_white_list
[] = {
971 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
972 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
973 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
974 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
975 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
976 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
977 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
978 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
979 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
980 /* blacklist -- no beep available */
981 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
982 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
986 static inline int has_cdefine_beep(struct hda_codec
*codec
)
988 struct alc_spec
*spec
= codec
->spec
;
989 const struct snd_pci_quirk
*q
;
990 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
993 return spec
->cdefine
.enable_pcbeep
;
996 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
997 #define has_cdefine_beep(codec) 0
1000 /* parse the BIOS configuration and set up the alc_spec */
1001 /* return 1 if successful, 0 if the proper config is not found,
1002 * or a negative error code
1004 static int alc_parse_auto_config(struct hda_codec
*codec
,
1005 const hda_nid_t
*ignore_nids
,
1006 const hda_nid_t
*ssid_nids
)
1008 struct alc_spec
*spec
= codec
->spec
;
1009 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1012 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1018 alc_ssid_check(codec
, ssid_nids
);
1020 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1027 /* common preparation job for alc_spec */
1028 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1030 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1036 snd_hda_gen_spec_init(&spec
->gen
);
1037 spec
->gen
.mixer_nid
= mixer_nid
;
1038 spec
->gen
.own_eapd_ctl
= 1;
1039 codec
->single_adc_amp
= 1;
1040 /* FIXME: do we need this for all Realtek codec models? */
1041 codec
->spdif_status_reset
= 1;
1042 codec
->patch_ops
= alc_patch_ops
;
1044 err
= alc_codec_rename_from_preset(codec
);
1052 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1054 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1055 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1056 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1065 ALC880_FIXUP_MEDION_RIM
,
1067 ALC880_FIXUP_LG_LW25
,
1069 ALC880_FIXUP_EAPD_COEF
,
1070 ALC880_FIXUP_TCL_S700
,
1071 ALC880_FIXUP_VOL_KNOB
,
1072 ALC880_FIXUP_FUJITSU
,
1074 ALC880_FIXUP_UNIWILL
,
1075 ALC880_FIXUP_UNIWILL_DIG
,
1077 ALC880_FIXUP_ASUS_W5A
,
1078 ALC880_FIXUP_3ST_BASE
,
1080 ALC880_FIXUP_3ST_DIG
,
1081 ALC880_FIXUP_5ST_BASE
,
1083 ALC880_FIXUP_5ST_DIG
,
1084 ALC880_FIXUP_6ST_BASE
,
1086 ALC880_FIXUP_6ST_DIG
,
1087 ALC880_FIXUP_6ST_AUTOMUTE
,
1090 /* enable the volume-knob widget support on NID 0x21 */
1091 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1092 const struct hda_fixup
*fix
, int action
)
1094 if (action
== HDA_FIXUP_ACT_PROBE
)
1095 snd_hda_jack_detect_enable_callback(codec
, 0x21,
1096 alc_update_knob_master
);
1099 static const struct hda_fixup alc880_fixups
[] = {
1100 [ALC880_FIXUP_GPIO1
] = {
1101 .type
= HDA_FIXUP_VERBS
,
1102 .v
.verbs
= alc_gpio1_init_verbs
,
1104 [ALC880_FIXUP_GPIO2
] = {
1105 .type
= HDA_FIXUP_VERBS
,
1106 .v
.verbs
= alc_gpio2_init_verbs
,
1108 [ALC880_FIXUP_MEDION_RIM
] = {
1109 .type
= HDA_FIXUP_VERBS
,
1110 .v
.verbs
= (const struct hda_verb
[]) {
1111 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1112 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1116 .chain_id
= ALC880_FIXUP_GPIO2
,
1118 [ALC880_FIXUP_LG
] = {
1119 .type
= HDA_FIXUP_PINS
,
1120 .v
.pins
= (const struct hda_pintbl
[]) {
1121 /* disable bogus unused pins */
1122 { 0x16, 0x411111f0 },
1123 { 0x18, 0x411111f0 },
1124 { 0x1a, 0x411111f0 },
1128 [ALC880_FIXUP_LG_LW25
] = {
1129 .type
= HDA_FIXUP_PINS
,
1130 .v
.pins
= (const struct hda_pintbl
[]) {
1131 { 0x1a, 0x0181344f }, /* line-in */
1132 { 0x1b, 0x0321403f }, /* headphone */
1136 [ALC880_FIXUP_W810
] = {
1137 .type
= HDA_FIXUP_PINS
,
1138 .v
.pins
= (const struct hda_pintbl
[]) {
1139 /* disable bogus unused pins */
1140 { 0x17, 0x411111f0 },
1144 .chain_id
= ALC880_FIXUP_GPIO2
,
1146 [ALC880_FIXUP_EAPD_COEF
] = {
1147 .type
= HDA_FIXUP_VERBS
,
1148 .v
.verbs
= (const struct hda_verb
[]) {
1149 /* change to EAPD mode */
1150 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1151 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1155 [ALC880_FIXUP_TCL_S700
] = {
1156 .type
= HDA_FIXUP_VERBS
,
1157 .v
.verbs
= (const struct hda_verb
[]) {
1158 /* change to EAPD mode */
1159 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1160 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1164 .chain_id
= ALC880_FIXUP_GPIO2
,
1166 [ALC880_FIXUP_VOL_KNOB
] = {
1167 .type
= HDA_FIXUP_FUNC
,
1168 .v
.func
= alc880_fixup_vol_knob
,
1170 [ALC880_FIXUP_FUJITSU
] = {
1171 /* override all pins as BIOS on old Amilo is broken */
1172 .type
= HDA_FIXUP_PINS
,
1173 .v
.pins
= (const struct hda_pintbl
[]) {
1174 { 0x14, 0x0121401f }, /* HP */
1175 { 0x15, 0x99030120 }, /* speaker */
1176 { 0x16, 0x99030130 }, /* bass speaker */
1177 { 0x17, 0x411111f0 }, /* N/A */
1178 { 0x18, 0x411111f0 }, /* N/A */
1179 { 0x19, 0x01a19950 }, /* mic-in */
1180 { 0x1a, 0x411111f0 }, /* N/A */
1181 { 0x1b, 0x411111f0 }, /* N/A */
1182 { 0x1c, 0x411111f0 }, /* N/A */
1183 { 0x1d, 0x411111f0 }, /* N/A */
1184 { 0x1e, 0x01454140 }, /* SPDIF out */
1188 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1190 [ALC880_FIXUP_F1734
] = {
1191 /* almost compatible with FUJITSU, but no bass and SPDIF */
1192 .type
= HDA_FIXUP_PINS
,
1193 .v
.pins
= (const struct hda_pintbl
[]) {
1194 { 0x14, 0x0121401f }, /* HP */
1195 { 0x15, 0x99030120 }, /* speaker */
1196 { 0x16, 0x411111f0 }, /* N/A */
1197 { 0x17, 0x411111f0 }, /* N/A */
1198 { 0x18, 0x411111f0 }, /* N/A */
1199 { 0x19, 0x01a19950 }, /* mic-in */
1200 { 0x1a, 0x411111f0 }, /* N/A */
1201 { 0x1b, 0x411111f0 }, /* N/A */
1202 { 0x1c, 0x411111f0 }, /* N/A */
1203 { 0x1d, 0x411111f0 }, /* N/A */
1204 { 0x1e, 0x411111f0 }, /* N/A */
1208 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1210 [ALC880_FIXUP_UNIWILL
] = {
1211 /* need to fix HP and speaker pins to be parsed correctly */
1212 .type
= HDA_FIXUP_PINS
,
1213 .v
.pins
= (const struct hda_pintbl
[]) {
1214 { 0x14, 0x0121411f }, /* HP */
1215 { 0x15, 0x99030120 }, /* speaker */
1216 { 0x16, 0x99030130 }, /* bass speaker */
1220 [ALC880_FIXUP_UNIWILL_DIG
] = {
1221 .type
= HDA_FIXUP_PINS
,
1222 .v
.pins
= (const struct hda_pintbl
[]) {
1223 /* disable bogus unused pins */
1224 { 0x17, 0x411111f0 },
1225 { 0x19, 0x411111f0 },
1226 { 0x1b, 0x411111f0 },
1227 { 0x1f, 0x411111f0 },
1231 [ALC880_FIXUP_Z71V
] = {
1232 .type
= HDA_FIXUP_PINS
,
1233 .v
.pins
= (const struct hda_pintbl
[]) {
1234 /* set up the whole pins as BIOS is utterly broken */
1235 { 0x14, 0x99030120 }, /* speaker */
1236 { 0x15, 0x0121411f }, /* HP */
1237 { 0x16, 0x411111f0 }, /* N/A */
1238 { 0x17, 0x411111f0 }, /* N/A */
1239 { 0x18, 0x01a19950 }, /* mic-in */
1240 { 0x19, 0x411111f0 }, /* N/A */
1241 { 0x1a, 0x01813031 }, /* line-in */
1242 { 0x1b, 0x411111f0 }, /* N/A */
1243 { 0x1c, 0x411111f0 }, /* N/A */
1244 { 0x1d, 0x411111f0 }, /* N/A */
1245 { 0x1e, 0x0144111e }, /* SPDIF */
1249 [ALC880_FIXUP_ASUS_W5A
] = {
1250 .type
= HDA_FIXUP_PINS
,
1251 .v
.pins
= (const struct hda_pintbl
[]) {
1252 /* set up the whole pins as BIOS is utterly broken */
1253 { 0x14, 0x0121411f }, /* HP */
1254 { 0x15, 0x411111f0 }, /* N/A */
1255 { 0x16, 0x411111f0 }, /* N/A */
1256 { 0x17, 0x411111f0 }, /* N/A */
1257 { 0x18, 0x90a60160 }, /* mic */
1258 { 0x19, 0x411111f0 }, /* N/A */
1259 { 0x1a, 0x411111f0 }, /* N/A */
1260 { 0x1b, 0x411111f0 }, /* N/A */
1261 { 0x1c, 0x411111f0 }, /* N/A */
1262 { 0x1d, 0x411111f0 }, /* N/A */
1263 { 0x1e, 0xb743111e }, /* SPDIF out */
1267 .chain_id
= ALC880_FIXUP_GPIO1
,
1269 [ALC880_FIXUP_3ST_BASE
] = {
1270 .type
= HDA_FIXUP_PINS
,
1271 .v
.pins
= (const struct hda_pintbl
[]) {
1272 { 0x14, 0x01014010 }, /* line-out */
1273 { 0x15, 0x411111f0 }, /* N/A */
1274 { 0x16, 0x411111f0 }, /* N/A */
1275 { 0x17, 0x411111f0 }, /* N/A */
1276 { 0x18, 0x01a19c30 }, /* mic-in */
1277 { 0x19, 0x0121411f }, /* HP */
1278 { 0x1a, 0x01813031 }, /* line-in */
1279 { 0x1b, 0x02a19c40 }, /* front-mic */
1280 { 0x1c, 0x411111f0 }, /* N/A */
1281 { 0x1d, 0x411111f0 }, /* N/A */
1282 /* 0x1e is filled in below */
1283 { 0x1f, 0x411111f0 }, /* N/A */
1287 [ALC880_FIXUP_3ST
] = {
1288 .type
= HDA_FIXUP_PINS
,
1289 .v
.pins
= (const struct hda_pintbl
[]) {
1290 { 0x1e, 0x411111f0 }, /* N/A */
1294 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1296 [ALC880_FIXUP_3ST_DIG
] = {
1297 .type
= HDA_FIXUP_PINS
,
1298 .v
.pins
= (const struct hda_pintbl
[]) {
1299 { 0x1e, 0x0144111e }, /* SPDIF */
1303 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1305 [ALC880_FIXUP_5ST_BASE
] = {
1306 .type
= HDA_FIXUP_PINS
,
1307 .v
.pins
= (const struct hda_pintbl
[]) {
1308 { 0x14, 0x01014010 }, /* front */
1309 { 0x15, 0x411111f0 }, /* N/A */
1310 { 0x16, 0x01011411 }, /* CLFE */
1311 { 0x17, 0x01016412 }, /* surr */
1312 { 0x18, 0x01a19c30 }, /* mic-in */
1313 { 0x19, 0x0121411f }, /* HP */
1314 { 0x1a, 0x01813031 }, /* line-in */
1315 { 0x1b, 0x02a19c40 }, /* front-mic */
1316 { 0x1c, 0x411111f0 }, /* N/A */
1317 { 0x1d, 0x411111f0 }, /* N/A */
1318 /* 0x1e is filled in below */
1319 { 0x1f, 0x411111f0 }, /* N/A */
1323 [ALC880_FIXUP_5ST
] = {
1324 .type
= HDA_FIXUP_PINS
,
1325 .v
.pins
= (const struct hda_pintbl
[]) {
1326 { 0x1e, 0x411111f0 }, /* N/A */
1330 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1332 [ALC880_FIXUP_5ST_DIG
] = {
1333 .type
= HDA_FIXUP_PINS
,
1334 .v
.pins
= (const struct hda_pintbl
[]) {
1335 { 0x1e, 0x0144111e }, /* SPDIF */
1339 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1341 [ALC880_FIXUP_6ST_BASE
] = {
1342 .type
= HDA_FIXUP_PINS
,
1343 .v
.pins
= (const struct hda_pintbl
[]) {
1344 { 0x14, 0x01014010 }, /* front */
1345 { 0x15, 0x01016412 }, /* surr */
1346 { 0x16, 0x01011411 }, /* CLFE */
1347 { 0x17, 0x01012414 }, /* side */
1348 { 0x18, 0x01a19c30 }, /* mic-in */
1349 { 0x19, 0x02a19c40 }, /* front-mic */
1350 { 0x1a, 0x01813031 }, /* line-in */
1351 { 0x1b, 0x0121411f }, /* HP */
1352 { 0x1c, 0x411111f0 }, /* N/A */
1353 { 0x1d, 0x411111f0 }, /* N/A */
1354 /* 0x1e is filled in below */
1355 { 0x1f, 0x411111f0 }, /* N/A */
1359 [ALC880_FIXUP_6ST
] = {
1360 .type
= HDA_FIXUP_PINS
,
1361 .v
.pins
= (const struct hda_pintbl
[]) {
1362 { 0x1e, 0x411111f0 }, /* N/A */
1366 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1368 [ALC880_FIXUP_6ST_DIG
] = {
1369 .type
= HDA_FIXUP_PINS
,
1370 .v
.pins
= (const struct hda_pintbl
[]) {
1371 { 0x1e, 0x0144111e }, /* SPDIF */
1375 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1377 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1378 .type
= HDA_FIXUP_PINS
,
1379 .v
.pins
= (const struct hda_pintbl
[]) {
1380 { 0x1b, 0x0121401f }, /* HP with jack detect */
1383 .chained_before
= true,
1384 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1388 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1389 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1390 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1391 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1392 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1393 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1394 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1395 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1396 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1397 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1398 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1399 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1400 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1401 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1402 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1403 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU
),
1404 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1405 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1406 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1407 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1408 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1409 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1410 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1411 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1413 /* Below is the copied entries from alc880_quirks.c.
1414 * It's not quite sure whether BIOS sets the correct pin-config table
1415 * on these machines, thus they are kept to be compatible with
1416 * the old static quirks. Once when it's confirmed to work without
1417 * these overrides, it'd be better to remove.
1419 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1420 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1421 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1422 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1423 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1424 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1425 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1426 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1427 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1428 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1429 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1430 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1431 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1432 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1433 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1434 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1435 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1436 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1437 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1438 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1439 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1440 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1441 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1442 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1443 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1444 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1445 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1446 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1447 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1448 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1449 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1450 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1451 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1453 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1454 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1455 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1459 static const struct hda_model_fixup alc880_fixup_models
[] = {
1460 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1461 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1462 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1463 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1464 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1465 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1466 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1472 * OK, here we have finally the patch for ALC880
1474 static int patch_alc880(struct hda_codec
*codec
)
1476 struct alc_spec
*spec
;
1479 err
= alc_alloc_spec(codec
, 0x0b);
1484 spec
->gen
.need_dac_fix
= 1;
1485 spec
->gen
.beep_nid
= 0x01;
1487 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1489 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1491 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1493 /* automatic parse from the BIOS config */
1494 err
= alc880_parse_auto_config(codec
);
1498 if (!spec
->gen
.no_analog
)
1499 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1501 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1514 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1516 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1517 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1518 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1525 ALC260_FIXUP_HP_DC5750
,
1526 ALC260_FIXUP_HP_PIN_0F
,
1529 ALC260_FIXUP_GPIO1_TOGGLE
,
1530 ALC260_FIXUP_REPLACER
,
1531 ALC260_FIXUP_HP_B1900
,
1533 ALC260_FIXUP_FSC_S7020
,
1534 ALC260_FIXUP_FSC_S7020_JWSE
,
1535 ALC260_FIXUP_VAIO_PINS
,
1538 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1540 struct alc_spec
*spec
= codec
->spec
;
1541 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
1542 spec
->gen
.hp_jack_present
);
1545 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1546 const struct hda_fixup
*fix
, int action
)
1548 struct alc_spec
*spec
= codec
->spec
;
1549 if (action
== HDA_FIXUP_ACT_PROBE
) {
1550 /* although the machine has only one output pin, we need to
1551 * toggle GPIO1 according to the jack state
1553 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1554 spec
->gen
.detect_hp
= 1;
1555 spec
->gen
.automute_speaker
= 1;
1556 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1557 snd_hda_jack_detect_enable_callback(codec
, 0x0f,
1558 snd_hda_gen_hp_automute
);
1559 snd_hda_add_verbs(codec
, alc_gpio1_init_verbs
);
1563 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1564 const struct hda_fixup
*fix
, int action
)
1566 struct alc_spec
*spec
= codec
->spec
;
1567 static const struct hda_pintbl pincfgs
[] = {
1568 { 0x0f, 0x02214000 }, /* HP/speaker */
1569 { 0x12, 0x90a60160 }, /* int mic */
1570 { 0x13, 0x02a19000 }, /* ext mic */
1571 { 0x18, 0x01446000 }, /* SPDIF out */
1572 /* disable bogus I/O pins */
1573 { 0x10, 0x411111f0 },
1574 { 0x11, 0x411111f0 },
1575 { 0x14, 0x411111f0 },
1576 { 0x15, 0x411111f0 },
1577 { 0x16, 0x411111f0 },
1578 { 0x17, 0x411111f0 },
1579 { 0x19, 0x411111f0 },
1584 case HDA_FIXUP_ACT_PRE_PROBE
:
1585 snd_hda_apply_pincfgs(codec
, pincfgs
);
1587 case HDA_FIXUP_ACT_PROBE
:
1588 spec
->init_amp
= ALC_INIT_NONE
;
1593 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1594 const struct hda_fixup
*fix
, int action
)
1596 struct alc_spec
*spec
= codec
->spec
;
1597 if (action
== HDA_FIXUP_ACT_PROBE
)
1598 spec
->init_amp
= ALC_INIT_NONE
;
1601 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec
*codec
,
1602 const struct hda_fixup
*fix
, int action
)
1604 struct alc_spec
*spec
= codec
->spec
;
1605 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1606 spec
->gen
.add_jack_modes
= 1;
1607 spec
->gen
.hp_mic
= 1;
1611 static const struct hda_fixup alc260_fixups
[] = {
1612 [ALC260_FIXUP_HP_DC5750
] = {
1613 .type
= HDA_FIXUP_PINS
,
1614 .v
.pins
= (const struct hda_pintbl
[]) {
1615 { 0x11, 0x90130110 }, /* speaker */
1619 [ALC260_FIXUP_HP_PIN_0F
] = {
1620 .type
= HDA_FIXUP_PINS
,
1621 .v
.pins
= (const struct hda_pintbl
[]) {
1622 { 0x0f, 0x01214000 }, /* HP */
1626 [ALC260_FIXUP_COEF
] = {
1627 .type
= HDA_FIXUP_VERBS
,
1628 .v
.verbs
= (const struct hda_verb
[]) {
1629 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1630 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1634 [ALC260_FIXUP_GPIO1
] = {
1635 .type
= HDA_FIXUP_VERBS
,
1636 .v
.verbs
= alc_gpio1_init_verbs
,
1638 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1639 .type
= HDA_FIXUP_FUNC
,
1640 .v
.func
= alc260_fixup_gpio1_toggle
,
1642 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1644 [ALC260_FIXUP_REPLACER
] = {
1645 .type
= HDA_FIXUP_VERBS
,
1646 .v
.verbs
= (const struct hda_verb
[]) {
1647 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1648 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1652 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1654 [ALC260_FIXUP_HP_B1900
] = {
1655 .type
= HDA_FIXUP_FUNC
,
1656 .v
.func
= alc260_fixup_gpio1_toggle
,
1658 .chain_id
= ALC260_FIXUP_COEF
,
1660 [ALC260_FIXUP_KN1
] = {
1661 .type
= HDA_FIXUP_FUNC
,
1662 .v
.func
= alc260_fixup_kn1
,
1664 [ALC260_FIXUP_FSC_S7020
] = {
1665 .type
= HDA_FIXUP_FUNC
,
1666 .v
.func
= alc260_fixup_fsc_s7020
,
1668 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1669 .type
= HDA_FIXUP_FUNC
,
1670 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1672 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1674 [ALC260_FIXUP_VAIO_PINS
] = {
1675 .type
= HDA_FIXUP_PINS
,
1676 .v
.pins
= (const struct hda_pintbl
[]) {
1677 /* Pin configs are missing completely on some VAIOs */
1678 { 0x0f, 0x01211020 },
1679 { 0x10, 0x0001003f },
1680 { 0x11, 0x411111f0 },
1681 { 0x12, 0x01a15930 },
1682 { 0x13, 0x411111f0 },
1683 { 0x14, 0x411111f0 },
1684 { 0x15, 0x411111f0 },
1685 { 0x16, 0x411111f0 },
1686 { 0x17, 0x411111f0 },
1687 { 0x18, 0x411111f0 },
1688 { 0x19, 0x411111f0 },
1694 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1695 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1696 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1697 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1698 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1699 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1700 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1701 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1702 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1703 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1704 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1705 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1706 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1710 static const struct hda_model_fixup alc260_fixup_models
[] = {
1711 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1712 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1713 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1714 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1720 static int patch_alc260(struct hda_codec
*codec
)
1722 struct alc_spec
*spec
;
1725 err
= alc_alloc_spec(codec
, 0x07);
1730 /* as quite a few machines require HP amp for speaker outputs,
1731 * it's easier to enable it unconditionally; even if it's unneeded,
1732 * it's almost harmless.
1734 spec
->gen
.prefer_hp_amp
= 1;
1735 spec
->gen
.beep_nid
= 0x01;
1737 spec
->shutup
= alc_eapd_shutup
;
1739 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1741 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1743 /* automatic parse from the BIOS config */
1744 err
= alc260_parse_auto_config(codec
);
1748 if (!spec
->gen
.no_analog
)
1749 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1751 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1762 * ALC882/883/885/888/889 support
1764 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1765 * configuration. Each pin widget can choose any input DACs and a mixer.
1766 * Each ADC is connected from a mixer of all inputs. This makes possible
1767 * 6-channel independent captures.
1769 * In addition, an independent DAC for the multi-playback (not used in this
1777 ALC882_FIXUP_ABIT_AW9D_MAX
,
1778 ALC882_FIXUP_LENOVO_Y530
,
1779 ALC882_FIXUP_PB_M5210
,
1780 ALC882_FIXUP_ACER_ASPIRE_7736
,
1781 ALC882_FIXUP_ASUS_W90V
,
1783 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1784 ALC889_FIXUP_VAIO_TT
,
1785 ALC888_FIXUP_EEE1601
,
1788 ALC883_FIXUP_ACER_EAPD
,
1793 ALC882_FIXUP_ASUS_W2JC
,
1794 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1795 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1796 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1797 ALC885_FIXUP_MACPRO_GPIO
,
1798 ALC889_FIXUP_DAC_ROUTE
,
1799 ALC889_FIXUP_MBP_VREF
,
1800 ALC889_FIXUP_IMAC91_VREF
,
1801 ALC889_FIXUP_MBA11_VREF
,
1802 ALC889_FIXUP_MBA21_VREF
,
1803 ALC889_FIXUP_MP11_VREF
,
1804 ALC889_FIXUP_MP41_VREF
,
1805 ALC882_FIXUP_INV_DMIC
,
1806 ALC882_FIXUP_NO_PRIMARY_HP
,
1807 ALC887_FIXUP_ASUS_BASS
,
1808 ALC887_FIXUP_BASS_CHMAP
,
1811 static void alc889_fixup_coef(struct hda_codec
*codec
,
1812 const struct hda_fixup
*fix
, int action
)
1814 if (action
!= HDA_FIXUP_ACT_INIT
)
1816 alc_update_coef_idx(codec
, 7, 0, 0x2030);
1819 /* toggle speaker-output according to the hp-jack state */
1820 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
1822 unsigned int gpiostate
, gpiomask
, gpiodir
;
1824 gpiostate
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1825 AC_VERB_GET_GPIO_DATA
, 0);
1828 gpiostate
|= (1 << pin
);
1830 gpiostate
&= ~(1 << pin
);
1832 gpiomask
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1833 AC_VERB_GET_GPIO_MASK
, 0);
1834 gpiomask
|= (1 << pin
);
1836 gpiodir
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1837 AC_VERB_GET_GPIO_DIRECTION
, 0);
1838 gpiodir
|= (1 << pin
);
1841 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1842 AC_VERB_SET_GPIO_MASK
, gpiomask
);
1843 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1844 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
1848 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1849 AC_VERB_SET_GPIO_DATA
, gpiostate
);
1852 /* set up GPIO at initialization */
1853 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1854 const struct hda_fixup
*fix
, int action
)
1856 if (action
!= HDA_FIXUP_ACT_INIT
)
1858 alc882_gpio_mute(codec
, 0, 0);
1859 alc882_gpio_mute(codec
, 1, 0);
1862 /* Fix the connection of some pins for ALC889:
1863 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1864 * work correctly (bko#42740)
1866 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1867 const struct hda_fixup
*fix
, int action
)
1869 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1870 /* fake the connections during parsing the tree */
1871 hda_nid_t conn1
[2] = { 0x0c, 0x0d };
1872 hda_nid_t conn2
[2] = { 0x0e, 0x0f };
1873 snd_hda_override_conn_list(codec
, 0x14, 2, conn1
);
1874 snd_hda_override_conn_list(codec
, 0x15, 2, conn1
);
1875 snd_hda_override_conn_list(codec
, 0x18, 2, conn2
);
1876 snd_hda_override_conn_list(codec
, 0x1a, 2, conn2
);
1877 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1878 /* restore the connections */
1879 hda_nid_t conn
[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1880 snd_hda_override_conn_list(codec
, 0x14, 5, conn
);
1881 snd_hda_override_conn_list(codec
, 0x15, 5, conn
);
1882 snd_hda_override_conn_list(codec
, 0x18, 5, conn
);
1883 snd_hda_override_conn_list(codec
, 0x1a, 5, conn
);
1887 /* Set VREF on HP pin */
1888 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1889 const struct hda_fixup
*fix
, int action
)
1891 struct alc_spec
*spec
= codec
->spec
;
1892 static hda_nid_t nids
[3] = { 0x14, 0x15, 0x19 };
1895 if (action
!= HDA_FIXUP_ACT_INIT
)
1897 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1898 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1899 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1901 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1902 val
|= AC_PINCTL_VREF_80
;
1903 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1904 spec
->gen
.keep_vref_in_automute
= 1;
1909 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
1910 const hda_nid_t
*nids
, int num_nids
)
1912 struct alc_spec
*spec
= codec
->spec
;
1915 for (i
= 0; i
< num_nids
; i
++) {
1917 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1918 val
|= AC_PINCTL_VREF_50
;
1919 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1921 spec
->gen
.keep_vref_in_automute
= 1;
1924 /* Set VREF on speaker pins on imac91 */
1925 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
1926 const struct hda_fixup
*fix
, int action
)
1928 static hda_nid_t nids
[2] = { 0x18, 0x1a };
1930 if (action
== HDA_FIXUP_ACT_INIT
)
1931 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1934 /* Set VREF on speaker pins on mba11 */
1935 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
1936 const struct hda_fixup
*fix
, int action
)
1938 static hda_nid_t nids
[1] = { 0x18 };
1940 if (action
== HDA_FIXUP_ACT_INIT
)
1941 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1944 /* Set VREF on speaker pins on mba21 */
1945 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
1946 const struct hda_fixup
*fix
, int action
)
1948 static hda_nid_t nids
[2] = { 0x18, 0x19 };
1950 if (action
== HDA_FIXUP_ACT_INIT
)
1951 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1954 /* Don't take HP output as primary
1955 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
1956 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
1958 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
1959 const struct hda_fixup
*fix
, int action
)
1961 struct alc_spec
*spec
= codec
->spec
;
1962 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1963 spec
->gen
.no_primary_hp
= 1;
1964 spec
->gen
.no_multi_io
= 1;
1968 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
1969 const struct hda_fixup
*fix
, int action
);
1971 static const struct hda_fixup alc882_fixups
[] = {
1972 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
1973 .type
= HDA_FIXUP_PINS
,
1974 .v
.pins
= (const struct hda_pintbl
[]) {
1975 { 0x15, 0x01080104 }, /* side */
1976 { 0x16, 0x01011012 }, /* rear */
1977 { 0x17, 0x01016011 }, /* clfe */
1981 [ALC882_FIXUP_LENOVO_Y530
] = {
1982 .type
= HDA_FIXUP_PINS
,
1983 .v
.pins
= (const struct hda_pintbl
[]) {
1984 { 0x15, 0x99130112 }, /* rear int speakers */
1985 { 0x16, 0x99130111 }, /* subwoofer */
1989 [ALC882_FIXUP_PB_M5210
] = {
1990 .type
= HDA_FIXUP_PINCTLS
,
1991 .v
.pins
= (const struct hda_pintbl
[]) {
1992 { 0x19, PIN_VREF50
},
1996 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
1997 .type
= HDA_FIXUP_FUNC
,
1998 .v
.func
= alc_fixup_sku_ignore
,
2000 [ALC882_FIXUP_ASUS_W90V
] = {
2001 .type
= HDA_FIXUP_PINS
,
2002 .v
.pins
= (const struct hda_pintbl
[]) {
2003 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2007 [ALC889_FIXUP_CD
] = {
2008 .type
= HDA_FIXUP_PINS
,
2009 .v
.pins
= (const struct hda_pintbl
[]) {
2010 { 0x1c, 0x993301f0 }, /* CD */
2014 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2015 .type
= HDA_FIXUP_PINS
,
2016 .v
.pins
= (const struct hda_pintbl
[]) {
2017 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2021 .chain_id
= ALC889_FIXUP_CD
,
2023 [ALC889_FIXUP_VAIO_TT
] = {
2024 .type
= HDA_FIXUP_PINS
,
2025 .v
.pins
= (const struct hda_pintbl
[]) {
2026 { 0x17, 0x90170111 }, /* hidden surround speaker */
2030 [ALC888_FIXUP_EEE1601
] = {
2031 .type
= HDA_FIXUP_VERBS
,
2032 .v
.verbs
= (const struct hda_verb
[]) {
2033 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2034 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2038 [ALC882_FIXUP_EAPD
] = {
2039 .type
= HDA_FIXUP_VERBS
,
2040 .v
.verbs
= (const struct hda_verb
[]) {
2041 /* change to EAPD mode */
2042 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2043 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2047 [ALC883_FIXUP_EAPD
] = {
2048 .type
= HDA_FIXUP_VERBS
,
2049 .v
.verbs
= (const struct hda_verb
[]) {
2050 /* change to EAPD mode */
2051 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2052 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2056 [ALC883_FIXUP_ACER_EAPD
] = {
2057 .type
= HDA_FIXUP_VERBS
,
2058 .v
.verbs
= (const struct hda_verb
[]) {
2059 /* eanable EAPD on Acer laptops */
2060 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2061 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2065 [ALC882_FIXUP_GPIO1
] = {
2066 .type
= HDA_FIXUP_VERBS
,
2067 .v
.verbs
= alc_gpio1_init_verbs
,
2069 [ALC882_FIXUP_GPIO2
] = {
2070 .type
= HDA_FIXUP_VERBS
,
2071 .v
.verbs
= alc_gpio2_init_verbs
,
2073 [ALC882_FIXUP_GPIO3
] = {
2074 .type
= HDA_FIXUP_VERBS
,
2075 .v
.verbs
= alc_gpio3_init_verbs
,
2077 [ALC882_FIXUP_ASUS_W2JC
] = {
2078 .type
= HDA_FIXUP_VERBS
,
2079 .v
.verbs
= alc_gpio1_init_verbs
,
2081 .chain_id
= ALC882_FIXUP_EAPD
,
2083 [ALC889_FIXUP_COEF
] = {
2084 .type
= HDA_FIXUP_FUNC
,
2085 .v
.func
= alc889_fixup_coef
,
2087 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2088 .type
= HDA_FIXUP_PINS
,
2089 .v
.pins
= (const struct hda_pintbl
[]) {
2090 { 0x16, 0x99130111 }, /* CLFE speaker */
2091 { 0x17, 0x99130112 }, /* surround speaker */
2095 .chain_id
= ALC882_FIXUP_GPIO1
,
2097 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2098 .type
= HDA_FIXUP_PINS
,
2099 .v
.pins
= (const struct hda_pintbl
[]) {
2100 { 0x16, 0x99130111 }, /* CLFE speaker */
2101 { 0x1b, 0x99130112 }, /* surround speaker */
2105 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2107 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2108 /* additional init verbs for Acer Aspire 8930G */
2109 .type
= HDA_FIXUP_VERBS
,
2110 .v
.verbs
= (const struct hda_verb
[]) {
2111 /* Enable all DACs */
2112 /* DAC DISABLE/MUTE 1? */
2113 /* setting bits 1-5 disables DAC nids 0x02-0x06
2114 * apparently. Init=0x38 */
2115 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2116 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2117 /* DAC DISABLE/MUTE 2? */
2118 /* some bit here disables the other DACs.
2120 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2121 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2123 * This laptop has a stereo digital microphone.
2124 * The mics are only 1cm apart which makes the stereo
2125 * useless. However, either the mic or the ALC889
2126 * makes the signal become a difference/sum signal
2127 * instead of standard stereo, which is annoying.
2128 * So instead we flip this bit which makes the
2129 * codec replicate the sum signal to both channels,
2130 * turning it into a normal mono mic.
2132 /* DMIC_CONTROL? Init value = 0x0001 */
2133 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2134 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2135 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2136 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2140 .chain_id
= ALC882_FIXUP_GPIO1
,
2142 [ALC885_FIXUP_MACPRO_GPIO
] = {
2143 .type
= HDA_FIXUP_FUNC
,
2144 .v
.func
= alc885_fixup_macpro_gpio
,
2146 [ALC889_FIXUP_DAC_ROUTE
] = {
2147 .type
= HDA_FIXUP_FUNC
,
2148 .v
.func
= alc889_fixup_dac_route
,
2150 [ALC889_FIXUP_MBP_VREF
] = {
2151 .type
= HDA_FIXUP_FUNC
,
2152 .v
.func
= alc889_fixup_mbp_vref
,
2154 .chain_id
= ALC882_FIXUP_GPIO1
,
2156 [ALC889_FIXUP_IMAC91_VREF
] = {
2157 .type
= HDA_FIXUP_FUNC
,
2158 .v
.func
= alc889_fixup_imac91_vref
,
2160 .chain_id
= ALC882_FIXUP_GPIO1
,
2162 [ALC889_FIXUP_MBA11_VREF
] = {
2163 .type
= HDA_FIXUP_FUNC
,
2164 .v
.func
= alc889_fixup_mba11_vref
,
2166 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2168 [ALC889_FIXUP_MBA21_VREF
] = {
2169 .type
= HDA_FIXUP_FUNC
,
2170 .v
.func
= alc889_fixup_mba21_vref
,
2172 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2174 [ALC889_FIXUP_MP11_VREF
] = {
2175 .type
= HDA_FIXUP_FUNC
,
2176 .v
.func
= alc889_fixup_mba11_vref
,
2178 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2180 [ALC889_FIXUP_MP41_VREF
] = {
2181 .type
= HDA_FIXUP_FUNC
,
2182 .v
.func
= alc889_fixup_mbp_vref
,
2184 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2186 [ALC882_FIXUP_INV_DMIC
] = {
2187 .type
= HDA_FIXUP_FUNC
,
2188 .v
.func
= alc_fixup_inv_dmic
,
2190 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2191 .type
= HDA_FIXUP_FUNC
,
2192 .v
.func
= alc882_fixup_no_primary_hp
,
2194 [ALC887_FIXUP_ASUS_BASS
] = {
2195 .type
= HDA_FIXUP_PINS
,
2196 .v
.pins
= (const struct hda_pintbl
[]) {
2197 {0x16, 0x99130130}, /* bass speaker */
2201 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2203 [ALC887_FIXUP_BASS_CHMAP
] = {
2204 .type
= HDA_FIXUP_FUNC
,
2205 .v
.func
= alc_fixup_bass_chmap
,
2209 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2210 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2211 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2212 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2213 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2214 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2215 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2216 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2217 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2218 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2219 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2220 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2221 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2222 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2223 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2224 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2225 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2226 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2227 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2228 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2229 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2230 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2231 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2232 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2233 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2234 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2235 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2236 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2237 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2238 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2239 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2240 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2241 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2242 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3
),
2243 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2244 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2245 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP
),
2246 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2247 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP
),
2249 /* All Apple entries are in codec SSIDs */
2250 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2251 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2252 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2253 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2254 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2255 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2256 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2257 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2258 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2259 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2260 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2261 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2262 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2263 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2264 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2265 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2266 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2267 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF
),
2268 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2269 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2270 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2271 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF
),
2273 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2274 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2275 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2276 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2277 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2278 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2279 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2280 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2281 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2285 static const struct hda_model_fixup alc882_fixup_models
[] = {
2286 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2287 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2288 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2289 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2290 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2295 * BIOS auto configuration
2297 /* almost identical with ALC880 parser... */
2298 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2300 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2301 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2302 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2307 static int patch_alc882(struct hda_codec
*codec
)
2309 struct alc_spec
*spec
;
2312 err
= alc_alloc_spec(codec
, 0x0b);
2318 switch (codec
->core
.vendor_id
) {
2324 /* ALC883 and variants */
2325 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2329 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2331 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2333 alc_auto_parse_customize_define(codec
);
2335 if (has_cdefine_beep(codec
))
2336 spec
->gen
.beep_nid
= 0x01;
2338 /* automatic parse from the BIOS config */
2339 err
= alc882_parse_auto_config(codec
);
2343 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2344 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2346 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2359 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2361 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2362 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2363 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2370 ALC262_FIXUP_FSC_H270
,
2371 ALC262_FIXUP_FSC_S7110
,
2372 ALC262_FIXUP_HP_Z200
,
2374 ALC262_FIXUP_LENOVO_3000
,
2376 ALC262_FIXUP_BENQ_T31
,
2377 ALC262_FIXUP_INV_DMIC
,
2378 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2381 static const struct hda_fixup alc262_fixups
[] = {
2382 [ALC262_FIXUP_FSC_H270
] = {
2383 .type
= HDA_FIXUP_PINS
,
2384 .v
.pins
= (const struct hda_pintbl
[]) {
2385 { 0x14, 0x99130110 }, /* speaker */
2386 { 0x15, 0x0221142f }, /* front HP */
2387 { 0x1b, 0x0121141f }, /* rear HP */
2391 [ALC262_FIXUP_FSC_S7110
] = {
2392 .type
= HDA_FIXUP_PINS
,
2393 .v
.pins
= (const struct hda_pintbl
[]) {
2394 { 0x15, 0x90170110 }, /* speaker */
2398 .chain_id
= ALC262_FIXUP_BENQ
,
2400 [ALC262_FIXUP_HP_Z200
] = {
2401 .type
= HDA_FIXUP_PINS
,
2402 .v
.pins
= (const struct hda_pintbl
[]) {
2403 { 0x16, 0x99130120 }, /* internal speaker */
2407 [ALC262_FIXUP_TYAN
] = {
2408 .type
= HDA_FIXUP_PINS
,
2409 .v
.pins
= (const struct hda_pintbl
[]) {
2410 { 0x14, 0x1993e1f0 }, /* int AUX */
2414 [ALC262_FIXUP_LENOVO_3000
] = {
2415 .type
= HDA_FIXUP_PINCTLS
,
2416 .v
.pins
= (const struct hda_pintbl
[]) {
2417 { 0x19, PIN_VREF50
},
2421 .chain_id
= ALC262_FIXUP_BENQ
,
2423 [ALC262_FIXUP_BENQ
] = {
2424 .type
= HDA_FIXUP_VERBS
,
2425 .v
.verbs
= (const struct hda_verb
[]) {
2426 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2427 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2431 [ALC262_FIXUP_BENQ_T31
] = {
2432 .type
= HDA_FIXUP_VERBS
,
2433 .v
.verbs
= (const struct hda_verb
[]) {
2434 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2435 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2439 [ALC262_FIXUP_INV_DMIC
] = {
2440 .type
= HDA_FIXUP_FUNC
,
2441 .v
.func
= alc_fixup_inv_dmic
,
2443 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2444 .type
= HDA_FIXUP_FUNC
,
2445 .v
.func
= alc_fixup_no_depop_delay
,
2449 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2450 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2451 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2452 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2453 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2454 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270
),
2455 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2456 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2457 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2458 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2459 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2463 static const struct hda_model_fixup alc262_fixup_models
[] = {
2464 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2470 static int patch_alc262(struct hda_codec
*codec
)
2472 struct alc_spec
*spec
;
2475 err
= alc_alloc_spec(codec
, 0x0b);
2480 spec
->gen
.shared_mic_vref_pin
= 0x18;
2482 spec
->shutup
= alc_eapd_shutup
;
2485 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2488 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2490 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2492 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2494 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2496 alc_auto_parse_customize_define(codec
);
2498 if (has_cdefine_beep(codec
))
2499 spec
->gen
.beep_nid
= 0x01;
2501 /* automatic parse from the BIOS config */
2502 err
= alc262_parse_auto_config(codec
);
2506 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2507 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2509 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2521 /* bind Beep switches of both NID 0x0f and 0x10 */
2522 static const struct hda_bind_ctls alc268_bind_beep_sw
= {
2523 .ops
= &snd_hda_bind_sw
,
2525 HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
),
2526 HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT
),
2531 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2532 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2533 HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw
),
2537 /* set PCBEEP vol = 0, mute connections */
2538 static const struct hda_verb alc268_beep_init_verbs
[] = {
2539 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2540 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2541 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2546 ALC268_FIXUP_INV_DMIC
,
2547 ALC268_FIXUP_HP_EAPD
,
2551 static const struct hda_fixup alc268_fixups
[] = {
2552 [ALC268_FIXUP_INV_DMIC
] = {
2553 .type
= HDA_FIXUP_FUNC
,
2554 .v
.func
= alc_fixup_inv_dmic
,
2556 [ALC268_FIXUP_HP_EAPD
] = {
2557 .type
= HDA_FIXUP_VERBS
,
2558 .v
.verbs
= (const struct hda_verb
[]) {
2559 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2563 [ALC268_FIXUP_SPDIF
] = {
2564 .type
= HDA_FIXUP_PINS
,
2565 .v
.pins
= (const struct hda_pintbl
[]) {
2566 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2572 static const struct hda_model_fixup alc268_fixup_models
[] = {
2573 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2574 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2578 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2579 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2580 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2581 /* below is codec SSID since multiple Toshiba laptops have the
2582 * same PCI SSID 1179:ff00
2584 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2589 * BIOS auto configuration
2591 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2593 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2594 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2599 static int patch_alc268(struct hda_codec
*codec
)
2601 struct alc_spec
*spec
;
2604 /* ALC268 has no aa-loopback mixer */
2605 err
= alc_alloc_spec(codec
, 0);
2610 spec
->gen
.beep_nid
= 0x01;
2612 spec
->shutup
= alc_eapd_shutup
;
2614 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2615 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2617 /* automatic parse from the BIOS config */
2618 err
= alc268_parse_auto_config(codec
);
2622 if (err
> 0 && !spec
->gen
.no_analog
&&
2623 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2624 add_mixer(spec
, alc268_beep_mixer
);
2625 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2626 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2627 /* override the amp caps for beep generator */
2628 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2629 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2630 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2631 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2632 (0 << AC_AMPCAP_MUTE_SHIFT
));
2635 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2648 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2649 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2652 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2653 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2656 /* different alc269-variants */
2658 ALC269_TYPE_ALC269VA
,
2659 ALC269_TYPE_ALC269VB
,
2660 ALC269_TYPE_ALC269VC
,
2661 ALC269_TYPE_ALC269VD
,
2677 * BIOS auto configuration
2679 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2681 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2682 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2683 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2684 struct alc_spec
*spec
= codec
->spec
;
2685 const hda_nid_t
*ssids
;
2687 switch (spec
->codec_variant
) {
2688 case ALC269_TYPE_ALC269VA
:
2689 case ALC269_TYPE_ALC269VC
:
2690 case ALC269_TYPE_ALC280
:
2691 case ALC269_TYPE_ALC284
:
2692 case ALC269_TYPE_ALC285
:
2693 ssids
= alc269va_ssids
;
2695 case ALC269_TYPE_ALC269VB
:
2696 case ALC269_TYPE_ALC269VD
:
2697 case ALC269_TYPE_ALC282
:
2698 case ALC269_TYPE_ALC283
:
2699 case ALC269_TYPE_ALC286
:
2700 case ALC269_TYPE_ALC298
:
2701 case ALC269_TYPE_ALC255
:
2702 case ALC269_TYPE_ALC256
:
2703 case ALC269_TYPE_ALC225
:
2704 case ALC269_TYPE_ALC294
:
2705 case ALC269_TYPE_ALC700
:
2706 ssids
= alc269_ssids
;
2709 ssids
= alc269_ssids
;
2713 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2716 static int find_ext_mic_pin(struct hda_codec
*codec
);
2718 static void alc286_shutup(struct hda_codec
*codec
)
2721 int mic_pin
= find_ext_mic_pin(codec
);
2722 /* don't shut up pins when unloading the driver; otherwise it breaks
2723 * the default pin setup at the next load of the driver
2725 if (codec
->bus
->shutdown
)
2727 for (i
= 0; i
< codec
->init_pins
.used
; i
++) {
2728 struct hda_pincfg
*pin
= snd_array_elem(&codec
->init_pins
, i
);
2729 /* use read here for syncing after issuing each verb */
2730 if (pin
->nid
!= mic_pin
)
2731 snd_hda_codec_read(codec
, pin
->nid
, 0,
2732 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
2734 codec
->pins_shutup
= 1;
2737 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2739 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
2742 static void alc269_shutup(struct hda_codec
*codec
)
2744 struct alc_spec
*spec
= codec
->spec
;
2746 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2747 alc269vb_toggle_power_output(codec
, 0);
2748 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2749 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2752 snd_hda_shutup_pins(codec
);
2755 static struct coef_fw alc282_coefs
[] = {
2756 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2757 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2758 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2759 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2760 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2761 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2762 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2763 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2764 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2765 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2766 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2767 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2768 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2769 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2770 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2771 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2772 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2773 WRITE_COEF(0x63, 0x2902), /* PLL */
2774 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2775 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2776 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2777 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2778 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2779 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2780 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2781 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2782 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2783 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2784 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2788 static void alc282_restore_default_value(struct hda_codec
*codec
)
2790 alc_process_coef_fw(codec
, alc282_coefs
);
2793 static void alc282_init(struct hda_codec
*codec
)
2795 struct alc_spec
*spec
= codec
->spec
;
2796 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2800 alc282_restore_default_value(codec
);
2804 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2805 coef78
= alc_read_coef_idx(codec
, 0x78);
2807 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
2808 /* Headphone capless set to high power mode */
2809 alc_write_coef_idx(codec
, 0x78, 0x9004);
2814 snd_hda_codec_write(codec
, hp_pin
, 0,
2815 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2820 snd_hda_codec_write(codec
, hp_pin
, 0,
2821 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
2826 /* Headphone capless set to normal mode */
2827 alc_write_coef_idx(codec
, 0x78, coef78
);
2830 static void alc282_shutup(struct hda_codec
*codec
)
2832 struct alc_spec
*spec
= codec
->spec
;
2833 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2838 alc269_shutup(codec
);
2842 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2843 coef78
= alc_read_coef_idx(codec
, 0x78);
2844 alc_write_coef_idx(codec
, 0x78, 0x9004);
2849 snd_hda_codec_write(codec
, hp_pin
, 0,
2850 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2855 snd_hda_codec_write(codec
, hp_pin
, 0,
2856 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
2861 alc_auto_setup_eapd(codec
, false);
2862 snd_hda_shutup_pins(codec
);
2863 alc_write_coef_idx(codec
, 0x78, coef78
);
2866 static struct coef_fw alc283_coefs
[] = {
2867 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2868 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2869 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2870 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2871 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2872 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2873 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2874 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
2875 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2876 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2877 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
2878 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
2879 WRITE_COEF(0x22, 0xa0c0), /* ANC */
2880 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
2881 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2882 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2883 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2884 WRITE_COEF(0x2e, 0x2902), /* PLL */
2885 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
2886 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
2887 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
2888 WRITE_COEF(0x36, 0x0), /* capless control 5 */
2889 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
2890 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
2891 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
2892 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
2893 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
2894 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
2895 WRITE_COEF(0x49, 0x0), /* test mode */
2896 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
2897 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
2898 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
2899 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
2903 static void alc283_restore_default_value(struct hda_codec
*codec
)
2905 alc_process_coef_fw(codec
, alc283_coefs
);
2908 static void alc283_init(struct hda_codec
*codec
)
2910 struct alc_spec
*spec
= codec
->spec
;
2911 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2914 if (!spec
->gen
.autocfg
.hp_outs
) {
2915 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
2916 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
2919 alc283_restore_default_value(codec
);
2925 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2927 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
2928 /* Headphone capless set to high power mode */
2929 alc_write_coef_idx(codec
, 0x43, 0x9004);
2931 snd_hda_codec_write(codec
, hp_pin
, 0,
2932 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2937 snd_hda_codec_write(codec
, hp_pin
, 0,
2938 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
2942 /* Index 0x46 Combo jack auto switch control 2 */
2943 /* 3k pull low control for Headset jack. */
2944 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
2945 /* Headphone capless set to normal mode */
2946 alc_write_coef_idx(codec
, 0x43, 0x9614);
2949 static void alc283_shutup(struct hda_codec
*codec
)
2951 struct alc_spec
*spec
= codec
->spec
;
2952 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2955 if (!spec
->gen
.autocfg
.hp_outs
) {
2956 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
2957 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
2961 alc269_shutup(codec
);
2965 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2967 alc_write_coef_idx(codec
, 0x43, 0x9004);
2969 /*depop hp during suspend*/
2970 alc_write_coef_idx(codec
, 0x06, 0x2100);
2972 snd_hda_codec_write(codec
, hp_pin
, 0,
2973 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2978 snd_hda_codec_write(codec
, hp_pin
, 0,
2979 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
2981 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
2985 alc_auto_setup_eapd(codec
, false);
2986 snd_hda_shutup_pins(codec
);
2987 alc_write_coef_idx(codec
, 0x43, 0x9614);
2990 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
2993 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
2994 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
2995 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
2998 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3002 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3003 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3005 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3010 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3014 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3015 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3016 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3017 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3018 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3019 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3020 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3021 val
= alc5505_coef_get(codec
, 0x6220);
3022 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3025 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3027 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3028 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3029 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3030 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3031 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3032 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3035 static void alc5505_dsp_init(struct hda_codec
*codec
)
3039 alc5505_dsp_halt(codec
);
3040 alc5505_dsp_back_from_halt(codec
);
3041 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3042 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3043 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3044 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3045 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3046 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3047 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3048 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3049 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3050 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3051 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3052 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3053 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3055 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3057 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3059 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3061 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3062 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3063 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3064 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3065 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3066 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3067 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3069 #ifdef HALT_REALTEK_ALC5505
3070 alc5505_dsp_halt(codec
);
3074 #ifdef HALT_REALTEK_ALC5505
3075 #define alc5505_dsp_suspend(codec) /* NOP */
3076 #define alc5505_dsp_resume(codec) /* NOP */
3078 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3079 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3083 static int alc269_suspend(struct hda_codec
*codec
)
3085 struct alc_spec
*spec
= codec
->spec
;
3087 if (spec
->has_alc5505_dsp
)
3088 alc5505_dsp_suspend(codec
);
3089 return alc_suspend(codec
);
3092 static int alc269_resume(struct hda_codec
*codec
)
3094 struct alc_spec
*spec
= codec
->spec
;
3096 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3097 alc269vb_toggle_power_output(codec
, 0);
3098 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3099 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3103 codec
->patch_ops
.init(codec
);
3105 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3106 alc269vb_toggle_power_output(codec
, 1);
3107 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3108 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3112 regcache_sync(codec
->core
.regmap
);
3113 hda_call_check_power_status(codec
, 0x01);
3115 /* on some machine, the BIOS will clear the codec gpio data when enter
3116 * suspend, and won't restore the data after resume, so we restore it
3120 snd_hda_codec_write(codec
, codec
->core
.afg
, 0, AC_VERB_SET_GPIO_DATA
,
3123 if (spec
->has_alc5505_dsp
)
3124 alc5505_dsp_resume(codec
);
3128 #endif /* CONFIG_PM */
3130 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3131 const struct hda_fixup
*fix
, int action
)
3133 struct alc_spec
*spec
= codec
->spec
;
3135 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3136 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3139 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec
*codec
,
3140 const struct hda_fixup
*fix
,
3143 unsigned int cfg_headphone
= snd_hda_codec_get_pincfg(codec
, 0x21);
3144 unsigned int cfg_headset_mic
= snd_hda_codec_get_pincfg(codec
, 0x19);
3146 if (cfg_headphone
&& cfg_headset_mic
== 0x411111f0)
3147 snd_hda_codec_set_pincfg(codec
, 0x19,
3148 (cfg_headphone
& ~AC_DEFCFG_DEVICE
) |
3149 (AC_JACK_MIC_IN
<< AC_DEFCFG_DEVICE_SHIFT
));
3152 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3153 const struct hda_fixup
*fix
, int action
)
3155 if (action
== HDA_FIXUP_ACT_INIT
)
3156 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3159 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3160 const struct hda_fixup
*fix
, int action
)
3162 struct alc_spec
*spec
= codec
->spec
;
3164 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3165 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3168 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3169 const struct hda_fixup
*fix
, int action
)
3171 static const struct hda_verb verbs
[] = {
3172 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3173 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3178 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3179 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3181 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3182 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3183 snd_hda_sequence_write(codec
, verbs
);
3186 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3187 const struct hda_fixup
*fix
, int action
)
3189 struct alc_spec
*spec
= codec
->spec
;
3191 if (action
!= HDA_FIXUP_ACT_PROBE
)
3194 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3195 * fix the sample rate of analog I/O to 44.1kHz
3197 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3198 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3201 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3202 const struct hda_fixup
*fix
, int action
)
3204 /* The digital-mic unit sends PDM (differential signal) instead of
3205 * the standard PCM, thus you can't record a valid mono stream as is.
3206 * Below is a workaround specific to ALC269 to control the dmic
3207 * signal source as mono.
3209 if (action
== HDA_FIXUP_ACT_INIT
)
3210 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3213 static void alc269_quanta_automute(struct hda_codec
*codec
)
3215 snd_hda_gen_update_outputs(codec
);
3217 alc_write_coef_idx(codec
, 0x0c, 0x680);
3218 alc_write_coef_idx(codec
, 0x0c, 0x480);
3221 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3222 const struct hda_fixup
*fix
, int action
)
3224 struct alc_spec
*spec
= codec
->spec
;
3225 if (action
!= HDA_FIXUP_ACT_PROBE
)
3227 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3230 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3231 struct hda_jack_callback
*jack
)
3233 struct alc_spec
*spec
= codec
->spec
;
3236 snd_hda_gen_hp_automute(codec
, jack
);
3238 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3240 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3243 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3247 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3248 const struct hda_fixup
*fix
, int action
)
3250 struct alc_spec
*spec
= codec
->spec
;
3251 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3252 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3253 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3258 /* update mute-LED according to the speaker mute state via mic VREF pin */
3259 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3261 struct hda_codec
*codec
= private_data
;
3262 struct alc_spec
*spec
= codec
->spec
;
3263 unsigned int pinval
;
3265 if (spec
->mute_led_polarity
)
3267 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3268 pinval
&= ~AC_PINCTL_VREFEN
;
3269 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3270 if (spec
->mute_led_nid
) {
3271 /* temporarily power up/down for setting VREF */
3272 snd_hda_power_up_pm(codec
);
3273 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3274 snd_hda_power_down_pm(codec
);
3278 /* Make sure the led works even in runtime suspend */
3279 static unsigned int led_power_filter(struct hda_codec
*codec
,
3281 unsigned int power_state
)
3283 struct alc_spec
*spec
= codec
->spec
;
3285 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
3286 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
3289 /* Set pin ctl again, it might have just been set to 0 */
3290 snd_hda_set_pin_ctl(codec
, nid
,
3291 snd_hda_codec_get_pin_target(codec
, nid
));
3293 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
3296 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3297 const struct hda_fixup
*fix
, int action
)
3299 struct alc_spec
*spec
= codec
->spec
;
3300 const struct dmi_device
*dev
= NULL
;
3302 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3305 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3307 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3309 if (pin
< 0x0a || pin
>= 0x10)
3311 spec
->mute_led_polarity
= pol
;
3312 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3313 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3314 spec
->gen
.vmaster_mute_enum
= 1;
3315 codec
->power_filter
= led_power_filter
;
3317 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3318 spec
->mute_led_polarity
);
3323 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3324 const struct hda_fixup
*fix
, int action
)
3326 struct alc_spec
*spec
= codec
->spec
;
3327 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3328 spec
->mute_led_polarity
= 0;
3329 spec
->mute_led_nid
= 0x18;
3330 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3331 spec
->gen
.vmaster_mute_enum
= 1;
3332 codec
->power_filter
= led_power_filter
;
3336 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3337 const struct hda_fixup
*fix
, int action
)
3339 struct alc_spec
*spec
= codec
->spec
;
3340 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3341 spec
->mute_led_polarity
= 0;
3342 spec
->mute_led_nid
= 0x19;
3343 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3344 spec
->gen
.vmaster_mute_enum
= 1;
3345 codec
->power_filter
= led_power_filter
;
3349 /* update LED status via GPIO */
3350 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
3353 struct alc_spec
*spec
= codec
->spec
;
3354 unsigned int oldval
= spec
->gpio_led
;
3356 if (spec
->mute_led_polarity
)
3360 spec
->gpio_led
&= ~mask
;
3362 spec
->gpio_led
|= mask
;
3363 if (spec
->gpio_led
!= oldval
)
3364 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3368 /* turn on/off mute LED via GPIO per vmaster hook */
3369 static void alc_fixup_gpio_mute_hook(void *private_data
, int enabled
)
3371 struct hda_codec
*codec
= private_data
;
3372 struct alc_spec
*spec
= codec
->spec
;
3374 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
, enabled
);
3377 /* turn on/off mic-mute LED via GPIO per capture hook */
3378 static void alc_fixup_gpio_mic_mute_hook(struct hda_codec
*codec
,
3379 struct snd_kcontrol
*kcontrol
,
3380 struct snd_ctl_elem_value
*ucontrol
)
3382 struct alc_spec
*spec
= codec
->spec
;
3385 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
3386 ucontrol
->value
.integer
.value
[0] ||
3387 ucontrol
->value
.integer
.value
[1]);
3390 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3391 const struct hda_fixup
*fix
, int action
)
3393 struct alc_spec
*spec
= codec
->spec
;
3394 static const struct hda_verb gpio_init
[] = {
3395 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3396 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3400 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3401 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3402 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3404 spec
->mute_led_polarity
= 0;
3405 spec
->gpio_mute_led_mask
= 0x08;
3406 spec
->gpio_mic_led_mask
= 0x10;
3407 snd_hda_add_verbs(codec
, gpio_init
);
3411 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
3412 const struct hda_fixup
*fix
, int action
)
3414 struct alc_spec
*spec
= codec
->spec
;
3415 static const struct hda_verb gpio_init
[] = {
3416 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x22 },
3417 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x22 },
3421 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3422 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3423 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3425 spec
->mute_led_polarity
= 0;
3426 spec
->gpio_mute_led_mask
= 0x02;
3427 spec
->gpio_mic_led_mask
= 0x20;
3428 snd_hda_add_verbs(codec
, gpio_init
);
3432 /* turn on/off mic-mute LED per capture hook */
3433 static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec
*codec
,
3434 struct snd_kcontrol
*kcontrol
,
3435 struct snd_ctl_elem_value
*ucontrol
)
3437 struct alc_spec
*spec
= codec
->spec
;
3438 unsigned int pinval
, enable
, disable
;
3440 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3441 pinval
&= ~AC_PINCTL_VREFEN
;
3442 enable
= pinval
| AC_PINCTL_VREF_80
;
3443 disable
= pinval
| AC_PINCTL_VREF_HIZ
;
3448 if (ucontrol
->value
.integer
.value
[0] ||
3449 ucontrol
->value
.integer
.value
[1])
3454 if (spec
->cap_mute_led_nid
)
3455 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3458 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3459 const struct hda_fixup
*fix
, int action
)
3461 struct alc_spec
*spec
= codec
->spec
;
3462 static const struct hda_verb gpio_init
[] = {
3463 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x08 },
3464 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x08 },
3468 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3469 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3470 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3472 spec
->mute_led_polarity
= 0;
3473 spec
->gpio_mute_led_mask
= 0x08;
3474 spec
->cap_mute_led_nid
= 0x18;
3475 snd_hda_add_verbs(codec
, gpio_init
);
3476 codec
->power_filter
= led_power_filter
;
3480 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
3481 const struct hda_fixup
*fix
, int action
)
3483 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */
3484 struct alc_spec
*spec
= codec
->spec
;
3485 static const struct hda_verb gpio_init
[] = {
3486 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3487 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3491 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3492 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3493 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3495 spec
->mute_led_polarity
= 0;
3496 spec
->gpio_mute_led_mask
= 0x08;
3497 spec
->cap_mute_led_nid
= 0x18;
3498 snd_hda_add_verbs(codec
, gpio_init
);
3499 codec
->power_filter
= led_power_filter
;
3503 #if IS_REACHABLE(CONFIG_INPUT)
3504 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
3505 struct hda_jack_callback
*event
)
3507 struct alc_spec
*spec
= codec
->spec
;
3509 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3510 send both key on and key off event for every interrupt. */
3511 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
3512 input_sync(spec
->kb_dev
);
3513 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
3514 input_sync(spec
->kb_dev
);
3517 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
3519 struct alc_spec
*spec
= codec
->spec
;
3522 spec
->kb_dev
= input_allocate_device();
3523 if (!spec
->kb_dev
) {
3524 codec_err(codec
, "Out of memory (input_allocate_device)\n");
3528 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
3530 spec
->kb_dev
->name
= "Microphone Mute Button";
3531 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
3532 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
3533 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
3534 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
3535 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
3536 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
3538 if (input_register_device(spec
->kb_dev
)) {
3539 codec_err(codec
, "input_register_device failed\n");
3540 input_free_device(spec
->kb_dev
);
3541 spec
->kb_dev
= NULL
;
3548 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
3549 const struct hda_fixup
*fix
, int action
)
3551 /* GPIO1 = set according to SKU external amp
3552 GPIO2 = mic mute hotkey
3554 GPIO4 = mic mute LED */
3555 static const struct hda_verb gpio_init
[] = {
3556 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x1e },
3557 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x1a },
3558 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x02 },
3562 struct alc_spec
*spec
= codec
->spec
;
3564 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3565 if (alc_register_micmute_input_device(codec
) != 0)
3568 snd_hda_add_verbs(codec
, gpio_init
);
3569 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
3570 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
3571 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
3572 gpio2_mic_hotkey_event
);
3574 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3575 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3577 spec
->mute_led_polarity
= 0;
3578 spec
->gpio_mute_led_mask
= 0x08;
3579 spec
->gpio_mic_led_mask
= 0x10;
3587 case HDA_FIXUP_ACT_PROBE
:
3588 spec
->init_amp
= ALC_INIT_DEFAULT
;
3590 case HDA_FIXUP_ACT_FREE
:
3591 input_unregister_device(spec
->kb_dev
);
3592 spec
->kb_dev
= NULL
;
3596 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
3597 const struct hda_fixup
*fix
, int action
)
3599 /* Line2 = mic mute hotkey
3600 GPIO2 = mic mute LED */
3601 static const struct hda_verb gpio_init
[] = {
3602 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
3603 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
3607 struct alc_spec
*spec
= codec
->spec
;
3609 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3610 if (alc_register_micmute_input_device(codec
) != 0)
3613 snd_hda_add_verbs(codec
, gpio_init
);
3614 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
3615 gpio2_mic_hotkey_event
);
3617 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3619 spec
->mute_led_polarity
= 0;
3620 spec
->gpio_mic_led_mask
= 0x04;
3628 case HDA_FIXUP_ACT_PROBE
:
3629 spec
->init_amp
= ALC_INIT_DEFAULT
;
3631 case HDA_FIXUP_ACT_FREE
:
3632 input_unregister_device(spec
->kb_dev
);
3633 spec
->kb_dev
= NULL
;
3637 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
3638 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
3641 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
3642 const struct hda_fixup
*fix
, int action
)
3644 struct alc_spec
*spec
= codec
->spec
;
3646 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3647 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3648 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3649 spec
->mute_led_polarity
= 0;
3650 spec
->mute_led_nid
= 0x1a;
3651 spec
->cap_mute_led_nid
= 0x18;
3652 spec
->gen
.vmaster_mute_enum
= 1;
3653 codec
->power_filter
= led_power_filter
;
3657 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
3659 static struct coef_fw coef0255
[] = {
3660 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
3661 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
3662 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
3663 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
3666 static struct coef_fw coef0255_1
[] = {
3667 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
3670 static struct coef_fw coef0256
[] = {
3671 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
3674 static struct coef_fw coef0233
[] = {
3675 WRITE_COEF(0x1b, 0x0c0b),
3676 WRITE_COEF(0x45, 0xc429),
3677 UPDATE_COEF(0x35, 0x4000, 0),
3678 WRITE_COEF(0x06, 0x2104),
3679 WRITE_COEF(0x1a, 0x0001),
3680 WRITE_COEF(0x26, 0x0004),
3681 WRITE_COEF(0x32, 0x42a3),
3684 static struct coef_fw coef0288
[] = {
3685 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
3686 UPDATE_COEF(0x50, 0x2000, 0x2000),
3687 UPDATE_COEF(0x56, 0x0006, 0x0006),
3688 UPDATE_COEF(0x66, 0x0008, 0),
3689 UPDATE_COEF(0x67, 0x2000, 0),
3692 static struct coef_fw coef0292
[] = {
3693 WRITE_COEF(0x76, 0x000e),
3694 WRITE_COEF(0x6c, 0x2400),
3695 WRITE_COEF(0x18, 0x7308),
3696 WRITE_COEF(0x6b, 0xc429),
3699 static struct coef_fw coef0293
[] = {
3700 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
3701 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
3702 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
3703 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
3704 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
3705 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
3708 static struct coef_fw coef0668
[] = {
3709 WRITE_COEF(0x15, 0x0d40),
3710 WRITE_COEF(0xb7, 0x802b),
3713 static struct coef_fw coef0225
[] = {
3714 UPDATE_COEF(0x4a, 1<<8, 0),
3715 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
3716 UPDATE_COEF(0x63, 3<<14, 3<<14),
3717 UPDATE_COEF(0x4a, 3<<4, 2<<4),
3718 UPDATE_COEF(0x4a, 3<<10, 3<<10),
3719 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
3720 UPDATE_COEF(0x4a, 3<<10, 0),
3724 switch (codec
->core
.vendor_id
) {
3726 alc_process_coef_fw(codec
, coef0255_1
);
3727 alc_process_coef_fw(codec
, coef0255
);
3731 alc_process_coef_fw(codec
, coef0256
);
3732 alc_process_coef_fw(codec
, coef0255
);
3736 alc_process_coef_fw(codec
, coef0233
);
3741 alc_process_coef_fw(codec
, coef0288
);
3744 alc_process_coef_fw(codec
, coef0292
);
3747 alc_process_coef_fw(codec
, coef0293
);
3750 alc_process_coef_fw(codec
, coef0668
);
3755 alc_process_coef_fw(codec
, coef0225
);
3758 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
3762 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
3765 static struct coef_fw coef0255
[] = {
3766 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
3767 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
3770 static struct coef_fw coef0233
[] = {
3771 UPDATE_COEF(0x35, 0, 1<<14),
3772 WRITE_COEF(0x06, 0x2100),
3773 WRITE_COEF(0x1a, 0x0021),
3774 WRITE_COEF(0x26, 0x008c),
3777 static struct coef_fw coef0288
[] = {
3778 UPDATE_COEF(0x50, 0x2000, 0),
3779 UPDATE_COEF(0x56, 0x0006, 0),
3780 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
3781 UPDATE_COEF(0x66, 0x0008, 0x0008),
3782 UPDATE_COEF(0x67, 0x2000, 0x2000),
3785 static struct coef_fw coef0292
[] = {
3786 WRITE_COEF(0x19, 0xa208),
3787 WRITE_COEF(0x2e, 0xacf0),
3790 static struct coef_fw coef0293
[] = {
3791 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
3792 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
3793 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
3796 static struct coef_fw coef0688
[] = {
3797 WRITE_COEF(0xb7, 0x802b),
3798 WRITE_COEF(0xb5, 0x1040),
3799 UPDATE_COEF(0xc3, 0, 1<<12),
3802 static struct coef_fw coef0225
[] = {
3803 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
3804 UPDATE_COEF(0x4a, 3<<4, 2<<4),
3805 UPDATE_COEF(0x63, 3<<14, 0),
3810 switch (codec
->core
.vendor_id
) {
3814 alc_write_coef_idx(codec
, 0x45, 0xc489);
3815 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3816 alc_process_coef_fw(codec
, coef0255
);
3817 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3821 alc_write_coef_idx(codec
, 0x45, 0xc429);
3822 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3823 alc_process_coef_fw(codec
, coef0233
);
3824 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3829 alc_update_coef_idx(codec
, 0x4f, 0x000c, 0);
3830 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3831 alc_process_coef_fw(codec
, coef0288
);
3832 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3835 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3836 alc_process_coef_fw(codec
, coef0292
);
3839 /* Set to TRS mode */
3840 alc_write_coef_idx(codec
, 0x45, 0xc429);
3841 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3842 alc_process_coef_fw(codec
, coef0293
);
3843 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3846 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3847 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3850 alc_write_coef_idx(codec
, 0x11, 0x0001);
3851 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3852 alc_process_coef_fw(codec
, coef0688
);
3853 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3858 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
3859 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3860 alc_process_coef_fw(codec
, coef0225
);
3861 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3864 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
3867 static void alc_headset_mode_default(struct hda_codec
*codec
)
3869 static struct coef_fw coef0225
[] = {
3870 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
3873 static struct coef_fw coef0255
[] = {
3874 WRITE_COEF(0x45, 0xc089),
3875 WRITE_COEF(0x45, 0xc489),
3876 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
3877 WRITE_COEF(0x49, 0x0049),
3880 static struct coef_fw coef0233
[] = {
3881 WRITE_COEF(0x06, 0x2100),
3882 WRITE_COEF(0x32, 0x4ea3),
3885 static struct coef_fw coef0288
[] = {
3886 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
3887 UPDATE_COEF(0x50, 0x2000, 0x2000),
3888 UPDATE_COEF(0x56, 0x0006, 0x0006),
3889 UPDATE_COEF(0x66, 0x0008, 0),
3890 UPDATE_COEF(0x67, 0x2000, 0),
3893 static struct coef_fw coef0292
[] = {
3894 WRITE_COEF(0x76, 0x000e),
3895 WRITE_COEF(0x6c, 0x2400),
3896 WRITE_COEF(0x6b, 0xc429),
3897 WRITE_COEF(0x18, 0x7308),
3900 static struct coef_fw coef0293
[] = {
3901 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
3902 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
3903 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
3906 static struct coef_fw coef0688
[] = {
3907 WRITE_COEF(0x11, 0x0041),
3908 WRITE_COEF(0x15, 0x0d40),
3909 WRITE_COEF(0xb7, 0x802b),
3913 switch (codec
->core
.vendor_id
) {
3917 alc_process_coef_fw(codec
, coef0225
);
3922 alc_process_coef_fw(codec
, coef0255
);
3926 alc_process_coef_fw(codec
, coef0233
);
3931 alc_process_coef_fw(codec
, coef0288
);
3934 alc_process_coef_fw(codec
, coef0292
);
3937 alc_process_coef_fw(codec
, coef0293
);
3940 alc_process_coef_fw(codec
, coef0688
);
3943 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
3947 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
3949 static struct coef_fw coef0255
[] = {
3950 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
3951 WRITE_COEF(0x1b, 0x0c2b),
3952 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
3955 static struct coef_fw coef0256
[] = {
3956 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
3957 WRITE_COEF(0x1b, 0x0c6b),
3958 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
3961 static struct coef_fw coef0233
[] = {
3962 WRITE_COEF(0x45, 0xd429),
3963 WRITE_COEF(0x1b, 0x0c2b),
3964 WRITE_COEF(0x32, 0x4ea3),
3967 static struct coef_fw coef0288
[] = {
3968 UPDATE_COEF(0x50, 0x2000, 0x2000),
3969 UPDATE_COEF(0x56, 0x0006, 0x0006),
3970 UPDATE_COEF(0x66, 0x0008, 0),
3971 UPDATE_COEF(0x67, 0x2000, 0),
3974 static struct coef_fw coef0292
[] = {
3975 WRITE_COEF(0x6b, 0xd429),
3976 WRITE_COEF(0x76, 0x0008),
3977 WRITE_COEF(0x18, 0x7388),
3980 static struct coef_fw coef0293
[] = {
3981 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
3982 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
3985 static struct coef_fw coef0688
[] = {
3986 WRITE_COEF(0x11, 0x0001),
3987 WRITE_COEF(0x15, 0x0d60),
3988 WRITE_COEF(0xc3, 0x0000),
3991 static struct coef_fw coef0225
[] = {
3992 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
3993 UPDATE_COEF(0x49, 1<<8, 1<<8),
3994 UPDATE_COEF(0x4a, 7<<6, 7<<6),
3995 UPDATE_COEF(0x4a, 3<<4, 3<<4),
3999 switch (codec
->core
.vendor_id
) {
4001 alc_process_coef_fw(codec
, coef0255
);
4005 alc_process_coef_fw(codec
, coef0256
);
4009 alc_process_coef_fw(codec
, coef0233
);
4012 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);/* Headset output enable */
4013 /* ALC298 jack type setting is the same with ALC286/ALC288 */
4016 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4018 alc_process_coef_fw(codec
, coef0288
);
4021 alc_process_coef_fw(codec
, coef0292
);
4024 alc_process_coef_fw(codec
, coef0293
);
4027 alc_process_coef_fw(codec
, coef0688
);
4032 alc_process_coef_fw(codec
, coef0225
);
4035 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
4039 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
4041 static struct coef_fw coef0255
[] = {
4042 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4043 WRITE_COEF(0x1b, 0x0c2b),
4044 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4047 static struct coef_fw coef0256
[] = {
4048 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4049 WRITE_COEF(0x1b, 0x0c6b),
4050 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4053 static struct coef_fw coef0233
[] = {
4054 WRITE_COEF(0x45, 0xe429),
4055 WRITE_COEF(0x1b, 0x0c2b),
4056 WRITE_COEF(0x32, 0x4ea3),
4059 static struct coef_fw coef0288
[] = {
4060 UPDATE_COEF(0x50, 0x2000, 0x2000),
4061 UPDATE_COEF(0x56, 0x0006, 0x0006),
4062 UPDATE_COEF(0x66, 0x0008, 0),
4063 UPDATE_COEF(0x67, 0x2000, 0),
4066 static struct coef_fw coef0292
[] = {
4067 WRITE_COEF(0x6b, 0xe429),
4068 WRITE_COEF(0x76, 0x0008),
4069 WRITE_COEF(0x18, 0x7388),
4072 static struct coef_fw coef0293
[] = {
4073 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4074 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4077 static struct coef_fw coef0688
[] = {
4078 WRITE_COEF(0x11, 0x0001),
4079 WRITE_COEF(0x15, 0x0d50),
4080 WRITE_COEF(0xc3, 0x0000),
4083 static struct coef_fw coef0225
[] = {
4084 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4085 UPDATE_COEF(0x49, 1<<8, 1<<8),
4086 UPDATE_COEF(0x4a, 7<<6, 7<<6),
4087 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4091 switch (codec
->core
.vendor_id
) {
4093 alc_process_coef_fw(codec
, coef0255
);
4097 alc_process_coef_fw(codec
, coef0256
);
4101 alc_process_coef_fw(codec
, coef0233
);
4104 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4105 /* ALC298 jack type setting is the same with ALC286/ALC288 */
4108 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4110 alc_process_coef_fw(codec
, coef0288
);
4113 alc_process_coef_fw(codec
, coef0292
);
4116 alc_process_coef_fw(codec
, coef0293
);
4119 alc_process_coef_fw(codec
, coef0688
);
4124 alc_process_coef_fw(codec
, coef0225
);
4127 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
4130 static void alc_determine_headset_type(struct hda_codec
*codec
)
4133 bool is_ctia
= false;
4134 struct alc_spec
*spec
= codec
->spec
;
4135 static struct coef_fw coef0255
[] = {
4136 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4137 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4141 static struct coef_fw coef0288
[] = {
4142 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4145 static struct coef_fw coef0293
[] = {
4146 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4147 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4150 static struct coef_fw coef0688
[] = {
4151 WRITE_COEF(0x11, 0x0001),
4152 WRITE_COEF(0xb7, 0x802b),
4153 WRITE_COEF(0x15, 0x0d60),
4154 WRITE_COEF(0xc3, 0x0c00),
4157 static struct coef_fw coef0225
[] = {
4158 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4159 UPDATE_COEF(0x49, 1<<8, 1<<8),
4163 switch (codec
->core
.vendor_id
) {
4167 alc_process_coef_fw(codec
, coef0255
);
4169 val
= alc_read_coef_idx(codec
, 0x46);
4170 is_ctia
= (val
& 0x0070) == 0x0070;
4174 alc_write_coef_idx(codec
, 0x45, 0xd029);
4176 val
= alc_read_coef_idx(codec
, 0x46);
4177 is_ctia
= (val
& 0x0070) == 0x0070;
4180 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020); /* Headset output enable */
4181 /* ALC298 check jack type is the same with ALC286/ALC288 */
4184 alc_process_coef_fw(codec
, coef0288
);
4186 val
= alc_read_coef_idx(codec
, 0x50);
4187 is_ctia
= (val
& 0x0070) == 0x0070;
4190 alc_write_coef_idx(codec
, 0x6b, 0xd429);
4192 val
= alc_read_coef_idx(codec
, 0x6c);
4193 is_ctia
= (val
& 0x001c) == 0x001c;
4196 alc_process_coef_fw(codec
, coef0293
);
4198 val
= alc_read_coef_idx(codec
, 0x46);
4199 is_ctia
= (val
& 0x0070) == 0x0070;
4202 alc_process_coef_fw(codec
, coef0688
);
4204 val
= alc_read_coef_idx(codec
, 0xbe);
4205 is_ctia
= (val
& 0x1c02) == 0x1c02;
4210 alc_process_coef_fw(codec
, coef0225
);
4212 val
= alc_read_coef_idx(codec
, 0x46);
4213 is_ctia
= (val
& 0x00f0) == 0x00f0;
4217 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
4218 is_ctia
? "yes" : "no");
4219 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
4222 static void alc_update_headset_mode(struct hda_codec
*codec
)
4224 struct alc_spec
*spec
= codec
->spec
;
4226 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
4227 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4229 int new_headset_mode
;
4231 if (!snd_hda_jack_detect(codec
, hp_pin
))
4232 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
4233 else if (mux_pin
== spec
->headset_mic_pin
)
4234 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
4235 else if (mux_pin
== spec
->headphone_mic_pin
)
4236 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
4238 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
4240 if (new_headset_mode
== spec
->current_headset_mode
) {
4241 snd_hda_gen_update_outputs(codec
);
4245 switch (new_headset_mode
) {
4246 case ALC_HEADSET_MODE_UNPLUGGED
:
4247 alc_headset_mode_unplugged(codec
);
4248 spec
->gen
.hp_jack_present
= false;
4250 case ALC_HEADSET_MODE_HEADSET
:
4251 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
4252 alc_determine_headset_type(codec
);
4253 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
4254 alc_headset_mode_ctia(codec
);
4255 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
4256 alc_headset_mode_omtp(codec
);
4257 spec
->gen
.hp_jack_present
= true;
4259 case ALC_HEADSET_MODE_MIC
:
4260 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
4261 spec
->gen
.hp_jack_present
= false;
4263 case ALC_HEADSET_MODE_HEADPHONE
:
4264 alc_headset_mode_default(codec
);
4265 spec
->gen
.hp_jack_present
= true;
4268 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
4269 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
4270 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
4271 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
4272 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
4275 spec
->current_headset_mode
= new_headset_mode
;
4277 snd_hda_gen_update_outputs(codec
);
4280 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
4281 struct snd_kcontrol
*kcontrol
,
4282 struct snd_ctl_elem_value
*ucontrol
)
4284 alc_update_headset_mode(codec
);
4287 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
4288 struct hda_jack_callback
*jack
)
4290 struct alc_spec
*spec
= codec
->spec
;
4291 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
4292 snd_hda_gen_hp_automute(codec
, jack
);
4295 static void alc_probe_headset_mode(struct hda_codec
*codec
)
4298 struct alc_spec
*spec
= codec
->spec
;
4299 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4302 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4303 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
4304 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
4305 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
4306 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
4309 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
4310 spec
->gen
.automute_hook
= alc_update_headset_mode
;
4311 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
4314 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
4315 const struct hda_fixup
*fix
, int action
)
4317 struct alc_spec
*spec
= codec
->spec
;
4320 case HDA_FIXUP_ACT_PRE_PROBE
:
4321 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
4323 case HDA_FIXUP_ACT_PROBE
:
4324 alc_probe_headset_mode(codec
);
4326 case HDA_FIXUP_ACT_INIT
:
4327 spec
->current_headset_mode
= 0;
4328 alc_update_headset_mode(codec
);
4333 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
4334 const struct hda_fixup
*fix
, int action
)
4336 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4337 struct alc_spec
*spec
= codec
->spec
;
4338 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4341 alc_fixup_headset_mode(codec
, fix
, action
);
4344 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
4346 /* Set to iphone type */
4347 static struct coef_fw alc255fw
[] = {
4348 WRITE_COEF(0x1b, 0x880b),
4349 WRITE_COEF(0x45, 0xd089),
4350 WRITE_COEF(0x1b, 0x080b),
4351 WRITE_COEF(0x46, 0x0004),
4352 WRITE_COEF(0x1b, 0x0c0b),
4355 static struct coef_fw alc256fw
[] = {
4356 WRITE_COEF(0x1b, 0x884b),
4357 WRITE_COEF(0x45, 0xd089),
4358 WRITE_COEF(0x1b, 0x084b),
4359 WRITE_COEF(0x46, 0x0004),
4360 WRITE_COEF(0x1b, 0x0c4b),
4363 switch (codec
->core
.vendor_id
) {
4365 alc_process_coef_fw(codec
, alc255fw
);
4369 alc_process_coef_fw(codec
, alc256fw
);
4375 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
4376 const struct hda_fixup
*fix
, int action
)
4378 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4379 alc255_set_default_jack_type(codec
);
4381 alc_fixup_headset_mode(codec
, fix
, action
);
4384 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
4385 const struct hda_fixup
*fix
, int action
)
4387 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4388 struct alc_spec
*spec
= codec
->spec
;
4389 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4390 alc255_set_default_jack_type(codec
);
4393 alc_fixup_headset_mode(codec
, fix
, action
);
4396 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
4397 struct hda_jack_callback
*jack
)
4399 struct alc_spec
*spec
= codec
->spec
;
4402 alc_update_headset_jack_cb(codec
, jack
);
4403 /* Headset Mic enable or disable, only for Dell Dino */
4404 present
= spec
->gen
.hp_jack_present
? 0x40 : 0;
4405 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
4409 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
4410 const struct hda_fixup
*fix
, int action
)
4412 alc_fixup_headset_mode(codec
, fix
, action
);
4413 if (action
== HDA_FIXUP_ACT_PROBE
) {
4414 struct alc_spec
*spec
= codec
->spec
;
4415 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
4419 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
4420 const struct hda_fixup
*fix
, int action
)
4422 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4423 struct alc_spec
*spec
= codec
->spec
;
4424 spec
->gen
.auto_mute_via_amp
= 1;
4428 static void alc_no_shutup(struct hda_codec
*codec
)
4432 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
4433 const struct hda_fixup
*fix
, int action
)
4435 if (action
== HDA_FIXUP_ACT_PROBE
) {
4436 struct alc_spec
*spec
= codec
->spec
;
4437 spec
->shutup
= alc_no_shutup
;
4441 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
4442 const struct hda_fixup
*fix
, int action
)
4444 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4445 struct alc_spec
*spec
= codec
->spec
;
4446 /* Disable AA-loopback as it causes white noise */
4447 spec
->gen
.mixer_nid
= 0;
4451 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
4452 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
4453 const struct hda_fixup
*fix
, int action
)
4455 static const struct hda_pintbl pincfgs
[] = {
4456 { 0x16, 0x21211010 }, /* dock headphone */
4457 { 0x19, 0x21a11010 }, /* dock mic */
4460 struct alc_spec
*spec
= codec
->spec
;
4462 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4463 spec
->shutup
= alc_no_shutup
; /* reduce click noise */
4464 spec
->reboot_notify
= alc_d3_at_reboot
; /* reduce noise */
4465 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
4466 codec
->power_save_node
= 0; /* avoid click noises */
4467 snd_hda_apply_pincfgs(codec
, pincfgs
);
4471 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
4473 struct alc_spec
*spec
= codec
->spec
;
4474 int hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4476 /* Prevent pop noises when headphones are plugged in */
4477 snd_hda_codec_write(codec
, hp_pin
, 0,
4478 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4482 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
4483 const struct hda_fixup
*fix
, int action
)
4485 struct alc_spec
*spec
= codec
->spec
;
4486 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
4490 case HDA_FIXUP_ACT_PRE_PROBE
:
4491 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
4492 * it causes a click noise at start up
4494 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
4496 case HDA_FIXUP_ACT_PROBE
:
4497 spec
->shutup
= alc_shutup_dell_xps13
;
4499 /* Make the internal mic the default input source. */
4500 for (i
= 0; i
< imux
->num_items
; i
++) {
4501 if (spec
->gen
.imux_pins
[i
] == 0x12) {
4502 spec
->gen
.cur_mux
[0] = i
;
4510 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
4511 const struct hda_fixup
*fix
, int action
)
4513 struct alc_spec
*spec
= codec
->spec
;
4515 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4516 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4517 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
4519 /* Disable boost for mic-in permanently. (This code is only called
4520 from quirks that guarantee that the headphone is at NID 0x1b.) */
4521 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
4522 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
4524 alc_fixup_headset_mode(codec
, fix
, action
);
4527 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
4528 const struct hda_fixup
*fix
, int action
)
4530 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4531 alc_write_coef_idx(codec
, 0xc4, 0x8000);
4532 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
4533 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
4535 alc_fixup_headset_mode(codec
, fix
, action
);
4538 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
4539 static int find_ext_mic_pin(struct hda_codec
*codec
)
4541 struct alc_spec
*spec
= codec
->spec
;
4542 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4544 unsigned int defcfg
;
4547 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4548 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
4550 nid
= cfg
->inputs
[i
].pin
;
4551 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
4552 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
4560 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
4561 const struct hda_fixup
*fix
,
4564 struct alc_spec
*spec
= codec
->spec
;
4566 if (action
== HDA_FIXUP_ACT_PROBE
) {
4567 int mic_pin
= find_ext_mic_pin(codec
);
4568 int hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4570 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
4572 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
4576 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
4577 const struct hda_fixup
*fix
,
4580 struct alc_spec
*spec
= codec
->spec
;
4581 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4584 /* The mic boosts on level 2 and 3 are too noisy
4585 on the internal mic input.
4586 Therefore limit the boost to 0 or 1. */
4588 if (action
!= HDA_FIXUP_ACT_PROBE
)
4591 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4592 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
4593 unsigned int defcfg
;
4594 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
4596 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
4597 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
4600 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
4601 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
4602 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
4603 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
4604 (0 << AC_AMPCAP_MUTE_SHIFT
));
4608 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
4609 struct hda_jack_callback
*jack
)
4611 struct alc_spec
*spec
= codec
->spec
;
4615 snd_hda_gen_hp_automute(codec
, jack
);
4617 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
4620 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
4624 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
4625 const struct hda_fixup
*fix
, int action
)
4627 struct alc_spec
*spec
= codec
->spec
;
4630 case HDA_FIXUP_ACT_PRE_PROBE
:
4631 snd_hda_override_wcaps(codec
, 0x03, 0);
4632 /* Disable AA-loopback as it causes white noise */
4633 spec
->gen
.mixer_nid
= 0;
4635 case HDA_FIXUP_ACT_INIT
:
4636 /* MIC2-VREF control */
4637 /* Set to manual mode */
4638 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
4639 /* Enable Line1 input control by verb */
4640 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
4645 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
4646 const struct hda_fixup
*fix
, int action
)
4648 struct alc_spec
*spec
= codec
->spec
;
4651 case HDA_FIXUP_ACT_PRE_PROBE
:
4652 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
4654 case HDA_FIXUP_ACT_INIT
:
4655 /* MIC2-VREF control */
4656 /* Set to manual mode */
4657 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
4662 /* mute tablet speaker pin (0x14) via dock plugging in addition */
4663 static void asus_tx300_automute(struct hda_codec
*codec
)
4665 struct alc_spec
*spec
= codec
->spec
;
4666 snd_hda_gen_update_outputs(codec
);
4667 if (snd_hda_jack_detect(codec
, 0x1b))
4668 spec
->gen
.mute_bits
|= (1ULL << 0x14);
4671 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
4672 const struct hda_fixup
*fix
, int action
)
4674 struct alc_spec
*spec
= codec
->spec
;
4675 /* TX300 needs to set up GPIO2 for the speaker amp */
4676 static const struct hda_verb gpio2_verbs
[] = {
4677 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
4678 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
4679 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
4682 static const struct hda_pintbl dock_pins
[] = {
4683 { 0x1b, 0x21114000 }, /* dock speaker pin */
4686 struct snd_kcontrol
*kctl
;
4689 case HDA_FIXUP_ACT_PRE_PROBE
:
4690 snd_hda_add_verbs(codec
, gpio2_verbs
);
4691 snd_hda_apply_pincfgs(codec
, dock_pins
);
4692 spec
->gen
.auto_mute_via_amp
= 1;
4693 spec
->gen
.automute_hook
= asus_tx300_automute
;
4694 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4695 snd_hda_gen_hp_automute
);
4697 case HDA_FIXUP_ACT_BUILD
:
4698 /* this is a bit tricky; give more sane names for the main
4699 * (tablet) speaker and the dock speaker, respectively
4701 kctl
= snd_hda_find_mixer_ctl(codec
, "Speaker Playback Switch");
4703 strcpy(kctl
->id
.name
, "Dock Speaker Playback Switch");
4704 kctl
= snd_hda_find_mixer_ctl(codec
, "Bass Speaker Playback Switch");
4706 strcpy(kctl
->id
.name
, "Speaker Playback Switch");
4711 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
4712 const struct hda_fixup
*fix
, int action
)
4714 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4715 /* DAC node 0x03 is giving mono output. We therefore want to
4716 make sure 0x14 (front speaker) and 0x15 (headphones) use the
4717 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
4718 hda_nid_t conn1
[2] = { 0x0c };
4719 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
4720 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
4724 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
4725 const struct hda_fixup
*fix
, int action
)
4727 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4728 /* The speaker is routed to the Node 0x06 by a mistake, as a result
4729 we can't adjust the speaker's volume since this node does not has
4730 Amp-out capability. we change the speaker's route to:
4731 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
4732 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
4733 speaker's volume now. */
4735 hda_nid_t conn1
[1] = { 0x0c };
4736 snd_hda_override_conn_list(codec
, 0x17, 1, conn1
);
4740 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
4741 static void alc295_fixup_disable_dac3(struct hda_codec
*codec
,
4742 const struct hda_fixup
*fix
, int action
)
4744 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4745 hda_nid_t conn
[2] = { 0x02, 0x03 };
4746 snd_hda_override_conn_list(codec
, 0x17, 2, conn
);
4750 /* Hook to update amp GPIO4 for automute */
4751 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
4752 struct hda_jack_callback
*jack
)
4754 struct alc_spec
*spec
= codec
->spec
;
4756 snd_hda_gen_hp_automute(codec
, jack
);
4757 /* mute_led_polarity is set to 0, so we pass inverted value here */
4758 alc_update_gpio_led(codec
, 0x10, !spec
->gen
.hp_jack_present
);
4761 /* Manage GPIOs for HP EliteBook Folio 9480m.
4763 * GPIO4 is the headphone amplifier power control
4764 * GPIO3 is the audio output mute indicator LED
4767 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
4768 const struct hda_fixup
*fix
,
4771 struct alc_spec
*spec
= codec
->spec
;
4772 static const struct hda_verb gpio_init
[] = {
4773 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
4774 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
4778 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4779 /* Set the hooks to turn the headphone amp on/off
4782 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
4783 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
4785 /* The GPIOs are currently off */
4788 /* GPIO3 is connected to the output mute LED,
4789 * high is on, low is off
4791 spec
->mute_led_polarity
= 0;
4792 spec
->gpio_mute_led_mask
= 0x08;
4794 /* Initialize GPIO configuration */
4795 snd_hda_add_verbs(codec
, gpio_init
);
4799 static void alc_fixup_disable_mic_vref(struct hda_codec
*codec
,
4800 const struct hda_fixup
*fix
, int action
)
4802 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
4803 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
4806 /* for hda_fixup_thinkpad_acpi() */
4807 #include "thinkpad_helper.c"
4809 /* for dell wmi mic mute led */
4810 #include "dell_wmi_helper.c"
4813 ALC269_FIXUP_SONY_VAIO
,
4814 ALC275_FIXUP_SONY_VAIO_GPIO2
,
4815 ALC269_FIXUP_DELL_M101Z
,
4816 ALC269_FIXUP_SKU_IGNORE
,
4817 ALC269_FIXUP_ASUS_G73JW
,
4818 ALC269_FIXUP_LENOVO_EAPD
,
4819 ALC275_FIXUP_SONY_HWEQ
,
4820 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
4822 ALC269_FIXUP_PCM_44K
,
4823 ALC269_FIXUP_STEREO_DMIC
,
4824 ALC269_FIXUP_HEADSET_MIC
,
4825 ALC269_FIXUP_QUANTA_MUTE
,
4826 ALC269_FIXUP_LIFEBOOK
,
4827 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
4828 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
4829 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
4830 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
,
4833 ALC269VB_FIXUP_AMIC
,
4834 ALC269VB_FIXUP_DMIC
,
4835 ALC269_FIXUP_HP_MUTE_LED
,
4836 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
4837 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
4838 ALC269_FIXUP_HP_GPIO_LED
,
4839 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
4840 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
4841 ALC269_FIXUP_INV_DMIC
,
4842 ALC269_FIXUP_LENOVO_DOCK
,
4843 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
,
4844 ALC269_FIXUP_NO_SHUTUP
,
4845 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
4846 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
4847 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
4848 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
4849 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
4850 ALC269_FIXUP_HEADSET_MODE
,
4851 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
4852 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
4853 ALC269_FIXUP_ASUS_X101_FUNC
,
4854 ALC269_FIXUP_ASUS_X101_VERB
,
4855 ALC269_FIXUP_ASUS_X101
,
4856 ALC271_FIXUP_AMIC_MIC2
,
4857 ALC271_FIXUP_HP_GATE_MIC_JACK
,
4858 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
4859 ALC269_FIXUP_ACER_AC700
,
4860 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
4861 ALC269VB_FIXUP_ASUS_ZENBOOK
,
4862 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
4863 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
4864 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
4865 ALC283_FIXUP_CHROME_BOOK
,
4866 ALC283_FIXUP_SENSE_COMBO_JACK
,
4867 ALC282_FIXUP_ASUS_TX300
,
4868 ALC283_FIXUP_INT_MIC
,
4869 ALC290_FIXUP_MONO_SPEAKERS
,
4870 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
4871 ALC290_FIXUP_SUBWOOFER
,
4872 ALC290_FIXUP_SUBWOOFER_HSJACK
,
4873 ALC269_FIXUP_THINKPAD_ACPI
,
4874 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
4875 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
4876 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
4877 ALC255_FIXUP_HEADSET_MODE
,
4878 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
4879 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
4880 ALC292_FIXUP_TPT440_DOCK
,
4881 ALC292_FIXUP_TPT440
,
4882 ALC283_FIXUP_BXBT2807_MIC
,
4883 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
,
4884 ALC282_FIXUP_ASPIRE_V5_PINS
,
4885 ALC280_FIXUP_HP_GPIO4
,
4886 ALC286_FIXUP_HP_GPIO_LED
,
4887 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
4888 ALC280_FIXUP_HP_DOCK_PINS
,
4889 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
4890 ALC280_FIXUP_HP_9480M
,
4891 ALC288_FIXUP_DELL_HEADSET_MODE
,
4892 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
4893 ALC288_FIXUP_DELL_XPS_13_GPIO6
,
4894 ALC288_FIXUP_DELL_XPS_13
,
4895 ALC288_FIXUP_DISABLE_AAMIX
,
4896 ALC292_FIXUP_DELL_E7X
,
4897 ALC292_FIXUP_DISABLE_AAMIX
,
4898 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
4899 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
4900 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
4901 ALC275_FIXUP_DELL_XPS
,
4902 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
,
4903 ALC293_FIXUP_LENOVO_SPK_NOISE
,
4904 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
4905 ALC255_FIXUP_DELL_SPK_NOISE
,
4906 ALC225_FIXUP_DISABLE_MIC_VREF
,
4907 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
4908 ALC295_FIXUP_DISABLE_DAC3
,
4909 ALC280_FIXUP_HP_HEADSET_MIC
,
4910 ALC221_FIXUP_HP_FRONT_MIC
,
4911 ALC292_FIXUP_TPT460
,
4912 ALC298_FIXUP_SPK_VOLUME
,
4913 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
4916 static const struct hda_fixup alc269_fixups
[] = {
4917 [ALC269_FIXUP_SONY_VAIO
] = {
4918 .type
= HDA_FIXUP_PINCTLS
,
4919 .v
.pins
= (const struct hda_pintbl
[]) {
4920 {0x19, PIN_VREFGRD
},
4924 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
4925 .type
= HDA_FIXUP_VERBS
,
4926 .v
.verbs
= (const struct hda_verb
[]) {
4927 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
4928 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
4929 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
4933 .chain_id
= ALC269_FIXUP_SONY_VAIO
4935 [ALC269_FIXUP_DELL_M101Z
] = {
4936 .type
= HDA_FIXUP_VERBS
,
4937 .v
.verbs
= (const struct hda_verb
[]) {
4938 /* Enables internal speaker */
4939 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
4940 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
4944 [ALC269_FIXUP_SKU_IGNORE
] = {
4945 .type
= HDA_FIXUP_FUNC
,
4946 .v
.func
= alc_fixup_sku_ignore
,
4948 [ALC269_FIXUP_ASUS_G73JW
] = {
4949 .type
= HDA_FIXUP_PINS
,
4950 .v
.pins
= (const struct hda_pintbl
[]) {
4951 { 0x17, 0x99130111 }, /* subwoofer */
4955 [ALC269_FIXUP_LENOVO_EAPD
] = {
4956 .type
= HDA_FIXUP_VERBS
,
4957 .v
.verbs
= (const struct hda_verb
[]) {
4958 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
4962 [ALC275_FIXUP_SONY_HWEQ
] = {
4963 .type
= HDA_FIXUP_FUNC
,
4964 .v
.func
= alc269_fixup_hweq
,
4966 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
4968 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
4969 .type
= HDA_FIXUP_FUNC
,
4970 .v
.func
= alc_fixup_disable_aamix
,
4972 .chain_id
= ALC269_FIXUP_SONY_VAIO
4974 [ALC271_FIXUP_DMIC
] = {
4975 .type
= HDA_FIXUP_FUNC
,
4976 .v
.func
= alc271_fixup_dmic
,
4978 [ALC269_FIXUP_PCM_44K
] = {
4979 .type
= HDA_FIXUP_FUNC
,
4980 .v
.func
= alc269_fixup_pcm_44k
,
4982 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
4984 [ALC269_FIXUP_STEREO_DMIC
] = {
4985 .type
= HDA_FIXUP_FUNC
,
4986 .v
.func
= alc269_fixup_stereo_dmic
,
4988 [ALC269_FIXUP_HEADSET_MIC
] = {
4989 .type
= HDA_FIXUP_FUNC
,
4990 .v
.func
= alc269_fixup_headset_mic
,
4992 [ALC269_FIXUP_QUANTA_MUTE
] = {
4993 .type
= HDA_FIXUP_FUNC
,
4994 .v
.func
= alc269_fixup_quanta_mute
,
4996 [ALC269_FIXUP_LIFEBOOK
] = {
4997 .type
= HDA_FIXUP_PINS
,
4998 .v
.pins
= (const struct hda_pintbl
[]) {
4999 { 0x1a, 0x2101103f }, /* dock line-out */
5000 { 0x1b, 0x23a11040 }, /* dock mic-in */
5004 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5006 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
5007 .type
= HDA_FIXUP_PINS
,
5008 .v
.pins
= (const struct hda_pintbl
[]) {
5009 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5013 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
5014 .type
= HDA_FIXUP_PINS
,
5015 .v
.pins
= (const struct hda_pintbl
[]) {
5016 { 0x21, 0x0221102f }, /* HP out */
5020 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
5021 .type
= HDA_FIXUP_FUNC
,
5022 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5024 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
] = {
5025 .type
= HDA_FIXUP_FUNC
,
5026 .v
.func
= alc269_fixup_pincfg_U7x7_headset_mic
,
5028 [ALC269_FIXUP_AMIC
] = {
5029 .type
= HDA_FIXUP_PINS
,
5030 .v
.pins
= (const struct hda_pintbl
[]) {
5031 { 0x14, 0x99130110 }, /* speaker */
5032 { 0x15, 0x0121401f }, /* HP out */
5033 { 0x18, 0x01a19c20 }, /* mic */
5034 { 0x19, 0x99a3092f }, /* int-mic */
5038 [ALC269_FIXUP_DMIC
] = {
5039 .type
= HDA_FIXUP_PINS
,
5040 .v
.pins
= (const struct hda_pintbl
[]) {
5041 { 0x12, 0x99a3092f }, /* int-mic */
5042 { 0x14, 0x99130110 }, /* speaker */
5043 { 0x15, 0x0121401f }, /* HP out */
5044 { 0x18, 0x01a19c20 }, /* mic */
5048 [ALC269VB_FIXUP_AMIC
] = {
5049 .type
= HDA_FIXUP_PINS
,
5050 .v
.pins
= (const struct hda_pintbl
[]) {
5051 { 0x14, 0x99130110 }, /* speaker */
5052 { 0x18, 0x01a19c20 }, /* mic */
5053 { 0x19, 0x99a3092f }, /* int-mic */
5054 { 0x21, 0x0121401f }, /* HP out */
5058 [ALC269VB_FIXUP_DMIC
] = {
5059 .type
= HDA_FIXUP_PINS
,
5060 .v
.pins
= (const struct hda_pintbl
[]) {
5061 { 0x12, 0x99a3092f }, /* int-mic */
5062 { 0x14, 0x99130110 }, /* speaker */
5063 { 0x18, 0x01a19c20 }, /* mic */
5064 { 0x21, 0x0121401f }, /* HP out */
5068 [ALC269_FIXUP_HP_MUTE_LED
] = {
5069 .type
= HDA_FIXUP_FUNC
,
5070 .v
.func
= alc269_fixup_hp_mute_led
,
5072 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
5073 .type
= HDA_FIXUP_FUNC
,
5074 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
5076 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
5077 .type
= HDA_FIXUP_FUNC
,
5078 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
5080 [ALC269_FIXUP_HP_GPIO_LED
] = {
5081 .type
= HDA_FIXUP_FUNC
,
5082 .v
.func
= alc269_fixup_hp_gpio_led
,
5084 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
5085 .type
= HDA_FIXUP_FUNC
,
5086 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
5088 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
5089 .type
= HDA_FIXUP_FUNC
,
5090 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
5092 [ALC269_FIXUP_INV_DMIC
] = {
5093 .type
= HDA_FIXUP_FUNC
,
5094 .v
.func
= alc_fixup_inv_dmic
,
5096 [ALC269_FIXUP_NO_SHUTUP
] = {
5097 .type
= HDA_FIXUP_FUNC
,
5098 .v
.func
= alc_fixup_no_shutup
,
5100 [ALC269_FIXUP_LENOVO_DOCK
] = {
5101 .type
= HDA_FIXUP_PINS
,
5102 .v
.pins
= (const struct hda_pintbl
[]) {
5103 { 0x19, 0x23a11040 }, /* dock mic */
5104 { 0x1b, 0x2121103f }, /* dock headphone */
5108 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5110 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
] = {
5111 .type
= HDA_FIXUP_FUNC
,
5112 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5114 .chain_id
= ALC269_FIXUP_LENOVO_DOCK
,
5116 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
5117 .type
= HDA_FIXUP_FUNC
,
5118 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5120 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5122 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5123 .type
= HDA_FIXUP_PINS
,
5124 .v
.pins
= (const struct hda_pintbl
[]) {
5125 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5126 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5130 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5132 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5133 .type
= HDA_FIXUP_PINS
,
5134 .v
.pins
= (const struct hda_pintbl
[]) {
5135 { 0x16, 0x21014020 }, /* dock line out */
5136 { 0x19, 0x21a19030 }, /* dock mic */
5137 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5141 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5143 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
5144 .type
= HDA_FIXUP_PINS
,
5145 .v
.pins
= (const struct hda_pintbl
[]) {
5146 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5150 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5152 [ALC269_FIXUP_HEADSET_MODE
] = {
5153 .type
= HDA_FIXUP_FUNC
,
5154 .v
.func
= alc_fixup_headset_mode
,
5156 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5158 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5159 .type
= HDA_FIXUP_FUNC
,
5160 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
5162 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
5163 .type
= HDA_FIXUP_PINS
,
5164 .v
.pins
= (const struct hda_pintbl
[]) {
5165 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5169 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
5171 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
5172 .type
= HDA_FIXUP_PINS
,
5173 .v
.pins
= (const struct hda_pintbl
[]) {
5174 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5178 .chain_id
= ALC269_FIXUP_HEADSET_MIC
5180 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
5181 .type
= HDA_FIXUP_FUNC
,
5182 .v
.func
= alc269_fixup_x101_headset_mic
,
5184 [ALC269_FIXUP_ASUS_X101_VERB
] = {
5185 .type
= HDA_FIXUP_VERBS
,
5186 .v
.verbs
= (const struct hda_verb
[]) {
5187 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5188 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
5189 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
5193 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
5195 [ALC269_FIXUP_ASUS_X101
] = {
5196 .type
= HDA_FIXUP_PINS
,
5197 .v
.pins
= (const struct hda_pintbl
[]) {
5198 { 0x18, 0x04a1182c }, /* Headset mic */
5202 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
5204 [ALC271_FIXUP_AMIC_MIC2
] = {
5205 .type
= HDA_FIXUP_PINS
,
5206 .v
.pins
= (const struct hda_pintbl
[]) {
5207 { 0x14, 0x99130110 }, /* speaker */
5208 { 0x19, 0x01a19c20 }, /* mic */
5209 { 0x1b, 0x99a7012f }, /* int-mic */
5210 { 0x21, 0x0121401f }, /* HP out */
5214 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
5215 .type
= HDA_FIXUP_FUNC
,
5216 .v
.func
= alc271_hp_gate_mic_jack
,
5218 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
5220 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
5221 .type
= HDA_FIXUP_FUNC
,
5222 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5224 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
5226 [ALC269_FIXUP_ACER_AC700
] = {
5227 .type
= HDA_FIXUP_PINS
,
5228 .v
.pins
= (const struct hda_pintbl
[]) {
5229 { 0x12, 0x99a3092f }, /* int-mic */
5230 { 0x14, 0x99130110 }, /* speaker */
5231 { 0x18, 0x03a11c20 }, /* mic */
5232 { 0x1e, 0x0346101e }, /* SPDIF1 */
5233 { 0x21, 0x0321101f }, /* HP out */
5237 .chain_id
= ALC271_FIXUP_DMIC
,
5239 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
5240 .type
= HDA_FIXUP_FUNC
,
5241 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5243 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5245 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
5246 .type
= HDA_FIXUP_FUNC
,
5247 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5249 .chain_id
= ALC269VB_FIXUP_DMIC
,
5251 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
5252 .type
= HDA_FIXUP_VERBS
,
5253 .v
.verbs
= (const struct hda_verb
[]) {
5254 /* class-D output amp +5dB */
5255 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
5256 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
5260 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
5262 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
5263 .type
= HDA_FIXUP_FUNC
,
5264 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5266 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5268 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
5269 .type
= HDA_FIXUP_PINS
,
5270 .v
.pins
= (const struct hda_pintbl
[]) {
5271 { 0x12, 0x99a3092f }, /* int-mic */
5272 { 0x18, 0x03a11d20 }, /* mic */
5273 { 0x19, 0x411111f0 }, /* Unused bogus pin */
5277 [ALC283_FIXUP_CHROME_BOOK
] = {
5278 .type
= HDA_FIXUP_FUNC
,
5279 .v
.func
= alc283_fixup_chromebook
,
5281 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
5282 .type
= HDA_FIXUP_FUNC
,
5283 .v
.func
= alc283_fixup_sense_combo_jack
,
5285 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
5287 [ALC282_FIXUP_ASUS_TX300
] = {
5288 .type
= HDA_FIXUP_FUNC
,
5289 .v
.func
= alc282_fixup_asus_tx300
,
5291 [ALC283_FIXUP_INT_MIC
] = {
5292 .type
= HDA_FIXUP_VERBS
,
5293 .v
.verbs
= (const struct hda_verb
[]) {
5294 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
5295 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
5299 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
5301 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
5302 .type
= HDA_FIXUP_PINS
,
5303 .v
.pins
= (const struct hda_pintbl
[]) {
5304 { 0x17, 0x90170112 }, /* subwoofer */
5308 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5310 [ALC290_FIXUP_SUBWOOFER
] = {
5311 .type
= HDA_FIXUP_PINS
,
5312 .v
.pins
= (const struct hda_pintbl
[]) {
5313 { 0x17, 0x90170112 }, /* subwoofer */
5317 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
5319 [ALC290_FIXUP_MONO_SPEAKERS
] = {
5320 .type
= HDA_FIXUP_FUNC
,
5321 .v
.func
= alc290_fixup_mono_speakers
,
5323 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
5324 .type
= HDA_FIXUP_FUNC
,
5325 .v
.func
= alc290_fixup_mono_speakers
,
5327 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5329 [ALC269_FIXUP_THINKPAD_ACPI
] = {
5330 .type
= HDA_FIXUP_FUNC
,
5331 .v
.func
= hda_fixup_thinkpad_acpi
,
5333 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
5334 .type
= HDA_FIXUP_FUNC
,
5335 .v
.func
= alc_fixup_inv_dmic
,
5337 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5339 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5340 .type
= HDA_FIXUP_PINS
,
5341 .v
.pins
= (const struct hda_pintbl
[]) {
5342 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5343 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5347 .chain_id
= ALC255_FIXUP_HEADSET_MODE
5349 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5350 .type
= HDA_FIXUP_PINS
,
5351 .v
.pins
= (const struct hda_pintbl
[]) {
5352 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5356 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
5358 [ALC255_FIXUP_HEADSET_MODE
] = {
5359 .type
= HDA_FIXUP_FUNC
,
5360 .v
.func
= alc_fixup_headset_mode_alc255
,
5362 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5364 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5365 .type
= HDA_FIXUP_FUNC
,
5366 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
5368 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5369 .type
= HDA_FIXUP_PINS
,
5370 .v
.pins
= (const struct hda_pintbl
[]) {
5371 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5372 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5376 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5378 [ALC292_FIXUP_TPT440_DOCK
] = {
5379 .type
= HDA_FIXUP_FUNC
,
5380 .v
.func
= alc_fixup_tpt440_dock
,
5382 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
5384 [ALC292_FIXUP_TPT440
] = {
5385 .type
= HDA_FIXUP_FUNC
,
5386 .v
.func
= alc_fixup_disable_aamix
,
5388 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
5390 [ALC283_FIXUP_BXBT2807_MIC
] = {
5391 .type
= HDA_FIXUP_PINS
,
5392 .v
.pins
= (const struct hda_pintbl
[]) {
5393 { 0x19, 0x04a110f0 },
5397 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
] = {
5398 .type
= HDA_FIXUP_FUNC
,
5399 .v
.func
= alc_fixup_dell_wmi
,
5401 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
5402 .type
= HDA_FIXUP_PINS
,
5403 .v
.pins
= (const struct hda_pintbl
[]) {
5404 { 0x12, 0x90a60130 },
5405 { 0x14, 0x90170110 },
5406 { 0x17, 0x40000008 },
5407 { 0x18, 0x411111f0 },
5408 { 0x19, 0x01a1913c },
5409 { 0x1a, 0x411111f0 },
5410 { 0x1b, 0x411111f0 },
5411 { 0x1d, 0x40f89b2d },
5412 { 0x1e, 0x411111f0 },
5413 { 0x21, 0x0321101f },
5417 [ALC280_FIXUP_HP_GPIO4
] = {
5418 .type
= HDA_FIXUP_FUNC
,
5419 .v
.func
= alc280_fixup_hp_gpio4
,
5421 [ALC286_FIXUP_HP_GPIO_LED
] = {
5422 .type
= HDA_FIXUP_FUNC
,
5423 .v
.func
= alc286_fixup_hp_gpio_led
,
5425 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
5426 .type
= HDA_FIXUP_FUNC
,
5427 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
5429 [ALC280_FIXUP_HP_DOCK_PINS
] = {
5430 .type
= HDA_FIXUP_PINS
,
5431 .v
.pins
= (const struct hda_pintbl
[]) {
5432 { 0x1b, 0x21011020 }, /* line-out */
5433 { 0x1a, 0x01a1903c }, /* headset mic */
5434 { 0x18, 0x2181103f }, /* line-in */
5438 .chain_id
= ALC280_FIXUP_HP_GPIO4
5440 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
5441 .type
= HDA_FIXUP_PINS
,
5442 .v
.pins
= (const struct hda_pintbl
[]) {
5443 { 0x1b, 0x21011020 }, /* line-out */
5444 { 0x18, 0x2181103f }, /* line-in */
5448 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
5450 [ALC280_FIXUP_HP_9480M
] = {
5451 .type
= HDA_FIXUP_FUNC
,
5452 .v
.func
= alc280_fixup_hp_9480m
,
5454 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
5455 .type
= HDA_FIXUP_FUNC
,
5456 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
5458 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5460 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5461 .type
= HDA_FIXUP_PINS
,
5462 .v
.pins
= (const struct hda_pintbl
[]) {
5463 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5464 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5468 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
5470 [ALC288_FIXUP_DELL_XPS_13_GPIO6
] = {
5471 .type
= HDA_FIXUP_VERBS
,
5472 .v
.verbs
= (const struct hda_verb
[]) {
5473 {0x01, AC_VERB_SET_GPIO_MASK
, 0x40},
5474 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x40},
5475 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5479 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
5481 [ALC288_FIXUP_DISABLE_AAMIX
] = {
5482 .type
= HDA_FIXUP_FUNC
,
5483 .v
.func
= alc_fixup_disable_aamix
,
5485 .chain_id
= ALC288_FIXUP_DELL_XPS_13_GPIO6
5487 [ALC288_FIXUP_DELL_XPS_13
] = {
5488 .type
= HDA_FIXUP_FUNC
,
5489 .v
.func
= alc_fixup_dell_xps13
,
5491 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
5493 [ALC292_FIXUP_DISABLE_AAMIX
] = {
5494 .type
= HDA_FIXUP_FUNC
,
5495 .v
.func
= alc_fixup_disable_aamix
,
5497 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
5499 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
5500 .type
= HDA_FIXUP_FUNC
,
5501 .v
.func
= alc_fixup_disable_aamix
,
5503 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
5505 [ALC292_FIXUP_DELL_E7X
] = {
5506 .type
= HDA_FIXUP_FUNC
,
5507 .v
.func
= alc_fixup_dell_xps13
,
5509 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
5511 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5512 .type
= HDA_FIXUP_PINS
,
5513 .v
.pins
= (const struct hda_pintbl
[]) {
5514 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5515 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5519 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5521 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
5522 .type
= HDA_FIXUP_PINS
,
5523 .v
.pins
= (const struct hda_pintbl
[]) {
5524 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5528 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5530 [ALC275_FIXUP_DELL_XPS
] = {
5531 .type
= HDA_FIXUP_VERBS
,
5532 .v
.verbs
= (const struct hda_verb
[]) {
5533 /* Enables internal speaker */
5534 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
5535 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
5536 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
5537 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
5541 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
] = {
5542 .type
= HDA_FIXUP_VERBS
,
5543 .v
.verbs
= (const struct hda_verb
[]) {
5544 /* Disable pass-through path for FRONT 14h */
5545 {0x20, AC_VERB_SET_COEF_INDEX
, 0x36},
5546 {0x20, AC_VERB_SET_PROC_COEF
, 0x1737},
5550 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
5552 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
5553 .type
= HDA_FIXUP_FUNC
,
5554 .v
.func
= alc_fixup_disable_aamix
,
5556 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
5558 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
5559 .type
= HDA_FIXUP_FUNC
,
5560 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
5562 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
5563 .type
= HDA_FIXUP_FUNC
,
5564 .v
.func
= alc_fixup_disable_aamix
,
5566 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
5568 [ALC225_FIXUP_DISABLE_MIC_VREF
] = {
5569 .type
= HDA_FIXUP_FUNC
,
5570 .v
.func
= alc_fixup_disable_mic_vref
,
5572 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
5574 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5575 .type
= HDA_FIXUP_VERBS
,
5576 .v
.verbs
= (const struct hda_verb
[]) {
5577 /* Disable pass-through path for FRONT 14h */
5578 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
5579 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
5583 .chain_id
= ALC225_FIXUP_DISABLE_MIC_VREF
5585 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
5586 .type
= HDA_FIXUP_FUNC
,
5587 .v
.func
= alc_fixup_disable_aamix
,
5589 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
5591 [ALC221_FIXUP_HP_FRONT_MIC
] = {
5592 .type
= HDA_FIXUP_PINS
,
5593 .v
.pins
= (const struct hda_pintbl
[]) {
5594 { 0x19, 0x02a19020 }, /* Front Mic */
5598 [ALC292_FIXUP_TPT460
] = {
5599 .type
= HDA_FIXUP_FUNC
,
5600 .v
.func
= alc_fixup_tpt440_dock
,
5602 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
5604 [ALC298_FIXUP_SPK_VOLUME
] = {
5605 .type
= HDA_FIXUP_FUNC
,
5606 .v
.func
= alc298_fixup_speaker_volume
,
5608 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5610 [ALC295_FIXUP_DISABLE_DAC3
] = {
5611 .type
= HDA_FIXUP_FUNC
,
5612 .v
.func
= alc295_fixup_disable_dac3
,
5614 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
5615 .type
= HDA_FIXUP_PINS
,
5616 .v
.pins
= (const struct hda_pintbl
[]) {
5617 { 0x1b, 0x90170151 },
5621 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
5625 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
5626 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
5627 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
5628 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
5629 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
5630 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
5631 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
5632 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
5633 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
5634 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
5635 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
5636 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
5637 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
5638 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
5639 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
5640 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
5641 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
5642 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
5643 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
5644 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
5645 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
5646 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
5647 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
5648 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
5649 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
5650 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
5651 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
5652 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
5653 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5654 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5655 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
5656 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
5657 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
5658 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
5659 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5660 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5661 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
5662 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
5663 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
5664 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
5665 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
5666 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
5667 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
5668 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
5669 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
5670 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME
),
5671 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
5672 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3
),
5673 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
5674 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
5675 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5676 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5677 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
5678 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
5679 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
5680 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
5682 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5683 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5684 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5685 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
5686 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
5687 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
5688 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
5689 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
5690 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5691 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5692 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5693 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5694 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
5695 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
5696 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
5697 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5698 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5699 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5700 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5701 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5702 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
5703 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5704 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5706 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5707 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5708 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5709 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5710 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5711 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5712 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5713 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5714 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5715 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
5716 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5717 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5718 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5719 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5720 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5721 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5722 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
5723 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5724 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5725 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5726 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5727 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5728 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5729 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5730 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5731 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5732 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5733 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5734 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
5735 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
5736 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
5737 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
5738 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5739 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5740 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
5741 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
5742 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
5743 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
5744 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
5745 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5746 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
5747 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
5748 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
5749 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
5750 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
5751 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
5752 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
5753 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
5754 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
5755 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
5756 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
5757 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
5758 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
5759 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
5760 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
5761 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
),
5762 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
5763 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
5764 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_BXBT2807_MIC
),
5765 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
5766 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
5767 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
5768 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
5769 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
5770 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
),
5771 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
5772 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
5773 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
5774 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
5775 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
5776 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
5777 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
5778 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
5779 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
5780 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
5781 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
5782 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5783 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
5784 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
5785 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
5786 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
5787 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
5788 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
5789 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
5790 SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
5791 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
5792 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
5793 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
5794 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5795 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
5796 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
5797 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5798 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
5799 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
5800 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
5801 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
5802 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
5803 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
5804 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
5805 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
5806 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5807 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
5808 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
5809 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
5812 /* Below is a quirk table taken from the old code.
5813 * Basically the device should work as is without the fixup table.
5814 * If BIOS doesn't give a proper info, enable the corresponding
5817 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
5819 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
5820 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
5821 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
5822 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
5823 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
5824 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
5825 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
5826 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
5827 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
5828 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
5829 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
5830 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
5831 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
5832 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
5833 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
5834 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
5835 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
5836 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
5837 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
5838 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
5839 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
5840 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
5841 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
5842 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
5843 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
5844 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
5845 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
5846 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
5847 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
5848 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
5849 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
5850 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
5851 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
5852 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
5853 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
5854 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
5855 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
5856 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
5857 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
5862 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
5863 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
5864 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
5865 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
5866 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
5870 static const struct hda_model_fixup alc269_fixup_models
[] = {
5871 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
5872 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
5873 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
5874 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
5875 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
5876 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
5877 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
5878 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
5879 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
5880 {.id
= ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
, .name
= "lenovo-dock-limit-boost"},
5881 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
5882 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
5883 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
5884 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
5885 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
5886 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
5887 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
5888 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
5889 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
5892 #define ALC225_STANDARD_PINS \
5895 #define ALC256_STANDARD_PINS \
5896 {0x12, 0x90a60140}, \
5897 {0x14, 0x90170110}, \
5900 #define ALC282_STANDARD_PINS \
5903 #define ALC290_STANDARD_PINS \
5906 #define ALC292_STANDARD_PINS \
5907 {0x14, 0x90170110}, \
5910 #define ALC295_STANDARD_PINS \
5911 {0x12, 0xb7a60130}, \
5912 {0x14, 0x90170110}, \
5915 #define ALC298_STANDARD_PINS \
5916 {0x12, 0x90a60130}, \
5919 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
5920 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5921 ALC225_STANDARD_PINS
,
5923 {0x14, 0x901701a0}),
5924 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5925 ALC225_STANDARD_PINS
,
5927 {0x14, 0x901701b0}),
5928 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5929 ALC225_STANDARD_PINS
,
5931 {0x14, 0x901701a0}),
5932 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5933 ALC225_STANDARD_PINS
,
5935 {0x14, 0x901701b0}),
5936 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5937 ALC225_STANDARD_PINS
,
5939 {0x1b, 0x90170110}),
5940 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5943 {0x21, 0x02211020}),
5944 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5947 {0x21, 0x02211020}),
5948 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
5950 {0x21, 0x02211020}),
5951 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5953 {0x21, 0x02211040}),
5954 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5957 {0x21, 0x02211020}),
5958 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5961 {0x21, 0x02211030}),
5962 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5965 {0x21, 0x0221101f}),
5966 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5969 {0x21, 0x0221101f}),
5970 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5973 {0x21, 0x0221103f}),
5974 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5977 {0x21, 0x0221103f}),
5978 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5981 {0x21, 0x0221103f}),
5982 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5985 {0x21, 0x0221105f}),
5986 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5989 {0x21, 0x0221101f}),
5990 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5994 {0x21, 0x0321102f}),
5995 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5998 {0x21, 0x02211040}),
5999 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6002 {0x21, 0x02211050}),
6003 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6006 {0x21, 0x02211030}),
6007 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6010 {0x21, 0x02211040}),
6011 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6014 {0x21, 0x02211040}),
6015 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6018 {0x21, 0x02211050}),
6019 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6022 {0x21, 0x02211040}),
6023 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6026 {0x21, 0x02211030}),
6027 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6029 {0x21, 0x02211010}),
6030 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6034 {0x21, 0x0221101f}),
6035 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6038 {0x21, 0x02211030}),
6039 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6042 {0x21, 0x02211030}),
6043 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6046 {0x21, 0x02211030}),
6047 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6050 {0x21, 0x02211020}),
6051 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6055 {0x21, 0x0221101f}),
6056 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6057 ALC256_STANDARD_PINS
),
6058 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
6062 {0x1a, 0x04a11020}),
6063 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
6069 {0x1b, 0x02011020}),
6070 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6071 ALC282_STANDARD_PINS
,
6074 {0x21, 0x0321101f}),
6075 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6076 ALC282_STANDARD_PINS
,
6079 {0x21, 0x03211040}),
6080 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6081 ALC282_STANDARD_PINS
,
6084 {0x21, 0x03211020}),
6085 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6086 ALC282_STANDARD_PINS
,
6089 {0x21, 0x0421101f}),
6090 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
6091 ALC282_STANDARD_PINS
,
6094 {0x21, 0x04211020}),
6095 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6096 ALC282_STANDARD_PINS
,
6098 {0x21, 0x0321101f}),
6099 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6102 {0x21, 0x02211030}),
6103 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6104 ALC282_STANDARD_PINS
,
6107 {0x21, 0x0321101f}),
6108 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6
,
6111 {0x21, 0x0321101f}),
6112 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6115 {0x21, 0x04211020}),
6116 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6117 ALC290_STANDARD_PINS
,
6120 {0x1a, 0x04a11020}),
6121 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6122 ALC290_STANDARD_PINS
,
6125 {0x1a, 0x04a11020}),
6126 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6127 ALC290_STANDARD_PINS
,
6129 {0x1a, 0x04a11020}),
6130 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6131 ALC290_STANDARD_PINS
,
6133 {0x1a, 0x04a11040}),
6134 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6135 ALC290_STANDARD_PINS
,
6138 {0x1a, 0x04a11040}),
6139 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6140 ALC290_STANDARD_PINS
,
6143 {0x1a, 0x04a11020}),
6144 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6145 ALC290_STANDARD_PINS
,
6148 {0x1a, 0x04a11020}),
6149 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
6150 ALC292_STANDARD_PINS
,
6153 {0x19, 0x01a19030}),
6154 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
6155 ALC292_STANDARD_PINS
,
6159 {0x19, 0x01a1903e}),
6160 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6161 ALC292_STANDARD_PINS
,
6162 {0x12, 0x90a60140}),
6163 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
6164 ALC292_STANDARD_PINS
,
6167 {0x19, 0x21a19030}),
6168 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
6169 ALC292_STANDARD_PINS
,
6170 {0x13, 0x90a60140}),
6171 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6172 ALC295_STANDARD_PINS
,
6174 {0x18, 0x21a19030}),
6175 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6176 ALC295_STANDARD_PINS
,
6178 {0x18, 0x21a19050}),
6179 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6180 ALC295_STANDARD_PINS
),
6181 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
6182 ALC298_STANDARD_PINS
,
6183 {0x17, 0x90170110}),
6184 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
6185 ALC298_STANDARD_PINS
,
6186 {0x17, 0x90170140}),
6187 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
6188 ALC298_STANDARD_PINS
,
6189 {0x17, 0x90170150}),
6190 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
6195 {0x21, 0x03211030}),
6199 static void alc269_fill_coef(struct hda_codec
*codec
)
6201 struct alc_spec
*spec
= codec
->spec
;
6204 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
6207 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
6208 alc_write_coef_idx(codec
, 0xf, 0x960b);
6209 alc_write_coef_idx(codec
, 0xe, 0x8817);
6212 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
6213 alc_write_coef_idx(codec
, 0xf, 0x960b);
6214 alc_write_coef_idx(codec
, 0xe, 0x8814);
6217 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
6218 /* Power up output pin */
6219 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
6222 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
6223 val
= alc_read_coef_idx(codec
, 0xd);
6224 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
6225 /* Capless ramp up clock control */
6226 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
6228 val
= alc_read_coef_idx(codec
, 0x17);
6229 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
6230 /* Class D power on reset */
6231 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
6236 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
6241 static int patch_alc269(struct hda_codec
*codec
)
6243 struct alc_spec
*spec
;
6246 err
= alc_alloc_spec(codec
, 0x0b);
6251 spec
->gen
.shared_mic_vref_pin
= 0x18;
6252 codec
->power_save_node
= 0;
6255 codec
->patch_ops
.suspend
= alc269_suspend
;
6256 codec
->patch_ops
.resume
= alc269_resume
;
6258 spec
->shutup
= alc269_shutup
;
6260 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
6261 alc269_fixup_tbl
, alc269_fixups
);
6262 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
);
6263 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
6265 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
6267 alc_auto_parse_customize_define(codec
);
6269 if (has_cdefine_beep(codec
))
6270 spec
->gen
.beep_nid
= 0x01;
6272 switch (codec
->core
.vendor_id
) {
6274 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
6275 switch (alc_get_coef0(codec
) & 0x00f0) {
6277 if (codec
->bus
->pci
&&
6278 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
6279 spec
->cdefine
.platform_type
== 1)
6280 err
= alc_codec_rename(codec
, "ALC271X");
6281 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
6284 if (codec
->bus
->pci
&&
6285 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
6286 codec
->bus
->pci
->subsystem_device
== 0x21f3)
6287 err
= alc_codec_rename(codec
, "ALC3202");
6288 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
6291 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
6294 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
6298 spec
->init_hook
= alc269_fill_coef
;
6299 alc269_fill_coef(codec
);
6304 spec
->codec_variant
= ALC269_TYPE_ALC280
;
6307 spec
->codec_variant
= ALC269_TYPE_ALC282
;
6308 spec
->shutup
= alc282_shutup
;
6309 spec
->init_hook
= alc282_init
;
6313 spec
->codec_variant
= ALC269_TYPE_ALC283
;
6314 spec
->shutup
= alc283_shutup
;
6315 spec
->init_hook
= alc283_init
;
6319 spec
->codec_variant
= ALC269_TYPE_ALC284
;
6323 spec
->codec_variant
= ALC269_TYPE_ALC285
;
6327 spec
->codec_variant
= ALC269_TYPE_ALC286
;
6328 spec
->shutup
= alc286_shutup
;
6331 spec
->codec_variant
= ALC269_TYPE_ALC298
;
6335 spec
->codec_variant
= ALC269_TYPE_ALC255
;
6339 spec
->codec_variant
= ALC269_TYPE_ALC256
;
6340 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
6341 alc_update_coef_idx(codec
, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
6345 spec
->codec_variant
= ALC269_TYPE_ALC225
;
6348 spec
->codec_variant
= ALC269_TYPE_ALC225
;
6349 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC299 */
6354 spec
->codec_variant
= ALC269_TYPE_ALC294
;
6359 spec
->codec_variant
= ALC269_TYPE_ALC700
;
6360 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
6361 alc_update_coef_idx(codec
, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
6366 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
6367 spec
->has_alc5505_dsp
= 1;
6368 spec
->init_hook
= alc5505_dsp_init
;
6371 /* automatic parse from the BIOS config */
6372 err
= alc269_parse_auto_config(codec
);
6376 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
)
6377 set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
6379 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
6392 static int alc861_parse_auto_config(struct hda_codec
*codec
)
6394 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
6395 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
6396 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
6399 /* Pin config fixes */
6401 ALC861_FIXUP_FSC_AMILO_PI1505
,
6402 ALC861_FIXUP_AMP_VREF_0F
,
6403 ALC861_FIXUP_NO_JACK_DETECT
,
6404 ALC861_FIXUP_ASUS_A6RP
,
6405 ALC660_FIXUP_ASUS_W7J
,
6408 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
6409 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
6410 const struct hda_fixup
*fix
, int action
)
6412 struct alc_spec
*spec
= codec
->spec
;
6415 if (action
!= HDA_FIXUP_ACT_INIT
)
6417 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
6418 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
6419 val
|= AC_PINCTL_IN_EN
;
6420 val
|= AC_PINCTL_VREF_50
;
6421 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
6422 spec
->gen
.keep_vref_in_automute
= 1;
6425 /* suppress the jack-detection */
6426 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
6427 const struct hda_fixup
*fix
, int action
)
6429 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
6430 codec
->no_jack_detect
= 1;
6433 static const struct hda_fixup alc861_fixups
[] = {
6434 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
6435 .type
= HDA_FIXUP_PINS
,
6436 .v
.pins
= (const struct hda_pintbl
[]) {
6437 { 0x0b, 0x0221101f }, /* HP */
6438 { 0x0f, 0x90170310 }, /* speaker */
6442 [ALC861_FIXUP_AMP_VREF_0F
] = {
6443 .type
= HDA_FIXUP_FUNC
,
6444 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
6446 [ALC861_FIXUP_NO_JACK_DETECT
] = {
6447 .type
= HDA_FIXUP_FUNC
,
6448 .v
.func
= alc_fixup_no_jack_detect
,
6450 [ALC861_FIXUP_ASUS_A6RP
] = {
6451 .type
= HDA_FIXUP_FUNC
,
6452 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
6454 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
6456 [ALC660_FIXUP_ASUS_W7J
] = {
6457 .type
= HDA_FIXUP_VERBS
,
6458 .v
.verbs
= (const struct hda_verb
[]) {
6459 /* ASUS W7J needs a magic pin setup on unused NID 0x10
6460 * for enabling outputs
6462 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
6468 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
6469 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
6470 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
6471 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
6472 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
6473 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
6474 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
6475 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
6476 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
6482 static int patch_alc861(struct hda_codec
*codec
)
6484 struct alc_spec
*spec
;
6487 err
= alc_alloc_spec(codec
, 0x15);
6492 spec
->gen
.beep_nid
= 0x23;
6495 spec
->power_hook
= alc_power_eapd
;
6498 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
6499 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
6501 /* automatic parse from the BIOS config */
6502 err
= alc861_parse_auto_config(codec
);
6506 if (!spec
->gen
.no_analog
)
6507 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
6509 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
6523 * In addition, an independent DAC
6525 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
6527 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
6528 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
6529 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
6533 ALC660VD_FIX_ASUS_GPIO1
,
6534 ALC861VD_FIX_DALLAS
,
6537 /* exclude VREF80 */
6538 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
6539 const struct hda_fixup
*fix
, int action
)
6541 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
6542 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
6543 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
6547 static const struct hda_fixup alc861vd_fixups
[] = {
6548 [ALC660VD_FIX_ASUS_GPIO1
] = {
6549 .type
= HDA_FIXUP_VERBS
,
6550 .v
.verbs
= (const struct hda_verb
[]) {
6552 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
6553 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
6554 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
6558 [ALC861VD_FIX_DALLAS
] = {
6559 .type
= HDA_FIXUP_FUNC
,
6560 .v
.func
= alc861vd_fixup_dallas
,
6564 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
6565 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
6566 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
6567 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
6573 static int patch_alc861vd(struct hda_codec
*codec
)
6575 struct alc_spec
*spec
;
6578 err
= alc_alloc_spec(codec
, 0x0b);
6583 spec
->gen
.beep_nid
= 0x23;
6585 spec
->shutup
= alc_eapd_shutup
;
6587 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
6588 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
6590 /* automatic parse from the BIOS config */
6591 err
= alc861vd_parse_auto_config(codec
);
6595 if (!spec
->gen
.no_analog
)
6596 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
6598 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
6610 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
6611 * configuration. Each pin widget can choose any input DACs and a mixer.
6612 * Each ADC is connected from a mixer of all inputs. This makes possible
6613 * 6-channel independent captures.
6615 * In addition, an independent DAC for the multi-playback (not used in this
6620 * BIOS auto configuration
6623 static int alc662_parse_auto_config(struct hda_codec
*codec
)
6625 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
6626 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
6627 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
6628 const hda_nid_t
*ssids
;
6630 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
6631 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
6632 codec
->core
.vendor_id
== 0x10ec0671)
6633 ssids
= alc663_ssids
;
6635 ssids
= alc662_ssids
;
6636 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
6639 static void alc272_fixup_mario(struct hda_codec
*codec
,
6640 const struct hda_fixup
*fix
, int action
)
6642 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
6644 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
6645 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
6646 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
6647 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
6648 (0 << AC_AMPCAP_MUTE_SHIFT
)))
6649 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
6652 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
6654 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
6656 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
6657 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
6661 /* override the 2.1 chmap */
6662 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
6663 const struct hda_fixup
*fix
, int action
)
6665 if (action
== HDA_FIXUP_ACT_BUILD
) {
6666 struct alc_spec
*spec
= codec
->spec
;
6667 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
6671 /* avoid D3 for keeping GPIO up */
6672 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
6674 unsigned int power_state
)
6676 struct alc_spec
*spec
= codec
->spec
;
6677 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_led
)
6682 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
6683 const struct hda_fixup
*fix
, int action
)
6685 struct alc_spec
*spec
= codec
->spec
;
6686 static const struct hda_verb gpio_init
[] = {
6687 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x01 },
6688 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01 },
6692 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
6693 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
6695 spec
->mute_led_polarity
= 1;
6696 spec
->gpio_mute_led_mask
= 0x01;
6697 snd_hda_add_verbs(codec
, gpio_init
);
6698 codec
->power_filter
= gpio_led_power_filter
;
6702 static struct coef_fw alc668_coefs
[] = {
6703 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
6704 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
6705 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
6706 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
6707 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
6708 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
6709 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
6710 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
6711 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
6712 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
6713 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
6714 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
6715 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
6716 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
6717 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
6718 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
6719 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
6720 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
6721 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
6722 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
6726 static void alc668_restore_default_value(struct hda_codec
*codec
)
6728 alc_process_coef_fw(codec
, alc668_coefs
);
6732 ALC662_FIXUP_ASPIRE
,
6733 ALC662_FIXUP_LED_GPIO1
,
6734 ALC662_FIXUP_IDEAPAD
,
6736 ALC662_FIXUP_CZC_P10T
,
6737 ALC662_FIXUP_SKU_IGNORE
,
6738 ALC662_FIXUP_HP_RP5800
,
6739 ALC662_FIXUP_ASUS_MODE1
,
6740 ALC662_FIXUP_ASUS_MODE2
,
6741 ALC662_FIXUP_ASUS_MODE3
,
6742 ALC662_FIXUP_ASUS_MODE4
,
6743 ALC662_FIXUP_ASUS_MODE5
,
6744 ALC662_FIXUP_ASUS_MODE6
,
6745 ALC662_FIXUP_ASUS_MODE7
,
6746 ALC662_FIXUP_ASUS_MODE8
,
6747 ALC662_FIXUP_NO_JACK_DETECT
,
6748 ALC662_FIXUP_ZOTAC_Z68
,
6749 ALC662_FIXUP_INV_DMIC
,
6750 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
6751 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
6752 ALC662_FIXUP_HEADSET_MODE
,
6753 ALC668_FIXUP_HEADSET_MODE
,
6754 ALC662_FIXUP_BASS_MODE4_CHMAP
,
6755 ALC662_FIXUP_BASS_16
,
6756 ALC662_FIXUP_BASS_1A
,
6757 ALC662_FIXUP_BASS_CHMAP
,
6758 ALC668_FIXUP_AUTO_MUTE
,
6759 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
6760 ALC668_FIXUP_DELL_XPS13
,
6761 ALC662_FIXUP_ASUS_Nx50
,
6762 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
6763 ALC668_FIXUP_ASUS_Nx51
,
6766 static const struct hda_fixup alc662_fixups
[] = {
6767 [ALC662_FIXUP_ASPIRE
] = {
6768 .type
= HDA_FIXUP_PINS
,
6769 .v
.pins
= (const struct hda_pintbl
[]) {
6770 { 0x15, 0x99130112 }, /* subwoofer */
6774 [ALC662_FIXUP_LED_GPIO1
] = {
6775 .type
= HDA_FIXUP_FUNC
,
6776 .v
.func
= alc662_fixup_led_gpio1
,
6778 [ALC662_FIXUP_IDEAPAD
] = {
6779 .type
= HDA_FIXUP_PINS
,
6780 .v
.pins
= (const struct hda_pintbl
[]) {
6781 { 0x17, 0x99130112 }, /* subwoofer */
6785 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
6787 [ALC272_FIXUP_MARIO
] = {
6788 .type
= HDA_FIXUP_FUNC
,
6789 .v
.func
= alc272_fixup_mario
,
6791 [ALC662_FIXUP_CZC_P10T
] = {
6792 .type
= HDA_FIXUP_VERBS
,
6793 .v
.verbs
= (const struct hda_verb
[]) {
6794 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
6798 [ALC662_FIXUP_SKU_IGNORE
] = {
6799 .type
= HDA_FIXUP_FUNC
,
6800 .v
.func
= alc_fixup_sku_ignore
,
6802 [ALC662_FIXUP_HP_RP5800
] = {
6803 .type
= HDA_FIXUP_PINS
,
6804 .v
.pins
= (const struct hda_pintbl
[]) {
6805 { 0x14, 0x0221201f }, /* HP out */
6809 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6811 [ALC662_FIXUP_ASUS_MODE1
] = {
6812 .type
= HDA_FIXUP_PINS
,
6813 .v
.pins
= (const struct hda_pintbl
[]) {
6814 { 0x14, 0x99130110 }, /* speaker */
6815 { 0x18, 0x01a19c20 }, /* mic */
6816 { 0x19, 0x99a3092f }, /* int-mic */
6817 { 0x21, 0x0121401f }, /* HP out */
6821 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6823 [ALC662_FIXUP_ASUS_MODE2
] = {
6824 .type
= HDA_FIXUP_PINS
,
6825 .v
.pins
= (const struct hda_pintbl
[]) {
6826 { 0x14, 0x99130110 }, /* speaker */
6827 { 0x18, 0x01a19820 }, /* mic */
6828 { 0x19, 0x99a3092f }, /* int-mic */
6829 { 0x1b, 0x0121401f }, /* HP out */
6833 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6835 [ALC662_FIXUP_ASUS_MODE3
] = {
6836 .type
= HDA_FIXUP_PINS
,
6837 .v
.pins
= (const struct hda_pintbl
[]) {
6838 { 0x14, 0x99130110 }, /* speaker */
6839 { 0x15, 0x0121441f }, /* HP */
6840 { 0x18, 0x01a19840 }, /* mic */
6841 { 0x19, 0x99a3094f }, /* int-mic */
6842 { 0x21, 0x01211420 }, /* HP2 */
6846 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6848 [ALC662_FIXUP_ASUS_MODE4
] = {
6849 .type
= HDA_FIXUP_PINS
,
6850 .v
.pins
= (const struct hda_pintbl
[]) {
6851 { 0x14, 0x99130110 }, /* speaker */
6852 { 0x16, 0x99130111 }, /* speaker */
6853 { 0x18, 0x01a19840 }, /* mic */
6854 { 0x19, 0x99a3094f }, /* int-mic */
6855 { 0x21, 0x0121441f }, /* HP */
6859 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6861 [ALC662_FIXUP_ASUS_MODE5
] = {
6862 .type
= HDA_FIXUP_PINS
,
6863 .v
.pins
= (const struct hda_pintbl
[]) {
6864 { 0x14, 0x99130110 }, /* speaker */
6865 { 0x15, 0x0121441f }, /* HP */
6866 { 0x16, 0x99130111 }, /* speaker */
6867 { 0x18, 0x01a19840 }, /* mic */
6868 { 0x19, 0x99a3094f }, /* int-mic */
6872 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6874 [ALC662_FIXUP_ASUS_MODE6
] = {
6875 .type
= HDA_FIXUP_PINS
,
6876 .v
.pins
= (const struct hda_pintbl
[]) {
6877 { 0x14, 0x99130110 }, /* speaker */
6878 { 0x15, 0x01211420 }, /* HP2 */
6879 { 0x18, 0x01a19840 }, /* mic */
6880 { 0x19, 0x99a3094f }, /* int-mic */
6881 { 0x1b, 0x0121441f }, /* HP */
6885 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6887 [ALC662_FIXUP_ASUS_MODE7
] = {
6888 .type
= HDA_FIXUP_PINS
,
6889 .v
.pins
= (const struct hda_pintbl
[]) {
6890 { 0x14, 0x99130110 }, /* speaker */
6891 { 0x17, 0x99130111 }, /* speaker */
6892 { 0x18, 0x01a19840 }, /* mic */
6893 { 0x19, 0x99a3094f }, /* int-mic */
6894 { 0x1b, 0x01214020 }, /* HP */
6895 { 0x21, 0x0121401f }, /* HP */
6899 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6901 [ALC662_FIXUP_ASUS_MODE8
] = {
6902 .type
= HDA_FIXUP_PINS
,
6903 .v
.pins
= (const struct hda_pintbl
[]) {
6904 { 0x14, 0x99130110 }, /* speaker */
6905 { 0x12, 0x99a30970 }, /* int-mic */
6906 { 0x15, 0x01214020 }, /* HP */
6907 { 0x17, 0x99130111 }, /* speaker */
6908 { 0x18, 0x01a19840 }, /* mic */
6909 { 0x21, 0x0121401f }, /* HP */
6913 .chain_id
= ALC662_FIXUP_SKU_IGNORE
6915 [ALC662_FIXUP_NO_JACK_DETECT
] = {
6916 .type
= HDA_FIXUP_FUNC
,
6917 .v
.func
= alc_fixup_no_jack_detect
,
6919 [ALC662_FIXUP_ZOTAC_Z68
] = {
6920 .type
= HDA_FIXUP_PINS
,
6921 .v
.pins
= (const struct hda_pintbl
[]) {
6922 { 0x1b, 0x02214020 }, /* Front HP */
6926 [ALC662_FIXUP_INV_DMIC
] = {
6927 .type
= HDA_FIXUP_FUNC
,
6928 .v
.func
= alc_fixup_inv_dmic
,
6930 [ALC668_FIXUP_DELL_XPS13
] = {
6931 .type
= HDA_FIXUP_FUNC
,
6932 .v
.func
= alc_fixup_dell_xps13
,
6934 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
6936 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
6937 .type
= HDA_FIXUP_FUNC
,
6938 .v
.func
= alc_fixup_disable_aamix
,
6940 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
6942 [ALC668_FIXUP_AUTO_MUTE
] = {
6943 .type
= HDA_FIXUP_FUNC
,
6944 .v
.func
= alc_fixup_auto_mute_via_amp
,
6946 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
6948 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
6949 .type
= HDA_FIXUP_PINS
,
6950 .v
.pins
= (const struct hda_pintbl
[]) {
6951 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
6952 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
6956 .chain_id
= ALC662_FIXUP_HEADSET_MODE
6958 [ALC662_FIXUP_HEADSET_MODE
] = {
6959 .type
= HDA_FIXUP_FUNC
,
6960 .v
.func
= alc_fixup_headset_mode_alc662
,
6962 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
6963 .type
= HDA_FIXUP_PINS
,
6964 .v
.pins
= (const struct hda_pintbl
[]) {
6965 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
6966 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
6970 .chain_id
= ALC668_FIXUP_HEADSET_MODE
6972 [ALC668_FIXUP_HEADSET_MODE
] = {
6973 .type
= HDA_FIXUP_FUNC
,
6974 .v
.func
= alc_fixup_headset_mode_alc668
,
6976 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
6977 .type
= HDA_FIXUP_FUNC
,
6978 .v
.func
= alc_fixup_bass_chmap
,
6980 .chain_id
= ALC662_FIXUP_ASUS_MODE4
6982 [ALC662_FIXUP_BASS_16
] = {
6983 .type
= HDA_FIXUP_PINS
,
6984 .v
.pins
= (const struct hda_pintbl
[]) {
6985 {0x16, 0x80106111}, /* bass speaker */
6989 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
6991 [ALC662_FIXUP_BASS_1A
] = {
6992 .type
= HDA_FIXUP_PINS
,
6993 .v
.pins
= (const struct hda_pintbl
[]) {
6994 {0x1a, 0x80106111}, /* bass speaker */
6998 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
7000 [ALC662_FIXUP_BASS_CHMAP
] = {
7001 .type
= HDA_FIXUP_FUNC
,
7002 .v
.func
= alc_fixup_bass_chmap
,
7004 [ALC662_FIXUP_ASUS_Nx50
] = {
7005 .type
= HDA_FIXUP_FUNC
,
7006 .v
.func
= alc_fixup_auto_mute_via_amp
,
7008 .chain_id
= ALC662_FIXUP_BASS_1A
7010 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
7011 .type
= HDA_FIXUP_FUNC
,
7012 .v
.func
= alc_fixup_headset_mode_alc668
,
7013 .chain_id
= ALC662_FIXUP_BASS_CHMAP
7015 [ALC668_FIXUP_ASUS_Nx51
] = {
7016 .type
= HDA_FIXUP_PINS
,
7017 .v
.pins
= (const struct hda_pintbl
[]) {
7018 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
7019 { 0x1a, 0x90170151 }, /* bass speaker */
7020 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
7024 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
7028 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
7029 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
7030 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
7031 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
7032 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
7033 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
7034 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
7035 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
7036 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
7037 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7038 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7039 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
7040 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
7041 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
7042 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7043 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7044 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7045 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7046 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7047 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
7048 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
7049 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
7050 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
7051 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
7052 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
7053 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
7054 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
7055 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
7056 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
7057 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
7058 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
7059 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
7060 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
7061 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
7062 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
7063 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
7064 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
7065 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
7068 /* Below is a quirk table taken from the old code.
7069 * Basically the device should work as is without the fixup table.
7070 * If BIOS doesn't give a proper info, enable the corresponding
7073 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
7074 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
7075 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
7076 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
7077 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7078 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7079 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7080 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
7081 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
7082 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7083 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
7084 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
7085 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
7086 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
7087 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
7088 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7089 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
7090 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
7091 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7092 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
7093 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
7094 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7095 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
7096 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
7097 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
7098 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7099 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
7100 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
7101 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7102 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
7103 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7104 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7105 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
7106 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
7107 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
7108 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
7109 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
7110 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
7111 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
7112 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7113 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
7114 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
7115 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7116 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
7117 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
7118 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
7119 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
7120 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
7121 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7122 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
7127 static const struct hda_model_fixup alc662_fixup_models
[] = {
7128 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
7129 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
7130 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
7131 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
7132 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
7133 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
7134 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
7135 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
7136 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
7137 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
7138 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
7142 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
7143 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
7147 {0x1b, 0x0221401f}),
7148 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7152 {0x16, 0x03011020}),
7153 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7157 {0x16, 0x03011020}),
7158 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7162 {0x16, 0x03011020}),
7163 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7166 {0x16, 0x03011020}),
7167 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
7170 {0x15, 0x0321101f}),
7176 static int patch_alc662(struct hda_codec
*codec
)
7178 struct alc_spec
*spec
;
7181 err
= alc_alloc_spec(codec
, 0x0b);
7187 spec
->shutup
= alc_eapd_shutup
;
7189 /* handle multiple HPs as is */
7190 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
7192 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
7194 switch (codec
->core
.vendor_id
) {
7196 spec
->init_hook
= alc668_restore_default_value
;
7200 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
7201 alc662_fixup_tbl
, alc662_fixups
);
7202 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
);
7203 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7205 alc_auto_parse_customize_define(codec
);
7207 if (has_cdefine_beep(codec
))
7208 spec
->gen
.beep_nid
= 0x01;
7210 if ((alc_get_coef0(codec
) & (1 << 14)) &&
7211 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
7212 spec
->cdefine
.platform_type
== 1) {
7213 err
= alc_codec_rename(codec
, "ALC272X");
7218 /* automatic parse from the BIOS config */
7219 err
= alc662_parse_auto_config(codec
);
7223 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
7224 switch (codec
->core
.vendor_id
) {
7226 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
7232 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
7235 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
7240 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7253 static int alc680_parse_auto_config(struct hda_codec
*codec
)
7255 return alc_parse_auto_config(codec
, NULL
, NULL
);
7260 static int patch_alc680(struct hda_codec
*codec
)
7264 /* ALC680 has no aa-loopback mixer */
7265 err
= alc_alloc_spec(codec
, 0);
7269 /* automatic parse from the BIOS config */
7270 err
= alc680_parse_auto_config(codec
);
7282 static const struct hda_device_id snd_hda_id_realtek
[] = {
7283 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
7284 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
7285 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
7286 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
7287 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
7288 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
7289 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269
),
7290 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
7291 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
7292 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
7293 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
7294 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
7295 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
7296 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
7297 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
7298 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
7299 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
7300 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
7301 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
7302 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
7303 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
7304 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
7305 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
7306 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
7307 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
7308 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
7309 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
7310 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
7311 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
7312 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
7313 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
7314 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
7315 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
7316 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
7317 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
7318 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
7319 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
7320 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
7321 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
7322 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
7323 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
7324 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
7325 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
7326 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
7327 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
7328 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
7329 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
7330 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
7331 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
7332 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
7333 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc882
),
7334 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
7335 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
7336 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
7337 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
7338 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
7339 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
7340 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
7341 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
7342 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
7343 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
7344 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
7345 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
7346 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
7349 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
7351 MODULE_LICENSE("GPL");
7352 MODULE_DESCRIPTION("Realtek HD-audio codec");
7354 static struct hda_codec_driver realtek_driver
= {
7355 .id
= snd_hda_id_realtek
,
7358 module_hda_codec_driver(realtek_driver
);