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 <sound/core.h>
33 #include <sound/jack.h>
34 #include "hda_codec.h"
35 #include "hda_local.h"
36 #include "hda_auto_parser.h"
38 #include "hda_generic.h"
40 /* keep halting ALC5505 DSP, for power saving */
41 #define HALT_REALTEK_ALC5505
43 /* unsol event tags */
44 #define ALC_DCVOL_EVENT 0x08
47 #define GPIO_MASK 0x03
49 /* extra amp-initialization sequence types */
59 ALC_HEADSET_MODE_UNKNOWN
,
60 ALC_HEADSET_MODE_UNPLUGGED
,
61 ALC_HEADSET_MODE_HEADSET
,
63 ALC_HEADSET_MODE_HEADPHONE
,
67 ALC_HEADSET_TYPE_UNKNOWN
,
68 ALC_HEADSET_TYPE_CTIA
,
69 ALC_HEADSET_TYPE_OMTP
,
72 struct alc_customize_define
{
74 unsigned char port_connectivity
;
75 unsigned char check_sum
;
76 unsigned char customization
;
77 unsigned char external_amp
;
78 unsigned int enable_pcbeep
:1;
79 unsigned int platform_type
:1;
81 unsigned int override
:1;
82 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
86 struct hda_gen_spec gen
; /* must be at head */
88 /* codec parameterization */
89 const struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
90 unsigned int num_mixers
;
91 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
93 struct alc_customize_define cdefine
;
94 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
96 /* inverted dmic fix */
97 unsigned int inv_dmic_fixup
:1; /* has inverted digital-mic workaround */
98 unsigned int inv_dmic_muted
:1; /* R-ch of inv d-mic is muted? */
99 hda_nid_t inv_dmic_pin
;
101 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
102 int mute_led_polarity
;
103 hda_nid_t mute_led_nid
;
104 hda_nid_t cap_mute_led_nid
;
106 unsigned int gpio_led
; /* used for alc269_fixup_hp_gpio_led() */
108 hda_nid_t headset_mic_pin
;
109 hda_nid_t headphone_mic_pin
;
110 int current_headset_mode
;
111 int current_headset_type
;
114 void (*init_hook
)(struct hda_codec
*codec
);
116 void (*power_hook
)(struct hda_codec
*codec
);
118 void (*shutup
)(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
;
132 * Append the given mixer and verb elements for the later use
133 * The mixer array is referred in build_controls(), and init_verbs are
136 static void add_mixer(struct alc_spec
*spec
, const struct snd_kcontrol_new
*mix
)
138 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
140 spec
->mixers
[spec
->num_mixers
++] = mix
;
144 * GPIO setup tables, used in initialization
146 /* Enable GPIO mask and set output */
147 static const struct hda_verb alc_gpio1_init_verbs
[] = {
148 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
149 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
150 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
154 static const struct hda_verb alc_gpio2_init_verbs
[] = {
155 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
156 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
157 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
161 static const struct hda_verb alc_gpio3_init_verbs
[] = {
162 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
163 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
164 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
169 * Fix hardware PLL issue
170 * On some codecs, the analog PLL gating control must be off while
171 * the default value is 1.
173 static void alc_fix_pll(struct hda_codec
*codec
)
175 struct alc_spec
*spec
= codec
->spec
;
180 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
182 val
= snd_hda_codec_read(codec
, spec
->pll_nid
, 0,
183 AC_VERB_GET_PROC_COEF
, 0);
184 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_COEF_INDEX
,
186 snd_hda_codec_write(codec
, spec
->pll_nid
, 0, AC_VERB_SET_PROC_COEF
,
187 val
& ~(1 << spec
->pll_coef_bit
));
190 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
191 unsigned int coef_idx
, unsigned int coef_bit
)
193 struct alc_spec
*spec
= codec
->spec
;
195 spec
->pll_coef_idx
= coef_idx
;
196 spec
->pll_coef_bit
= coef_bit
;
200 /* update the master volume per volume-knob's unsol event */
201 static void alc_update_knob_master(struct hda_codec
*codec
, struct hda_jack_tbl
*jack
)
204 struct snd_kcontrol
*kctl
;
205 struct snd_ctl_elem_value
*uctl
;
207 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
210 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
213 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
214 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
215 val
&= HDA_AMP_VOLMASK
;
216 uctl
->value
.integer
.value
[0] = val
;
217 uctl
->value
.integer
.value
[1] = val
;
218 kctl
->put(kctl
, uctl
);
222 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
224 /* For some reason, the res given from ALC880 is broken.
225 Here we adjust it properly. */
226 snd_hda_jack_unsol_event(codec
, res
>> 2);
229 /* additional initialization for ALC888 variants */
230 static void alc888_coef_init(struct hda_codec
*codec
)
234 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 0);
235 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
236 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
237 if ((tmp
& 0xf0) == 0x20)
239 snd_hda_codec_read(codec
, 0x20, 0,
240 AC_VERB_SET_PROC_COEF
, 0x830);
243 snd_hda_codec_read(codec
, 0x20, 0,
244 AC_VERB_SET_PROC_COEF
, 0x3030);
247 /* additional initialization for ALC889 variants */
248 static void alc889_coef_init(struct hda_codec
*codec
)
252 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
253 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
254 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 7);
255 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_PROC_COEF
, tmp
|0x2010);
258 /* turn on/off EAPD control (only if available) */
259 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
261 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
263 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
264 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
268 /* turn on/off EAPD controls of the codec */
269 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
271 /* We currently only handle front, HP */
272 static hda_nid_t pins
[] = {
273 0x0f, 0x10, 0x14, 0x15, 0
276 for (p
= pins
; *p
; p
++)
277 set_eapd(codec
, *p
, on
);
280 /* generic shutup callback;
281 * just turning off EPAD and a little pause for avoiding pop-noise
283 static void alc_eapd_shutup(struct hda_codec
*codec
)
285 struct alc_spec
*spec
= codec
->spec
;
287 alc_auto_setup_eapd(codec
, false);
288 if (!spec
->no_depop_delay
)
290 snd_hda_shutup_pins(codec
);
293 /* generic EAPD initialization */
294 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
298 alc_auto_setup_eapd(codec
, true);
301 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
304 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
307 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
309 case ALC_INIT_DEFAULT
:
310 switch (codec
->vendor_id
) {
312 snd_hda_codec_write(codec
, 0x1a, 0,
313 AC_VERB_SET_COEF_INDEX
, 7);
314 tmp
= snd_hda_codec_read(codec
, 0x1a, 0,
315 AC_VERB_GET_PROC_COEF
, 0);
316 snd_hda_codec_write(codec
, 0x1a, 0,
317 AC_VERB_SET_COEF_INDEX
, 7);
318 snd_hda_codec_write(codec
, 0x1a, 0,
319 AC_VERB_SET_PROC_COEF
,
328 /*case 0x10ec0889:*/ /* this causes an SPDIF problem */
329 alc889_coef_init(codec
);
332 alc888_coef_init(codec
);
334 #if 0 /* XXX: This may cause the silent output on speaker on some machines */
337 snd_hda_codec_write(codec
, 0x20, 0,
338 AC_VERB_SET_COEF_INDEX
, 7);
339 tmp
= snd_hda_codec_read(codec
, 0x20, 0,
340 AC_VERB_GET_PROC_COEF
, 0);
341 snd_hda_codec_write(codec
, 0x20, 0,
342 AC_VERB_SET_COEF_INDEX
, 7);
343 snd_hda_codec_write(codec
, 0x20, 0,
344 AC_VERB_SET_PROC_COEF
,
355 * Realtek SSID verification
358 /* Could be any non-zero and even value. When used as fixup, tells
359 * the driver to ignore any present sku defines.
361 #define ALC_FIXUP_SKU_IGNORE (2)
363 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
364 const struct hda_fixup
*fix
, int action
)
366 struct alc_spec
*spec
= codec
->spec
;
367 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
368 spec
->cdefine
.fixup
= 1;
369 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
373 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
374 const struct hda_fixup
*fix
, int action
)
376 struct alc_spec
*spec
= codec
->spec
;
378 if (action
== HDA_FIXUP_ACT_PROBE
) {
379 spec
->no_depop_delay
= 1;
380 codec
->depop_delay
= 0;
384 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
386 unsigned int ass
, tmp
, i
;
388 struct alc_spec
*spec
= codec
->spec
;
390 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
392 if (spec
->cdefine
.fixup
) {
393 ass
= spec
->cdefine
.sku_cfg
;
394 if (ass
== ALC_FIXUP_SKU_IGNORE
)
399 if (!codec
->bus
->pci
)
401 ass
= codec
->subsystem_id
& 0xffff;
402 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
406 if (codec
->vendor_id
== 0x10ec0260)
408 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
411 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
412 codec
->chip_name
, ass
);
418 for (i
= 1; i
< 16; i
++) {
422 if (((ass
>> 16) & 0xf) != tmp
)
425 spec
->cdefine
.port_connectivity
= ass
>> 30;
426 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
427 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
428 spec
->cdefine
.customization
= ass
>> 8;
430 spec
->cdefine
.sku_cfg
= ass
;
431 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
432 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
433 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
434 spec
->cdefine
.override
= ass
& 0x1;
436 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
437 nid
, spec
->cdefine
.sku_cfg
);
438 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
439 spec
->cdefine
.port_connectivity
);
440 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
441 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
442 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
443 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
444 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
445 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
446 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
451 /* return the position of NID in the list, or -1 if not found */
452 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
455 for (i
= 0; i
< nums
; i
++)
460 /* return true if the given NID is found in the list */
461 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
463 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
466 /* check subsystem ID and set up device-specific initialization;
467 * return 1 if initialized, 0 if invalid SSID
469 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
470 * 31 ~ 16 : Manufacture ID
472 * 7 ~ 0 : Assembly ID
473 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
475 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
477 unsigned int ass
, tmp
, i
;
479 struct alc_spec
*spec
= codec
->spec
;
481 if (spec
->cdefine
.fixup
) {
482 ass
= spec
->cdefine
.sku_cfg
;
483 if (ass
== ALC_FIXUP_SKU_IGNORE
)
488 ass
= codec
->subsystem_id
& 0xffff;
489 if (codec
->bus
->pci
&&
490 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
493 /* invalid SSID, check the special NID pin defcfg instead */
495 * 31~30 : port connectivity
498 * 19~16 : Check sum (15:1)
503 if (codec
->vendor_id
== 0x10ec0260)
505 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
507 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
511 if ((ass
>> 30) != 1) /* no physical connection */
516 for (i
= 1; i
< 16; i
++) {
520 if (((ass
>> 16) & 0xf) != tmp
)
523 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
524 ass
& 0xffff, codec
->vendor_id
);
528 * 2 : 0 --> Desktop, 1 --> Laptop
529 * 3~5 : External Amplifier control
532 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
535 spec
->init_amp
= ALC_INIT_GPIO1
;
538 spec
->init_amp
= ALC_INIT_GPIO2
;
541 spec
->init_amp
= ALC_INIT_GPIO3
;
545 spec
->init_amp
= ALC_INIT_DEFAULT
;
549 /* is laptop or Desktop and enable the function "Mute internal speaker
550 * when the external headphone out jack is plugged"
555 * 10~8 : Jack location
556 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
558 * 15 : 1 --> enable the function "Mute internal speaker
559 * when the external headphone out jack is plugged"
561 if (!spec
->gen
.autocfg
.hp_pins
[0] &&
562 !(spec
->gen
.autocfg
.line_out_pins
[0] &&
563 spec
->gen
.autocfg
.line_out_type
== AUTO_PIN_HP_OUT
)) {
565 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
567 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
568 spec
->gen
.autocfg
.line_outs
))
570 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
575 /* Check the validity of ALC subsystem-id
576 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
577 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
579 if (!alc_subsystem_id(codec
, ports
)) {
580 struct alc_spec
*spec
= codec
->spec
;
582 "realtek: Enable default setup for auto mode as fallback\n");
583 spec
->init_amp
= ALC_INIT_DEFAULT
;
588 * COEF access helper functions
591 static int alc_read_coefex_idx(struct hda_codec
*codec
,
593 unsigned int coef_idx
)
596 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
,
598 val
= snd_hda_codec_read(codec
, nid
, 0,
599 AC_VERB_GET_PROC_COEF
, 0);
603 #define alc_read_coef_idx(codec, coef_idx) \
604 alc_read_coefex_idx(codec, 0x20, coef_idx)
606 static void alc_write_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
607 unsigned int coef_idx
,
608 unsigned int coef_val
)
610 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
,
612 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PROC_COEF
,
616 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
617 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
619 /* a special bypass for COEF 0; read the cached value at the second time */
620 static unsigned int alc_get_coef0(struct hda_codec
*codec
)
622 struct alc_spec
*spec
= codec
->spec
;
624 spec
->coef0
= alc_read_coef_idx(codec
, 0);
631 static hda_nid_t
get_adc_nid(struct hda_codec
*codec
, int adc_idx
, int imux_idx
)
633 struct hda_gen_spec
*spec
= codec
->spec
;
634 if (spec
->dyn_adc_switch
)
635 adc_idx
= spec
->dyn_adc_idx
[imux_idx
];
636 return spec
->adc_nids
[adc_idx
];
639 static void alc_inv_dmic_sync_adc(struct hda_codec
*codec
, int adc_idx
)
641 struct alc_spec
*spec
= codec
->spec
;
642 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
643 struct nid_path
*path
;
648 for (i
= 0; i
< imux
->num_items
; i
++) {
649 if (spec
->gen
.imux_pins
[i
] == spec
->inv_dmic_pin
)
652 if (i
>= imux
->num_items
)
655 path
= snd_hda_get_nid_path(codec
, spec
->inv_dmic_pin
,
656 get_adc_nid(codec
, adc_idx
, i
));
657 val
= path
->ctls
[NID_PATH_MUTE_CTL
];
660 nid
= get_amp_nid_(val
);
661 dir
= get_amp_direction_(val
);
662 parm
= AC_AMP_SET_RIGHT
|
663 (dir
== HDA_OUTPUT
? AC_AMP_SET_OUTPUT
: AC_AMP_SET_INPUT
);
665 /* flush all cached amps at first */
666 snd_hda_codec_flush_cache(codec
);
668 /* we care only right channel */
669 val
= snd_hda_codec_amp_read(codec
, nid
, 1, dir
, 0);
670 if (val
& 0x80) /* if already muted, we don't need to touch */
673 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_AMP_GAIN_MUTE
,
678 * Inverted digital-mic handling
680 * First off, it's a bit tricky. The "Inverted Internal Mic Capture Switch"
681 * gives the additional mute only to the right channel of the digital mic
682 * capture stream. This is a workaround for avoiding the almost silence
683 * by summing the stereo stream from some (known to be ForteMedia)
686 * The logic is to call alc_inv_dmic_sync() after each action (possibly)
687 * modifying ADC amp. When the mute flag is set, it mutes the R-channel
688 * without caching so that the cache can still keep the original value.
689 * The cached value is then restored when the flag is set off or any other
690 * than d-mic is used as the current input source.
692 static void alc_inv_dmic_sync(struct hda_codec
*codec
, bool force
)
694 struct alc_spec
*spec
= codec
->spec
;
697 if (!spec
->inv_dmic_fixup
)
699 if (!spec
->inv_dmic_muted
&& !force
)
701 nums
= spec
->gen
.dyn_adc_switch
? 1 : spec
->gen
.num_adc_nids
;
702 for (src
= 0; src
< nums
; src
++) {
703 bool dmic_fixup
= false;
705 if (spec
->inv_dmic_muted
&&
706 spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[src
]] == spec
->inv_dmic_pin
)
708 if (!dmic_fixup
&& !force
)
710 alc_inv_dmic_sync_adc(codec
, src
);
714 static void alc_inv_dmic_hook(struct hda_codec
*codec
,
715 struct snd_kcontrol
*kcontrol
,
716 struct snd_ctl_elem_value
*ucontrol
)
718 alc_inv_dmic_sync(codec
, false);
721 static int alc_inv_dmic_sw_get(struct snd_kcontrol
*kcontrol
,
722 struct snd_ctl_elem_value
*ucontrol
)
724 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
725 struct alc_spec
*spec
= codec
->spec
;
727 ucontrol
->value
.integer
.value
[0] = !spec
->inv_dmic_muted
;
731 static int alc_inv_dmic_sw_put(struct snd_kcontrol
*kcontrol
,
732 struct snd_ctl_elem_value
*ucontrol
)
734 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
735 struct alc_spec
*spec
= codec
->spec
;
736 unsigned int val
= !ucontrol
->value
.integer
.value
[0];
738 if (val
== spec
->inv_dmic_muted
)
740 spec
->inv_dmic_muted
= val
;
741 alc_inv_dmic_sync(codec
, true);
745 static const struct snd_kcontrol_new alc_inv_dmic_sw
= {
746 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
747 .name
= "Inverted Internal Mic Capture Switch",
748 .info
= snd_ctl_boolean_mono_info
,
749 .get
= alc_inv_dmic_sw_get
,
750 .put
= alc_inv_dmic_sw_put
,
753 static int alc_add_inv_dmic_mixer(struct hda_codec
*codec
, hda_nid_t nid
)
755 struct alc_spec
*spec
= codec
->spec
;
757 if (!snd_hda_gen_add_kctl(&spec
->gen
, NULL
, &alc_inv_dmic_sw
))
759 spec
->inv_dmic_fixup
= 1;
760 spec
->inv_dmic_muted
= 0;
761 spec
->inv_dmic_pin
= nid
;
762 spec
->gen
.cap_sync_hook
= alc_inv_dmic_hook
;
766 /* typically the digital mic is put at node 0x12 */
767 static void alc_fixup_inv_dmic_0x12(struct hda_codec
*codec
,
768 const struct hda_fixup
*fix
, int action
)
770 if (action
== HDA_FIXUP_ACT_PROBE
)
771 alc_add_inv_dmic_mixer(codec
, 0x12);
775 #ifdef CONFIG_SND_HDA_INPUT_BEEP
776 /* additional beep mixers; the actual parameters are overwritten at build */
777 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
778 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
779 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
784 static int alc_build_controls(struct hda_codec
*codec
)
786 struct alc_spec
*spec
= codec
->spec
;
789 err
= snd_hda_gen_build_controls(codec
);
793 for (i
= 0; i
< spec
->num_mixers
; i
++) {
794 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
799 #ifdef CONFIG_SND_HDA_INPUT_BEEP
800 /* create beep controls if needed */
801 if (spec
->beep_amp
) {
802 const struct snd_kcontrol_new
*knew
;
803 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
804 struct snd_kcontrol
*kctl
;
805 kctl
= snd_ctl_new1(knew
, codec
);
808 kctl
->private_value
= spec
->beep_amp
;
809 err
= snd_hda_ctl_add(codec
, 0, kctl
);
816 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
825 static int alc_init(struct hda_codec
*codec
)
827 struct alc_spec
*spec
= codec
->spec
;
830 spec
->init_hook(codec
);
833 alc_auto_init_amp(codec
, spec
->init_amp
);
835 snd_hda_gen_init(codec
);
837 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
842 static inline void alc_shutup(struct hda_codec
*codec
)
844 struct alc_spec
*spec
= codec
->spec
;
846 if (spec
&& spec
->shutup
)
849 snd_hda_shutup_pins(codec
);
852 #define alc_free snd_hda_gen_free
855 static void alc_power_eapd(struct hda_codec
*codec
)
857 alc_auto_setup_eapd(codec
, false);
860 static int alc_suspend(struct hda_codec
*codec
)
862 struct alc_spec
*spec
= codec
->spec
;
864 if (spec
&& spec
->power_hook
)
865 spec
->power_hook(codec
);
871 static int alc_resume(struct hda_codec
*codec
)
873 struct alc_spec
*spec
= codec
->spec
;
875 if (!spec
->no_depop_delay
)
876 msleep(150); /* to avoid pop noise */
877 codec
->patch_ops
.init(codec
);
878 snd_hda_codec_resume_amp(codec
);
879 snd_hda_codec_resume_cache(codec
);
880 alc_inv_dmic_sync(codec
, true);
881 hda_call_check_power_status(codec
, 0x01);
888 static const struct hda_codec_ops alc_patch_ops
= {
889 .build_controls
= alc_build_controls
,
890 .build_pcms
= snd_hda_gen_build_pcms
,
893 .unsol_event
= snd_hda_jack_unsol_event
,
895 .resume
= alc_resume
,
896 .suspend
= alc_suspend
,
897 .check_power_status
= snd_hda_gen_check_power_status
,
899 .reboot_notify
= alc_shutup
,
903 /* replace the codec chip_name with the given string */
904 static int alc_codec_rename(struct hda_codec
*codec
, const char *name
)
906 kfree(codec
->chip_name
);
907 codec
->chip_name
= kstrdup(name
, GFP_KERNEL
);
908 if (!codec
->chip_name
) {
916 * Rename codecs appropriately from COEF value or subvendor id
918 struct alc_codec_rename_table
{
919 unsigned int vendor_id
;
920 unsigned short coef_mask
;
921 unsigned short coef_bits
;
925 struct alc_codec_rename_pci_table
{
926 unsigned int codec_vendor_id
;
927 unsigned short pci_subvendor
;
928 unsigned short pci_subdevice
;
932 static struct alc_codec_rename_table rename_tbl
[] = {
933 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
934 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
935 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
936 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
937 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
938 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
939 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
940 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
941 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
942 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
943 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
944 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
945 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
946 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
947 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
948 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
949 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
953 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
954 { 0x10ec0280, 0x1028, 0, "ALC3220" },
955 { 0x10ec0282, 0x1028, 0, "ALC3221" },
956 { 0x10ec0283, 0x1028, 0, "ALC3223" },
957 { 0x10ec0288, 0x1028, 0, "ALC3263" },
958 { 0x10ec0292, 0x1028, 0, "ALC3226" },
959 { 0x10ec0293, 0x1028, 0, "ALC3235" },
960 { 0x10ec0255, 0x1028, 0, "ALC3234" },
961 { 0x10ec0668, 0x1028, 0, "ALC3661" },
962 { 0x10ec0275, 0x1028, 0, "ALC3260" },
963 { 0x10ec0899, 0x1028, 0, "ALC3861" },
964 { 0x10ec0670, 0x1025, 0, "ALC669X" },
965 { 0x10ec0676, 0x1025, 0, "ALC679X" },
966 { 0x10ec0282, 0x1043, 0, "ALC3229" },
967 { 0x10ec0233, 0x1043, 0, "ALC3236" },
968 { 0x10ec0280, 0x103c, 0, "ALC3228" },
969 { 0x10ec0282, 0x103c, 0, "ALC3227" },
970 { 0x10ec0286, 0x103c, 0, "ALC3242" },
971 { 0x10ec0290, 0x103c, 0, "ALC3241" },
972 { 0x10ec0668, 0x103c, 0, "ALC3662" },
973 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
974 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
978 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
980 const struct alc_codec_rename_table
*p
;
981 const struct alc_codec_rename_pci_table
*q
;
983 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
984 if (p
->vendor_id
!= codec
->vendor_id
)
986 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
987 return alc_codec_rename(codec
, p
->name
);
990 if (!codec
->bus
->pci
)
992 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
993 if (q
->codec_vendor_id
!= codec
->vendor_id
)
995 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
997 if (!q
->pci_subdevice
||
998 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
999 return alc_codec_rename(codec
, q
->name
);
1007 * Digital-beep handlers
1009 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1010 #define set_beep_amp(spec, nid, idx, dir) \
1011 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
1013 static const struct snd_pci_quirk beep_white_list
[] = {
1014 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1015 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1016 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1017 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1018 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1019 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1020 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1021 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1022 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1026 static inline int has_cdefine_beep(struct hda_codec
*codec
)
1028 struct alc_spec
*spec
= codec
->spec
;
1029 const struct snd_pci_quirk
*q
;
1030 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
1033 return spec
->cdefine
.enable_pcbeep
;
1036 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
1037 #define has_cdefine_beep(codec) 0
1040 /* parse the BIOS configuration and set up the alc_spec */
1041 /* return 1 if successful, 0 if the proper config is not found,
1042 * or a negative error code
1044 static int alc_parse_auto_config(struct hda_codec
*codec
,
1045 const hda_nid_t
*ignore_nids
,
1046 const hda_nid_t
*ssid_nids
)
1048 struct alc_spec
*spec
= codec
->spec
;
1049 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1052 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1058 alc_ssid_check(codec
, ssid_nids
);
1060 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1067 /* common preparation job for alc_spec */
1068 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1070 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1076 snd_hda_gen_spec_init(&spec
->gen
);
1077 spec
->gen
.mixer_nid
= mixer_nid
;
1078 spec
->gen
.own_eapd_ctl
= 1;
1079 codec
->single_adc_amp
= 1;
1080 /* FIXME: do we need this for all Realtek codec models? */
1081 codec
->spdif_status_reset
= 1;
1083 err
= alc_codec_rename_from_preset(codec
);
1091 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1093 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1094 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1095 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1104 ALC880_FIXUP_MEDION_RIM
,
1106 ALC880_FIXUP_LG_LW25
,
1108 ALC880_FIXUP_EAPD_COEF
,
1109 ALC880_FIXUP_TCL_S700
,
1110 ALC880_FIXUP_VOL_KNOB
,
1111 ALC880_FIXUP_FUJITSU
,
1113 ALC880_FIXUP_UNIWILL
,
1114 ALC880_FIXUP_UNIWILL_DIG
,
1116 ALC880_FIXUP_ASUS_W5A
,
1117 ALC880_FIXUP_3ST_BASE
,
1119 ALC880_FIXUP_3ST_DIG
,
1120 ALC880_FIXUP_5ST_BASE
,
1122 ALC880_FIXUP_5ST_DIG
,
1123 ALC880_FIXUP_6ST_BASE
,
1125 ALC880_FIXUP_6ST_DIG
,
1126 ALC880_FIXUP_6ST_AUTOMUTE
,
1129 /* enable the volume-knob widget support on NID 0x21 */
1130 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1131 const struct hda_fixup
*fix
, int action
)
1133 if (action
== HDA_FIXUP_ACT_PROBE
)
1134 snd_hda_jack_detect_enable_callback(codec
, 0x21, ALC_DCVOL_EVENT
, alc_update_knob_master
);
1137 static const struct hda_fixup alc880_fixups
[] = {
1138 [ALC880_FIXUP_GPIO1
] = {
1139 .type
= HDA_FIXUP_VERBS
,
1140 .v
.verbs
= alc_gpio1_init_verbs
,
1142 [ALC880_FIXUP_GPIO2
] = {
1143 .type
= HDA_FIXUP_VERBS
,
1144 .v
.verbs
= alc_gpio2_init_verbs
,
1146 [ALC880_FIXUP_MEDION_RIM
] = {
1147 .type
= HDA_FIXUP_VERBS
,
1148 .v
.verbs
= (const struct hda_verb
[]) {
1149 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1150 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1154 .chain_id
= ALC880_FIXUP_GPIO2
,
1156 [ALC880_FIXUP_LG
] = {
1157 .type
= HDA_FIXUP_PINS
,
1158 .v
.pins
= (const struct hda_pintbl
[]) {
1159 /* disable bogus unused pins */
1160 { 0x16, 0x411111f0 },
1161 { 0x18, 0x411111f0 },
1162 { 0x1a, 0x411111f0 },
1166 [ALC880_FIXUP_LG_LW25
] = {
1167 .type
= HDA_FIXUP_PINS
,
1168 .v
.pins
= (const struct hda_pintbl
[]) {
1169 { 0x1a, 0x0181344f }, /* line-in */
1170 { 0x1b, 0x0321403f }, /* headphone */
1174 [ALC880_FIXUP_W810
] = {
1175 .type
= HDA_FIXUP_PINS
,
1176 .v
.pins
= (const struct hda_pintbl
[]) {
1177 /* disable bogus unused pins */
1178 { 0x17, 0x411111f0 },
1182 .chain_id
= ALC880_FIXUP_GPIO2
,
1184 [ALC880_FIXUP_EAPD_COEF
] = {
1185 .type
= HDA_FIXUP_VERBS
,
1186 .v
.verbs
= (const struct hda_verb
[]) {
1187 /* change to EAPD mode */
1188 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1189 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1193 [ALC880_FIXUP_TCL_S700
] = {
1194 .type
= HDA_FIXUP_VERBS
,
1195 .v
.verbs
= (const struct hda_verb
[]) {
1196 /* change to EAPD mode */
1197 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1198 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1202 .chain_id
= ALC880_FIXUP_GPIO2
,
1204 [ALC880_FIXUP_VOL_KNOB
] = {
1205 .type
= HDA_FIXUP_FUNC
,
1206 .v
.func
= alc880_fixup_vol_knob
,
1208 [ALC880_FIXUP_FUJITSU
] = {
1209 /* override all pins as BIOS on old Amilo is broken */
1210 .type
= HDA_FIXUP_PINS
,
1211 .v
.pins
= (const struct hda_pintbl
[]) {
1212 { 0x14, 0x0121411f }, /* HP */
1213 { 0x15, 0x99030120 }, /* speaker */
1214 { 0x16, 0x99030130 }, /* bass speaker */
1215 { 0x17, 0x411111f0 }, /* N/A */
1216 { 0x18, 0x411111f0 }, /* N/A */
1217 { 0x19, 0x01a19950 }, /* mic-in */
1218 { 0x1a, 0x411111f0 }, /* N/A */
1219 { 0x1b, 0x411111f0 }, /* N/A */
1220 { 0x1c, 0x411111f0 }, /* N/A */
1221 { 0x1d, 0x411111f0 }, /* N/A */
1222 { 0x1e, 0x01454140 }, /* SPDIF out */
1226 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1228 [ALC880_FIXUP_F1734
] = {
1229 /* almost compatible with FUJITSU, but no bass and SPDIF */
1230 .type
= HDA_FIXUP_PINS
,
1231 .v
.pins
= (const struct hda_pintbl
[]) {
1232 { 0x14, 0x0121411f }, /* HP */
1233 { 0x15, 0x99030120 }, /* speaker */
1234 { 0x16, 0x411111f0 }, /* N/A */
1235 { 0x17, 0x411111f0 }, /* N/A */
1236 { 0x18, 0x411111f0 }, /* N/A */
1237 { 0x19, 0x01a19950 }, /* mic-in */
1238 { 0x1a, 0x411111f0 }, /* N/A */
1239 { 0x1b, 0x411111f0 }, /* N/A */
1240 { 0x1c, 0x411111f0 }, /* N/A */
1241 { 0x1d, 0x411111f0 }, /* N/A */
1242 { 0x1e, 0x411111f0 }, /* N/A */
1246 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1248 [ALC880_FIXUP_UNIWILL
] = {
1249 /* need to fix HP and speaker pins to be parsed correctly */
1250 .type
= HDA_FIXUP_PINS
,
1251 .v
.pins
= (const struct hda_pintbl
[]) {
1252 { 0x14, 0x0121411f }, /* HP */
1253 { 0x15, 0x99030120 }, /* speaker */
1254 { 0x16, 0x99030130 }, /* bass speaker */
1258 [ALC880_FIXUP_UNIWILL_DIG
] = {
1259 .type
= HDA_FIXUP_PINS
,
1260 .v
.pins
= (const struct hda_pintbl
[]) {
1261 /* disable bogus unused pins */
1262 { 0x17, 0x411111f0 },
1263 { 0x19, 0x411111f0 },
1264 { 0x1b, 0x411111f0 },
1265 { 0x1f, 0x411111f0 },
1269 [ALC880_FIXUP_Z71V
] = {
1270 .type
= HDA_FIXUP_PINS
,
1271 .v
.pins
= (const struct hda_pintbl
[]) {
1272 /* set up the whole pins as BIOS is utterly broken */
1273 { 0x14, 0x99030120 }, /* speaker */
1274 { 0x15, 0x0121411f }, /* HP */
1275 { 0x16, 0x411111f0 }, /* N/A */
1276 { 0x17, 0x411111f0 }, /* N/A */
1277 { 0x18, 0x01a19950 }, /* mic-in */
1278 { 0x19, 0x411111f0 }, /* N/A */
1279 { 0x1a, 0x01813031 }, /* line-in */
1280 { 0x1b, 0x411111f0 }, /* N/A */
1281 { 0x1c, 0x411111f0 }, /* N/A */
1282 { 0x1d, 0x411111f0 }, /* N/A */
1283 { 0x1e, 0x0144111e }, /* SPDIF */
1287 [ALC880_FIXUP_ASUS_W5A
] = {
1288 .type
= HDA_FIXUP_PINS
,
1289 .v
.pins
= (const struct hda_pintbl
[]) {
1290 /* set up the whole pins as BIOS is utterly broken */
1291 { 0x14, 0x0121411f }, /* HP */
1292 { 0x15, 0x411111f0 }, /* N/A */
1293 { 0x16, 0x411111f0 }, /* N/A */
1294 { 0x17, 0x411111f0 }, /* N/A */
1295 { 0x18, 0x90a60160 }, /* mic */
1296 { 0x19, 0x411111f0 }, /* N/A */
1297 { 0x1a, 0x411111f0 }, /* N/A */
1298 { 0x1b, 0x411111f0 }, /* N/A */
1299 { 0x1c, 0x411111f0 }, /* N/A */
1300 { 0x1d, 0x411111f0 }, /* N/A */
1301 { 0x1e, 0xb743111e }, /* SPDIF out */
1305 .chain_id
= ALC880_FIXUP_GPIO1
,
1307 [ALC880_FIXUP_3ST_BASE
] = {
1308 .type
= HDA_FIXUP_PINS
,
1309 .v
.pins
= (const struct hda_pintbl
[]) {
1310 { 0x14, 0x01014010 }, /* line-out */
1311 { 0x15, 0x411111f0 }, /* N/A */
1312 { 0x16, 0x411111f0 }, /* N/A */
1313 { 0x17, 0x411111f0 }, /* N/A */
1314 { 0x18, 0x01a19c30 }, /* mic-in */
1315 { 0x19, 0x0121411f }, /* HP */
1316 { 0x1a, 0x01813031 }, /* line-in */
1317 { 0x1b, 0x02a19c40 }, /* front-mic */
1318 { 0x1c, 0x411111f0 }, /* N/A */
1319 { 0x1d, 0x411111f0 }, /* N/A */
1320 /* 0x1e is filled in below */
1321 { 0x1f, 0x411111f0 }, /* N/A */
1325 [ALC880_FIXUP_3ST
] = {
1326 .type
= HDA_FIXUP_PINS
,
1327 .v
.pins
= (const struct hda_pintbl
[]) {
1328 { 0x1e, 0x411111f0 }, /* N/A */
1332 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1334 [ALC880_FIXUP_3ST_DIG
] = {
1335 .type
= HDA_FIXUP_PINS
,
1336 .v
.pins
= (const struct hda_pintbl
[]) {
1337 { 0x1e, 0x0144111e }, /* SPDIF */
1341 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1343 [ALC880_FIXUP_5ST_BASE
] = {
1344 .type
= HDA_FIXUP_PINS
,
1345 .v
.pins
= (const struct hda_pintbl
[]) {
1346 { 0x14, 0x01014010 }, /* front */
1347 { 0x15, 0x411111f0 }, /* N/A */
1348 { 0x16, 0x01011411 }, /* CLFE */
1349 { 0x17, 0x01016412 }, /* surr */
1350 { 0x18, 0x01a19c30 }, /* mic-in */
1351 { 0x19, 0x0121411f }, /* HP */
1352 { 0x1a, 0x01813031 }, /* line-in */
1353 { 0x1b, 0x02a19c40 }, /* front-mic */
1354 { 0x1c, 0x411111f0 }, /* N/A */
1355 { 0x1d, 0x411111f0 }, /* N/A */
1356 /* 0x1e is filled in below */
1357 { 0x1f, 0x411111f0 }, /* N/A */
1361 [ALC880_FIXUP_5ST
] = {
1362 .type
= HDA_FIXUP_PINS
,
1363 .v
.pins
= (const struct hda_pintbl
[]) {
1364 { 0x1e, 0x411111f0 }, /* N/A */
1368 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1370 [ALC880_FIXUP_5ST_DIG
] = {
1371 .type
= HDA_FIXUP_PINS
,
1372 .v
.pins
= (const struct hda_pintbl
[]) {
1373 { 0x1e, 0x0144111e }, /* SPDIF */
1377 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1379 [ALC880_FIXUP_6ST_BASE
] = {
1380 .type
= HDA_FIXUP_PINS
,
1381 .v
.pins
= (const struct hda_pintbl
[]) {
1382 { 0x14, 0x01014010 }, /* front */
1383 { 0x15, 0x01016412 }, /* surr */
1384 { 0x16, 0x01011411 }, /* CLFE */
1385 { 0x17, 0x01012414 }, /* side */
1386 { 0x18, 0x01a19c30 }, /* mic-in */
1387 { 0x19, 0x02a19c40 }, /* front-mic */
1388 { 0x1a, 0x01813031 }, /* line-in */
1389 { 0x1b, 0x0121411f }, /* HP */
1390 { 0x1c, 0x411111f0 }, /* N/A */
1391 { 0x1d, 0x411111f0 }, /* N/A */
1392 /* 0x1e is filled in below */
1393 { 0x1f, 0x411111f0 }, /* N/A */
1397 [ALC880_FIXUP_6ST
] = {
1398 .type
= HDA_FIXUP_PINS
,
1399 .v
.pins
= (const struct hda_pintbl
[]) {
1400 { 0x1e, 0x411111f0 }, /* N/A */
1404 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1406 [ALC880_FIXUP_6ST_DIG
] = {
1407 .type
= HDA_FIXUP_PINS
,
1408 .v
.pins
= (const struct hda_pintbl
[]) {
1409 { 0x1e, 0x0144111e }, /* SPDIF */
1413 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1415 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1416 .type
= HDA_FIXUP_PINS
,
1417 .v
.pins
= (const struct hda_pintbl
[]) {
1418 { 0x1b, 0x0121401f }, /* HP with jack detect */
1421 .chained_before
= true,
1422 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1426 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1427 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1428 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1429 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1430 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1431 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1432 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1433 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1434 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1435 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1436 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1437 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1438 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1439 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1440 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1441 SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734
),
1442 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1443 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1444 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1445 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1446 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1447 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1448 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1449 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1451 /* Below is the copied entries from alc880_quirks.c.
1452 * It's not quite sure whether BIOS sets the correct pin-config table
1453 * on these machines, thus they are kept to be compatible with
1454 * the old static quirks. Once when it's confirmed to work without
1455 * these overrides, it'd be better to remove.
1457 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1458 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1459 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1460 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1461 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1462 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1463 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1464 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1465 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1466 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1467 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1468 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1469 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1470 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1471 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1472 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1473 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1474 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1475 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1476 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1477 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1478 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1479 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1480 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1481 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1482 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1483 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1484 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1485 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1486 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1487 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1488 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1489 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1491 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1492 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1493 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1497 static const struct hda_model_fixup alc880_fixup_models
[] = {
1498 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1499 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1500 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1501 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1502 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1503 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1504 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1510 * OK, here we have finally the patch for ALC880
1512 static int patch_alc880(struct hda_codec
*codec
)
1514 struct alc_spec
*spec
;
1517 err
= alc_alloc_spec(codec
, 0x0b);
1522 spec
->gen
.need_dac_fix
= 1;
1523 spec
->gen
.beep_nid
= 0x01;
1525 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1527 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1529 /* automatic parse from the BIOS config */
1530 err
= alc880_parse_auto_config(codec
);
1534 if (!spec
->gen
.no_analog
)
1535 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1537 codec
->patch_ops
= alc_patch_ops
;
1538 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1541 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1554 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1556 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1557 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1558 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1565 ALC260_FIXUP_HP_DC5750
,
1566 ALC260_FIXUP_HP_PIN_0F
,
1569 ALC260_FIXUP_GPIO1_TOGGLE
,
1570 ALC260_FIXUP_REPLACER
,
1571 ALC260_FIXUP_HP_B1900
,
1573 ALC260_FIXUP_FSC_S7020
,
1574 ALC260_FIXUP_FSC_S7020_JWSE
,
1575 ALC260_FIXUP_VAIO_PINS
,
1578 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1580 struct alc_spec
*spec
= codec
->spec
;
1581 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
1582 spec
->gen
.hp_jack_present
);
1585 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1586 const struct hda_fixup
*fix
, int action
)
1588 struct alc_spec
*spec
= codec
->spec
;
1589 if (action
== HDA_FIXUP_ACT_PROBE
) {
1590 /* although the machine has only one output pin, we need to
1591 * toggle GPIO1 according to the jack state
1593 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1594 spec
->gen
.detect_hp
= 1;
1595 spec
->gen
.automute_speaker
= 1;
1596 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1597 snd_hda_jack_detect_enable_callback(codec
, 0x0f, HDA_GEN_HP_EVENT
,
1598 snd_hda_gen_hp_automute
);
1599 snd_hda_add_verbs(codec
, alc_gpio1_init_verbs
);
1603 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1604 const struct hda_fixup
*fix
, int action
)
1606 struct alc_spec
*spec
= codec
->spec
;
1607 static const struct hda_pintbl pincfgs
[] = {
1608 { 0x0f, 0x02214000 }, /* HP/speaker */
1609 { 0x12, 0x90a60160 }, /* int mic */
1610 { 0x13, 0x02a19000 }, /* ext mic */
1611 { 0x18, 0x01446000 }, /* SPDIF out */
1612 /* disable bogus I/O pins */
1613 { 0x10, 0x411111f0 },
1614 { 0x11, 0x411111f0 },
1615 { 0x14, 0x411111f0 },
1616 { 0x15, 0x411111f0 },
1617 { 0x16, 0x411111f0 },
1618 { 0x17, 0x411111f0 },
1619 { 0x19, 0x411111f0 },
1624 case HDA_FIXUP_ACT_PRE_PROBE
:
1625 snd_hda_apply_pincfgs(codec
, pincfgs
);
1627 case HDA_FIXUP_ACT_PROBE
:
1628 spec
->init_amp
= ALC_INIT_NONE
;
1633 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1634 const struct hda_fixup
*fix
, int action
)
1636 struct alc_spec
*spec
= codec
->spec
;
1637 if (action
== HDA_FIXUP_ACT_PROBE
)
1638 spec
->init_amp
= ALC_INIT_NONE
;
1641 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec
*codec
,
1642 const struct hda_fixup
*fix
, int action
)
1644 struct alc_spec
*spec
= codec
->spec
;
1645 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1646 spec
->gen
.add_jack_modes
= 1;
1647 spec
->gen
.hp_mic
= 1;
1651 static const struct hda_fixup alc260_fixups
[] = {
1652 [ALC260_FIXUP_HP_DC5750
] = {
1653 .type
= HDA_FIXUP_PINS
,
1654 .v
.pins
= (const struct hda_pintbl
[]) {
1655 { 0x11, 0x90130110 }, /* speaker */
1659 [ALC260_FIXUP_HP_PIN_0F
] = {
1660 .type
= HDA_FIXUP_PINS
,
1661 .v
.pins
= (const struct hda_pintbl
[]) {
1662 { 0x0f, 0x01214000 }, /* HP */
1666 [ALC260_FIXUP_COEF
] = {
1667 .type
= HDA_FIXUP_VERBS
,
1668 .v
.verbs
= (const struct hda_verb
[]) {
1669 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1670 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1674 [ALC260_FIXUP_GPIO1
] = {
1675 .type
= HDA_FIXUP_VERBS
,
1676 .v
.verbs
= alc_gpio1_init_verbs
,
1678 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1679 .type
= HDA_FIXUP_FUNC
,
1680 .v
.func
= alc260_fixup_gpio1_toggle
,
1682 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1684 [ALC260_FIXUP_REPLACER
] = {
1685 .type
= HDA_FIXUP_VERBS
,
1686 .v
.verbs
= (const struct hda_verb
[]) {
1687 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1688 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1692 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1694 [ALC260_FIXUP_HP_B1900
] = {
1695 .type
= HDA_FIXUP_FUNC
,
1696 .v
.func
= alc260_fixup_gpio1_toggle
,
1698 .chain_id
= ALC260_FIXUP_COEF
,
1700 [ALC260_FIXUP_KN1
] = {
1701 .type
= HDA_FIXUP_FUNC
,
1702 .v
.func
= alc260_fixup_kn1
,
1704 [ALC260_FIXUP_FSC_S7020
] = {
1705 .type
= HDA_FIXUP_FUNC
,
1706 .v
.func
= alc260_fixup_fsc_s7020
,
1708 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1709 .type
= HDA_FIXUP_FUNC
,
1710 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1712 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1714 [ALC260_FIXUP_VAIO_PINS
] = {
1715 .type
= HDA_FIXUP_PINS
,
1716 .v
.pins
= (const struct hda_pintbl
[]) {
1717 /* Pin configs are missing completely on some VAIOs */
1718 { 0x0f, 0x01211020 },
1719 { 0x10, 0x0001003f },
1720 { 0x11, 0x411111f0 },
1721 { 0x12, 0x01a15930 },
1722 { 0x13, 0x411111f0 },
1723 { 0x14, 0x411111f0 },
1724 { 0x15, 0x411111f0 },
1725 { 0x16, 0x411111f0 },
1726 { 0x17, 0x411111f0 },
1727 { 0x18, 0x411111f0 },
1728 { 0x19, 0x411111f0 },
1734 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1735 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1736 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1737 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1738 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1739 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1740 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1741 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1742 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1743 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1744 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1745 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1746 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1750 static const struct hda_model_fixup alc260_fixup_models
[] = {
1751 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1752 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1753 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1754 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1760 static int patch_alc260(struct hda_codec
*codec
)
1762 struct alc_spec
*spec
;
1765 err
= alc_alloc_spec(codec
, 0x07);
1770 /* as quite a few machines require HP amp for speaker outputs,
1771 * it's easier to enable it unconditionally; even if it's unneeded,
1772 * it's almost harmless.
1774 spec
->gen
.prefer_hp_amp
= 1;
1775 spec
->gen
.beep_nid
= 0x01;
1777 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1779 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1781 /* automatic parse from the BIOS config */
1782 err
= alc260_parse_auto_config(codec
);
1786 if (!spec
->gen
.no_analog
)
1787 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1789 codec
->patch_ops
= alc_patch_ops
;
1790 spec
->shutup
= alc_eapd_shutup
;
1792 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1803 * ALC882/883/885/888/889 support
1805 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1806 * configuration. Each pin widget can choose any input DACs and a mixer.
1807 * Each ADC is connected from a mixer of all inputs. This makes possible
1808 * 6-channel independent captures.
1810 * In addition, an independent DAC for the multi-playback (not used in this
1818 ALC882_FIXUP_ABIT_AW9D_MAX
,
1819 ALC882_FIXUP_LENOVO_Y530
,
1820 ALC882_FIXUP_PB_M5210
,
1821 ALC882_FIXUP_ACER_ASPIRE_7736
,
1822 ALC882_FIXUP_ASUS_W90V
,
1824 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1825 ALC889_FIXUP_VAIO_TT
,
1826 ALC888_FIXUP_EEE1601
,
1829 ALC883_FIXUP_ACER_EAPD
,
1834 ALC882_FIXUP_ASUS_W2JC
,
1835 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1836 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1837 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1838 ALC885_FIXUP_MACPRO_GPIO
,
1839 ALC889_FIXUP_DAC_ROUTE
,
1840 ALC889_FIXUP_MBP_VREF
,
1841 ALC889_FIXUP_IMAC91_VREF
,
1842 ALC889_FIXUP_MBA11_VREF
,
1843 ALC889_FIXUP_MBA21_VREF
,
1844 ALC889_FIXUP_MP11_VREF
,
1845 ALC882_FIXUP_INV_DMIC
,
1846 ALC882_FIXUP_NO_PRIMARY_HP
,
1847 ALC887_FIXUP_ASUS_BASS
,
1848 ALC887_FIXUP_BASS_CHMAP
,
1851 static void alc889_fixup_coef(struct hda_codec
*codec
,
1852 const struct hda_fixup
*fix
, int action
)
1854 if (action
!= HDA_FIXUP_ACT_INIT
)
1856 alc889_coef_init(codec
);
1859 /* toggle speaker-output according to the hp-jack state */
1860 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
1862 unsigned int gpiostate
, gpiomask
, gpiodir
;
1864 gpiostate
= snd_hda_codec_read(codec
, codec
->afg
, 0,
1865 AC_VERB_GET_GPIO_DATA
, 0);
1868 gpiostate
|= (1 << pin
);
1870 gpiostate
&= ~(1 << pin
);
1872 gpiomask
= snd_hda_codec_read(codec
, codec
->afg
, 0,
1873 AC_VERB_GET_GPIO_MASK
, 0);
1874 gpiomask
|= (1 << pin
);
1876 gpiodir
= snd_hda_codec_read(codec
, codec
->afg
, 0,
1877 AC_VERB_GET_GPIO_DIRECTION
, 0);
1878 gpiodir
|= (1 << pin
);
1881 snd_hda_codec_write(codec
, codec
->afg
, 0,
1882 AC_VERB_SET_GPIO_MASK
, gpiomask
);
1883 snd_hda_codec_write(codec
, codec
->afg
, 0,
1884 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
1888 snd_hda_codec_write(codec
, codec
->afg
, 0,
1889 AC_VERB_SET_GPIO_DATA
, gpiostate
);
1892 /* set up GPIO at initialization */
1893 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1894 const struct hda_fixup
*fix
, int action
)
1896 if (action
!= HDA_FIXUP_ACT_INIT
)
1898 alc882_gpio_mute(codec
, 0, 0);
1899 alc882_gpio_mute(codec
, 1, 0);
1902 /* Fix the connection of some pins for ALC889:
1903 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1904 * work correctly (bko#42740)
1906 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1907 const struct hda_fixup
*fix
, int action
)
1909 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1910 /* fake the connections during parsing the tree */
1911 hda_nid_t conn1
[2] = { 0x0c, 0x0d };
1912 hda_nid_t conn2
[2] = { 0x0e, 0x0f };
1913 snd_hda_override_conn_list(codec
, 0x14, 2, conn1
);
1914 snd_hda_override_conn_list(codec
, 0x15, 2, conn1
);
1915 snd_hda_override_conn_list(codec
, 0x18, 2, conn2
);
1916 snd_hda_override_conn_list(codec
, 0x1a, 2, conn2
);
1917 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1918 /* restore the connections */
1919 hda_nid_t conn
[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1920 snd_hda_override_conn_list(codec
, 0x14, 5, conn
);
1921 snd_hda_override_conn_list(codec
, 0x15, 5, conn
);
1922 snd_hda_override_conn_list(codec
, 0x18, 5, conn
);
1923 snd_hda_override_conn_list(codec
, 0x1a, 5, conn
);
1927 /* Set VREF on HP pin */
1928 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1929 const struct hda_fixup
*fix
, int action
)
1931 struct alc_spec
*spec
= codec
->spec
;
1932 static hda_nid_t nids
[2] = { 0x14, 0x15 };
1935 if (action
!= HDA_FIXUP_ACT_INIT
)
1937 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1938 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1939 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1941 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1942 val
|= AC_PINCTL_VREF_80
;
1943 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1944 spec
->gen
.keep_vref_in_automute
= 1;
1949 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
1950 const hda_nid_t
*nids
, int num_nids
)
1952 struct alc_spec
*spec
= codec
->spec
;
1955 for (i
= 0; i
< num_nids
; i
++) {
1957 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1958 val
|= AC_PINCTL_VREF_50
;
1959 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1961 spec
->gen
.keep_vref_in_automute
= 1;
1964 /* Set VREF on speaker pins on imac91 */
1965 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
1966 const struct hda_fixup
*fix
, int action
)
1968 static hda_nid_t nids
[2] = { 0x18, 0x1a };
1970 if (action
== HDA_FIXUP_ACT_INIT
)
1971 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1974 /* Set VREF on speaker pins on mba11 */
1975 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
1976 const struct hda_fixup
*fix
, int action
)
1978 static hda_nid_t nids
[1] = { 0x18 };
1980 if (action
== HDA_FIXUP_ACT_INIT
)
1981 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1984 /* Set VREF on speaker pins on mba21 */
1985 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
1986 const struct hda_fixup
*fix
, int action
)
1988 static hda_nid_t nids
[2] = { 0x18, 0x19 };
1990 if (action
== HDA_FIXUP_ACT_INIT
)
1991 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1994 /* Don't take HP output as primary
1995 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
1996 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
1998 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
1999 const struct hda_fixup
*fix
, int action
)
2001 struct alc_spec
*spec
= codec
->spec
;
2002 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
2003 spec
->gen
.no_primary_hp
= 1;
2004 spec
->gen
.no_multi_io
= 1;
2008 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
2009 const struct hda_fixup
*fix
, int action
);
2011 static const struct hda_fixup alc882_fixups
[] = {
2012 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
2013 .type
= HDA_FIXUP_PINS
,
2014 .v
.pins
= (const struct hda_pintbl
[]) {
2015 { 0x15, 0x01080104 }, /* side */
2016 { 0x16, 0x01011012 }, /* rear */
2017 { 0x17, 0x01016011 }, /* clfe */
2021 [ALC882_FIXUP_LENOVO_Y530
] = {
2022 .type
= HDA_FIXUP_PINS
,
2023 .v
.pins
= (const struct hda_pintbl
[]) {
2024 { 0x15, 0x99130112 }, /* rear int speakers */
2025 { 0x16, 0x99130111 }, /* subwoofer */
2029 [ALC882_FIXUP_PB_M5210
] = {
2030 .type
= HDA_FIXUP_PINCTLS
,
2031 .v
.pins
= (const struct hda_pintbl
[]) {
2032 { 0x19, PIN_VREF50
},
2036 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
2037 .type
= HDA_FIXUP_FUNC
,
2038 .v
.func
= alc_fixup_sku_ignore
,
2040 [ALC882_FIXUP_ASUS_W90V
] = {
2041 .type
= HDA_FIXUP_PINS
,
2042 .v
.pins
= (const struct hda_pintbl
[]) {
2043 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2047 [ALC889_FIXUP_CD
] = {
2048 .type
= HDA_FIXUP_PINS
,
2049 .v
.pins
= (const struct hda_pintbl
[]) {
2050 { 0x1c, 0x993301f0 }, /* CD */
2054 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2055 .type
= HDA_FIXUP_PINS
,
2056 .v
.pins
= (const struct hda_pintbl
[]) {
2057 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2061 .chain_id
= ALC889_FIXUP_CD
,
2063 [ALC889_FIXUP_VAIO_TT
] = {
2064 .type
= HDA_FIXUP_PINS
,
2065 .v
.pins
= (const struct hda_pintbl
[]) {
2066 { 0x17, 0x90170111 }, /* hidden surround speaker */
2070 [ALC888_FIXUP_EEE1601
] = {
2071 .type
= HDA_FIXUP_VERBS
,
2072 .v
.verbs
= (const struct hda_verb
[]) {
2073 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2074 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2078 [ALC882_FIXUP_EAPD
] = {
2079 .type
= HDA_FIXUP_VERBS
,
2080 .v
.verbs
= (const struct hda_verb
[]) {
2081 /* change to EAPD mode */
2082 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2083 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2087 [ALC883_FIXUP_EAPD
] = {
2088 .type
= HDA_FIXUP_VERBS
,
2089 .v
.verbs
= (const struct hda_verb
[]) {
2090 /* change to EAPD mode */
2091 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2092 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2096 [ALC883_FIXUP_ACER_EAPD
] = {
2097 .type
= HDA_FIXUP_VERBS
,
2098 .v
.verbs
= (const struct hda_verb
[]) {
2099 /* eanable EAPD on Acer laptops */
2100 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2101 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2105 [ALC882_FIXUP_GPIO1
] = {
2106 .type
= HDA_FIXUP_VERBS
,
2107 .v
.verbs
= alc_gpio1_init_verbs
,
2109 [ALC882_FIXUP_GPIO2
] = {
2110 .type
= HDA_FIXUP_VERBS
,
2111 .v
.verbs
= alc_gpio2_init_verbs
,
2113 [ALC882_FIXUP_GPIO3
] = {
2114 .type
= HDA_FIXUP_VERBS
,
2115 .v
.verbs
= alc_gpio3_init_verbs
,
2117 [ALC882_FIXUP_ASUS_W2JC
] = {
2118 .type
= HDA_FIXUP_VERBS
,
2119 .v
.verbs
= alc_gpio1_init_verbs
,
2121 .chain_id
= ALC882_FIXUP_EAPD
,
2123 [ALC889_FIXUP_COEF
] = {
2124 .type
= HDA_FIXUP_FUNC
,
2125 .v
.func
= alc889_fixup_coef
,
2127 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2128 .type
= HDA_FIXUP_PINS
,
2129 .v
.pins
= (const struct hda_pintbl
[]) {
2130 { 0x16, 0x99130111 }, /* CLFE speaker */
2131 { 0x17, 0x99130112 }, /* surround speaker */
2135 .chain_id
= ALC882_FIXUP_GPIO1
,
2137 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2138 .type
= HDA_FIXUP_PINS
,
2139 .v
.pins
= (const struct hda_pintbl
[]) {
2140 { 0x16, 0x99130111 }, /* CLFE speaker */
2141 { 0x1b, 0x99130112 }, /* surround speaker */
2145 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2147 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2148 /* additional init verbs for Acer Aspire 8930G */
2149 .type
= HDA_FIXUP_VERBS
,
2150 .v
.verbs
= (const struct hda_verb
[]) {
2151 /* Enable all DACs */
2152 /* DAC DISABLE/MUTE 1? */
2153 /* setting bits 1-5 disables DAC nids 0x02-0x06
2154 * apparently. Init=0x38 */
2155 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2156 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2157 /* DAC DISABLE/MUTE 2? */
2158 /* some bit here disables the other DACs.
2160 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2161 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2163 * This laptop has a stereo digital microphone.
2164 * The mics are only 1cm apart which makes the stereo
2165 * useless. However, either the mic or the ALC889
2166 * makes the signal become a difference/sum signal
2167 * instead of standard stereo, which is annoying.
2168 * So instead we flip this bit which makes the
2169 * codec replicate the sum signal to both channels,
2170 * turning it into a normal mono mic.
2172 /* DMIC_CONTROL? Init value = 0x0001 */
2173 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2174 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2175 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2176 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2180 .chain_id
= ALC882_FIXUP_GPIO1
,
2182 [ALC885_FIXUP_MACPRO_GPIO
] = {
2183 .type
= HDA_FIXUP_FUNC
,
2184 .v
.func
= alc885_fixup_macpro_gpio
,
2186 [ALC889_FIXUP_DAC_ROUTE
] = {
2187 .type
= HDA_FIXUP_FUNC
,
2188 .v
.func
= alc889_fixup_dac_route
,
2190 [ALC889_FIXUP_MBP_VREF
] = {
2191 .type
= HDA_FIXUP_FUNC
,
2192 .v
.func
= alc889_fixup_mbp_vref
,
2194 .chain_id
= ALC882_FIXUP_GPIO1
,
2196 [ALC889_FIXUP_IMAC91_VREF
] = {
2197 .type
= HDA_FIXUP_FUNC
,
2198 .v
.func
= alc889_fixup_imac91_vref
,
2200 .chain_id
= ALC882_FIXUP_GPIO1
,
2202 [ALC889_FIXUP_MBA11_VREF
] = {
2203 .type
= HDA_FIXUP_FUNC
,
2204 .v
.func
= alc889_fixup_mba11_vref
,
2206 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2208 [ALC889_FIXUP_MBA21_VREF
] = {
2209 .type
= HDA_FIXUP_FUNC
,
2210 .v
.func
= alc889_fixup_mba21_vref
,
2212 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2214 [ALC889_FIXUP_MP11_VREF
] = {
2215 .type
= HDA_FIXUP_FUNC
,
2216 .v
.func
= alc889_fixup_mba11_vref
,
2218 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2220 [ALC882_FIXUP_INV_DMIC
] = {
2221 .type
= HDA_FIXUP_FUNC
,
2222 .v
.func
= alc_fixup_inv_dmic_0x12
,
2224 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2225 .type
= HDA_FIXUP_FUNC
,
2226 .v
.func
= alc882_fixup_no_primary_hp
,
2228 [ALC887_FIXUP_ASUS_BASS
] = {
2229 .type
= HDA_FIXUP_PINS
,
2230 .v
.pins
= (const struct hda_pintbl
[]) {
2231 {0x16, 0x99130130}, /* bass speaker */
2235 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2237 [ALC887_FIXUP_BASS_CHMAP
] = {
2238 .type
= HDA_FIXUP_FUNC
,
2239 .v
.func
= alc_fixup_bass_chmap
,
2243 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2244 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2245 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2246 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2247 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2248 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2249 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2250 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2251 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2252 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2253 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2254 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2255 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2256 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2257 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2258 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2259 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2260 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2261 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2262 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2263 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2264 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2265 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2266 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2267 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2268 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2269 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2270 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2271 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2272 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2273 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2274 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2275 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2276 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2277 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2279 /* All Apple entries are in codec SSIDs */
2280 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2281 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2282 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2283 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2284 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2285 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2286 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2287 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2288 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2289 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2290 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2291 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2292 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2293 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2294 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2295 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2296 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2297 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO
),
2298 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2299 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2300 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2301 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF
),
2303 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2304 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2305 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2306 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2307 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2308 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2309 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2310 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2311 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2315 static const struct hda_model_fixup alc882_fixup_models
[] = {
2316 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2317 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2318 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2319 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2320 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2325 * BIOS auto configuration
2327 /* almost identical with ALC880 parser... */
2328 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2330 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2331 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2332 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2337 static int patch_alc882(struct hda_codec
*codec
)
2339 struct alc_spec
*spec
;
2342 err
= alc_alloc_spec(codec
, 0x0b);
2348 switch (codec
->vendor_id
) {
2353 /* ALC883 and variants */
2354 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2358 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2360 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2362 alc_auto_parse_customize_define(codec
);
2364 if (has_cdefine_beep(codec
))
2365 spec
->gen
.beep_nid
= 0x01;
2367 /* automatic parse from the BIOS config */
2368 err
= alc882_parse_auto_config(codec
);
2372 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2373 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2375 codec
->patch_ops
= alc_patch_ops
;
2377 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2390 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2392 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2393 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2394 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2401 ALC262_FIXUP_FSC_H270
,
2402 ALC262_FIXUP_FSC_S7110
,
2403 ALC262_FIXUP_HP_Z200
,
2405 ALC262_FIXUP_LENOVO_3000
,
2407 ALC262_FIXUP_BENQ_T31
,
2408 ALC262_FIXUP_INV_DMIC
,
2409 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2412 static const struct hda_fixup alc262_fixups
[] = {
2413 [ALC262_FIXUP_FSC_H270
] = {
2414 .type
= HDA_FIXUP_PINS
,
2415 .v
.pins
= (const struct hda_pintbl
[]) {
2416 { 0x14, 0x99130110 }, /* speaker */
2417 { 0x15, 0x0221142f }, /* front HP */
2418 { 0x1b, 0x0121141f }, /* rear HP */
2422 [ALC262_FIXUP_FSC_S7110
] = {
2423 .type
= HDA_FIXUP_PINS
,
2424 .v
.pins
= (const struct hda_pintbl
[]) {
2425 { 0x15, 0x90170110 }, /* speaker */
2429 .chain_id
= ALC262_FIXUP_BENQ
,
2431 [ALC262_FIXUP_HP_Z200
] = {
2432 .type
= HDA_FIXUP_PINS
,
2433 .v
.pins
= (const struct hda_pintbl
[]) {
2434 { 0x16, 0x99130120 }, /* internal speaker */
2438 [ALC262_FIXUP_TYAN
] = {
2439 .type
= HDA_FIXUP_PINS
,
2440 .v
.pins
= (const struct hda_pintbl
[]) {
2441 { 0x14, 0x1993e1f0 }, /* int AUX */
2445 [ALC262_FIXUP_LENOVO_3000
] = {
2446 .type
= HDA_FIXUP_PINCTLS
,
2447 .v
.pins
= (const struct hda_pintbl
[]) {
2448 { 0x19, PIN_VREF50
},
2452 .chain_id
= ALC262_FIXUP_BENQ
,
2454 [ALC262_FIXUP_BENQ
] = {
2455 .type
= HDA_FIXUP_VERBS
,
2456 .v
.verbs
= (const struct hda_verb
[]) {
2457 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2458 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2462 [ALC262_FIXUP_BENQ_T31
] = {
2463 .type
= HDA_FIXUP_VERBS
,
2464 .v
.verbs
= (const struct hda_verb
[]) {
2465 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2466 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2470 [ALC262_FIXUP_INV_DMIC
] = {
2471 .type
= HDA_FIXUP_FUNC
,
2472 .v
.func
= alc_fixup_inv_dmic_0x12
,
2474 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2475 .type
= HDA_FIXUP_FUNC
,
2476 .v
.func
= alc_fixup_no_depop_delay
,
2480 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2481 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2482 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2483 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2484 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2485 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2486 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2487 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2488 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2489 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2493 static const struct hda_model_fixup alc262_fixup_models
[] = {
2494 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2500 static int patch_alc262(struct hda_codec
*codec
)
2502 struct alc_spec
*spec
;
2505 err
= alc_alloc_spec(codec
, 0x0b);
2510 spec
->gen
.shared_mic_vref_pin
= 0x18;
2513 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2518 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
2519 tmp
= snd_hda_codec_read(codec
, 0x20, 0, AC_VERB_GET_PROC_COEF
, 0);
2520 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_COEF_INDEX
, 7);
2521 snd_hda_codec_write(codec
, 0x1a, 0, AC_VERB_SET_PROC_COEF
, tmp
| 0x80);
2524 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2526 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2528 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2530 alc_auto_parse_customize_define(codec
);
2532 if (has_cdefine_beep(codec
))
2533 spec
->gen
.beep_nid
= 0x01;
2535 /* automatic parse from the BIOS config */
2536 err
= alc262_parse_auto_config(codec
);
2540 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2541 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2543 codec
->patch_ops
= alc_patch_ops
;
2544 spec
->shutup
= alc_eapd_shutup
;
2546 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2558 /* bind Beep switches of both NID 0x0f and 0x10 */
2559 static const struct hda_bind_ctls alc268_bind_beep_sw
= {
2560 .ops
= &snd_hda_bind_sw
,
2562 HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
),
2563 HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT
),
2568 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2569 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2570 HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw
),
2574 /* set PCBEEP vol = 0, mute connections */
2575 static const struct hda_verb alc268_beep_init_verbs
[] = {
2576 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2577 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2578 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2583 ALC268_FIXUP_INV_DMIC
,
2584 ALC268_FIXUP_HP_EAPD
,
2588 static const struct hda_fixup alc268_fixups
[] = {
2589 [ALC268_FIXUP_INV_DMIC
] = {
2590 .type
= HDA_FIXUP_FUNC
,
2591 .v
.func
= alc_fixup_inv_dmic_0x12
,
2593 [ALC268_FIXUP_HP_EAPD
] = {
2594 .type
= HDA_FIXUP_VERBS
,
2595 .v
.verbs
= (const struct hda_verb
[]) {
2596 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2600 [ALC268_FIXUP_SPDIF
] = {
2601 .type
= HDA_FIXUP_PINS
,
2602 .v
.pins
= (const struct hda_pintbl
[]) {
2603 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2609 static const struct hda_model_fixup alc268_fixup_models
[] = {
2610 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2611 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2615 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2616 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2617 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2618 /* below is codec SSID since multiple Toshiba laptops have the
2619 * same PCI SSID 1179:ff00
2621 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2626 * BIOS auto configuration
2628 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2630 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2631 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2636 static int patch_alc268(struct hda_codec
*codec
)
2638 struct alc_spec
*spec
;
2641 /* ALC268 has no aa-loopback mixer */
2642 err
= alc_alloc_spec(codec
, 0);
2647 spec
->gen
.beep_nid
= 0x01;
2649 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2650 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2652 /* automatic parse from the BIOS config */
2653 err
= alc268_parse_auto_config(codec
);
2657 if (err
> 0 && !spec
->gen
.no_analog
&&
2658 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2659 add_mixer(spec
, alc268_beep_mixer
);
2660 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2661 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2662 /* override the amp caps for beep generator */
2663 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2664 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2665 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2666 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2667 (0 << AC_AMPCAP_MUTE_SHIFT
));
2670 codec
->patch_ops
= alc_patch_ops
;
2671 spec
->shutup
= alc_eapd_shutup
;
2673 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2686 static int playback_pcm_open(struct hda_pcm_stream
*hinfo
,
2687 struct hda_codec
*codec
,
2688 struct snd_pcm_substream
*substream
)
2690 struct hda_gen_spec
*spec
= codec
->spec
;
2691 return snd_hda_multi_out_analog_open(codec
, &spec
->multiout
, substream
,
2695 static int playback_pcm_prepare(struct hda_pcm_stream
*hinfo
,
2696 struct hda_codec
*codec
,
2697 unsigned int stream_tag
,
2698 unsigned int format
,
2699 struct snd_pcm_substream
*substream
)
2701 struct hda_gen_spec
*spec
= codec
->spec
;
2702 return snd_hda_multi_out_analog_prepare(codec
, &spec
->multiout
,
2703 stream_tag
, format
, substream
);
2706 static int playback_pcm_cleanup(struct hda_pcm_stream
*hinfo
,
2707 struct hda_codec
*codec
,
2708 struct snd_pcm_substream
*substream
)
2710 struct hda_gen_spec
*spec
= codec
->spec
;
2711 return snd_hda_multi_out_analog_cleanup(codec
, &spec
->multiout
);
2714 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2718 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2719 /* NID is set in alc_build_pcms */
2721 .open
= playback_pcm_open
,
2722 .prepare
= playback_pcm_prepare
,
2723 .cleanup
= playback_pcm_cleanup
2727 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2731 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2732 /* NID is set in alc_build_pcms */
2735 /* different alc269-variants */
2737 ALC269_TYPE_ALC269VA
,
2738 ALC269_TYPE_ALC269VB
,
2739 ALC269_TYPE_ALC269VC
,
2740 ALC269_TYPE_ALC269VD
,
2751 * BIOS auto configuration
2753 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2755 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2756 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2757 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2758 struct alc_spec
*spec
= codec
->spec
;
2759 const hda_nid_t
*ssids
;
2761 switch (spec
->codec_variant
) {
2762 case ALC269_TYPE_ALC269VA
:
2763 case ALC269_TYPE_ALC269VC
:
2764 case ALC269_TYPE_ALC280
:
2765 case ALC269_TYPE_ALC284
:
2766 case ALC269_TYPE_ALC285
:
2767 ssids
= alc269va_ssids
;
2769 case ALC269_TYPE_ALC269VB
:
2770 case ALC269_TYPE_ALC269VD
:
2771 case ALC269_TYPE_ALC282
:
2772 case ALC269_TYPE_ALC283
:
2773 case ALC269_TYPE_ALC286
:
2774 case ALC269_TYPE_ALC255
:
2775 ssids
= alc269_ssids
;
2778 ssids
= alc269_ssids
;
2782 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2785 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2787 int val
= alc_read_coef_idx(codec
, 0x04);
2792 alc_write_coef_idx(codec
, 0x04, val
);
2795 static void alc269_shutup(struct hda_codec
*codec
)
2797 struct alc_spec
*spec
= codec
->spec
;
2799 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2800 alc269vb_toggle_power_output(codec
, 0);
2801 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2802 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2805 snd_hda_shutup_pins(codec
);
2808 static void alc282_restore_default_value(struct hda_codec
*codec
)
2812 /* Power Down Control */
2813 alc_write_coef_idx(codec
, 0x03, 0x0002);
2814 /* FIFO and filter clock */
2815 alc_write_coef_idx(codec
, 0x05, 0x0700);
2817 alc_write_coef_idx(codec
, 0x07, 0x0200);
2819 val
= alc_read_coef_idx(codec
, 0x06);
2820 alc_write_coef_idx(codec
, 0x06, (val
& ~0x00f0) | 0x0);
2822 val
= alc_read_coef_idx(codec
, 0x08);
2823 alc_write_coef_idx(codec
, 0x08, (val
& ~0xfffc) | 0x0c2c);
2825 alc_write_coef_idx(codec
, 0x0a, 0xcccc);
2827 alc_write_coef_idx(codec
, 0x0b, 0xcccc);
2828 /* LDO1/2/3, DAC/ADC */
2829 alc_write_coef_idx(codec
, 0x0e, 0x6e00);
2831 val
= alc_read_coef_idx(codec
, 0x0f);
2832 alc_write_coef_idx(codec
, 0x0f, (val
& ~0xf800) | 0x1000);
2834 val
= alc_read_coef_idx(codec
, 0x10);
2835 alc_write_coef_idx(codec
, 0x10, (val
& ~0xfc00) | 0x0c00);
2836 /* Class D test 4 */
2837 alc_write_coef_idx(codec
, 0x6f, 0x0);
2838 /* IO power down directly */
2839 val
= alc_read_coef_idx(codec
, 0x0c);
2840 alc_write_coef_idx(codec
, 0x0c, (val
& ~0xfe00) | 0x0);
2842 alc_write_coef_idx(codec
, 0x34, 0xa0c0);
2844 val
= alc_read_coef_idx(codec
, 0x16);
2845 alc_write_coef_idx(codec
, 0x16, (val
& ~0x0008) | 0x0);
2846 /* DAC simple content protection */
2847 val
= alc_read_coef_idx(codec
, 0x1d);
2848 alc_write_coef_idx(codec
, 0x1d, (val
& ~0x00e0) | 0x0);
2849 /* ADC simple content protection */
2850 val
= alc_read_coef_idx(codec
, 0x1f);
2851 alc_write_coef_idx(codec
, 0x1f, (val
& ~0x00e0) | 0x0);
2852 /* DAC ADC Zero Detection */
2853 alc_write_coef_idx(codec
, 0x21, 0x8804);
2855 alc_write_coef_idx(codec
, 0x63, 0x2902);
2856 /* capless control 2 */
2857 alc_write_coef_idx(codec
, 0x68, 0xa080);
2858 /* capless control 3 */
2859 alc_write_coef_idx(codec
, 0x69, 0x3400);
2860 /* capless control 4 */
2861 alc_write_coef_idx(codec
, 0x6a, 0x2f3e);
2862 /* capless control 5 */
2863 alc_write_coef_idx(codec
, 0x6b, 0x0);
2864 /* class D test 2 */
2865 val
= alc_read_coef_idx(codec
, 0x6d);
2866 alc_write_coef_idx(codec
, 0x6d, (val
& ~0x0fff) | 0x0900);
2867 /* class D test 3 */
2868 alc_write_coef_idx(codec
, 0x6e, 0x110a);
2869 /* class D test 5 */
2870 val
= alc_read_coef_idx(codec
, 0x70);
2871 alc_write_coef_idx(codec
, 0x70, (val
& ~0x00f8) | 0x00d8);
2872 /* class D test 6 */
2873 alc_write_coef_idx(codec
, 0x71, 0x0014);
2875 alc_write_coef_idx(codec
, 0x72, 0xc2ba);
2876 /* classD pure DC test */
2877 val
= alc_read_coef_idx(codec
, 0x77);
2878 alc_write_coef_idx(codec
, 0x77, (val
& ~0x0f80) | 0x0);
2879 /* Class D amp control */
2880 alc_write_coef_idx(codec
, 0x6c, 0xfc06);
2883 static void alc282_init(struct hda_codec
*codec
)
2885 struct alc_spec
*spec
= codec
->spec
;
2886 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2890 alc282_restore_default_value(codec
);
2894 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2895 coef78
= alc_read_coef_idx(codec
, 0x78);
2897 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
2898 /* Headphone capless set to high power mode */
2899 alc_write_coef_idx(codec
, 0x78, 0x9004);
2904 snd_hda_codec_write(codec
, hp_pin
, 0,
2905 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2910 snd_hda_codec_write(codec
, hp_pin
, 0,
2911 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
2916 /* Headphone capless set to normal mode */
2917 alc_write_coef_idx(codec
, 0x78, coef78
);
2920 static void alc282_shutup(struct hda_codec
*codec
)
2922 struct alc_spec
*spec
= codec
->spec
;
2923 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2928 alc269_shutup(codec
);
2932 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2933 coef78
= alc_read_coef_idx(codec
, 0x78);
2934 alc_write_coef_idx(codec
, 0x78, 0x9004);
2939 snd_hda_codec_write(codec
, hp_pin
, 0,
2940 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2945 snd_hda_codec_write(codec
, hp_pin
, 0,
2946 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
2951 alc_auto_setup_eapd(codec
, false);
2952 snd_hda_shutup_pins(codec
);
2953 alc_write_coef_idx(codec
, 0x78, coef78
);
2956 static void alc283_restore_default_value(struct hda_codec
*codec
)
2960 /* Power Down Control */
2961 alc_write_coef_idx(codec
, 0x03, 0x0002);
2962 /* FIFO and filter clock */
2963 alc_write_coef_idx(codec
, 0x05, 0x0700);
2965 alc_write_coef_idx(codec
, 0x07, 0x0200);
2967 val
= alc_read_coef_idx(codec
, 0x06);
2968 alc_write_coef_idx(codec
, 0x06, (val
& ~0x00f0) | 0x0);
2970 val
= alc_read_coef_idx(codec
, 0x08);
2971 alc_write_coef_idx(codec
, 0x08, (val
& ~0xfffc) | 0x0c2c);
2973 alc_write_coef_idx(codec
, 0x0a, 0xcccc);
2975 alc_write_coef_idx(codec
, 0x0b, 0xcccc);
2976 /* LDO1/2/3, DAC/ADC */
2977 alc_write_coef_idx(codec
, 0x0e, 0x6fc0);
2979 val
= alc_read_coef_idx(codec
, 0x0f);
2980 alc_write_coef_idx(codec
, 0x0f, (val
& ~0xf800) | 0x1000);
2982 val
= alc_read_coef_idx(codec
, 0x10);
2983 alc_write_coef_idx(codec
, 0x10, (val
& ~0xfc00) | 0x0c00);
2984 /* Class D test 4 */
2985 alc_write_coef_idx(codec
, 0x3a, 0x0);
2986 /* IO power down directly */
2987 val
= alc_read_coef_idx(codec
, 0x0c);
2988 alc_write_coef_idx(codec
, 0x0c, (val
& ~0xfe00) | 0x0);
2990 alc_write_coef_idx(codec
, 0x22, 0xa0c0);
2992 val
= alc_read_coefex_idx(codec
, 0x53, 0x01);
2993 alc_write_coefex_idx(codec
, 0x53, 0x01, (val
& ~0x000f) | 0x0008);
2994 /* DAC simple content protection */
2995 val
= alc_read_coef_idx(codec
, 0x1d);
2996 alc_write_coef_idx(codec
, 0x1d, (val
& ~0x00e0) | 0x0);
2997 /* ADC simple content protection */
2998 val
= alc_read_coef_idx(codec
, 0x1f);
2999 alc_write_coef_idx(codec
, 0x1f, (val
& ~0x00e0) | 0x0);
3000 /* DAC ADC Zero Detection */
3001 alc_write_coef_idx(codec
, 0x21, 0x8804);
3003 alc_write_coef_idx(codec
, 0x2e, 0x2902);
3004 /* capless control 2 */
3005 alc_write_coef_idx(codec
, 0x33, 0xa080);
3006 /* capless control 3 */
3007 alc_write_coef_idx(codec
, 0x34, 0x3400);
3008 /* capless control 4 */
3009 alc_write_coef_idx(codec
, 0x35, 0x2f3e);
3010 /* capless control 5 */
3011 alc_write_coef_idx(codec
, 0x36, 0x0);
3012 /* class D test 2 */
3013 val
= alc_read_coef_idx(codec
, 0x38);
3014 alc_write_coef_idx(codec
, 0x38, (val
& ~0x0fff) | 0x0900);
3015 /* class D test 3 */
3016 alc_write_coef_idx(codec
, 0x39, 0x110a);
3017 /* class D test 5 */
3018 val
= alc_read_coef_idx(codec
, 0x3b);
3019 alc_write_coef_idx(codec
, 0x3b, (val
& ~0x00f8) | 0x00d8);
3020 /* class D test 6 */
3021 alc_write_coef_idx(codec
, 0x3c, 0x0014);
3023 alc_write_coef_idx(codec
, 0x3d, 0xc2ba);
3024 /* classD pure DC test */
3025 val
= alc_read_coef_idx(codec
, 0x42);
3026 alc_write_coef_idx(codec
, 0x42, (val
& ~0x0f80) | 0x0);
3028 alc_write_coef_idx(codec
, 0x49, 0x0);
3029 /* Class D DC enable */
3030 val
= alc_read_coef_idx(codec
, 0x40);
3031 alc_write_coef_idx(codec
, 0x40, (val
& ~0xf800) | 0x9800);
3033 val
= alc_read_coef_idx(codec
, 0x42);
3034 alc_write_coef_idx(codec
, 0x42, (val
& ~0xf000) | 0x2000);
3035 /* Class D amp control */
3036 alc_write_coef_idx(codec
, 0x37, 0xfc06);
3039 static void alc283_init(struct hda_codec
*codec
)
3041 struct alc_spec
*spec
= codec
->spec
;
3042 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3046 if (!spec
->gen
.autocfg
.hp_outs
) {
3047 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3048 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3051 alc283_restore_default_value(codec
);
3055 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3057 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3058 /* Headphone capless set to high power mode */
3059 alc_write_coef_idx(codec
, 0x43, 0x9004);
3061 snd_hda_codec_write(codec
, hp_pin
, 0,
3062 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3067 snd_hda_codec_write(codec
, hp_pin
, 0,
3068 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3072 /* Index 0x46 Combo jack auto switch control 2 */
3073 /* 3k pull low control for Headset jack. */
3074 val
= alc_read_coef_idx(codec
, 0x46);
3075 alc_write_coef_idx(codec
, 0x46, val
& ~(3 << 12));
3076 /* Headphone capless set to normal mode */
3077 alc_write_coef_idx(codec
, 0x43, 0x9614);
3080 static void alc283_shutup(struct hda_codec
*codec
)
3082 struct alc_spec
*spec
= codec
->spec
;
3083 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3087 if (!spec
->gen
.autocfg
.hp_outs
) {
3088 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3089 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3093 alc269_shutup(codec
);
3097 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3099 alc_write_coef_idx(codec
, 0x43, 0x9004);
3101 snd_hda_codec_write(codec
, hp_pin
, 0,
3102 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3107 snd_hda_codec_write(codec
, hp_pin
, 0,
3108 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3110 val
= alc_read_coef_idx(codec
, 0x46);
3111 alc_write_coef_idx(codec
, 0x46, val
| (3 << 12));
3115 alc_auto_setup_eapd(codec
, false);
3116 snd_hda_shutup_pins(codec
);
3117 alc_write_coef_idx(codec
, 0x43, 0x9614);
3120 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3123 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3124 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3125 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3128 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3132 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3133 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3135 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3140 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3144 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3145 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3146 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3147 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3148 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3149 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3150 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3151 val
= alc5505_coef_get(codec
, 0x6220);
3152 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3155 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3157 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3158 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3159 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3160 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3161 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3162 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3165 static void alc5505_dsp_init(struct hda_codec
*codec
)
3169 alc5505_dsp_halt(codec
);
3170 alc5505_dsp_back_from_halt(codec
);
3171 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3172 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3173 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3174 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3175 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3176 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3177 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3178 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3179 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3180 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3181 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3182 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3183 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3185 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3187 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3189 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3191 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3192 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3193 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3194 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3195 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3196 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3197 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3199 #ifdef HALT_REALTEK_ALC5505
3200 alc5505_dsp_halt(codec
);
3204 #ifdef HALT_REALTEK_ALC5505
3205 #define alc5505_dsp_suspend(codec) /* NOP */
3206 #define alc5505_dsp_resume(codec) /* NOP */
3208 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3209 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3213 static int alc269_suspend(struct hda_codec
*codec
)
3215 struct alc_spec
*spec
= codec
->spec
;
3217 if (spec
->has_alc5505_dsp
)
3218 alc5505_dsp_suspend(codec
);
3219 return alc_suspend(codec
);
3222 static int alc269_resume(struct hda_codec
*codec
)
3224 struct alc_spec
*spec
= codec
->spec
;
3226 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3227 alc269vb_toggle_power_output(codec
, 0);
3228 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3229 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3233 codec
->patch_ops
.init(codec
);
3235 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3236 alc269vb_toggle_power_output(codec
, 1);
3237 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3238 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3242 snd_hda_codec_resume_amp(codec
);
3243 snd_hda_codec_resume_cache(codec
);
3244 alc_inv_dmic_sync(codec
, true);
3245 hda_call_check_power_status(codec
, 0x01);
3246 if (spec
->has_alc5505_dsp
)
3247 alc5505_dsp_resume(codec
);
3251 #endif /* CONFIG_PM */
3253 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3254 const struct hda_fixup
*fix
, int action
)
3256 struct alc_spec
*spec
= codec
->spec
;
3258 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3259 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3262 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3263 const struct hda_fixup
*fix
, int action
)
3267 if (action
!= HDA_FIXUP_ACT_INIT
)
3269 coef
= alc_read_coef_idx(codec
, 0x1e);
3270 alc_write_coef_idx(codec
, 0x1e, coef
| 0x80);
3273 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3274 const struct hda_fixup
*fix
, int action
)
3276 struct alc_spec
*spec
= codec
->spec
;
3278 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3279 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3282 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3283 const struct hda_fixup
*fix
, int action
)
3285 static const struct hda_verb verbs
[] = {
3286 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3287 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3292 if (strcmp(codec
->chip_name
, "ALC271X") &&
3293 strcmp(codec
->chip_name
, "ALC269VB"))
3295 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3296 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3297 snd_hda_sequence_write(codec
, verbs
);
3300 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3301 const struct hda_fixup
*fix
, int action
)
3303 struct alc_spec
*spec
= codec
->spec
;
3305 if (action
!= HDA_FIXUP_ACT_PROBE
)
3308 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3309 * fix the sample rate of analog I/O to 44.1kHz
3311 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3312 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3315 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3316 const struct hda_fixup
*fix
, int action
)
3320 if (action
!= HDA_FIXUP_ACT_INIT
)
3322 /* The digital-mic unit sends PDM (differential signal) instead of
3323 * the standard PCM, thus you can't record a valid mono stream as is.
3324 * Below is a workaround specific to ALC269 to control the dmic
3325 * signal source as mono.
3327 coef
= alc_read_coef_idx(codec
, 0x07);
3328 alc_write_coef_idx(codec
, 0x07, coef
| 0x80);
3331 static void alc269_quanta_automute(struct hda_codec
*codec
)
3333 snd_hda_gen_update_outputs(codec
);
3335 snd_hda_codec_write(codec
, 0x20, 0,
3336 AC_VERB_SET_COEF_INDEX
, 0x0c);
3337 snd_hda_codec_write(codec
, 0x20, 0,
3338 AC_VERB_SET_PROC_COEF
, 0x680);
3340 snd_hda_codec_write(codec
, 0x20, 0,
3341 AC_VERB_SET_COEF_INDEX
, 0x0c);
3342 snd_hda_codec_write(codec
, 0x20, 0,
3343 AC_VERB_SET_PROC_COEF
, 0x480);
3346 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3347 const struct hda_fixup
*fix
, int action
)
3349 struct alc_spec
*spec
= codec
->spec
;
3350 if (action
!= HDA_FIXUP_ACT_PROBE
)
3352 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3355 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3356 struct hda_jack_tbl
*jack
)
3358 struct alc_spec
*spec
= codec
->spec
;
3361 snd_hda_gen_hp_automute(codec
, jack
);
3363 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3365 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3368 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3372 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3373 const struct hda_fixup
*fix
, int action
)
3375 struct alc_spec
*spec
= codec
->spec
;
3376 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3377 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3378 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3383 /* update mute-LED according to the speaker mute state via mic VREF pin */
3384 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3386 struct hda_codec
*codec
= private_data
;
3387 struct alc_spec
*spec
= codec
->spec
;
3388 unsigned int pinval
;
3390 if (spec
->mute_led_polarity
)
3392 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3393 pinval
&= ~AC_PINCTL_VREFEN
;
3394 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3395 if (spec
->mute_led_nid
)
3396 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3399 /* Make sure the led works even in runtime suspend */
3400 static unsigned int led_power_filter(struct hda_codec
*codec
,
3402 unsigned int power_state
)
3404 struct alc_spec
*spec
= codec
->spec
;
3406 if (power_state
!= AC_PWRST_D3
|| nid
!= spec
->mute_led_nid
)
3409 /* Set pin ctl again, it might have just been set to 0 */
3410 snd_hda_set_pin_ctl(codec
, nid
,
3411 snd_hda_codec_get_pin_target(codec
, nid
));
3416 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3417 const struct hda_fixup
*fix
, int action
)
3419 struct alc_spec
*spec
= codec
->spec
;
3420 const struct dmi_device
*dev
= NULL
;
3422 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3425 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3427 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3429 if (pin
< 0x0a || pin
>= 0x10)
3431 spec
->mute_led_polarity
= pol
;
3432 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3433 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3434 spec
->gen
.vmaster_mute_enum
= 1;
3435 codec
->power_filter
= led_power_filter
;
3437 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3438 spec
->mute_led_polarity
);
3443 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3444 const struct hda_fixup
*fix
, int action
)
3446 struct alc_spec
*spec
= codec
->spec
;
3447 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3448 spec
->mute_led_polarity
= 0;
3449 spec
->mute_led_nid
= 0x18;
3450 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3451 spec
->gen
.vmaster_mute_enum
= 1;
3452 codec
->power_filter
= led_power_filter
;
3456 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3457 const struct hda_fixup
*fix
, int action
)
3459 struct alc_spec
*spec
= codec
->spec
;
3460 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3461 spec
->mute_led_polarity
= 0;
3462 spec
->mute_led_nid
= 0x19;
3463 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3464 spec
->gen
.vmaster_mute_enum
= 1;
3465 codec
->power_filter
= led_power_filter
;
3469 /* turn on/off mute LED per vmaster hook */
3470 static void alc269_fixup_hp_gpio_mute_hook(void *private_data
, int enabled
)
3472 struct hda_codec
*codec
= private_data
;
3473 struct alc_spec
*spec
= codec
->spec
;
3474 unsigned int oldval
= spec
->gpio_led
;
3477 spec
->gpio_led
&= ~0x08;
3479 spec
->gpio_led
|= 0x08;
3480 if (spec
->gpio_led
!= oldval
)
3481 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3485 /* turn on/off mic-mute LED per capture hook */
3486 static void alc269_fixup_hp_gpio_mic_mute_hook(struct hda_codec
*codec
,
3487 struct snd_kcontrol
*kcontrol
,
3488 struct snd_ctl_elem_value
*ucontrol
)
3490 struct alc_spec
*spec
= codec
->spec
;
3491 unsigned int oldval
= spec
->gpio_led
;
3496 if (ucontrol
->value
.integer
.value
[0] ||
3497 ucontrol
->value
.integer
.value
[1])
3498 spec
->gpio_led
&= ~0x10;
3500 spec
->gpio_led
|= 0x10;
3501 if (spec
->gpio_led
!= oldval
)
3502 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3506 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3507 const struct hda_fixup
*fix
, int action
)
3509 struct alc_spec
*spec
= codec
->spec
;
3510 static const struct hda_verb gpio_init
[] = {
3511 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3512 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3516 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3517 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_hp_gpio_mute_hook
;
3518 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_gpio_mic_mute_hook
;
3520 snd_hda_add_verbs(codec
, gpio_init
);
3524 /* turn on/off mic-mute LED per capture hook */
3525 static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec
*codec
,
3526 struct snd_kcontrol
*kcontrol
,
3527 struct snd_ctl_elem_value
*ucontrol
)
3529 struct alc_spec
*spec
= codec
->spec
;
3530 unsigned int pinval
, enable
, disable
;
3532 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3533 pinval
&= ~AC_PINCTL_VREFEN
;
3534 enable
= pinval
| AC_PINCTL_VREF_80
;
3535 disable
= pinval
| AC_PINCTL_VREF_HIZ
;
3540 if (ucontrol
->value
.integer
.value
[0] ||
3541 ucontrol
->value
.integer
.value
[1])
3546 if (spec
->cap_mute_led_nid
)
3547 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3550 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3551 const struct hda_fixup
*fix
, int action
)
3553 struct alc_spec
*spec
= codec
->spec
;
3554 static const struct hda_verb gpio_init
[] = {
3555 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x08 },
3556 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x08 },
3560 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3561 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_hp_gpio_mute_hook
;
3562 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3564 spec
->cap_mute_led_nid
= 0x18;
3565 snd_hda_add_verbs(codec
, gpio_init
);
3569 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
3570 const struct hda_fixup
*fix
, int action
)
3572 struct alc_spec
*spec
= codec
->spec
;
3574 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3575 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3576 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3577 spec
->mute_led_polarity
= 0;
3578 spec
->mute_led_nid
= 0x1a;
3579 spec
->cap_mute_led_nid
= 0x18;
3580 spec
->gen
.vmaster_mute_enum
= 1;
3581 codec
->power_filter
= led_power_filter
;
3585 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
3589 switch (codec
->vendor_id
) {
3591 /* LDO and MISC control */
3592 alc_write_coef_idx(codec
, 0x1b, 0x0c0b);
3593 /* UAJ function set to menual mode */
3594 alc_write_coef_idx(codec
, 0x45, 0xd089);
3595 /* Direct Drive HP Amp control(Set to verb control)*/
3596 val
= alc_read_coefex_idx(codec
, 0x57, 0x05);
3597 alc_write_coefex_idx(codec
, 0x57, 0x05, val
& ~(1<<14));
3598 /* Set MIC2 Vref gate with HP */
3599 alc_write_coef_idx(codec
, 0x06, 0x6104);
3600 /* Direct Drive HP Amp control */
3601 alc_write_coefex_idx(codec
, 0x57, 0x03, 0x8aa6);
3605 alc_write_coef_idx(codec
, 0x1b, 0x0c0b);
3606 alc_write_coef_idx(codec
, 0x45, 0xc429);
3607 val
= alc_read_coef_idx(codec
, 0x35);
3608 alc_write_coef_idx(codec
, 0x35, val
& 0xbfff);
3609 alc_write_coef_idx(codec
, 0x06, 0x2104);
3610 alc_write_coef_idx(codec
, 0x1a, 0x0001);
3611 alc_write_coef_idx(codec
, 0x26, 0x0004);
3612 alc_write_coef_idx(codec
, 0x32, 0x42a3);
3615 alc_write_coef_idx(codec
, 0x76, 0x000e);
3616 alc_write_coef_idx(codec
, 0x6c, 0x2400);
3617 alc_write_coef_idx(codec
, 0x18, 0x7308);
3618 alc_write_coef_idx(codec
, 0x6b, 0xc429);
3621 /* SET Line1 JD to 0 */
3622 val
= alc_read_coef_idx(codec
, 0x10);
3623 alc_write_coef_idx(codec
, 0x10, (val
& ~(7<<8)) | 6<<8);
3624 /* SET charge pump by verb */
3625 val
= alc_read_coefex_idx(codec
, 0x57, 0x05);
3626 alc_write_coefex_idx(codec
, 0x57, 0x05, (val
& ~(1<<15|1<<13)) | 0x0);
3627 /* SET EN_OSW to 1 */
3628 val
= alc_read_coefex_idx(codec
, 0x57, 0x03);
3629 alc_write_coefex_idx(codec
, 0x57, 0x03, (val
& ~(1<<10)) | (1<<10) );
3630 /* Combo JD gating with LINE1-VREFO */
3631 val
= alc_read_coef_idx(codec
, 0x1a);
3632 alc_write_coef_idx(codec
, 0x1a, (val
& ~(1<<3)) | (1<<3));
3633 /* Set to TRS type */
3634 alc_write_coef_idx(codec
, 0x45, 0xc429);
3635 /* Combo Jack auto detect */
3636 val
= alc_read_coef_idx(codec
, 0x4a);
3637 alc_write_coef_idx(codec
, 0x4a, (val
& 0xfff0) | 0x000e);
3640 alc_write_coef_idx(codec
, 0x15, 0x0d40);
3641 alc_write_coef_idx(codec
, 0xb7, 0x802b);
3644 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
3648 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
3653 switch (codec
->vendor_id
) {
3655 alc_write_coef_idx(codec
, 0x45, 0xc489);
3656 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3657 alc_write_coefex_idx(codec
, 0x57, 0x03, 0x8aa6);
3658 /* Set MIC2 Vref gate to normal */
3659 alc_write_coef_idx(codec
, 0x06, 0x6100);
3660 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3664 alc_write_coef_idx(codec
, 0x45, 0xc429);
3665 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3666 val
= alc_read_coef_idx(codec
, 0x35);
3667 alc_write_coef_idx(codec
, 0x35, val
| 1<<14);
3668 alc_write_coef_idx(codec
, 0x06, 0x2100);
3669 alc_write_coef_idx(codec
, 0x1a, 0x0021);
3670 alc_write_coef_idx(codec
, 0x26, 0x008c);
3671 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3674 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3675 alc_write_coef_idx(codec
, 0x19, 0xa208);
3676 alc_write_coef_idx(codec
, 0x2e, 0xacf0);
3679 /* Set to TRS mode */
3680 alc_write_coef_idx(codec
, 0x45, 0xc429);
3681 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3682 /* SET charge pump by verb */
3683 val
= alc_read_coefex_idx(codec
, 0x57, 0x05);
3684 alc_write_coefex_idx(codec
, 0x57, 0x05, (val
& ~(1<<15|1<<13)) | (1<<15|1<<13));
3685 /* SET EN_OSW to 0 */
3686 val
= alc_read_coefex_idx(codec
, 0x57, 0x03);
3687 alc_write_coefex_idx(codec
, 0x57, 0x03, (val
& ~(1<<10)) | 0x0);
3688 /* Combo JD gating without LINE1-VREFO */
3689 val
= alc_read_coef_idx(codec
, 0x1a);
3690 alc_write_coef_idx(codec
, 0x1a, (val
& ~(1<<3)) | 0x0);
3691 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3694 alc_write_coef_idx(codec
, 0x11, 0x0001);
3695 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
3696 alc_write_coef_idx(codec
, 0xb7, 0x802b);
3697 alc_write_coef_idx(codec
, 0xb5, 0x1040);
3698 val
= alc_read_coef_idx(codec
, 0xc3);
3699 alc_write_coef_idx(codec
, 0xc3, val
| 1<<12);
3700 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
3703 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
3706 static void alc_headset_mode_default(struct hda_codec
*codec
)
3710 switch (codec
->vendor_id
) {
3712 alc_write_coef_idx(codec
, 0x45, 0xc089);
3713 alc_write_coef_idx(codec
, 0x45, 0xc489);
3714 alc_write_coefex_idx(codec
, 0x57, 0x03, 0x8ea6);
3715 alc_write_coef_idx(codec
, 0x49, 0x0049);
3719 alc_write_coef_idx(codec
, 0x06, 0x2100);
3720 alc_write_coef_idx(codec
, 0x32, 0x4ea3);
3723 alc_write_coef_idx(codec
, 0x76, 0x000e);
3724 alc_write_coef_idx(codec
, 0x6c, 0x2400);
3725 alc_write_coef_idx(codec
, 0x6b, 0xc429);
3726 alc_write_coef_idx(codec
, 0x18, 0x7308);
3729 /* Combo Jack auto detect */
3730 val
= alc_read_coef_idx(codec
, 0x4a);
3731 alc_write_coef_idx(codec
, 0x4a, (val
& 0xfff0) | 0x000e);
3732 /* Set to TRS type */
3733 alc_write_coef_idx(codec
, 0x45, 0xC429);
3734 /* Combo JD gating without LINE1-VREFO */
3735 val
= alc_read_coef_idx(codec
, 0x1a);
3736 alc_write_coef_idx(codec
, 0x1a, (val
& ~(1<<3)) | 0x0);
3739 alc_write_coef_idx(codec
, 0x11, 0x0041);
3740 alc_write_coef_idx(codec
, 0x15, 0x0d40);
3741 alc_write_coef_idx(codec
, 0xb7, 0x802b);
3744 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
3748 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
3752 switch (codec
->vendor_id
) {
3754 /* Set to CTIA type */
3755 alc_write_coef_idx(codec
, 0x45, 0xd489);
3756 alc_write_coef_idx(codec
, 0x1b, 0x0c2b);
3757 alc_write_coefex_idx(codec
, 0x57, 0x03, 0x8ea6);
3761 alc_write_coef_idx(codec
, 0x45, 0xd429);
3762 alc_write_coef_idx(codec
, 0x1b, 0x0c2b);
3763 alc_write_coef_idx(codec
, 0x32, 0x4ea3);
3766 alc_write_coef_idx(codec
, 0x6b, 0xd429);
3767 alc_write_coef_idx(codec
, 0x76, 0x0008);
3768 alc_write_coef_idx(codec
, 0x18, 0x7388);
3771 /* Set to ctia type */
3772 alc_write_coef_idx(codec
, 0x45, 0xd429);
3773 /* SET Line1 JD to 1 */
3774 val
= alc_read_coef_idx(codec
, 0x10);
3775 alc_write_coef_idx(codec
, 0x10, (val
& ~(7<<8)) | 7<<8);
3778 alc_write_coef_idx(codec
, 0x11, 0x0001);
3779 alc_write_coef_idx(codec
, 0x15, 0x0d60);
3780 alc_write_coef_idx(codec
, 0xc3, 0x0000);
3783 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
3787 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
3791 switch (codec
->vendor_id
) {
3793 /* Set to OMTP Type */
3794 alc_write_coef_idx(codec
, 0x45, 0xe489);
3795 alc_write_coef_idx(codec
, 0x1b, 0x0c2b);
3796 alc_write_coefex_idx(codec
, 0x57, 0x03, 0x8ea6);
3800 alc_write_coef_idx(codec
, 0x45, 0xe429);
3801 alc_write_coef_idx(codec
, 0x1b, 0x0c2b);
3802 alc_write_coef_idx(codec
, 0x32, 0x4ea3);
3805 alc_write_coef_idx(codec
, 0x6b, 0xe429);
3806 alc_write_coef_idx(codec
, 0x76, 0x0008);
3807 alc_write_coef_idx(codec
, 0x18, 0x7388);
3810 /* Set to omtp type */
3811 alc_write_coef_idx(codec
, 0x45, 0xe429);
3812 /* SET Line1 JD to 1 */
3813 val
= alc_read_coef_idx(codec
, 0x10);
3814 alc_write_coef_idx(codec
, 0x10, (val
& ~(7<<8)) | 7<<8);
3817 alc_write_coef_idx(codec
, 0x11, 0x0001);
3818 alc_write_coef_idx(codec
, 0x15, 0x0d50);
3819 alc_write_coef_idx(codec
, 0xc3, 0x0000);
3822 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
3825 static void alc_determine_headset_type(struct hda_codec
*codec
)
3828 bool is_ctia
= false;
3829 struct alc_spec
*spec
= codec
->spec
;
3831 switch (codec
->vendor_id
) {
3833 /* combo jack auto switch control(Check type)*/
3834 alc_write_coef_idx(codec
, 0x45, 0xd089);
3835 /* combo jack auto switch control(Vref conteol) */
3836 alc_write_coef_idx(codec
, 0x49, 0x0149);
3838 val
= alc_read_coef_idx(codec
, 0x46);
3839 is_ctia
= (val
& 0x0070) == 0x0070;
3843 alc_write_coef_idx(codec
, 0x45, 0xd029);
3845 val
= alc_read_coef_idx(codec
, 0x46);
3846 is_ctia
= (val
& 0x0070) == 0x0070;
3849 alc_write_coef_idx(codec
, 0x6b, 0xd429);
3851 val
= alc_read_coef_idx(codec
, 0x6c);
3852 is_ctia
= (val
& 0x001c) == 0x001c;
3855 /* Combo Jack auto detect */
3856 val
= alc_read_coef_idx(codec
, 0x4a);
3857 alc_write_coef_idx(codec
, 0x4a, (val
& 0xfff0) | 0x0008);
3858 /* Set to ctia type */
3859 alc_write_coef_idx(codec
, 0x45, 0xD429);
3861 val
= alc_read_coef_idx(codec
, 0x46);
3862 is_ctia
= (val
& 0x0070) == 0x0070;
3865 alc_write_coef_idx(codec
, 0x11, 0x0001);
3866 alc_write_coef_idx(codec
, 0xb7, 0x802b);
3867 alc_write_coef_idx(codec
, 0x15, 0x0d60);
3868 alc_write_coef_idx(codec
, 0xc3, 0x0c00);
3870 val
= alc_read_coef_idx(codec
, 0xbe);
3871 is_ctia
= (val
& 0x1c02) == 0x1c02;
3875 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
3876 is_ctia
? "yes" : "no");
3877 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
3880 static void alc_update_headset_mode(struct hda_codec
*codec
)
3882 struct alc_spec
*spec
= codec
->spec
;
3884 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
3885 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3887 int new_headset_mode
;
3889 if (!snd_hda_jack_detect(codec
, hp_pin
))
3890 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
3891 else if (mux_pin
== spec
->headset_mic_pin
)
3892 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
3893 else if (mux_pin
== spec
->headphone_mic_pin
)
3894 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
3896 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
3898 if (new_headset_mode
== spec
->current_headset_mode
) {
3899 snd_hda_gen_update_outputs(codec
);
3903 switch (new_headset_mode
) {
3904 case ALC_HEADSET_MODE_UNPLUGGED
:
3905 alc_headset_mode_unplugged(codec
);
3906 spec
->gen
.hp_jack_present
= false;
3908 case ALC_HEADSET_MODE_HEADSET
:
3909 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
3910 alc_determine_headset_type(codec
);
3911 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
3912 alc_headset_mode_ctia(codec
);
3913 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
3914 alc_headset_mode_omtp(codec
);
3915 spec
->gen
.hp_jack_present
= true;
3917 case ALC_HEADSET_MODE_MIC
:
3918 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
3919 spec
->gen
.hp_jack_present
= false;
3921 case ALC_HEADSET_MODE_HEADPHONE
:
3922 alc_headset_mode_default(codec
);
3923 spec
->gen
.hp_jack_present
= true;
3926 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
3927 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
3928 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
3929 if (spec
->headphone_mic_pin
)
3930 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
3933 spec
->current_headset_mode
= new_headset_mode
;
3935 snd_hda_gen_update_outputs(codec
);
3938 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
3939 struct snd_kcontrol
*kcontrol
,
3940 struct snd_ctl_elem_value
*ucontrol
)
3942 alc_update_headset_mode(codec
);
3945 static void alc_update_headset_jack_cb(struct hda_codec
*codec
, struct hda_jack_tbl
*jack
)
3947 struct alc_spec
*spec
= codec
->spec
;
3948 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
3949 snd_hda_gen_hp_automute(codec
, jack
);
3952 static void alc_probe_headset_mode(struct hda_codec
*codec
)
3955 struct alc_spec
*spec
= codec
->spec
;
3956 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
3959 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
3960 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
3961 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
3962 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
3963 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
3966 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
3967 spec
->gen
.automute_hook
= alc_update_headset_mode
;
3968 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
3971 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
3972 const struct hda_fixup
*fix
, int action
)
3974 struct alc_spec
*spec
= codec
->spec
;
3977 case HDA_FIXUP_ACT_PRE_PROBE
:
3978 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
3980 case HDA_FIXUP_ACT_PROBE
:
3981 alc_probe_headset_mode(codec
);
3983 case HDA_FIXUP_ACT_INIT
:
3984 spec
->current_headset_mode
= 0;
3985 alc_update_headset_mode(codec
);
3990 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
3991 const struct hda_fixup
*fix
, int action
)
3993 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3994 struct alc_spec
*spec
= codec
->spec
;
3995 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3998 alc_fixup_headset_mode(codec
, fix
, action
);
4001 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
4003 /* Set to iphone type */
4004 alc_write_coef_idx(codec
, 0x1b, 0x880b);
4005 alc_write_coef_idx(codec
, 0x45, 0xd089);
4006 alc_write_coef_idx(codec
, 0x1b, 0x080b);
4007 alc_write_coef_idx(codec
, 0x46, 0x0004);
4008 alc_write_coef_idx(codec
, 0x1b, 0x0c0b);
4012 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
4013 const struct hda_fixup
*fix
, int action
)
4015 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4016 alc255_set_default_jack_type(codec
);
4018 alc_fixup_headset_mode(codec
, fix
, action
);
4021 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
4022 const struct hda_fixup
*fix
, int action
)
4024 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4025 struct alc_spec
*spec
= codec
->spec
;
4026 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4027 alc255_set_default_jack_type(codec
);
4030 alc_fixup_headset_mode(codec
, fix
, action
);
4033 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
4034 const struct hda_fixup
*fix
, int action
)
4036 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4037 struct alc_spec
*spec
= codec
->spec
;
4038 spec
->gen
.auto_mute_via_amp
= 1;
4042 static void alc_no_shutup(struct hda_codec
*codec
)
4046 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
4047 const struct hda_fixup
*fix
, int action
)
4049 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4050 struct alc_spec
*spec
= codec
->spec
;
4051 spec
->shutup
= alc_no_shutup
;
4055 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
4056 const struct hda_fixup
*fix
, int action
)
4058 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4059 struct alc_spec
*spec
= codec
->spec
;
4060 /* Disable AA-loopback as it causes white noise */
4061 spec
->gen
.mixer_nid
= 0;
4065 static unsigned int alc_power_filter_xps13(struct hda_codec
*codec
,
4067 unsigned int power_state
)
4069 struct alc_spec
*spec
= codec
->spec
;
4071 /* Avoid pop noises when headphones are plugged in */
4072 if (spec
->gen
.hp_jack_present
)
4073 if (nid
== codec
->afg
|| nid
== 0x02)
4078 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
4079 const struct hda_fixup
*fix
, int action
)
4081 if (action
== HDA_FIXUP_ACT_PROBE
) {
4082 struct alc_spec
*spec
= codec
->spec
;
4083 spec
->shutup
= alc_no_shutup
;
4084 codec
->power_filter
= alc_power_filter_xps13
;
4088 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
4089 const struct hda_fixup
*fix
, int action
)
4091 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4093 alc_write_coef_idx(codec
, 0xc4, 0x8000);
4094 val
= alc_read_coef_idx(codec
, 0xc2);
4095 alc_write_coef_idx(codec
, 0xc2, val
& 0xfe);
4096 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
4098 alc_fixup_headset_mode(codec
, fix
, action
);
4101 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
4102 static int find_ext_mic_pin(struct hda_codec
*codec
)
4104 struct alc_spec
*spec
= codec
->spec
;
4105 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4107 unsigned int defcfg
;
4110 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4111 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
4113 nid
= cfg
->inputs
[i
].pin
;
4114 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
4115 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
4123 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
4124 const struct hda_fixup
*fix
,
4127 struct alc_spec
*spec
= codec
->spec
;
4129 if (action
== HDA_FIXUP_ACT_PROBE
) {
4130 int mic_pin
= find_ext_mic_pin(codec
);
4131 int hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4133 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
4135 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
4139 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
4140 const struct hda_fixup
*fix
,
4143 struct alc_spec
*spec
= codec
->spec
;
4144 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4147 /* The mic boosts on level 2 and 3 are too noisy
4148 on the internal mic input.
4149 Therefore limit the boost to 0 or 1. */
4151 if (action
!= HDA_FIXUP_ACT_PROBE
)
4154 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4155 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
4156 unsigned int defcfg
;
4157 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
4159 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
4160 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
4163 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
4164 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
4165 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
4166 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
4167 (0 << AC_AMPCAP_MUTE_SHIFT
));
4171 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
4172 struct hda_jack_tbl
*jack
)
4174 struct alc_spec
*spec
= codec
->spec
;
4178 snd_hda_gen_hp_automute(codec
, jack
);
4180 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
4183 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
4187 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
4188 const struct hda_fixup
*fix
, int action
)
4190 struct alc_spec
*spec
= codec
->spec
;
4194 case HDA_FIXUP_ACT_PRE_PROBE
:
4195 snd_hda_override_wcaps(codec
, 0x03, 0);
4196 /* Disable AA-loopback as it causes white noise */
4197 spec
->gen
.mixer_nid
= 0;
4199 case HDA_FIXUP_ACT_INIT
:
4200 /* MIC2-VREF control */
4201 /* Set to manual mode */
4202 val
= alc_read_coef_idx(codec
, 0x06);
4203 alc_write_coef_idx(codec
, 0x06, val
& ~0x000c);
4204 /* Enable Line1 input control by verb */
4205 val
= alc_read_coef_idx(codec
, 0x1a);
4206 alc_write_coef_idx(codec
, 0x1a, val
| (1 << 4));
4211 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
4212 const struct hda_fixup
*fix
, int action
)
4214 struct alc_spec
*spec
= codec
->spec
;
4218 case HDA_FIXUP_ACT_PRE_PROBE
:
4219 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
4221 case HDA_FIXUP_ACT_INIT
:
4222 /* MIC2-VREF control */
4223 /* Set to manual mode */
4224 val
= alc_read_coef_idx(codec
, 0x06);
4225 alc_write_coef_idx(codec
, 0x06, val
& ~0x000c);
4230 /* mute tablet speaker pin (0x14) via dock plugging in addition */
4231 static void asus_tx300_automute(struct hda_codec
*codec
)
4233 struct alc_spec
*spec
= codec
->spec
;
4234 snd_hda_gen_update_outputs(codec
);
4235 if (snd_hda_jack_detect(codec
, 0x1b))
4236 spec
->gen
.mute_bits
|= (1ULL << 0x14);
4239 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
4240 const struct hda_fixup
*fix
, int action
)
4242 struct alc_spec
*spec
= codec
->spec
;
4243 /* TX300 needs to set up GPIO2 for the speaker amp */
4244 static const struct hda_verb gpio2_verbs
[] = {
4245 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
4246 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
4247 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
4250 static const struct hda_pintbl dock_pins
[] = {
4251 { 0x1b, 0x21114000 }, /* dock speaker pin */
4254 struct snd_kcontrol
*kctl
;
4257 case HDA_FIXUP_ACT_PRE_PROBE
:
4258 snd_hda_add_verbs(codec
, gpio2_verbs
);
4259 snd_hda_apply_pincfgs(codec
, dock_pins
);
4260 spec
->gen
.auto_mute_via_amp
= 1;
4261 spec
->gen
.automute_hook
= asus_tx300_automute
;
4262 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4264 snd_hda_gen_hp_automute
);
4266 case HDA_FIXUP_ACT_BUILD
:
4267 /* this is a bit tricky; give more sane names for the main
4268 * (tablet) speaker and the dock speaker, respectively
4270 kctl
= snd_hda_find_mixer_ctl(codec
, "Speaker Playback Switch");
4272 strcpy(kctl
->id
.name
, "Dock Speaker Playback Switch");
4273 kctl
= snd_hda_find_mixer_ctl(codec
, "Bass Speaker Playback Switch");
4275 strcpy(kctl
->id
.name
, "Speaker Playback Switch");
4280 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
4281 const struct hda_fixup
*fix
, int action
)
4283 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4284 /* DAC node 0x03 is giving mono output. We therefore want to
4285 make sure 0x14 (front speaker) and 0x15 (headphones) use the
4286 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
4287 hda_nid_t conn1
[2] = { 0x0c };
4288 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
4289 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
4293 /* for hda_fixup_thinkpad_acpi() */
4294 #include "thinkpad_helper.c"
4297 ALC269_FIXUP_SONY_VAIO
,
4298 ALC275_FIXUP_SONY_VAIO_GPIO2
,
4299 ALC269_FIXUP_DELL_M101Z
,
4300 ALC269_FIXUP_SKU_IGNORE
,
4301 ALC269_FIXUP_ASUS_G73JW
,
4302 ALC269_FIXUP_LENOVO_EAPD
,
4303 ALC275_FIXUP_SONY_HWEQ
,
4304 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
4306 ALC269_FIXUP_PCM_44K
,
4307 ALC269_FIXUP_STEREO_DMIC
,
4308 ALC269_FIXUP_HEADSET_MIC
,
4309 ALC269_FIXUP_QUANTA_MUTE
,
4310 ALC269_FIXUP_LIFEBOOK
,
4311 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
4314 ALC269VB_FIXUP_AMIC
,
4315 ALC269VB_FIXUP_DMIC
,
4316 ALC269_FIXUP_HP_MUTE_LED
,
4317 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
4318 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
4319 ALC269_FIXUP_HP_GPIO_LED
,
4320 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
4321 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
4322 ALC269_FIXUP_INV_DMIC
,
4323 ALC269_FIXUP_LENOVO_DOCK
,
4324 ALC269_FIXUP_NO_SHUTUP
,
4325 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
4326 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
4327 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
4328 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
4329 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
4330 ALC269_FIXUP_HEADSET_MODE
,
4331 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
4332 ALC269_FIXUP_ASUS_X101_FUNC
,
4333 ALC269_FIXUP_ASUS_X101_VERB
,
4334 ALC269_FIXUP_ASUS_X101
,
4335 ALC271_FIXUP_AMIC_MIC2
,
4336 ALC271_FIXUP_HP_GATE_MIC_JACK
,
4337 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
4338 ALC269_FIXUP_ACER_AC700
,
4339 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
4340 ALC269VB_FIXUP_ASUS_ZENBOOK
,
4341 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
4342 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
4343 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
4344 ALC283_FIXUP_CHROME_BOOK
,
4345 ALC283_FIXUP_SENSE_COMBO_JACK
,
4346 ALC282_FIXUP_ASUS_TX300
,
4347 ALC283_FIXUP_INT_MIC
,
4348 ALC290_FIXUP_MONO_SPEAKERS
,
4349 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
4350 ALC290_FIXUP_SUBWOOFER
,
4351 ALC290_FIXUP_SUBWOOFER_HSJACK
,
4352 ALC269_FIXUP_THINKPAD_ACPI
,
4353 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
4354 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
4355 ALC255_FIXUP_HEADSET_MODE
,
4356 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
4357 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
4358 ALC292_FIXUP_TPT440_DOCK
,
4361 static const struct hda_fixup alc269_fixups
[] = {
4362 [ALC269_FIXUP_SONY_VAIO
] = {
4363 .type
= HDA_FIXUP_PINCTLS
,
4364 .v
.pins
= (const struct hda_pintbl
[]) {
4365 {0x19, PIN_VREFGRD
},
4369 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
4370 .type
= HDA_FIXUP_VERBS
,
4371 .v
.verbs
= (const struct hda_verb
[]) {
4372 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
4373 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
4374 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
4378 .chain_id
= ALC269_FIXUP_SONY_VAIO
4380 [ALC269_FIXUP_DELL_M101Z
] = {
4381 .type
= HDA_FIXUP_VERBS
,
4382 .v
.verbs
= (const struct hda_verb
[]) {
4383 /* Enables internal speaker */
4384 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
4385 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
4389 [ALC269_FIXUP_SKU_IGNORE
] = {
4390 .type
= HDA_FIXUP_FUNC
,
4391 .v
.func
= alc_fixup_sku_ignore
,
4393 [ALC269_FIXUP_ASUS_G73JW
] = {
4394 .type
= HDA_FIXUP_PINS
,
4395 .v
.pins
= (const struct hda_pintbl
[]) {
4396 { 0x17, 0x99130111 }, /* subwoofer */
4400 [ALC269_FIXUP_LENOVO_EAPD
] = {
4401 .type
= HDA_FIXUP_VERBS
,
4402 .v
.verbs
= (const struct hda_verb
[]) {
4403 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
4407 [ALC275_FIXUP_SONY_HWEQ
] = {
4408 .type
= HDA_FIXUP_FUNC
,
4409 .v
.func
= alc269_fixup_hweq
,
4411 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
4413 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
4414 .type
= HDA_FIXUP_FUNC
,
4415 .v
.func
= alc_fixup_disable_aamix
,
4417 .chain_id
= ALC269_FIXUP_SONY_VAIO
4419 [ALC271_FIXUP_DMIC
] = {
4420 .type
= HDA_FIXUP_FUNC
,
4421 .v
.func
= alc271_fixup_dmic
,
4423 [ALC269_FIXUP_PCM_44K
] = {
4424 .type
= HDA_FIXUP_FUNC
,
4425 .v
.func
= alc269_fixup_pcm_44k
,
4427 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
4429 [ALC269_FIXUP_STEREO_DMIC
] = {
4430 .type
= HDA_FIXUP_FUNC
,
4431 .v
.func
= alc269_fixup_stereo_dmic
,
4433 [ALC269_FIXUP_HEADSET_MIC
] = {
4434 .type
= HDA_FIXUP_FUNC
,
4435 .v
.func
= alc269_fixup_headset_mic
,
4437 [ALC269_FIXUP_QUANTA_MUTE
] = {
4438 .type
= HDA_FIXUP_FUNC
,
4439 .v
.func
= alc269_fixup_quanta_mute
,
4441 [ALC269_FIXUP_LIFEBOOK
] = {
4442 .type
= HDA_FIXUP_PINS
,
4443 .v
.pins
= (const struct hda_pintbl
[]) {
4444 { 0x1a, 0x2101103f }, /* dock line-out */
4445 { 0x1b, 0x23a11040 }, /* dock mic-in */
4449 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
4451 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
4452 .type
= HDA_FIXUP_PINS
,
4453 .v
.pins
= (const struct hda_pintbl
[]) {
4454 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
4458 [ALC269_FIXUP_AMIC
] = {
4459 .type
= HDA_FIXUP_PINS
,
4460 .v
.pins
= (const struct hda_pintbl
[]) {
4461 { 0x14, 0x99130110 }, /* speaker */
4462 { 0x15, 0x0121401f }, /* HP out */
4463 { 0x18, 0x01a19c20 }, /* mic */
4464 { 0x19, 0x99a3092f }, /* int-mic */
4468 [ALC269_FIXUP_DMIC
] = {
4469 .type
= HDA_FIXUP_PINS
,
4470 .v
.pins
= (const struct hda_pintbl
[]) {
4471 { 0x12, 0x99a3092f }, /* int-mic */
4472 { 0x14, 0x99130110 }, /* speaker */
4473 { 0x15, 0x0121401f }, /* HP out */
4474 { 0x18, 0x01a19c20 }, /* mic */
4478 [ALC269VB_FIXUP_AMIC
] = {
4479 .type
= HDA_FIXUP_PINS
,
4480 .v
.pins
= (const struct hda_pintbl
[]) {
4481 { 0x14, 0x99130110 }, /* speaker */
4482 { 0x18, 0x01a19c20 }, /* mic */
4483 { 0x19, 0x99a3092f }, /* int-mic */
4484 { 0x21, 0x0121401f }, /* HP out */
4488 [ALC269VB_FIXUP_DMIC
] = {
4489 .type
= HDA_FIXUP_PINS
,
4490 .v
.pins
= (const struct hda_pintbl
[]) {
4491 { 0x12, 0x99a3092f }, /* int-mic */
4492 { 0x14, 0x99130110 }, /* speaker */
4493 { 0x18, 0x01a19c20 }, /* mic */
4494 { 0x21, 0x0121401f }, /* HP out */
4498 [ALC269_FIXUP_HP_MUTE_LED
] = {
4499 .type
= HDA_FIXUP_FUNC
,
4500 .v
.func
= alc269_fixup_hp_mute_led
,
4502 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
4503 .type
= HDA_FIXUP_FUNC
,
4504 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
4506 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
4507 .type
= HDA_FIXUP_FUNC
,
4508 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
4510 [ALC269_FIXUP_HP_GPIO_LED
] = {
4511 .type
= HDA_FIXUP_FUNC
,
4512 .v
.func
= alc269_fixup_hp_gpio_led
,
4514 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
4515 .type
= HDA_FIXUP_FUNC
,
4516 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
4518 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
4519 .type
= HDA_FIXUP_FUNC
,
4520 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
4522 [ALC269_FIXUP_INV_DMIC
] = {
4523 .type
= HDA_FIXUP_FUNC
,
4524 .v
.func
= alc_fixup_inv_dmic_0x12
,
4526 [ALC269_FIXUP_NO_SHUTUP
] = {
4527 .type
= HDA_FIXUP_FUNC
,
4528 .v
.func
= alc_fixup_no_shutup
,
4530 [ALC269_FIXUP_LENOVO_DOCK
] = {
4531 .type
= HDA_FIXUP_PINS
,
4532 .v
.pins
= (const struct hda_pintbl
[]) {
4533 { 0x19, 0x23a11040 }, /* dock mic */
4534 { 0x1b, 0x2121103f }, /* dock headphone */
4538 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
4540 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
4541 .type
= HDA_FIXUP_FUNC
,
4542 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
4544 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
4546 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
4547 .type
= HDA_FIXUP_PINS
,
4548 .v
.pins
= (const struct hda_pintbl
[]) {
4549 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4550 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
4554 .chain_id
= ALC269_FIXUP_HEADSET_MODE
4556 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
4557 .type
= HDA_FIXUP_PINS
,
4558 .v
.pins
= (const struct hda_pintbl
[]) {
4559 { 0x16, 0x21014020 }, /* dock line out */
4560 { 0x19, 0x21a19030 }, /* dock mic */
4561 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4565 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
4567 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
4568 .type
= HDA_FIXUP_PINS
,
4569 .v
.pins
= (const struct hda_pintbl
[]) {
4570 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4574 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
4576 [ALC269_FIXUP_HEADSET_MODE
] = {
4577 .type
= HDA_FIXUP_FUNC
,
4578 .v
.func
= alc_fixup_headset_mode
,
4580 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
4581 .type
= HDA_FIXUP_FUNC
,
4582 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
4584 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
4585 .type
= HDA_FIXUP_PINS
,
4586 .v
.pins
= (const struct hda_pintbl
[]) {
4587 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4591 .chain_id
= ALC269_FIXUP_HEADSET_MIC
4593 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
4594 .type
= HDA_FIXUP_FUNC
,
4595 .v
.func
= alc269_fixup_x101_headset_mic
,
4597 [ALC269_FIXUP_ASUS_X101_VERB
] = {
4598 .type
= HDA_FIXUP_VERBS
,
4599 .v
.verbs
= (const struct hda_verb
[]) {
4600 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
4601 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
4602 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
4606 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
4608 [ALC269_FIXUP_ASUS_X101
] = {
4609 .type
= HDA_FIXUP_PINS
,
4610 .v
.pins
= (const struct hda_pintbl
[]) {
4611 { 0x18, 0x04a1182c }, /* Headset mic */
4615 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
4617 [ALC271_FIXUP_AMIC_MIC2
] = {
4618 .type
= HDA_FIXUP_PINS
,
4619 .v
.pins
= (const struct hda_pintbl
[]) {
4620 { 0x14, 0x99130110 }, /* speaker */
4621 { 0x19, 0x01a19c20 }, /* mic */
4622 { 0x1b, 0x99a7012f }, /* int-mic */
4623 { 0x21, 0x0121401f }, /* HP out */
4627 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
4628 .type
= HDA_FIXUP_FUNC
,
4629 .v
.func
= alc271_hp_gate_mic_jack
,
4631 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
4633 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
4634 .type
= HDA_FIXUP_FUNC
,
4635 .v
.func
= alc269_fixup_limit_int_mic_boost
,
4637 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
4639 [ALC269_FIXUP_ACER_AC700
] = {
4640 .type
= HDA_FIXUP_PINS
,
4641 .v
.pins
= (const struct hda_pintbl
[]) {
4642 { 0x12, 0x99a3092f }, /* int-mic */
4643 { 0x14, 0x99130110 }, /* speaker */
4644 { 0x18, 0x03a11c20 }, /* mic */
4645 { 0x1e, 0x0346101e }, /* SPDIF1 */
4646 { 0x21, 0x0321101f }, /* HP out */
4650 .chain_id
= ALC271_FIXUP_DMIC
,
4652 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
4653 .type
= HDA_FIXUP_FUNC
,
4654 .v
.func
= alc269_fixup_limit_int_mic_boost
,
4656 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
4658 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
4659 .type
= HDA_FIXUP_FUNC
,
4660 .v
.func
= alc269_fixup_limit_int_mic_boost
,
4662 .chain_id
= ALC269VB_FIXUP_DMIC
,
4664 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
4665 .type
= HDA_FIXUP_VERBS
,
4666 .v
.verbs
= (const struct hda_verb
[]) {
4667 /* class-D output amp +5dB */
4668 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
4669 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
4673 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
4675 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
4676 .type
= HDA_FIXUP_FUNC
,
4677 .v
.func
= alc269_fixup_limit_int_mic_boost
,
4679 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
4681 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
4682 .type
= HDA_FIXUP_PINS
,
4683 .v
.pins
= (const struct hda_pintbl
[]) {
4684 { 0x12, 0x99a3092f }, /* int-mic */
4685 { 0x18, 0x03a11d20 }, /* mic */
4686 { 0x19, 0x411111f0 }, /* Unused bogus pin */
4690 [ALC283_FIXUP_CHROME_BOOK
] = {
4691 .type
= HDA_FIXUP_FUNC
,
4692 .v
.func
= alc283_fixup_chromebook
,
4694 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
4695 .type
= HDA_FIXUP_FUNC
,
4696 .v
.func
= alc283_fixup_sense_combo_jack
,
4698 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
4700 [ALC282_FIXUP_ASUS_TX300
] = {
4701 .type
= HDA_FIXUP_FUNC
,
4702 .v
.func
= alc282_fixup_asus_tx300
,
4704 [ALC283_FIXUP_INT_MIC
] = {
4705 .type
= HDA_FIXUP_VERBS
,
4706 .v
.verbs
= (const struct hda_verb
[]) {
4707 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
4708 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
4712 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
4714 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
4715 .type
= HDA_FIXUP_PINS
,
4716 .v
.pins
= (const struct hda_pintbl
[]) {
4717 { 0x17, 0x90170112 }, /* subwoofer */
4721 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
4723 [ALC290_FIXUP_SUBWOOFER
] = {
4724 .type
= HDA_FIXUP_PINS
,
4725 .v
.pins
= (const struct hda_pintbl
[]) {
4726 { 0x17, 0x90170112 }, /* subwoofer */
4730 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
4732 [ALC290_FIXUP_MONO_SPEAKERS
] = {
4733 .type
= HDA_FIXUP_FUNC
,
4734 .v
.func
= alc290_fixup_mono_speakers
,
4736 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
4737 .type
= HDA_FIXUP_FUNC
,
4738 .v
.func
= alc290_fixup_mono_speakers
,
4740 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
4742 [ALC269_FIXUP_THINKPAD_ACPI
] = {
4743 .type
= HDA_FIXUP_FUNC
,
4744 .v
.func
= hda_fixup_thinkpad_acpi
,
4746 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
4747 .type
= HDA_FIXUP_PINS
,
4748 .v
.pins
= (const struct hda_pintbl
[]) {
4749 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4750 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
4754 .chain_id
= ALC255_FIXUP_HEADSET_MODE
4756 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
4757 .type
= HDA_FIXUP_PINS
,
4758 .v
.pins
= (const struct hda_pintbl
[]) {
4759 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4763 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
4765 [ALC255_FIXUP_HEADSET_MODE
] = {
4766 .type
= HDA_FIXUP_FUNC
,
4767 .v
.func
= alc_fixup_headset_mode_alc255
,
4769 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
4770 .type
= HDA_FIXUP_FUNC
,
4771 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
4773 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
4774 .type
= HDA_FIXUP_PINS
,
4775 .v
.pins
= (const struct hda_pintbl
[]) {
4776 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
4777 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
4781 .chain_id
= ALC269_FIXUP_HEADSET_MODE
4783 [ALC292_FIXUP_TPT440_DOCK
] = {
4784 .type
= HDA_FIXUP_PINS
,
4785 .v
.pins
= (const struct hda_pintbl
[]) {
4786 { 0x16, 0x21211010 }, /* dock headphone */
4787 { 0x19, 0x21a11010 }, /* dock mic */
4791 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
4795 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
4796 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
4797 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
4798 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
4799 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
4800 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
4801 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
4802 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
4803 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
4804 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
4805 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4806 SND_PCI_QUIRK(0x1028, 0x05be, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4807 SND_PCI_QUIRK(0x1028, 0x05c4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4808 SND_PCI_QUIRK(0x1028, 0x05c5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4809 SND_PCI_QUIRK(0x1028, 0x05c6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4810 SND_PCI_QUIRK(0x1028, 0x05c7, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4811 SND_PCI_QUIRK(0x1028, 0x05c8, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4812 SND_PCI_QUIRK(0x1028, 0x05c9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4813 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4814 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4815 SND_PCI_QUIRK(0x1028, 0x05cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4816 SND_PCI_QUIRK(0x1028, 0x05cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4817 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
4818 SND_PCI_QUIRK(0x1028, 0x05de, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4819 SND_PCI_QUIRK(0x1028, 0x05e0, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4820 SND_PCI_QUIRK(0x1028, 0x05e9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4821 SND_PCI_QUIRK(0x1028, 0x05ea, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4822 SND_PCI_QUIRK(0x1028, 0x05eb, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4823 SND_PCI_QUIRK(0x1028, 0x05ec, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4824 SND_PCI_QUIRK(0x1028, 0x05ed, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4825 SND_PCI_QUIRK(0x1028, 0x05ee, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4826 SND_PCI_QUIRK(0x1028, 0x05f3, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4827 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4828 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4829 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4830 SND_PCI_QUIRK(0x1028, 0x05f8, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4831 SND_PCI_QUIRK(0x1028, 0x05f9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4832 SND_PCI_QUIRK(0x1028, 0x05fb, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4833 SND_PCI_QUIRK(0x1028, 0x0606, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4834 SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4835 SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4836 SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4837 SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
4838 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
4839 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
4840 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
4841 SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
4842 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
4843 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
4844 SND_PCI_QUIRK(0x1028, 0x0668, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
),
4845 SND_PCI_QUIRK(0x1028, 0x0669, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
),
4846 SND_PCI_QUIRK(0x1028, 0x0684, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4847 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4848 SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
),
4849 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
4850 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
4851 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
4852 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
4853 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4854 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4855 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
4857 SND_PCI_QUIRK(0x103c, 0x21f8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4858 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4859 SND_PCI_QUIRK(0x103c, 0x220d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4860 SND_PCI_QUIRK(0x103c, 0x220e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4861 SND_PCI_QUIRK(0x103c, 0x220f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4862 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4863 SND_PCI_QUIRK(0x103c, 0x2211, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4864 SND_PCI_QUIRK(0x103c, 0x2212, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4865 SND_PCI_QUIRK(0x103c, 0x2213, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4866 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4867 SND_PCI_QUIRK(0x103c, 0x2234, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4868 SND_PCI_QUIRK(0x103c, 0x2235, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4869 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4870 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4871 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4872 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4873 SND_PCI_QUIRK(0x103c, 0x2246, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4874 SND_PCI_QUIRK(0x103c, 0x2247, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4875 SND_PCI_QUIRK(0x103c, 0x2248, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4876 SND_PCI_QUIRK(0x103c, 0x2249, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4877 SND_PCI_QUIRK(0x103c, 0x224a, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4878 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4879 SND_PCI_QUIRK(0x103c, 0x224c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4880 SND_PCI_QUIRK(0x103c, 0x224d, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
4881 SND_PCI_QUIRK(0x103c, 0x2266, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4882 SND_PCI_QUIRK(0x103c, 0x2267, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4883 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4884 SND_PCI_QUIRK(0x103c, 0x2269, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4885 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4886 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4887 SND_PCI_QUIRK(0x103c, 0x226c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4888 SND_PCI_QUIRK(0x103c, 0x226d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4889 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4890 SND_PCI_QUIRK(0x103c, 0x226f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4891 SND_PCI_QUIRK(0x103c, 0x227a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4892 SND_PCI_QUIRK(0x103c, 0x227b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4893 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4894 SND_PCI_QUIRK(0x103c, 0x22a0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4895 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4896 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4897 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4898 SND_PCI_QUIRK(0x103c, 0x22c0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4899 SND_PCI_QUIRK(0x103c, 0x22c1, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4900 SND_PCI_QUIRK(0x103c, 0x22c2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4901 SND_PCI_QUIRK(0x103c, 0x22cd, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4902 SND_PCI_QUIRK(0x103c, 0x22ce, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4903 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4904 SND_PCI_QUIRK(0x103c, 0x22d0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4905 SND_PCI_QUIRK(0x103c, 0x22da, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4906 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4907 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4908 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4909 SND_PCI_QUIRK(0x103c, 0x8004, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4911 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4912 SND_PCI_QUIRK(0x103c, 0x221c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4913 SND_PCI_QUIRK(0x103c, 0x221d, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4914 SND_PCI_QUIRK(0x103c, 0x2220, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4915 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4916 SND_PCI_QUIRK(0x103c, 0x2222, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4917 SND_PCI_QUIRK(0x103c, 0x2223, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4918 SND_PCI_QUIRK(0x103c, 0x2224, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4919 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4920 SND_PCI_QUIRK(0x103c, 0x2246, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4921 SND_PCI_QUIRK(0x103c, 0x2247, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4922 SND_PCI_QUIRK(0x103c, 0x2248, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4923 SND_PCI_QUIRK(0x103c, 0x2249, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4924 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4925 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4926 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4927 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4928 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4929 SND_PCI_QUIRK(0x103c, 0x2258, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4930 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4931 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4932 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4933 SND_PCI_QUIRK(0x103c, 0x2261, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4934 SND_PCI_QUIRK(0x103c, 0x2262, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4935 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4936 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4937 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4938 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4939 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4940 SND_PCI_QUIRK(0x103c, 0x2277, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4941 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
4942 SND_PCI_QUIRK(0x103c, 0x227d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4943 SND_PCI_QUIRK(0x103c, 0x227e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4944 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4945 SND_PCI_QUIRK(0x103c, 0x2280, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4946 SND_PCI_QUIRK(0x103c, 0x2281, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4947 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4948 SND_PCI_QUIRK(0x103c, 0x2289, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4949 SND_PCI_QUIRK(0x103c, 0x228a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4950 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4951 SND_PCI_QUIRK(0x103c, 0x228c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4952 SND_PCI_QUIRK(0x103c, 0x228d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4953 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4954 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4955 SND_PCI_QUIRK(0x103c, 0x22c6, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4956 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4957 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4958 SND_PCI_QUIRK(0x103c, 0x22c3, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4959 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4960 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4961 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4962 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4963 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
4964 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
4965 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
4966 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
4967 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
4968 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
4969 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
4970 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
4971 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
4972 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
4973 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
4974 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
4975 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
4976 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
4977 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
4978 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
4979 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
4980 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
4981 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
4982 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
4983 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
4984 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
4985 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
4986 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
4987 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
4988 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
4989 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
4990 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
4991 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
4992 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
4993 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK
),
4994 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
4995 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
4996 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
4997 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
4998 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
4999 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK
),
5000 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
5001 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
5002 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5003 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5004 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5005 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP
),
5006 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5007 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
5008 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5009 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
5010 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
5011 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
5012 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
5013 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
5016 /* Below is a quirk table taken from the old code.
5017 * Basically the device should work as is without the fixup table.
5018 * If BIOS doesn't give a proper info, enable the corresponding
5021 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
5023 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
5024 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
5025 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
5026 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
5027 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
5028 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
5029 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
5030 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
5031 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
5032 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
5033 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
5034 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
5035 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
5036 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
5037 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
5038 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
5039 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
5040 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
5041 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
5042 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
5043 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
5044 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
5045 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
5046 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
5047 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
5048 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
5049 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
5050 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
5051 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
5052 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
5053 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
5054 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
5055 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
5056 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
5057 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
5058 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
5059 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
5060 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
5061 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
5066 static const struct hda_model_fixup alc269_fixup_models
[] = {
5067 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
5068 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
5069 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
5070 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
5071 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
5072 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
5073 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
5074 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
5075 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
5076 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
5077 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
5078 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
5079 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
5083 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
5084 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5094 {0x21, 0x02211020}),
5095 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5105 {0x21, 0x02211030}),
5106 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5116 {0x21, 0x0321102f}),
5117 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5127 {0x21, 0x02211040}),
5128 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5138 {0x21, 0x02211050}),
5139 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5149 {0x21, 0x02211030}),
5150 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5160 {0x21, 0x02211040}),
5161 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5171 {0x21, 0x0321101f}),
5172 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5182 {0x21, 0x02211030}),
5183 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5194 {0x1e, 0x411111f0}),
5195 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5206 {0x1e, 0x411111f0}),
5207 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5218 {0x1e, 0x411111f0}),
5222 static void alc269_fill_coef(struct hda_codec
*codec
)
5224 struct alc_spec
*spec
= codec
->spec
;
5227 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
5230 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
5231 alc_write_coef_idx(codec
, 0xf, 0x960b);
5232 alc_write_coef_idx(codec
, 0xe, 0x8817);
5235 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
5236 alc_write_coef_idx(codec
, 0xf, 0x960b);
5237 alc_write_coef_idx(codec
, 0xe, 0x8814);
5240 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
5241 val
= alc_read_coef_idx(codec
, 0x04);
5242 /* Power up output pin */
5243 alc_write_coef_idx(codec
, 0x04, val
| (1<<11));
5246 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
5247 val
= alc_read_coef_idx(codec
, 0xd);
5248 if ((val
& 0x0c00) >> 10 != 0x1) {
5249 /* Capless ramp up clock control */
5250 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
5252 val
= alc_read_coef_idx(codec
, 0x17);
5253 if ((val
& 0x01c0) >> 6 != 0x4) {
5254 /* Class D power on reset */
5255 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
5259 val
= alc_read_coef_idx(codec
, 0xd); /* Class D */
5260 alc_write_coef_idx(codec
, 0xd, val
| (1<<14));
5262 val
= alc_read_coef_idx(codec
, 0x4); /* HP */
5263 alc_write_coef_idx(codec
, 0x4, val
| (1<<11));
5268 static int patch_alc269(struct hda_codec
*codec
)
5270 struct alc_spec
*spec
;
5273 err
= alc_alloc_spec(codec
, 0x0b);
5278 spec
->gen
.shared_mic_vref_pin
= 0x18;
5280 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
5281 alc269_fixup_tbl
, alc269_fixups
);
5282 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
);
5283 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
5285 alc_auto_parse_customize_define(codec
);
5287 if (has_cdefine_beep(codec
))
5288 spec
->gen
.beep_nid
= 0x01;
5290 switch (codec
->vendor_id
) {
5292 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
5293 switch (alc_get_coef0(codec
) & 0x00f0) {
5295 if (codec
->bus
->pci
&&
5296 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
5297 spec
->cdefine
.platform_type
== 1)
5298 err
= alc_codec_rename(codec
, "ALC271X");
5299 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
5302 if (codec
->bus
->pci
&&
5303 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
5304 codec
->bus
->pci
->subsystem_device
== 0x21f3)
5305 err
= alc_codec_rename(codec
, "ALC3202");
5306 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
5309 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
5312 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
5316 spec
->init_hook
= alc269_fill_coef
;
5317 alc269_fill_coef(codec
);
5322 spec
->codec_variant
= ALC269_TYPE_ALC280
;
5325 spec
->codec_variant
= ALC269_TYPE_ALC282
;
5326 spec
->shutup
= alc282_shutup
;
5327 spec
->init_hook
= alc282_init
;
5331 spec
->codec_variant
= ALC269_TYPE_ALC283
;
5332 spec
->shutup
= alc283_shutup
;
5333 spec
->init_hook
= alc283_init
;
5337 spec
->codec_variant
= ALC269_TYPE_ALC284
;
5341 spec
->codec_variant
= ALC269_TYPE_ALC285
;
5345 spec
->codec_variant
= ALC269_TYPE_ALC286
;
5348 spec
->codec_variant
= ALC269_TYPE_ALC255
;
5352 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
5353 spec
->has_alc5505_dsp
= 1;
5354 spec
->init_hook
= alc5505_dsp_init
;
5357 /* automatic parse from the BIOS config */
5358 err
= alc269_parse_auto_config(codec
);
5362 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
5363 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
5365 codec
->patch_ops
= alc_patch_ops
;
5367 codec
->patch_ops
.suspend
= alc269_suspend
;
5368 codec
->patch_ops
.resume
= alc269_resume
;
5371 spec
->shutup
= alc269_shutup
;
5373 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
5386 static int alc861_parse_auto_config(struct hda_codec
*codec
)
5388 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
5389 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
5390 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
5393 /* Pin config fixes */
5395 ALC861_FIXUP_FSC_AMILO_PI1505
,
5396 ALC861_FIXUP_AMP_VREF_0F
,
5397 ALC861_FIXUP_NO_JACK_DETECT
,
5398 ALC861_FIXUP_ASUS_A6RP
,
5399 ALC660_FIXUP_ASUS_W7J
,
5402 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
5403 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
5404 const struct hda_fixup
*fix
, int action
)
5406 struct alc_spec
*spec
= codec
->spec
;
5409 if (action
!= HDA_FIXUP_ACT_INIT
)
5411 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
5412 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
5413 val
|= AC_PINCTL_IN_EN
;
5414 val
|= AC_PINCTL_VREF_50
;
5415 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
5416 spec
->gen
.keep_vref_in_automute
= 1;
5419 /* suppress the jack-detection */
5420 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
5421 const struct hda_fixup
*fix
, int action
)
5423 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
5424 codec
->no_jack_detect
= 1;
5427 static const struct hda_fixup alc861_fixups
[] = {
5428 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
5429 .type
= HDA_FIXUP_PINS
,
5430 .v
.pins
= (const struct hda_pintbl
[]) {
5431 { 0x0b, 0x0221101f }, /* HP */
5432 { 0x0f, 0x90170310 }, /* speaker */
5436 [ALC861_FIXUP_AMP_VREF_0F
] = {
5437 .type
= HDA_FIXUP_FUNC
,
5438 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
5440 [ALC861_FIXUP_NO_JACK_DETECT
] = {
5441 .type
= HDA_FIXUP_FUNC
,
5442 .v
.func
= alc_fixup_no_jack_detect
,
5444 [ALC861_FIXUP_ASUS_A6RP
] = {
5445 .type
= HDA_FIXUP_FUNC
,
5446 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
5448 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
5450 [ALC660_FIXUP_ASUS_W7J
] = {
5451 .type
= HDA_FIXUP_VERBS
,
5452 .v
.verbs
= (const struct hda_verb
[]) {
5453 /* ASUS W7J needs a magic pin setup on unused NID 0x10
5454 * for enabling outputs
5456 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
5462 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
5463 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
5464 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
5465 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
5466 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
5467 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
5468 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
5469 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
5470 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
5476 static int patch_alc861(struct hda_codec
*codec
)
5478 struct alc_spec
*spec
;
5481 err
= alc_alloc_spec(codec
, 0x15);
5486 spec
->gen
.beep_nid
= 0x23;
5488 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
5489 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
5491 /* automatic parse from the BIOS config */
5492 err
= alc861_parse_auto_config(codec
);
5496 if (!spec
->gen
.no_analog
)
5497 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
5499 codec
->patch_ops
= alc_patch_ops
;
5501 spec
->power_hook
= alc_power_eapd
;
5504 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
5518 * In addition, an independent DAC
5520 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
5522 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
5523 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
5524 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
5528 ALC660VD_FIX_ASUS_GPIO1
,
5529 ALC861VD_FIX_DALLAS
,
5532 /* exclude VREF80 */
5533 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
5534 const struct hda_fixup
*fix
, int action
)
5536 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5537 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
5538 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
5542 static const struct hda_fixup alc861vd_fixups
[] = {
5543 [ALC660VD_FIX_ASUS_GPIO1
] = {
5544 .type
= HDA_FIXUP_VERBS
,
5545 .v
.verbs
= (const struct hda_verb
[]) {
5547 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
5548 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
5549 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
5553 [ALC861VD_FIX_DALLAS
] = {
5554 .type
= HDA_FIXUP_FUNC
,
5555 .v
.func
= alc861vd_fixup_dallas
,
5559 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
5560 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
5561 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
5562 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
5568 static int patch_alc861vd(struct hda_codec
*codec
)
5570 struct alc_spec
*spec
;
5573 err
= alc_alloc_spec(codec
, 0x0b);
5578 spec
->gen
.beep_nid
= 0x23;
5580 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
5581 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
5583 /* automatic parse from the BIOS config */
5584 err
= alc861vd_parse_auto_config(codec
);
5588 if (!spec
->gen
.no_analog
)
5589 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
5591 codec
->patch_ops
= alc_patch_ops
;
5593 spec
->shutup
= alc_eapd_shutup
;
5595 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
5607 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
5608 * configuration. Each pin widget can choose any input DACs and a mixer.
5609 * Each ADC is connected from a mixer of all inputs. This makes possible
5610 * 6-channel independent captures.
5612 * In addition, an independent DAC for the multi-playback (not used in this
5617 * BIOS auto configuration
5620 static int alc662_parse_auto_config(struct hda_codec
*codec
)
5622 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
5623 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
5624 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
5625 const hda_nid_t
*ssids
;
5627 if (codec
->vendor_id
== 0x10ec0272 || codec
->vendor_id
== 0x10ec0663 ||
5628 codec
->vendor_id
== 0x10ec0665 || codec
->vendor_id
== 0x10ec0670 ||
5629 codec
->vendor_id
== 0x10ec0671)
5630 ssids
= alc663_ssids
;
5632 ssids
= alc662_ssids
;
5633 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
5636 static void alc272_fixup_mario(struct hda_codec
*codec
,
5637 const struct hda_fixup
*fix
, int action
)
5639 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5641 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
5642 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
5643 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
5644 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
5645 (0 << AC_AMPCAP_MUTE_SHIFT
)))
5646 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
5649 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
5651 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
5653 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
5654 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
5658 /* override the 2.1 chmap */
5659 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
5660 const struct hda_fixup
*fix
, int action
)
5662 if (action
== HDA_FIXUP_ACT_BUILD
) {
5663 struct alc_spec
*spec
= codec
->spec
;
5664 spec
->gen
.pcm_rec
[0].stream
[0].chmap
= asus_pcm_2_1_chmaps
;
5668 /* turn on/off mute LED per vmaster hook */
5669 static void alc662_led_gpio1_mute_hook(void *private_data
, int enabled
)
5671 struct hda_codec
*codec
= private_data
;
5672 struct alc_spec
*spec
= codec
->spec
;
5673 unsigned int oldval
= spec
->gpio_led
;
5676 spec
->gpio_led
&= ~0x01;
5678 spec
->gpio_led
|= 0x01;
5679 if (spec
->gpio_led
!= oldval
)
5680 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
5684 /* avoid D3 for keeping GPIO up */
5685 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
5687 unsigned int power_state
)
5689 struct alc_spec
*spec
= codec
->spec
;
5690 if (nid
== codec
->afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_led
)
5695 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
5696 const struct hda_fixup
*fix
, int action
)
5698 struct alc_spec
*spec
= codec
->spec
;
5699 static const struct hda_verb gpio_init
[] = {
5700 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x01 },
5701 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01 },
5705 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5706 spec
->gen
.vmaster_mute
.hook
= alc662_led_gpio1_mute_hook
;
5708 snd_hda_add_verbs(codec
, gpio_init
);
5709 codec
->power_filter
= gpio_led_power_filter
;
5714 ALC662_FIXUP_ASPIRE
,
5715 ALC662_FIXUP_LED_GPIO1
,
5716 ALC662_FIXUP_IDEAPAD
,
5718 ALC662_FIXUP_CZC_P10T
,
5719 ALC662_FIXUP_SKU_IGNORE
,
5720 ALC662_FIXUP_HP_RP5800
,
5721 ALC662_FIXUP_ASUS_MODE1
,
5722 ALC662_FIXUP_ASUS_MODE2
,
5723 ALC662_FIXUP_ASUS_MODE3
,
5724 ALC662_FIXUP_ASUS_MODE4
,
5725 ALC662_FIXUP_ASUS_MODE5
,
5726 ALC662_FIXUP_ASUS_MODE6
,
5727 ALC662_FIXUP_ASUS_MODE7
,
5728 ALC662_FIXUP_ASUS_MODE8
,
5729 ALC662_FIXUP_NO_JACK_DETECT
,
5730 ALC662_FIXUP_ZOTAC_Z68
,
5731 ALC662_FIXUP_INV_DMIC
,
5732 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
5733 ALC668_FIXUP_HEADSET_MODE
,
5734 ALC662_FIXUP_BASS_MODE4_CHMAP
,
5735 ALC662_FIXUP_BASS_16
,
5736 ALC662_FIXUP_BASS_1A
,
5737 ALC662_FIXUP_BASS_CHMAP
,
5738 ALC668_FIXUP_AUTO_MUTE
,
5739 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
5740 ALC668_FIXUP_DELL_XPS13
,
5743 static const struct hda_fixup alc662_fixups
[] = {
5744 [ALC662_FIXUP_ASPIRE
] = {
5745 .type
= HDA_FIXUP_PINS
,
5746 .v
.pins
= (const struct hda_pintbl
[]) {
5747 { 0x15, 0x99130112 }, /* subwoofer */
5751 [ALC662_FIXUP_LED_GPIO1
] = {
5752 .type
= HDA_FIXUP_FUNC
,
5753 .v
.func
= alc662_fixup_led_gpio1
,
5755 [ALC662_FIXUP_IDEAPAD
] = {
5756 .type
= HDA_FIXUP_PINS
,
5757 .v
.pins
= (const struct hda_pintbl
[]) {
5758 { 0x17, 0x99130112 }, /* subwoofer */
5762 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
5764 [ALC272_FIXUP_MARIO
] = {
5765 .type
= HDA_FIXUP_FUNC
,
5766 .v
.func
= alc272_fixup_mario
,
5768 [ALC662_FIXUP_CZC_P10T
] = {
5769 .type
= HDA_FIXUP_VERBS
,
5770 .v
.verbs
= (const struct hda_verb
[]) {
5771 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
5775 [ALC662_FIXUP_SKU_IGNORE
] = {
5776 .type
= HDA_FIXUP_FUNC
,
5777 .v
.func
= alc_fixup_sku_ignore
,
5779 [ALC662_FIXUP_HP_RP5800
] = {
5780 .type
= HDA_FIXUP_PINS
,
5781 .v
.pins
= (const struct hda_pintbl
[]) {
5782 { 0x14, 0x0221201f }, /* HP out */
5786 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5788 [ALC662_FIXUP_ASUS_MODE1
] = {
5789 .type
= HDA_FIXUP_PINS
,
5790 .v
.pins
= (const struct hda_pintbl
[]) {
5791 { 0x14, 0x99130110 }, /* speaker */
5792 { 0x18, 0x01a19c20 }, /* mic */
5793 { 0x19, 0x99a3092f }, /* int-mic */
5794 { 0x21, 0x0121401f }, /* HP out */
5798 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5800 [ALC662_FIXUP_ASUS_MODE2
] = {
5801 .type
= HDA_FIXUP_PINS
,
5802 .v
.pins
= (const struct hda_pintbl
[]) {
5803 { 0x14, 0x99130110 }, /* speaker */
5804 { 0x18, 0x01a19820 }, /* mic */
5805 { 0x19, 0x99a3092f }, /* int-mic */
5806 { 0x1b, 0x0121401f }, /* HP out */
5810 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5812 [ALC662_FIXUP_ASUS_MODE3
] = {
5813 .type
= HDA_FIXUP_PINS
,
5814 .v
.pins
= (const struct hda_pintbl
[]) {
5815 { 0x14, 0x99130110 }, /* speaker */
5816 { 0x15, 0x0121441f }, /* HP */
5817 { 0x18, 0x01a19840 }, /* mic */
5818 { 0x19, 0x99a3094f }, /* int-mic */
5819 { 0x21, 0x01211420 }, /* HP2 */
5823 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5825 [ALC662_FIXUP_ASUS_MODE4
] = {
5826 .type
= HDA_FIXUP_PINS
,
5827 .v
.pins
= (const struct hda_pintbl
[]) {
5828 { 0x14, 0x99130110 }, /* speaker */
5829 { 0x16, 0x99130111 }, /* speaker */
5830 { 0x18, 0x01a19840 }, /* mic */
5831 { 0x19, 0x99a3094f }, /* int-mic */
5832 { 0x21, 0x0121441f }, /* HP */
5836 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5838 [ALC662_FIXUP_ASUS_MODE5
] = {
5839 .type
= HDA_FIXUP_PINS
,
5840 .v
.pins
= (const struct hda_pintbl
[]) {
5841 { 0x14, 0x99130110 }, /* speaker */
5842 { 0x15, 0x0121441f }, /* HP */
5843 { 0x16, 0x99130111 }, /* speaker */
5844 { 0x18, 0x01a19840 }, /* mic */
5845 { 0x19, 0x99a3094f }, /* int-mic */
5849 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5851 [ALC662_FIXUP_ASUS_MODE6
] = {
5852 .type
= HDA_FIXUP_PINS
,
5853 .v
.pins
= (const struct hda_pintbl
[]) {
5854 { 0x14, 0x99130110 }, /* speaker */
5855 { 0x15, 0x01211420 }, /* HP2 */
5856 { 0x18, 0x01a19840 }, /* mic */
5857 { 0x19, 0x99a3094f }, /* int-mic */
5858 { 0x1b, 0x0121441f }, /* HP */
5862 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5864 [ALC662_FIXUP_ASUS_MODE7
] = {
5865 .type
= HDA_FIXUP_PINS
,
5866 .v
.pins
= (const struct hda_pintbl
[]) {
5867 { 0x14, 0x99130110 }, /* speaker */
5868 { 0x17, 0x99130111 }, /* speaker */
5869 { 0x18, 0x01a19840 }, /* mic */
5870 { 0x19, 0x99a3094f }, /* int-mic */
5871 { 0x1b, 0x01214020 }, /* HP */
5872 { 0x21, 0x0121401f }, /* HP */
5876 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5878 [ALC662_FIXUP_ASUS_MODE8
] = {
5879 .type
= HDA_FIXUP_PINS
,
5880 .v
.pins
= (const struct hda_pintbl
[]) {
5881 { 0x14, 0x99130110 }, /* speaker */
5882 { 0x12, 0x99a30970 }, /* int-mic */
5883 { 0x15, 0x01214020 }, /* HP */
5884 { 0x17, 0x99130111 }, /* speaker */
5885 { 0x18, 0x01a19840 }, /* mic */
5886 { 0x21, 0x0121401f }, /* HP */
5890 .chain_id
= ALC662_FIXUP_SKU_IGNORE
5892 [ALC662_FIXUP_NO_JACK_DETECT
] = {
5893 .type
= HDA_FIXUP_FUNC
,
5894 .v
.func
= alc_fixup_no_jack_detect
,
5896 [ALC662_FIXUP_ZOTAC_Z68
] = {
5897 .type
= HDA_FIXUP_PINS
,
5898 .v
.pins
= (const struct hda_pintbl
[]) {
5899 { 0x1b, 0x02214020 }, /* Front HP */
5903 [ALC662_FIXUP_INV_DMIC
] = {
5904 .type
= HDA_FIXUP_FUNC
,
5905 .v
.func
= alc_fixup_inv_dmic_0x12
,
5907 [ALC668_FIXUP_DELL_XPS13
] = {
5908 .type
= HDA_FIXUP_FUNC
,
5909 .v
.func
= alc_fixup_dell_xps13
,
5911 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
5913 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
5914 .type
= HDA_FIXUP_FUNC
,
5915 .v
.func
= alc_fixup_disable_aamix
,
5917 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
5919 [ALC668_FIXUP_AUTO_MUTE
] = {
5920 .type
= HDA_FIXUP_FUNC
,
5921 .v
.func
= alc_fixup_auto_mute_via_amp
,
5923 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
5925 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
5926 .type
= HDA_FIXUP_PINS
,
5927 .v
.pins
= (const struct hda_pintbl
[]) {
5928 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
5929 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
5933 .chain_id
= ALC668_FIXUP_HEADSET_MODE
5935 [ALC668_FIXUP_HEADSET_MODE
] = {
5936 .type
= HDA_FIXUP_FUNC
,
5937 .v
.func
= alc_fixup_headset_mode_alc668
,
5939 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
5940 .type
= HDA_FIXUP_FUNC
,
5941 .v
.func
= alc_fixup_bass_chmap
,
5943 .chain_id
= ALC662_FIXUP_ASUS_MODE4
5945 [ALC662_FIXUP_BASS_16
] = {
5946 .type
= HDA_FIXUP_PINS
,
5947 .v
.pins
= (const struct hda_pintbl
[]) {
5948 {0x16, 0x80106111}, /* bass speaker */
5952 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
5954 [ALC662_FIXUP_BASS_1A
] = {
5955 .type
= HDA_FIXUP_PINS
,
5956 .v
.pins
= (const struct hda_pintbl
[]) {
5957 {0x1a, 0x80106111}, /* bass speaker */
5961 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
5963 [ALC662_FIXUP_BASS_CHMAP
] = {
5964 .type
= HDA_FIXUP_FUNC
,
5965 .v
.func
= alc_fixup_bass_chmap
,
5969 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
5970 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
5971 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
5972 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
5973 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
5974 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
5975 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
5976 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
5977 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
5978 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
5979 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
5980 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
5981 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
5982 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
5983 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
5984 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
5985 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A
),
5986 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
5987 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
5988 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
5989 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
5990 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
5991 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
5992 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
5993 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
5994 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
5995 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
5996 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
5999 /* Below is a quirk table taken from the old code.
6000 * Basically the device should work as is without the fixup table.
6001 * If BIOS doesn't give a proper info, enable the corresponding
6004 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
6005 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
6006 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
6007 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
6008 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
6009 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6010 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
6011 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
6012 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
6013 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6014 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
6015 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
6016 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
6017 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
6018 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
6019 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6020 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
6021 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
6022 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6023 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
6024 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
6025 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6026 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
6027 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
6028 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
6029 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6030 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
6031 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
6032 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6033 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
6034 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6035 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6036 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
6037 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
6038 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
6039 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
6040 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
6041 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
6042 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
6043 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
6044 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
6045 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
6046 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
6047 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
6048 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
6049 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
6050 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
6051 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
6052 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
6053 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
6058 static const struct hda_model_fixup alc662_fixup_models
[] = {
6059 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
6060 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
6061 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
6062 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
6063 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
6064 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
6065 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
6066 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
6067 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
6068 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
6069 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
6073 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
6074 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
6085 {0x1f, 0x411111f0}),
6086 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
6097 {0x1f, 0x411111f0}),
6098 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
6109 {0x1f, 0x411111f0}),
6110 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
6121 {0x1f, 0x411111f0}),
6122 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
6133 {0x1f, 0x411111f0}),
6137 static void alc662_fill_coef(struct hda_codec
*codec
)
6141 coef
= alc_get_coef0(codec
);
6143 switch (codec
->vendor_id
) {
6145 if ((coef
& 0x00f0) == 0x0030) {
6146 val
= alc_read_coef_idx(codec
, 0x4); /* EAPD Ctrl */
6147 alc_write_coef_idx(codec
, 0x4, val
& ~(1<<10));
6157 val
= alc_read_coef_idx(codec
, 0xd); /* EAPD Ctrl */
6158 alc_write_coef_idx(codec
, 0xd, val
| (1<<14));
6165 static int patch_alc662(struct hda_codec
*codec
)
6167 struct alc_spec
*spec
;
6170 err
= alc_alloc_spec(codec
, 0x0b);
6176 /* handle multiple HPs as is */
6177 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
6179 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
6181 spec
->init_hook
= alc662_fill_coef
;
6182 alc662_fill_coef(codec
);
6184 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
6185 alc662_fixup_tbl
, alc662_fixups
);
6186 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
);
6187 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
6189 alc_auto_parse_customize_define(codec
);
6191 if (has_cdefine_beep(codec
))
6192 spec
->gen
.beep_nid
= 0x01;
6194 if ((alc_get_coef0(codec
) & (1 << 14)) &&
6195 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
6196 spec
->cdefine
.platform_type
== 1) {
6197 err
= alc_codec_rename(codec
, "ALC272X");
6202 /* automatic parse from the BIOS config */
6203 err
= alc662_parse_auto_config(codec
);
6207 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
6208 switch (codec
->vendor_id
) {
6210 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
6216 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
6219 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
6224 codec
->patch_ops
= alc_patch_ops
;
6225 spec
->shutup
= alc_eapd_shutup
;
6227 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
6240 static int alc680_parse_auto_config(struct hda_codec
*codec
)
6242 return alc_parse_auto_config(codec
, NULL
, NULL
);
6247 static int patch_alc680(struct hda_codec
*codec
)
6251 /* ALC680 has no aa-loopback mixer */
6252 err
= alc_alloc_spec(codec
, 0);
6256 /* automatic parse from the BIOS config */
6257 err
= alc680_parse_auto_config(codec
);
6263 codec
->patch_ops
= alc_patch_ops
;
6271 static const struct hda_codec_preset snd_hda_preset_realtek
[] = {
6272 { .id
= 0x10ec0221, .name
= "ALC221", .patch
= patch_alc269
},
6273 { .id
= 0x10ec0231, .name
= "ALC231", .patch
= patch_alc269
},
6274 { .id
= 0x10ec0233, .name
= "ALC233", .patch
= patch_alc269
},
6275 { .id
= 0x10ec0235, .name
= "ALC233", .patch
= patch_alc269
},
6276 { .id
= 0x10ec0255, .name
= "ALC255", .patch
= patch_alc269
},
6277 { .id
= 0x10ec0260, .name
= "ALC260", .patch
= patch_alc260
},
6278 { .id
= 0x10ec0262, .name
= "ALC262", .patch
= patch_alc262
},
6279 { .id
= 0x10ec0267, .name
= "ALC267", .patch
= patch_alc268
},
6280 { .id
= 0x10ec0268, .name
= "ALC268", .patch
= patch_alc268
},
6281 { .id
= 0x10ec0269, .name
= "ALC269", .patch
= patch_alc269
},
6282 { .id
= 0x10ec0270, .name
= "ALC270", .patch
= patch_alc269
},
6283 { .id
= 0x10ec0272, .name
= "ALC272", .patch
= patch_alc662
},
6284 { .id
= 0x10ec0275, .name
= "ALC275", .patch
= patch_alc269
},
6285 { .id
= 0x10ec0276, .name
= "ALC276", .patch
= patch_alc269
},
6286 { .id
= 0x10ec0280, .name
= "ALC280", .patch
= patch_alc269
},
6287 { .id
= 0x10ec0282, .name
= "ALC282", .patch
= patch_alc269
},
6288 { .id
= 0x10ec0283, .name
= "ALC283", .patch
= patch_alc269
},
6289 { .id
= 0x10ec0284, .name
= "ALC284", .patch
= patch_alc269
},
6290 { .id
= 0x10ec0285, .name
= "ALC285", .patch
= patch_alc269
},
6291 { .id
= 0x10ec0286, .name
= "ALC286", .patch
= patch_alc269
},
6292 { .id
= 0x10ec0288, .name
= "ALC288", .patch
= patch_alc269
},
6293 { .id
= 0x10ec0290, .name
= "ALC290", .patch
= patch_alc269
},
6294 { .id
= 0x10ec0292, .name
= "ALC292", .patch
= patch_alc269
},
6295 { .id
= 0x10ec0293, .name
= "ALC293", .patch
= patch_alc269
},
6296 { .id
= 0x10ec0861, .rev
= 0x100340, .name
= "ALC660",
6297 .patch
= patch_alc861
},
6298 { .id
= 0x10ec0660, .name
= "ALC660-VD", .patch
= patch_alc861vd
},
6299 { .id
= 0x10ec0861, .name
= "ALC861", .patch
= patch_alc861
},
6300 { .id
= 0x10ec0862, .name
= "ALC861-VD", .patch
= patch_alc861vd
},
6301 { .id
= 0x10ec0662, .rev
= 0x100002, .name
= "ALC662 rev2",
6302 .patch
= patch_alc882
},
6303 { .id
= 0x10ec0662, .rev
= 0x100101, .name
= "ALC662 rev1",
6304 .patch
= patch_alc662
},
6305 { .id
= 0x10ec0662, .rev
= 0x100300, .name
= "ALC662 rev3",
6306 .patch
= patch_alc662
},
6307 { .id
= 0x10ec0663, .name
= "ALC663", .patch
= patch_alc662
},
6308 { .id
= 0x10ec0665, .name
= "ALC665", .patch
= patch_alc662
},
6309 { .id
= 0x10ec0667, .name
= "ALC667", .patch
= patch_alc662
},
6310 { .id
= 0x10ec0668, .name
= "ALC668", .patch
= patch_alc662
},
6311 { .id
= 0x10ec0670, .name
= "ALC670", .patch
= patch_alc662
},
6312 { .id
= 0x10ec0671, .name
= "ALC671", .patch
= patch_alc662
},
6313 { .id
= 0x10ec0680, .name
= "ALC680", .patch
= patch_alc680
},
6314 { .id
= 0x10ec0867, .name
= "ALC891", .patch
= patch_alc882
},
6315 { .id
= 0x10ec0880, .name
= "ALC880", .patch
= patch_alc880
},
6316 { .id
= 0x10ec0882, .name
= "ALC882", .patch
= patch_alc882
},
6317 { .id
= 0x10ec0883, .name
= "ALC883", .patch
= patch_alc882
},
6318 { .id
= 0x10ec0885, .rev
= 0x100101, .name
= "ALC889A",
6319 .patch
= patch_alc882
},
6320 { .id
= 0x10ec0885, .rev
= 0x100103, .name
= "ALC889A",
6321 .patch
= patch_alc882
},
6322 { .id
= 0x10ec0885, .name
= "ALC885", .patch
= patch_alc882
},
6323 { .id
= 0x10ec0887, .name
= "ALC887", .patch
= patch_alc882
},
6324 { .id
= 0x10ec0888, .rev
= 0x100101, .name
= "ALC1200",
6325 .patch
= patch_alc882
},
6326 { .id
= 0x10ec0888, .name
= "ALC888", .patch
= patch_alc882
},
6327 { .id
= 0x10ec0889, .name
= "ALC889", .patch
= patch_alc882
},
6328 { .id
= 0x10ec0892, .name
= "ALC892", .patch
= patch_alc662
},
6329 { .id
= 0x10ec0899, .name
= "ALC898", .patch
= patch_alc882
},
6330 { .id
= 0x10ec0900, .name
= "ALC1150", .patch
= patch_alc882
},
6334 MODULE_ALIAS("snd-hda-codec-id:10ec*");
6336 MODULE_LICENSE("GPL");
6337 MODULE_DESCRIPTION("Realtek HD-audio codec");
6339 static struct hda_codec_preset_list realtek_list
= {
6340 .preset
= snd_hda_preset_realtek
,
6341 .owner
= THIS_MODULE
,
6344 static int __init
patch_realtek_init(void)
6346 return snd_hda_add_codec_preset(&realtek_list
);
6349 static void __exit
patch_realtek_exit(void)
6351 snd_hda_delete_codec_preset(&realtek_list
);
6354 module_init(patch_realtek_init
)
6355 module_exit(patch_realtek_exit
)