]>
Commit | Line | Data |
---|---|---|
d0fa1179 | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
1da177e4 LT |
2 | /* |
3 | * Universal Interface for Intel High Definition Audio Codec | |
4 | * | |
1d045db9 | 5 | * HD audio interface patch for Realtek ALC codecs |
1da177e4 | 6 | * |
df694daa KY |
7 | * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw> |
8 | * PeiSen Hou <pshou@realtek.com.tw> | |
1da177e4 | 9 | * Takashi Iwai <tiwai@suse.de> |
409a3e98 | 10 | * Jonathan Woithe <jwoithe@just42.net> |
1da177e4 LT |
11 | */ |
12 | ||
1da177e4 LT |
13 | #include <linux/init.h> |
14 | #include <linux/delay.h> | |
15 | #include <linux/slab.h> | |
16 | #include <linux/pci.h> | |
08fb0d0e | 17 | #include <linux/dmi.h> |
da155d5b | 18 | #include <linux/module.h> |
33f4acd3 | 19 | #include <linux/input.h> |
87dc3648 | 20 | #include <linux/leds.h> |
1da177e4 | 21 | #include <sound/core.h> |
9ad0e496 | 22 | #include <sound/jack.h> |
be57bfff | 23 | #include <sound/hda_codec.h> |
1da177e4 | 24 | #include "hda_local.h" |
23d30f28 | 25 | #include "hda_auto_parser.h" |
1835a0f9 | 26 | #include "hda_jack.h" |
08c189f2 | 27 | #include "hda_generic.h" |
1da177e4 | 28 | |
cd63a5ff TI |
29 | /* keep halting ALC5505 DSP, for power saving */ |
30 | #define HALT_REALTEK_ALC5505 | |
31 | ||
4a79ba34 TI |
32 | /* extra amp-initialization sequence types */ |
33 | enum { | |
1c76aa5f | 34 | ALC_INIT_UNDEFINED, |
4a79ba34 TI |
35 | ALC_INIT_NONE, |
36 | ALC_INIT_DEFAULT, | |
4a79ba34 TI |
37 | }; |
38 | ||
73bdd597 DH |
39 | enum { |
40 | ALC_HEADSET_MODE_UNKNOWN, | |
41 | ALC_HEADSET_MODE_UNPLUGGED, | |
42 | ALC_HEADSET_MODE_HEADSET, | |
43 | ALC_HEADSET_MODE_MIC, | |
44 | ALC_HEADSET_MODE_HEADPHONE, | |
45 | }; | |
46 | ||
47 | enum { | |
48 | ALC_HEADSET_TYPE_UNKNOWN, | |
49 | ALC_HEADSET_TYPE_CTIA, | |
50 | ALC_HEADSET_TYPE_OMTP, | |
51 | }; | |
52 | ||
c7b60a89 HW |
53 | enum { |
54 | ALC_KEY_MICMUTE_INDEX, | |
55 | }; | |
56 | ||
da00c244 KY |
57 | struct alc_customize_define { |
58 | unsigned int sku_cfg; | |
59 | unsigned char port_connectivity; | |
60 | unsigned char check_sum; | |
61 | unsigned char customization; | |
62 | unsigned char external_amp; | |
63 | unsigned int enable_pcbeep:1; | |
64 | unsigned int platform_type:1; | |
65 | unsigned int swap:1; | |
66 | unsigned int override:1; | |
90622917 | 67 | unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ |
da00c244 KY |
68 | }; |
69 | ||
766538ac TI |
70 | struct alc_coef_led { |
71 | unsigned int idx; | |
72 | unsigned int mask; | |
73 | unsigned int on; | |
74 | unsigned int off; | |
75 | }; | |
76 | ||
1da177e4 | 77 | struct alc_spec { |
08c189f2 | 78 | struct hda_gen_spec gen; /* must be at head */ |
23d30f28 | 79 | |
1da177e4 | 80 | /* codec parameterization */ |
da00c244 | 81 | struct alc_customize_define cdefine; |
08c189f2 | 82 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
834be88d | 83 | |
5579cd6f TI |
84 | /* GPIO bits */ |
85 | unsigned int gpio_mask; | |
86 | unsigned int gpio_dir; | |
87 | unsigned int gpio_data; | |
215c850c | 88 | bool gpio_write_delay; /* add a delay before writing gpio_data */ |
5579cd6f | 89 | |
8d3d1ece | 90 | /* mute LED for HP laptops, see vref_mute_led_set() */ |
08fb0d0e | 91 | int mute_led_polarity; |
dbd13179 | 92 | int micmute_led_polarity; |
08fb0d0e | 93 | hda_nid_t mute_led_nid; |
9c5dc3bf | 94 | hda_nid_t cap_mute_led_nid; |
08fb0d0e | 95 | |
0f32fd19 TI |
96 | unsigned int gpio_mute_led_mask; |
97 | unsigned int gpio_mic_led_mask; | |
766538ac TI |
98 | struct alc_coef_led mute_led_coef; |
99 | struct alc_coef_led mic_led_coef; | |
9f5c6faf | 100 | |
73bdd597 DH |
101 | hda_nid_t headset_mic_pin; |
102 | hda_nid_t headphone_mic_pin; | |
103 | int current_headset_mode; | |
104 | int current_headset_type; | |
105 | ||
ae6b813a TI |
106 | /* hooks */ |
107 | void (*init_hook)(struct hda_codec *codec); | |
83012a7c | 108 | #ifdef CONFIG_PM |
c97259df | 109 | void (*power_hook)(struct hda_codec *codec); |
f5de24b0 | 110 | #endif |
1c716153 | 111 | void (*shutup)(struct hda_codec *codec); |
70a0976b | 112 | void (*reboot_notify)(struct hda_codec *codec); |
d922b51d | 113 | |
4a79ba34 | 114 | int init_amp; |
d433a678 | 115 | int codec_variant; /* flag for other variants */ |
97a26570 KY |
116 | unsigned int has_alc5505_dsp:1; |
117 | unsigned int no_depop_delay:1; | |
693abe11 | 118 | unsigned int done_hp_init:1; |
c0ca5ece | 119 | unsigned int no_shutup_pins:1; |
d3ba58bb | 120 | unsigned int ultra_low_power:1; |
476c02e0 | 121 | unsigned int has_hs_key:1; |
92666d45 | 122 | unsigned int no_internal_mic_pin:1; |
e64f14f4 | 123 | |
2c3bf9ab TI |
124 | /* for PLL fix */ |
125 | hda_nid_t pll_nid; | |
126 | unsigned int pll_coef_idx, pll_coef_bit; | |
1bb7e43e | 127 | unsigned int coef0; |
33f4acd3 | 128 | struct input_dev *kb_dev; |
c7b60a89 | 129 | u8 alc_mute_keycode_map[1]; |
df694daa KY |
130 | }; |
131 | ||
f2a227cd TI |
132 | /* |
133 | * COEF access helper functions | |
134 | */ | |
135 | ||
136 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
137 | unsigned int coef_idx) | |
138 | { | |
139 | unsigned int val; | |
140 | ||
141 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
142 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); | |
143 | return val; | |
144 | } | |
145 | ||
146 | #define alc_read_coef_idx(codec, coef_idx) \ | |
147 | alc_read_coefex_idx(codec, 0x20, coef_idx) | |
148 | ||
149 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
150 | unsigned int coef_idx, unsigned int coef_val) | |
151 | { | |
152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
153 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); | |
154 | } | |
155 | ||
156 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ | |
157 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) | |
158 | ||
98b24883 TI |
159 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
160 | unsigned int coef_idx, unsigned int mask, | |
161 | unsigned int bits_set) | |
162 | { | |
163 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); | |
164 | ||
165 | if (val != -1) | |
166 | alc_write_coefex_idx(codec, nid, coef_idx, | |
167 | (val & ~mask) | bits_set); | |
168 | } | |
169 | ||
170 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ | |
171 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) | |
172 | ||
f2a227cd TI |
173 | /* a special bypass for COEF 0; read the cached value at the second time */ |
174 | static unsigned int alc_get_coef0(struct hda_codec *codec) | |
175 | { | |
176 | struct alc_spec *spec = codec->spec; | |
177 | ||
178 | if (!spec->coef0) | |
179 | spec->coef0 = alc_read_coef_idx(codec, 0); | |
180 | return spec->coef0; | |
181 | } | |
182 | ||
54db6c39 TI |
183 | /* coef writes/updates batch */ |
184 | struct coef_fw { | |
185 | unsigned char nid; | |
186 | unsigned char idx; | |
187 | unsigned short mask; | |
188 | unsigned short val; | |
189 | }; | |
190 | ||
191 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ | |
192 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } | |
193 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) | |
194 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) | |
195 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) | |
196 | ||
197 | static void alc_process_coef_fw(struct hda_codec *codec, | |
198 | const struct coef_fw *fw) | |
199 | { | |
200 | for (; fw->nid; fw++) { | |
201 | if (fw->mask == (unsigned short)-1) | |
202 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); | |
203 | else | |
204 | alc_update_coefex_idx(codec, fw->nid, fw->idx, | |
205 | fw->mask, fw->val); | |
206 | } | |
207 | } | |
208 | ||
df694daa | 209 | /* |
1d045db9 | 210 | * GPIO setup tables, used in initialization |
df694daa | 211 | */ |
5579cd6f | 212 | |
bc9f98a9 | 213 | /* Enable GPIO mask and set output */ |
5579cd6f TI |
214 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
215 | { | |
216 | struct alc_spec *spec = codec->spec; | |
bc9f98a9 | 217 | |
5579cd6f TI |
218 | spec->gpio_mask |= mask; |
219 | spec->gpio_dir |= mask; | |
220 | spec->gpio_data |= mask; | |
221 | } | |
bc9f98a9 | 222 | |
5579cd6f TI |
223 | static void alc_write_gpio_data(struct hda_codec *codec) |
224 | { | |
225 | struct alc_spec *spec = codec->spec; | |
226 | ||
227 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | |
228 | spec->gpio_data); | |
229 | } | |
230 | ||
aaf312de TI |
231 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
232 | bool on) | |
233 | { | |
234 | struct alc_spec *spec = codec->spec; | |
235 | unsigned int oldval = spec->gpio_data; | |
236 | ||
237 | if (on) | |
238 | spec->gpio_data |= mask; | |
239 | else | |
240 | spec->gpio_data &= ~mask; | |
241 | if (oldval != spec->gpio_data) | |
242 | alc_write_gpio_data(codec); | |
243 | } | |
244 | ||
5579cd6f TI |
245 | static void alc_write_gpio(struct hda_codec *codec) |
246 | { | |
247 | struct alc_spec *spec = codec->spec; | |
248 | ||
249 | if (!spec->gpio_mask) | |
250 | return; | |
251 | ||
252 | snd_hda_codec_write(codec, codec->core.afg, 0, | |
253 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); | |
254 | snd_hda_codec_write(codec, codec->core.afg, 0, | |
255 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); | |
215c850c TI |
256 | if (spec->gpio_write_delay) |
257 | msleep(1); | |
5579cd6f TI |
258 | alc_write_gpio_data(codec); |
259 | } | |
260 | ||
261 | static void alc_fixup_gpio(struct hda_codec *codec, int action, | |
262 | unsigned int mask) | |
263 | { | |
264 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
265 | alc_setup_gpio(codec, mask); | |
266 | } | |
267 | ||
268 | static void alc_fixup_gpio1(struct hda_codec *codec, | |
269 | const struct hda_fixup *fix, int action) | |
270 | { | |
271 | alc_fixup_gpio(codec, action, 0x01); | |
272 | } | |
273 | ||
274 | static void alc_fixup_gpio2(struct hda_codec *codec, | |
275 | const struct hda_fixup *fix, int action) | |
276 | { | |
277 | alc_fixup_gpio(codec, action, 0x02); | |
278 | } | |
279 | ||
280 | static void alc_fixup_gpio3(struct hda_codec *codec, | |
281 | const struct hda_fixup *fix, int action) | |
282 | { | |
283 | alc_fixup_gpio(codec, action, 0x03); | |
284 | } | |
bdd148a3 | 285 | |
ae065f1c TI |
286 | static void alc_fixup_gpio4(struct hda_codec *codec, |
287 | const struct hda_fixup *fix, int action) | |
288 | { | |
289 | alc_fixup_gpio(codec, action, 0x04); | |
290 | } | |
291 | ||
8a503555 TI |
292 | static void alc_fixup_micmute_led(struct hda_codec *codec, |
293 | const struct hda_fixup *fix, int action) | |
294 | { | |
e65bf997 | 295 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
8a503555 TI |
296 | snd_hda_gen_add_micmute_led_cdev(codec, NULL); |
297 | } | |
298 | ||
2c3bf9ab TI |
299 | /* |
300 | * Fix hardware PLL issue | |
301 | * On some codecs, the analog PLL gating control must be off while | |
302 | * the default value is 1. | |
303 | */ | |
304 | static void alc_fix_pll(struct hda_codec *codec) | |
305 | { | |
306 | struct alc_spec *spec = codec->spec; | |
2c3bf9ab | 307 | |
98b24883 TI |
308 | if (spec->pll_nid) |
309 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, | |
310 | 1 << spec->pll_coef_bit, 0); | |
2c3bf9ab TI |
311 | } |
312 | ||
313 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, | |
314 | unsigned int coef_idx, unsigned int coef_bit) | |
315 | { | |
316 | struct alc_spec *spec = codec->spec; | |
317 | spec->pll_nid = nid; | |
318 | spec->pll_coef_idx = coef_idx; | |
319 | spec->pll_coef_bit = coef_bit; | |
320 | alc_fix_pll(codec); | |
321 | } | |
322 | ||
cf5a2279 | 323 | /* update the master volume per volume-knob's unsol event */ |
1a4f69d5 TI |
324 | static void alc_update_knob_master(struct hda_codec *codec, |
325 | struct hda_jack_callback *jack) | |
cf5a2279 TI |
326 | { |
327 | unsigned int val; | |
328 | struct snd_kcontrol *kctl; | |
329 | struct snd_ctl_elem_value *uctl; | |
330 | ||
331 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); | |
332 | if (!kctl) | |
333 | return; | |
334 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | |
335 | if (!uctl) | |
336 | return; | |
2ebab40e | 337 | val = snd_hda_codec_read(codec, jack->nid, 0, |
cf5a2279 TI |
338 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
339 | val &= HDA_AMP_VOLMASK; | |
340 | uctl->value.integer.value[0] = val; | |
341 | uctl->value.integer.value[1] = val; | |
342 | kctl->put(kctl, uctl); | |
343 | kfree(uctl); | |
344 | } | |
345 | ||
29adc4b9 | 346 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
f21d78e2 | 347 | { |
29adc4b9 DH |
348 | /* For some reason, the res given from ALC880 is broken. |
349 | Here we adjust it properly. */ | |
350 | snd_hda_jack_unsol_event(codec, res >> 2); | |
f21d78e2 TI |
351 | } |
352 | ||
394c97f8 KY |
353 | /* Change EAPD to verb control */ |
354 | static void alc_fill_eapd_coef(struct hda_codec *codec) | |
355 | { | |
356 | int coef; | |
357 | ||
358 | coef = alc_get_coef0(codec); | |
359 | ||
7639a06c | 360 | switch (codec->core.vendor_id) { |
394c97f8 KY |
361 | case 0x10ec0262: |
362 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); | |
363 | break; | |
364 | case 0x10ec0267: | |
365 | case 0x10ec0268: | |
366 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); | |
367 | break; | |
368 | case 0x10ec0269: | |
369 | if ((coef & 0x00f0) == 0x0010) | |
370 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); | |
371 | if ((coef & 0x00f0) == 0x0020) | |
372 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
373 | if ((coef & 0x00f0) == 0x0030) | |
374 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); | |
375 | break; | |
376 | case 0x10ec0280: | |
377 | case 0x10ec0284: | |
378 | case 0x10ec0290: | |
379 | case 0x10ec0292: | |
380 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
381 | break; | |
4231430d | 382 | case 0x10ec0225: |
44be77c5 TI |
383 | case 0x10ec0295: |
384 | case 0x10ec0299: | |
385 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
c0dbbdad | 386 | fallthrough; |
44be77c5 | 387 | case 0x10ec0215: |
1948fc06 | 388 | case 0x10ec0230: |
394c97f8 | 389 | case 0x10ec0233: |
ea04a1db | 390 | case 0x10ec0235: |
c4473744 | 391 | case 0x10ec0236: |
7fbdcd83 | 392 | case 0x10ec0245: |
394c97f8 | 393 | case 0x10ec0255: |
c4473744 | 394 | case 0x10ec0256: |
f429e7e4 | 395 | case 0x10ec0257: |
394c97f8 KY |
396 | case 0x10ec0282: |
397 | case 0x10ec0283: | |
398 | case 0x10ec0286: | |
399 | case 0x10ec0288: | |
0a6f0600 | 400 | case 0x10ec0285: |
506b62c3 | 401 | case 0x10ec0298: |
0a6f0600 | 402 | case 0x10ec0289: |
1078bef0 | 403 | case 0x10ec0300: |
394c97f8 KY |
404 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
405 | break; | |
3aabf94c KY |
406 | case 0x10ec0275: |
407 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); | |
408 | break; | |
8822702f HW |
409 | case 0x10ec0287: |
410 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); | |
411 | alc_write_coef_idx(codec, 0x8, 0x4ab7); | |
412 | break; | |
394c97f8 KY |
413 | case 0x10ec0293: |
414 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); | |
415 | break; | |
dcd4f0db KY |
416 | case 0x10ec0234: |
417 | case 0x10ec0274: | |
418 | case 0x10ec0294: | |
6fbae35a KY |
419 | case 0x10ec0700: |
420 | case 0x10ec0701: | |
421 | case 0x10ec0703: | |
83629532 | 422 | case 0x10ec0711: |
dcd4f0db KY |
423 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
424 | break; | |
394c97f8 KY |
425 | case 0x10ec0662: |
426 | if ((coef & 0x00f0) == 0x0030) | |
427 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ | |
428 | break; | |
429 | case 0x10ec0272: | |
430 | case 0x10ec0273: | |
431 | case 0x10ec0663: | |
432 | case 0x10ec0665: | |
433 | case 0x10ec0670: | |
434 | case 0x10ec0671: | |
435 | case 0x10ec0672: | |
436 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ | |
437 | break; | |
9194a1eb | 438 | case 0x10ec0222: |
f0778871 KY |
439 | case 0x10ec0623: |
440 | alc_update_coef_idx(codec, 0x19, 1<<13, 0); | |
441 | break; | |
394c97f8 KY |
442 | case 0x10ec0668: |
443 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); | |
444 | break; | |
445 | case 0x10ec0867: | |
446 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); | |
447 | break; | |
448 | case 0x10ec0888: | |
449 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) | |
450 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); | |
451 | break; | |
452 | case 0x10ec0892: | |
e5782a5d | 453 | case 0x10ec0897: |
394c97f8 KY |
454 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
455 | break; | |
456 | case 0x10ec0899: | |
457 | case 0x10ec0900: | |
6d9ffcff | 458 | case 0x10ec0b00: |
65553b12 | 459 | case 0x10ec1168: |
a535ad57 | 460 | case 0x10ec1220: |
394c97f8 KY |
461 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
462 | break; | |
463 | } | |
464 | } | |
465 | ||
f9423e7a KY |
466 | /* additional initialization for ALC888 variants */ |
467 | static void alc888_coef_init(struct hda_codec *codec) | |
468 | { | |
1df8874b KY |
469 | switch (alc_get_coef0(codec) & 0x00f0) { |
470 | /* alc888-VA */ | |
471 | case 0x00: | |
472 | /* alc888-VB */ | |
473 | case 0x10: | |
474 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ | |
475 | break; | |
476 | } | |
87a8c370 JK |
477 | } |
478 | ||
3fb4a508 TI |
479 | /* turn on/off EAPD control (only if available) */ |
480 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) | |
481 | { | |
482 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) | |
483 | return; | |
484 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) | |
485 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, | |
486 | on ? 2 : 0); | |
487 | } | |
488 | ||
691f1fcc TI |
489 | /* turn on/off EAPD controls of the codec */ |
490 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) | |
491 | { | |
492 | /* We currently only handle front, HP */ | |
caf3c043 | 493 | static const hda_nid_t pins[] = { |
af95b414 | 494 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
39fa84e9 | 495 | }; |
caf3c043 | 496 | const hda_nid_t *p; |
39fa84e9 TI |
497 | for (p = pins; *p; p++) |
498 | set_eapd(codec, *p, on); | |
691f1fcc TI |
499 | } |
500 | ||
dad3197d KY |
501 | static int find_ext_mic_pin(struct hda_codec *codec); |
502 | ||
503 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) | |
504 | { | |
505 | const struct hda_pincfg *pin; | |
506 | int mic_pin = find_ext_mic_pin(codec); | |
507 | int i; | |
508 | ||
509 | /* don't shut up pins when unloading the driver; otherwise it breaks | |
510 | * the default pin setup at the next load of the driver | |
511 | */ | |
512 | if (codec->bus->shutdown) | |
513 | return; | |
514 | ||
515 | snd_array_for_each(&codec->init_pins, i, pin) { | |
516 | /* use read here for syncing after issuing each verb */ | |
517 | if (pin->nid != mic_pin) | |
518 | snd_hda_codec_read(codec, pin->nid, 0, | |
519 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | |
520 | } | |
521 | ||
522 | codec->pins_shutup = 1; | |
523 | } | |
524 | ||
c0ca5ece TI |
525 | static void alc_shutup_pins(struct hda_codec *codec) |
526 | { | |
527 | struct alc_spec *spec = codec->spec; | |
528 | ||
dad3197d | 529 | switch (codec->core.vendor_id) { |
66c5d718 | 530 | case 0x10ec0283: |
dad3197d KY |
531 | case 0x10ec0286: |
532 | case 0x10ec0288: | |
533 | case 0x10ec0298: | |
534 | alc_headset_mic_no_shutup(codec); | |
535 | break; | |
536 | default: | |
537 | if (!spec->no_shutup_pins) | |
538 | snd_hda_shutup_pins(codec); | |
539 | break; | |
540 | } | |
c0ca5ece TI |
541 | } |
542 | ||
1c716153 | 543 | /* generic shutup callback; |
4ce8e6a5 | 544 | * just turning off EAPD and a little pause for avoiding pop-noise |
1c716153 TI |
545 | */ |
546 | static void alc_eapd_shutup(struct hda_codec *codec) | |
547 | { | |
97a26570 KY |
548 | struct alc_spec *spec = codec->spec; |
549 | ||
1c716153 | 550 | alc_auto_setup_eapd(codec, false); |
97a26570 KY |
551 | if (!spec->no_depop_delay) |
552 | msleep(200); | |
c0ca5ece | 553 | alc_shutup_pins(codec); |
1c716153 TI |
554 | } |
555 | ||
1d045db9 | 556 | /* generic EAPD initialization */ |
4a79ba34 | 557 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
bc9f98a9 | 558 | { |
39fa84e9 | 559 | alc_auto_setup_eapd(codec, true); |
5579cd6f | 560 | alc_write_gpio(codec); |
4a79ba34 | 561 | switch (type) { |
4a79ba34 | 562 | case ALC_INIT_DEFAULT: |
7639a06c | 563 | switch (codec->core.vendor_id) { |
c9b58006 | 564 | case 0x10ec0260: |
98b24883 | 565 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
c9b58006 | 566 | break; |
c9b58006 KY |
567 | case 0x10ec0880: |
568 | case 0x10ec0882: | |
569 | case 0x10ec0883: | |
570 | case 0x10ec0885: | |
1df8874b | 571 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
c9b58006 | 572 | break; |
f9423e7a | 573 | case 0x10ec0888: |
4a79ba34 | 574 | alc888_coef_init(codec); |
f9423e7a | 575 | break; |
bc9f98a9 | 576 | } |
4a79ba34 TI |
577 | break; |
578 | } | |
579 | } | |
580 | ||
35a39f98 TI |
581 | /* get a primary headphone pin if available */ |
582 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) | |
583 | { | |
584 | if (spec->gen.autocfg.hp_pins[0]) | |
585 | return spec->gen.autocfg.hp_pins[0]; | |
586 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
587 | return spec->gen.autocfg.line_out_pins[0]; | |
588 | return 0; | |
589 | } | |
08c189f2 | 590 | |
1d045db9 | 591 | /* |
08c189f2 | 592 | * Realtek SSID verification |
1d045db9 | 593 | */ |
42cf0d01 | 594 | |
08c189f2 TI |
595 | /* Could be any non-zero and even value. When used as fixup, tells |
596 | * the driver to ignore any present sku defines. | |
597 | */ | |
598 | #define ALC_FIXUP_SKU_IGNORE (2) | |
1a1455de | 599 | |
08c189f2 TI |
600 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
601 | const struct hda_fixup *fix, int action) | |
1a1455de | 602 | { |
1a1455de | 603 | struct alc_spec *spec = codec->spec; |
08c189f2 TI |
604 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
605 | spec->cdefine.fixup = 1; | |
606 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; | |
1a1455de | 607 | } |
1a1455de TI |
608 | } |
609 | ||
b5c6611f ML |
610 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
611 | const struct hda_fixup *fix, int action) | |
612 | { | |
613 | struct alc_spec *spec = codec->spec; | |
614 | ||
84d2dc3e | 615 | if (action == HDA_FIXUP_ACT_PROBE) { |
b5c6611f | 616 | spec->no_depop_delay = 1; |
84d2dc3e ML |
617 | codec->depop_delay = 0; |
618 | } | |
b5c6611f ML |
619 | } |
620 | ||
08c189f2 | 621 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
4a79ba34 | 622 | { |
08c189f2 TI |
623 | unsigned int ass, tmp, i; |
624 | unsigned nid = 0; | |
4a79ba34 TI |
625 | struct alc_spec *spec = codec->spec; |
626 | ||
08c189f2 | 627 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
4a79ba34 | 628 | |
08c189f2 TI |
629 | if (spec->cdefine.fixup) { |
630 | ass = spec->cdefine.sku_cfg; | |
631 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
632 | return -1; | |
633 | goto do_sku; | |
bb35febd TI |
634 | } |
635 | ||
5100cd07 TI |
636 | if (!codec->bus->pci) |
637 | return -1; | |
7639a06c | 638 | ass = codec->core.subsystem_id & 0xffff; |
08c189f2 TI |
639 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
640 | goto do_sku; | |
4a79ba34 | 641 | |
08c189f2 | 642 | nid = 0x1d; |
7639a06c | 643 | if (codec->core.vendor_id == 0x10ec0260) |
08c189f2 TI |
644 | nid = 0x17; |
645 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
42cf0d01 | 646 | |
08c189f2 | 647 | if (!(ass & 1)) { |
4e76a883 | 648 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
7639a06c | 649 | codec->core.chip_name, ass); |
08c189f2 | 650 | return -1; |
42cf0d01 DH |
651 | } |
652 | ||
08c189f2 TI |
653 | /* check sum */ |
654 | tmp = 0; | |
655 | for (i = 1; i < 16; i++) { | |
656 | if ((ass >> i) & 1) | |
657 | tmp++; | |
ae8a60a5 | 658 | } |
08c189f2 TI |
659 | if (((ass >> 16) & 0xf) != tmp) |
660 | return -1; | |
ae8a60a5 | 661 | |
da00c244 KY |
662 | spec->cdefine.port_connectivity = ass >> 30; |
663 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; | |
664 | spec->cdefine.check_sum = (ass >> 16) & 0xf; | |
665 | spec->cdefine.customization = ass >> 8; | |
666 | do_sku: | |
667 | spec->cdefine.sku_cfg = ass; | |
668 | spec->cdefine.external_amp = (ass & 0x38) >> 3; | |
669 | spec->cdefine.platform_type = (ass & 0x4) >> 2; | |
670 | spec->cdefine.swap = (ass & 0x2) >> 1; | |
671 | spec->cdefine.override = ass & 0x1; | |
672 | ||
4e76a883 | 673 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
da00c244 | 674 | nid, spec->cdefine.sku_cfg); |
4e76a883 | 675 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
da00c244 | 676 | spec->cdefine.port_connectivity); |
4e76a883 TI |
677 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
678 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); | |
679 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); | |
680 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); | |
681 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); | |
682 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); | |
683 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); | |
da00c244 KY |
684 | |
685 | return 0; | |
686 | } | |
687 | ||
08c189f2 TI |
688 | /* return the position of NID in the list, or -1 if not found */ |
689 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) | |
690 | { | |
691 | int i; | |
692 | for (i = 0; i < nums; i++) | |
693 | if (list[i] == nid) | |
694 | return i; | |
695 | return -1; | |
696 | } | |
1d045db9 | 697 | /* return true if the given NID is found in the list */ |
3af9ee6b TI |
698 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
699 | { | |
21268961 | 700 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
3af9ee6b TI |
701 | } |
702 | ||
4a79ba34 TI |
703 | /* check subsystem ID and set up device-specific initialization; |
704 | * return 1 if initialized, 0 if invalid SSID | |
705 | */ | |
706 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. | |
707 | * 31 ~ 16 : Manufacture ID | |
708 | * 15 ~ 8 : SKU ID | |
709 | * 7 ~ 0 : Assembly ID | |
710 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 | |
711 | */ | |
58c57cfa | 712 | static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) |
4a79ba34 TI |
713 | { |
714 | unsigned int ass, tmp, i; | |
715 | unsigned nid; | |
716 | struct alc_spec *spec = codec->spec; | |
717 | ||
90622917 DH |
718 | if (spec->cdefine.fixup) { |
719 | ass = spec->cdefine.sku_cfg; | |
720 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
721 | return 0; | |
722 | goto do_sku; | |
723 | } | |
724 | ||
7639a06c | 725 | ass = codec->core.subsystem_id & 0xffff; |
5100cd07 TI |
726 | if (codec->bus->pci && |
727 | ass != codec->bus->pci->subsystem_device && (ass & 1)) | |
4a79ba34 TI |
728 | goto do_sku; |
729 | ||
730 | /* invalid SSID, check the special NID pin defcfg instead */ | |
731 | /* | |
def319f9 | 732 | * 31~30 : port connectivity |
4a79ba34 TI |
733 | * 29~21 : reserve |
734 | * 20 : PCBEEP input | |
735 | * 19~16 : Check sum (15:1) | |
736 | * 15~1 : Custom | |
737 | * 0 : override | |
738 | */ | |
739 | nid = 0x1d; | |
7639a06c | 740 | if (codec->core.vendor_id == 0x10ec0260) |
4a79ba34 TI |
741 | nid = 0x17; |
742 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
4e76a883 TI |
743 | codec_dbg(codec, |
744 | "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", | |
cb6605c1 | 745 | ass, nid); |
6227cdce | 746 | if (!(ass & 1)) |
4a79ba34 TI |
747 | return 0; |
748 | if ((ass >> 30) != 1) /* no physical connection */ | |
749 | return 0; | |
750 | ||
751 | /* check sum */ | |
752 | tmp = 0; | |
753 | for (i = 1; i < 16; i++) { | |
754 | if ((ass >> i) & 1) | |
755 | tmp++; | |
756 | } | |
757 | if (((ass >> 16) & 0xf) != tmp) | |
758 | return 0; | |
759 | do_sku: | |
4e76a883 | 760 | codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", |
7639a06c | 761 | ass & 0xffff, codec->core.vendor_id); |
4a79ba34 TI |
762 | /* |
763 | * 0 : override | |
764 | * 1 : Swap Jack | |
765 | * 2 : 0 --> Desktop, 1 --> Laptop | |
766 | * 3~5 : External Amplifier control | |
767 | * 7~6 : Reserved | |
768 | */ | |
769 | tmp = (ass & 0x38) >> 3; /* external Amp control */ | |
1c76aa5f TI |
770 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
771 | switch (tmp) { | |
772 | case 1: | |
5579cd6f | 773 | alc_setup_gpio(codec, 0x01); |
1c76aa5f TI |
774 | break; |
775 | case 3: | |
5579cd6f | 776 | alc_setup_gpio(codec, 0x02); |
1c76aa5f TI |
777 | break; |
778 | case 7: | |
5579cd6f | 779 | alc_setup_gpio(codec, 0x03); |
1c76aa5f TI |
780 | break; |
781 | case 5: | |
782 | default: | |
783 | spec->init_amp = ALC_INIT_DEFAULT; | |
784 | break; | |
785 | } | |
bc9f98a9 | 786 | } |
ea1fb29a | 787 | |
8c427226 | 788 | /* is laptop or Desktop and enable the function "Mute internal speaker |
c9b58006 KY |
789 | * when the external headphone out jack is plugged" |
790 | */ | |
8c427226 | 791 | if (!(ass & 0x8000)) |
4a79ba34 | 792 | return 1; |
c9b58006 KY |
793 | /* |
794 | * 10~8 : Jack location | |
795 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered | |
796 | * 14~13: Resvered | |
797 | * 15 : 1 --> enable the function "Mute internal speaker | |
798 | * when the external headphone out jack is plugged" | |
799 | */ | |
35a39f98 | 800 | if (!alc_get_hp_pin(spec)) { |
01d4825d | 801 | hda_nid_t nid; |
c9b58006 | 802 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
58c57cfa | 803 | nid = ports[tmp]; |
08c189f2 TI |
804 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
805 | spec->gen.autocfg.line_outs)) | |
3af9ee6b | 806 | return 1; |
08c189f2 | 807 | spec->gen.autocfg.hp_pins[0] = nid; |
c9b58006 | 808 | } |
4a79ba34 TI |
809 | return 1; |
810 | } | |
ea1fb29a | 811 | |
3e6179b8 TI |
812 | /* Check the validity of ALC subsystem-id |
813 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ | |
814 | static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) | |
4a79ba34 | 815 | { |
58c57cfa | 816 | if (!alc_subsystem_id(codec, ports)) { |
4a79ba34 | 817 | struct alc_spec *spec = codec->spec; |
67791202 TI |
818 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
819 | codec_dbg(codec, | |
820 | "realtek: Enable default setup for auto mode as fallback\n"); | |
821 | spec->init_amp = ALC_INIT_DEFAULT; | |
822 | } | |
4a79ba34 | 823 | } |
21268961 | 824 | } |
1a1455de | 825 | |
1d045db9 | 826 | /* |
ef8ef5fb | 827 | */ |
f9e336f6 | 828 | |
9d36a7dc DH |
829 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
830 | const struct hda_fixup *fix, int action) | |
125821ae TI |
831 | { |
832 | struct alc_spec *spec = codec->spec; | |
668d1e96 | 833 | |
9d36a7dc | 834 | spec->gen.inv_dmic_split = 1; |
6e72aa5f TI |
835 | } |
836 | ||
e9edcee0 | 837 | |
08c189f2 | 838 | static int alc_build_controls(struct hda_codec *codec) |
1d045db9 | 839 | { |
a5cb463a | 840 | int err; |
e9427969 | 841 | |
08c189f2 TI |
842 | err = snd_hda_gen_build_controls(codec); |
843 | if (err < 0) | |
844 | return err; | |
1da177e4 | 845 | |
1727a771 | 846 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
1c4a54b4 | 847 | return 0; |
a361d84b KY |
848 | } |
849 | ||
a361d84b | 850 | |
df694daa | 851 | /* |
08c189f2 | 852 | * Common callbacks |
df694daa | 853 | */ |
a361d84b | 854 | |
c9af753f TI |
855 | static void alc_pre_init(struct hda_codec *codec) |
856 | { | |
857 | alc_fill_eapd_coef(codec); | |
858 | } | |
859 | ||
aeac1a0d KY |
860 | #define is_s3_resume(codec) \ |
861 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) | |
c9af753f TI |
862 | #define is_s4_resume(codec) \ |
863 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) | |
864 | ||
08c189f2 | 865 | static int alc_init(struct hda_codec *codec) |
1d045db9 TI |
866 | { |
867 | struct alc_spec *spec = codec->spec; | |
a361d84b | 868 | |
c9af753f TI |
869 | /* hibernation resume needs the full chip initialization */ |
870 | if (is_s4_resume(codec)) | |
871 | alc_pre_init(codec); | |
872 | ||
08c189f2 TI |
873 | if (spec->init_hook) |
874 | spec->init_hook(codec); | |
a361d84b | 875 | |
89781d08 | 876 | spec->gen.skip_verbs = 1; /* applied in below */ |
607ca3bd | 877 | snd_hda_gen_init(codec); |
08c189f2 TI |
878 | alc_fix_pll(codec); |
879 | alc_auto_init_amp(codec, spec->init_amp); | |
89781d08 | 880 | snd_hda_apply_verbs(codec); /* apply verbs here after own init */ |
3abf2f36 | 881 | |
1727a771 | 882 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
a361d84b | 883 | |
1d045db9 TI |
884 | return 0; |
885 | } | |
a361d84b | 886 | |
08c189f2 | 887 | static inline void alc_shutup(struct hda_codec *codec) |
1d045db9 TI |
888 | { |
889 | struct alc_spec *spec = codec->spec; | |
a361d84b | 890 | |
c7273bd6 TI |
891 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
892 | return; /* disabled explicitly by hints */ | |
893 | ||
08c189f2 TI |
894 | if (spec && spec->shutup) |
895 | spec->shutup(codec); | |
9bfb2844 | 896 | else |
c0ca5ece | 897 | alc_shutup_pins(codec); |
1d045db9 TI |
898 | } |
899 | ||
70a0976b TI |
900 | static void alc_reboot_notify(struct hda_codec *codec) |
901 | { | |
902 | struct alc_spec *spec = codec->spec; | |
903 | ||
904 | if (spec && spec->reboot_notify) | |
905 | spec->reboot_notify(codec); | |
906 | else | |
907 | alc_shutup(codec); | |
908 | } | |
909 | ||
8a02c0cc | 910 | #define alc_free snd_hda_gen_free |
2134ea4f | 911 | |
08c189f2 TI |
912 | #ifdef CONFIG_PM |
913 | static void alc_power_eapd(struct hda_codec *codec) | |
1d045db9 | 914 | { |
08c189f2 | 915 | alc_auto_setup_eapd(codec, false); |
1d045db9 | 916 | } |
2134ea4f | 917 | |
08c189f2 | 918 | static int alc_suspend(struct hda_codec *codec) |
1d045db9 TI |
919 | { |
920 | struct alc_spec *spec = codec->spec; | |
08c189f2 TI |
921 | alc_shutup(codec); |
922 | if (spec && spec->power_hook) | |
923 | spec->power_hook(codec); | |
a361d84b KY |
924 | return 0; |
925 | } | |
08c189f2 | 926 | #endif |
a361d84b | 927 | |
08c189f2 TI |
928 | #ifdef CONFIG_PM |
929 | static int alc_resume(struct hda_codec *codec) | |
1d045db9 | 930 | { |
97a26570 KY |
931 | struct alc_spec *spec = codec->spec; |
932 | ||
933 | if (!spec->no_depop_delay) | |
934 | msleep(150); /* to avoid pop noise */ | |
08c189f2 | 935 | codec->patch_ops.init(codec); |
1a462be5 | 936 | snd_hda_regmap_sync(codec); |
08c189f2 TI |
937 | hda_call_check_power_status(codec, 0x01); |
938 | return 0; | |
1d045db9 | 939 | } |
08c189f2 | 940 | #endif |
f6a92248 | 941 | |
1d045db9 | 942 | /* |
1d045db9 | 943 | */ |
08c189f2 TI |
944 | static const struct hda_codec_ops alc_patch_ops = { |
945 | .build_controls = alc_build_controls, | |
946 | .build_pcms = snd_hda_gen_build_pcms, | |
947 | .init = alc_init, | |
948 | .free = alc_free, | |
949 | .unsol_event = snd_hda_jack_unsol_event, | |
950 | #ifdef CONFIG_PM | |
951 | .resume = alc_resume, | |
08c189f2 | 952 | .suspend = alc_suspend, |
fce52a3b | 953 | .check_power_status = snd_hda_gen_check_power_status, |
08c189f2 | 954 | #endif |
70a0976b | 955 | .reboot_notify = alc_reboot_notify, |
08c189f2 | 956 | }; |
f6a92248 | 957 | |
f53281e6 | 958 | |
ded255be | 959 | #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) |
e01bf509 | 960 | |
e4770629 | 961 | /* |
4b016931 | 962 | * Rename codecs appropriately from COEF value or subvendor id |
e4770629 | 963 | */ |
08c189f2 TI |
964 | struct alc_codec_rename_table { |
965 | unsigned int vendor_id; | |
966 | unsigned short coef_mask; | |
967 | unsigned short coef_bits; | |
968 | const char *name; | |
969 | }; | |
84898e87 | 970 | |
4b016931 KY |
971 | struct alc_codec_rename_pci_table { |
972 | unsigned int codec_vendor_id; | |
973 | unsigned short pci_subvendor; | |
974 | unsigned short pci_subdevice; | |
975 | const char *name; | |
976 | }; | |
977 | ||
6b0f95c4 | 978 | static const struct alc_codec_rename_table rename_tbl[] = { |
e6e5f7ad | 979 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
08c189f2 TI |
980 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
981 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, | |
982 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, | |
983 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, | |
984 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, | |
985 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, | |
986 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, | |
987 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, | |
e6e5f7ad | 988 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
08c189f2 TI |
989 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
990 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, | |
991 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, | |
992 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, | |
993 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, | |
994 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, | |
995 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, | |
996 | { } /* terminator */ | |
997 | }; | |
84898e87 | 998 | |
6b0f95c4 | 999 | static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
4b016931 KY |
1000 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
1001 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, | |
1002 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, | |
193177de | 1003 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
4b016931 | 1004 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
193177de | 1005 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
4b016931 KY |
1006 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
1007 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, | |
e6e5f7ad KY |
1008 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
1009 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, | |
2c674fac | 1010 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
736f20a7 | 1011 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
82324502 | 1012 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
4231430d | 1013 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
7d727869 | 1014 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
28f1f9b2 | 1015 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
e6e5f7ad KY |
1016 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
1017 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, | |
1018 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, | |
1019 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, | |
1020 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, | |
1021 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, | |
1022 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, | |
1023 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, | |
1024 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, | |
1025 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, | |
1026 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, | |
4b016931 KY |
1027 | { } /* terminator */ |
1028 | }; | |
1029 | ||
08c189f2 | 1030 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
1d045db9 | 1031 | { |
08c189f2 | 1032 | const struct alc_codec_rename_table *p; |
4b016931 | 1033 | const struct alc_codec_rename_pci_table *q; |
60db6b53 | 1034 | |
08c189f2 | 1035 | for (p = rename_tbl; p->vendor_id; p++) { |
7639a06c | 1036 | if (p->vendor_id != codec->core.vendor_id) |
08c189f2 TI |
1037 | continue; |
1038 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) | |
1039 | return alc_codec_rename(codec, p->name); | |
1d045db9 | 1040 | } |
4b016931 | 1041 | |
5100cd07 TI |
1042 | if (!codec->bus->pci) |
1043 | return 0; | |
4b016931 | 1044 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
7639a06c | 1045 | if (q->codec_vendor_id != codec->core.vendor_id) |
4b016931 KY |
1046 | continue; |
1047 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) | |
1048 | continue; | |
1049 | if (!q->pci_subdevice || | |
1050 | q->pci_subdevice == codec->bus->pci->subsystem_device) | |
1051 | return alc_codec_rename(codec, q->name); | |
1052 | } | |
1053 | ||
08c189f2 | 1054 | return 0; |
1d045db9 | 1055 | } |
f53281e6 | 1056 | |
e4770629 | 1057 | |
1d045db9 TI |
1058 | /* |
1059 | * Digital-beep handlers | |
1060 | */ | |
1061 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | |
fea80fae TI |
1062 | |
1063 | /* additional beep mixers; private_value will be overwritten */ | |
1064 | static const struct snd_kcontrol_new alc_beep_mixer[] = { | |
1065 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), | |
1066 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), | |
1067 | }; | |
1068 | ||
1069 | /* set up and create beep controls */ | |
1070 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, | |
1071 | int idx, int dir) | |
1072 | { | |
1073 | struct snd_kcontrol_new *knew; | |
1074 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); | |
1075 | int i; | |
1076 | ||
1077 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { | |
1078 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, | |
1079 | &alc_beep_mixer[i]); | |
1080 | if (!knew) | |
1081 | return -ENOMEM; | |
1082 | knew->private_value = beep_amp; | |
1083 | } | |
1084 | return 0; | |
1085 | } | |
84898e87 | 1086 | |
6317e5eb | 1087 | static const struct snd_pci_quirk beep_allow_list[] = { |
7110005e | 1088 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
a4b7f21d | 1089 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
1d045db9 | 1090 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
8554ee40 | 1091 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
1d045db9 TI |
1092 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
1093 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), | |
1094 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), | |
78f8baf1 | 1095 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
1d045db9 | 1096 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
6317e5eb | 1097 | /* denylist -- no beep available */ |
051c78af TI |
1098 | SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
1099 | SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), | |
1d045db9 | 1100 | {} |
fe3eb0a7 KY |
1101 | }; |
1102 | ||
1d045db9 TI |
1103 | static inline int has_cdefine_beep(struct hda_codec *codec) |
1104 | { | |
1105 | struct alc_spec *spec = codec->spec; | |
1106 | const struct snd_pci_quirk *q; | |
6317e5eb | 1107 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); |
1d045db9 TI |
1108 | if (q) |
1109 | return q->value; | |
1110 | return spec->cdefine.enable_pcbeep; | |
1111 | } | |
1112 | #else | |
fea80fae | 1113 | #define set_beep_amp(spec, nid, idx, dir) 0 |
1d045db9 TI |
1114 | #define has_cdefine_beep(codec) 0 |
1115 | #endif | |
84898e87 | 1116 | |
1d045db9 TI |
1117 | /* parse the BIOS configuration and set up the alc_spec */ |
1118 | /* return 1 if successful, 0 if the proper config is not found, | |
1119 | * or a negative error code | |
1120 | */ | |
3e6179b8 TI |
1121 | static int alc_parse_auto_config(struct hda_codec *codec, |
1122 | const hda_nid_t *ignore_nids, | |
1123 | const hda_nid_t *ssid_nids) | |
1d045db9 TI |
1124 | { |
1125 | struct alc_spec *spec = codec->spec; | |
08c189f2 | 1126 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
1d045db9 | 1127 | int err; |
26f5df26 | 1128 | |
53c334ad TI |
1129 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
1130 | spec->parse_flags); | |
1d045db9 TI |
1131 | if (err < 0) |
1132 | return err; | |
3e6179b8 TI |
1133 | |
1134 | if (ssid_nids) | |
1135 | alc_ssid_check(codec, ssid_nids); | |
64154835 | 1136 | |
08c189f2 TI |
1137 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
1138 | if (err < 0) | |
1139 | return err; | |
070cff4c | 1140 | |
1d045db9 | 1141 | return 1; |
60db6b53 | 1142 | } |
f6a92248 | 1143 | |
3de95173 TI |
1144 | /* common preparation job for alc_spec */ |
1145 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) | |
1146 | { | |
1147 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); | |
1148 | int err; | |
1149 | ||
1150 | if (!spec) | |
1151 | return -ENOMEM; | |
1152 | codec->spec = spec; | |
08c189f2 TI |
1153 | snd_hda_gen_spec_init(&spec->gen); |
1154 | spec->gen.mixer_nid = mixer_nid; | |
1155 | spec->gen.own_eapd_ctl = 1; | |
1098b7c2 | 1156 | codec->single_adc_amp = 1; |
08c189f2 TI |
1157 | /* FIXME: do we need this for all Realtek codec models? */ |
1158 | codec->spdif_status_reset = 1; | |
a6e7d0a4 | 1159 | codec->forced_resume = 1; |
225068ab | 1160 | codec->patch_ops = alc_patch_ops; |
3de95173 TI |
1161 | |
1162 | err = alc_codec_rename_from_preset(codec); | |
1163 | if (err < 0) { | |
1164 | kfree(spec); | |
1165 | return err; | |
1166 | } | |
1167 | return 0; | |
1168 | } | |
1169 | ||
3e6179b8 TI |
1170 | static int alc880_parse_auto_config(struct hda_codec *codec) |
1171 | { | |
1172 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; | |
7d7eb9ea | 1173 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
3e6179b8 TI |
1174 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
1175 | } | |
1176 | ||
ee3b2969 TI |
1177 | /* |
1178 | * ALC880 fix-ups | |
1179 | */ | |
1180 | enum { | |
411225a0 | 1181 | ALC880_FIXUP_GPIO1, |
ee3b2969 TI |
1182 | ALC880_FIXUP_GPIO2, |
1183 | ALC880_FIXUP_MEDION_RIM, | |
dc6af52d | 1184 | ALC880_FIXUP_LG, |
db8a38e5 | 1185 | ALC880_FIXUP_LG_LW25, |
f02aab5d | 1186 | ALC880_FIXUP_W810, |
27e917f8 | 1187 | ALC880_FIXUP_EAPD_COEF, |
b9368f5c | 1188 | ALC880_FIXUP_TCL_S700, |
cf5a2279 TI |
1189 | ALC880_FIXUP_VOL_KNOB, |
1190 | ALC880_FIXUP_FUJITSU, | |
ba533818 | 1191 | ALC880_FIXUP_F1734, |
817de92f | 1192 | ALC880_FIXUP_UNIWILL, |
967b88c4 | 1193 | ALC880_FIXUP_UNIWILL_DIG, |
96e225f6 | 1194 | ALC880_FIXUP_Z71V, |
487a588d | 1195 | ALC880_FIXUP_ASUS_W5A, |
67b6ec31 TI |
1196 | ALC880_FIXUP_3ST_BASE, |
1197 | ALC880_FIXUP_3ST, | |
1198 | ALC880_FIXUP_3ST_DIG, | |
1199 | ALC880_FIXUP_5ST_BASE, | |
1200 | ALC880_FIXUP_5ST, | |
1201 | ALC880_FIXUP_5ST_DIG, | |
1202 | ALC880_FIXUP_6ST_BASE, | |
1203 | ALC880_FIXUP_6ST, | |
1204 | ALC880_FIXUP_6ST_DIG, | |
5397145f | 1205 | ALC880_FIXUP_6ST_AUTOMUTE, |
ee3b2969 TI |
1206 | }; |
1207 | ||
cf5a2279 TI |
1208 | /* enable the volume-knob widget support on NID 0x21 */ |
1209 | static void alc880_fixup_vol_knob(struct hda_codec *codec, | |
1727a771 | 1210 | const struct hda_fixup *fix, int action) |
cf5a2279 | 1211 | { |
1727a771 | 1212 | if (action == HDA_FIXUP_ACT_PROBE) |
62f949bf TI |
1213 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
1214 | alc_update_knob_master); | |
cf5a2279 TI |
1215 | } |
1216 | ||
1727a771 | 1217 | static const struct hda_fixup alc880_fixups[] = { |
411225a0 | 1218 | [ALC880_FIXUP_GPIO1] = { |
5579cd6f TI |
1219 | .type = HDA_FIXUP_FUNC, |
1220 | .v.func = alc_fixup_gpio1, | |
411225a0 | 1221 | }, |
ee3b2969 | 1222 | [ALC880_FIXUP_GPIO2] = { |
5579cd6f TI |
1223 | .type = HDA_FIXUP_FUNC, |
1224 | .v.func = alc_fixup_gpio2, | |
ee3b2969 TI |
1225 | }, |
1226 | [ALC880_FIXUP_MEDION_RIM] = { | |
1727a771 | 1227 | .type = HDA_FIXUP_VERBS, |
ee3b2969 TI |
1228 | .v.verbs = (const struct hda_verb[]) { |
1229 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1230 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1231 | { } | |
1232 | }, | |
1233 | .chained = true, | |
1234 | .chain_id = ALC880_FIXUP_GPIO2, | |
1235 | }, | |
dc6af52d | 1236 | [ALC880_FIXUP_LG] = { |
1727a771 TI |
1237 | .type = HDA_FIXUP_PINS, |
1238 | .v.pins = (const struct hda_pintbl[]) { | |
dc6af52d TI |
1239 | /* disable bogus unused pins */ |
1240 | { 0x16, 0x411111f0 }, | |
1241 | { 0x18, 0x411111f0 }, | |
1242 | { 0x1a, 0x411111f0 }, | |
1243 | { } | |
1244 | } | |
1245 | }, | |
db8a38e5 TI |
1246 | [ALC880_FIXUP_LG_LW25] = { |
1247 | .type = HDA_FIXUP_PINS, | |
1248 | .v.pins = (const struct hda_pintbl[]) { | |
1249 | { 0x1a, 0x0181344f }, /* line-in */ | |
1250 | { 0x1b, 0x0321403f }, /* headphone */ | |
1251 | { } | |
1252 | } | |
1253 | }, | |
f02aab5d | 1254 | [ALC880_FIXUP_W810] = { |
1727a771 TI |
1255 | .type = HDA_FIXUP_PINS, |
1256 | .v.pins = (const struct hda_pintbl[]) { | |
f02aab5d TI |
1257 | /* disable bogus unused pins */ |
1258 | { 0x17, 0x411111f0 }, | |
1259 | { } | |
1260 | }, | |
1261 | .chained = true, | |
1262 | .chain_id = ALC880_FIXUP_GPIO2, | |
1263 | }, | |
27e917f8 | 1264 | [ALC880_FIXUP_EAPD_COEF] = { |
1727a771 | 1265 | .type = HDA_FIXUP_VERBS, |
27e917f8 TI |
1266 | .v.verbs = (const struct hda_verb[]) { |
1267 | /* change to EAPD mode */ | |
1268 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1269 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1270 | {} | |
1271 | }, | |
1272 | }, | |
b9368f5c | 1273 | [ALC880_FIXUP_TCL_S700] = { |
1727a771 | 1274 | .type = HDA_FIXUP_VERBS, |
b9368f5c TI |
1275 | .v.verbs = (const struct hda_verb[]) { |
1276 | /* change to EAPD mode */ | |
1277 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1278 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
1279 | {} | |
1280 | }, | |
1281 | .chained = true, | |
1282 | .chain_id = ALC880_FIXUP_GPIO2, | |
1283 | }, | |
cf5a2279 | 1284 | [ALC880_FIXUP_VOL_KNOB] = { |
1727a771 | 1285 | .type = HDA_FIXUP_FUNC, |
cf5a2279 TI |
1286 | .v.func = alc880_fixup_vol_knob, |
1287 | }, | |
1288 | [ALC880_FIXUP_FUJITSU] = { | |
1289 | /* override all pins as BIOS on old Amilo is broken */ | |
1727a771 TI |
1290 | .type = HDA_FIXUP_PINS, |
1291 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1292 | { 0x14, 0x0121401f }, /* HP */ |
cf5a2279 TI |
1293 | { 0x15, 0x99030120 }, /* speaker */ |
1294 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1295 | { 0x17, 0x411111f0 }, /* N/A */ | |
1296 | { 0x18, 0x411111f0 }, /* N/A */ | |
1297 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1298 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1299 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1300 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1301 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1302 | { 0x1e, 0x01454140 }, /* SPDIF out */ | |
1303 | { } | |
1304 | }, | |
1305 | .chained = true, | |
1306 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1307 | }, | |
ba533818 TI |
1308 | [ALC880_FIXUP_F1734] = { |
1309 | /* almost compatible with FUJITSU, but no bass and SPDIF */ | |
1727a771 TI |
1310 | .type = HDA_FIXUP_PINS, |
1311 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1312 | { 0x14, 0x0121401f }, /* HP */ |
ba533818 TI |
1313 | { 0x15, 0x99030120 }, /* speaker */ |
1314 | { 0x16, 0x411111f0 }, /* N/A */ | |
1315 | { 0x17, 0x411111f0 }, /* N/A */ | |
1316 | { 0x18, 0x411111f0 }, /* N/A */ | |
1317 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1318 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1319 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1320 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1321 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1322 | { 0x1e, 0x411111f0 }, /* N/A */ | |
1323 | { } | |
1324 | }, | |
1325 | .chained = true, | |
1326 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1327 | }, | |
817de92f TI |
1328 | [ALC880_FIXUP_UNIWILL] = { |
1329 | /* need to fix HP and speaker pins to be parsed correctly */ | |
1727a771 TI |
1330 | .type = HDA_FIXUP_PINS, |
1331 | .v.pins = (const struct hda_pintbl[]) { | |
817de92f TI |
1332 | { 0x14, 0x0121411f }, /* HP */ |
1333 | { 0x15, 0x99030120 }, /* speaker */ | |
1334 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1335 | { } | |
1336 | }, | |
1337 | }, | |
967b88c4 | 1338 | [ALC880_FIXUP_UNIWILL_DIG] = { |
1727a771 TI |
1339 | .type = HDA_FIXUP_PINS, |
1340 | .v.pins = (const struct hda_pintbl[]) { | |
967b88c4 TI |
1341 | /* disable bogus unused pins */ |
1342 | { 0x17, 0x411111f0 }, | |
1343 | { 0x19, 0x411111f0 }, | |
1344 | { 0x1b, 0x411111f0 }, | |
1345 | { 0x1f, 0x411111f0 }, | |
1346 | { } | |
1347 | } | |
1348 | }, | |
96e225f6 | 1349 | [ALC880_FIXUP_Z71V] = { |
1727a771 TI |
1350 | .type = HDA_FIXUP_PINS, |
1351 | .v.pins = (const struct hda_pintbl[]) { | |
96e225f6 TI |
1352 | /* set up the whole pins as BIOS is utterly broken */ |
1353 | { 0x14, 0x99030120 }, /* speaker */ | |
1354 | { 0x15, 0x0121411f }, /* HP */ | |
1355 | { 0x16, 0x411111f0 }, /* N/A */ | |
1356 | { 0x17, 0x411111f0 }, /* N/A */ | |
1357 | { 0x18, 0x01a19950 }, /* mic-in */ | |
1358 | { 0x19, 0x411111f0 }, /* N/A */ | |
1359 | { 0x1a, 0x01813031 }, /* line-in */ | |
1360 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1361 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1362 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1363 | { 0x1e, 0x0144111e }, /* SPDIF */ | |
1364 | { } | |
1365 | } | |
1366 | }, | |
487a588d TI |
1367 | [ALC880_FIXUP_ASUS_W5A] = { |
1368 | .type = HDA_FIXUP_PINS, | |
1369 | .v.pins = (const struct hda_pintbl[]) { | |
1370 | /* set up the whole pins as BIOS is utterly broken */ | |
1371 | { 0x14, 0x0121411f }, /* HP */ | |
1372 | { 0x15, 0x411111f0 }, /* N/A */ | |
1373 | { 0x16, 0x411111f0 }, /* N/A */ | |
1374 | { 0x17, 0x411111f0 }, /* N/A */ | |
1375 | { 0x18, 0x90a60160 }, /* mic */ | |
1376 | { 0x19, 0x411111f0 }, /* N/A */ | |
1377 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1378 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1379 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1380 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1381 | { 0x1e, 0xb743111e }, /* SPDIF out */ | |
1382 | { } | |
1383 | }, | |
1384 | .chained = true, | |
1385 | .chain_id = ALC880_FIXUP_GPIO1, | |
1386 | }, | |
67b6ec31 | 1387 | [ALC880_FIXUP_3ST_BASE] = { |
1727a771 TI |
1388 | .type = HDA_FIXUP_PINS, |
1389 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1390 | { 0x14, 0x01014010 }, /* line-out */ |
1391 | { 0x15, 0x411111f0 }, /* N/A */ | |
1392 | { 0x16, 0x411111f0 }, /* N/A */ | |
1393 | { 0x17, 0x411111f0 }, /* N/A */ | |
1394 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1395 | { 0x19, 0x0121411f }, /* HP */ | |
1396 | { 0x1a, 0x01813031 }, /* line-in */ | |
1397 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1398 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1399 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1400 | /* 0x1e is filled in below */ | |
1401 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1402 | { } | |
1403 | } | |
1404 | }, | |
1405 | [ALC880_FIXUP_3ST] = { | |
1727a771 TI |
1406 | .type = HDA_FIXUP_PINS, |
1407 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1408 | { 0x1e, 0x411111f0 }, /* N/A */ |
1409 | { } | |
1410 | }, | |
1411 | .chained = true, | |
1412 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1413 | }, | |
1414 | [ALC880_FIXUP_3ST_DIG] = { | |
1727a771 TI |
1415 | .type = HDA_FIXUP_PINS, |
1416 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1417 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1418 | { } | |
1419 | }, | |
1420 | .chained = true, | |
1421 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1422 | }, | |
1423 | [ALC880_FIXUP_5ST_BASE] = { | |
1727a771 TI |
1424 | .type = HDA_FIXUP_PINS, |
1425 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1426 | { 0x14, 0x01014010 }, /* front */ |
1427 | { 0x15, 0x411111f0 }, /* N/A */ | |
1428 | { 0x16, 0x01011411 }, /* CLFE */ | |
1429 | { 0x17, 0x01016412 }, /* surr */ | |
1430 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1431 | { 0x19, 0x0121411f }, /* HP */ | |
1432 | { 0x1a, 0x01813031 }, /* line-in */ | |
1433 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1434 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1435 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1436 | /* 0x1e is filled in below */ | |
1437 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1438 | { } | |
1439 | } | |
1440 | }, | |
1441 | [ALC880_FIXUP_5ST] = { | |
1727a771 TI |
1442 | .type = HDA_FIXUP_PINS, |
1443 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1444 | { 0x1e, 0x411111f0 }, /* N/A */ |
1445 | { } | |
1446 | }, | |
1447 | .chained = true, | |
1448 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1449 | }, | |
1450 | [ALC880_FIXUP_5ST_DIG] = { | |
1727a771 TI |
1451 | .type = HDA_FIXUP_PINS, |
1452 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1453 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1454 | { } | |
1455 | }, | |
1456 | .chained = true, | |
1457 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1458 | }, | |
1459 | [ALC880_FIXUP_6ST_BASE] = { | |
1727a771 TI |
1460 | .type = HDA_FIXUP_PINS, |
1461 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1462 | { 0x14, 0x01014010 }, /* front */ |
1463 | { 0x15, 0x01016412 }, /* surr */ | |
1464 | { 0x16, 0x01011411 }, /* CLFE */ | |
1465 | { 0x17, 0x01012414 }, /* side */ | |
1466 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1467 | { 0x19, 0x02a19c40 }, /* front-mic */ | |
1468 | { 0x1a, 0x01813031 }, /* line-in */ | |
1469 | { 0x1b, 0x0121411f }, /* HP */ | |
1470 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1471 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1472 | /* 0x1e is filled in below */ | |
1473 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1474 | { } | |
1475 | } | |
1476 | }, | |
1477 | [ALC880_FIXUP_6ST] = { | |
1727a771 TI |
1478 | .type = HDA_FIXUP_PINS, |
1479 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1480 | { 0x1e, 0x411111f0 }, /* N/A */ |
1481 | { } | |
1482 | }, | |
1483 | .chained = true, | |
1484 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1485 | }, | |
1486 | [ALC880_FIXUP_6ST_DIG] = { | |
1727a771 TI |
1487 | .type = HDA_FIXUP_PINS, |
1488 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1489 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1490 | { } | |
1491 | }, | |
1492 | .chained = true, | |
1493 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1494 | }, | |
5397145f TI |
1495 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
1496 | .type = HDA_FIXUP_PINS, | |
1497 | .v.pins = (const struct hda_pintbl[]) { | |
1498 | { 0x1b, 0x0121401f }, /* HP with jack detect */ | |
1499 | { } | |
1500 | }, | |
1501 | .chained_before = true, | |
1502 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1503 | }, | |
ee3b2969 TI |
1504 | }; |
1505 | ||
1506 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { | |
f02aab5d | 1507 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
487a588d | 1508 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
96e225f6 | 1509 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
29e3fdcc | 1510 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
6538de03 | 1511 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
29e3fdcc | 1512 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
27e917f8 | 1513 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
967b88c4 | 1514 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
ba533818 | 1515 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
817de92f | 1516 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
7833c7e8 | 1517 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
f02aab5d | 1518 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
ee3b2969 | 1519 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
5397145f | 1520 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
a161574e | 1521 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
cf5a2279 | 1522 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
ba533818 | 1523 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
cf5a2279 | 1524 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
dc6af52d TI |
1525 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
1526 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), | |
1527 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), | |
db8a38e5 | 1528 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
b9368f5c | 1529 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
67b6ec31 TI |
1530 | |
1531 | /* Below is the copied entries from alc880_quirks.c. | |
1532 | * It's not quite sure whether BIOS sets the correct pin-config table | |
1533 | * on these machines, thus they are kept to be compatible with | |
1534 | * the old static quirks. Once when it's confirmed to work without | |
1535 | * these overrides, it'd be better to remove. | |
1536 | */ | |
1537 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), | |
1538 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), | |
1539 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), | |
1540 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), | |
1541 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), | |
1542 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), | |
1543 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), | |
1544 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), | |
1545 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), | |
1546 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), | |
1547 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), | |
1548 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), | |
1549 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), | |
1550 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), | |
1551 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), | |
1552 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), | |
1553 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), | |
1554 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), | |
1555 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), | |
1556 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), | |
1557 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), | |
1558 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ | |
1559 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), | |
1560 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1561 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1562 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1563 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1564 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1565 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1566 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1567 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1568 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1569 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1570 | /* default Intel */ | |
1571 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), | |
1572 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), | |
1573 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), | |
1574 | {} | |
1575 | }; | |
1576 | ||
1727a771 | 1577 | static const struct hda_model_fixup alc880_fixup_models[] = { |
67b6ec31 TI |
1578 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
1579 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, | |
1580 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, | |
1581 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, | |
1582 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, | |
1583 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, | |
5397145f | 1584 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
ee3b2969 TI |
1585 | {} |
1586 | }; | |
1587 | ||
1588 | ||
1d045db9 TI |
1589 | /* |
1590 | * OK, here we have finally the patch for ALC880 | |
1591 | */ | |
1d045db9 | 1592 | static int patch_alc880(struct hda_codec *codec) |
60db6b53 | 1593 | { |
1d045db9 | 1594 | struct alc_spec *spec; |
1d045db9 | 1595 | int err; |
f6a92248 | 1596 | |
3de95173 TI |
1597 | err = alc_alloc_spec(codec, 0x0b); |
1598 | if (err < 0) | |
1599 | return err; | |
64154835 | 1600 | |
3de95173 | 1601 | spec = codec->spec; |
08c189f2 | 1602 | spec->gen.need_dac_fix = 1; |
7504b6cd | 1603 | spec->gen.beep_nid = 0x01; |
f53281e6 | 1604 | |
225068ab TI |
1605 | codec->patch_ops.unsol_event = alc880_unsol_event; |
1606 | ||
c9af753f TI |
1607 | alc_pre_init(codec); |
1608 | ||
1727a771 | 1609 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
67b6ec31 | 1610 | alc880_fixups); |
1727a771 | 1611 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ee3b2969 | 1612 | |
67b6ec31 TI |
1613 | /* automatic parse from the BIOS config */ |
1614 | err = alc880_parse_auto_config(codec); | |
1615 | if (err < 0) | |
1616 | goto error; | |
fe3eb0a7 | 1617 | |
fea80fae TI |
1618 | if (!spec->gen.no_analog) { |
1619 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
1620 | if (err < 0) | |
1621 | goto error; | |
1622 | } | |
f53281e6 | 1623 | |
1727a771 | 1624 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1625 | |
1d045db9 | 1626 | return 0; |
e16fb6d1 TI |
1627 | |
1628 | error: | |
1629 | alc_free(codec); | |
1630 | return err; | |
226b1ec8 KY |
1631 | } |
1632 | ||
1d045db9 | 1633 | |
60db6b53 | 1634 | /* |
1d045db9 | 1635 | * ALC260 support |
60db6b53 | 1636 | */ |
1d045db9 | 1637 | static int alc260_parse_auto_config(struct hda_codec *codec) |
f6a92248 | 1638 | { |
1d045db9 | 1639 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
3e6179b8 TI |
1640 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
1641 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); | |
f6a92248 KY |
1642 | } |
1643 | ||
1d045db9 TI |
1644 | /* |
1645 | * Pin config fixes | |
1646 | */ | |
1647 | enum { | |
ca8f0424 TI |
1648 | ALC260_FIXUP_HP_DC5750, |
1649 | ALC260_FIXUP_HP_PIN_0F, | |
1650 | ALC260_FIXUP_COEF, | |
15317ab2 | 1651 | ALC260_FIXUP_GPIO1, |
20f7d928 TI |
1652 | ALC260_FIXUP_GPIO1_TOGGLE, |
1653 | ALC260_FIXUP_REPLACER, | |
0a1c4fa2 | 1654 | ALC260_FIXUP_HP_B1900, |
118cb4a4 | 1655 | ALC260_FIXUP_KN1, |
39aedee7 | 1656 | ALC260_FIXUP_FSC_S7020, |
5ebd3bbd | 1657 | ALC260_FIXUP_FSC_S7020_JWSE, |
d08c5ef2 | 1658 | ALC260_FIXUP_VAIO_PINS, |
1d045db9 TI |
1659 | }; |
1660 | ||
20f7d928 TI |
1661 | static void alc260_gpio1_automute(struct hda_codec *codec) |
1662 | { | |
1663 | struct alc_spec *spec = codec->spec; | |
aaf312de TI |
1664 | |
1665 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); | |
20f7d928 TI |
1666 | } |
1667 | ||
1668 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, | |
1727a771 | 1669 | const struct hda_fixup *fix, int action) |
20f7d928 TI |
1670 | { |
1671 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1672 | if (action == HDA_FIXUP_ACT_PROBE) { |
20f7d928 TI |
1673 | /* although the machine has only one output pin, we need to |
1674 | * toggle GPIO1 according to the jack state | |
1675 | */ | |
08c189f2 TI |
1676 | spec->gen.automute_hook = alc260_gpio1_automute; |
1677 | spec->gen.detect_hp = 1; | |
1678 | spec->gen.automute_speaker = 1; | |
1679 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ | |
62f949bf | 1680 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
08c189f2 | 1681 | snd_hda_gen_hp_automute); |
5579cd6f | 1682 | alc_setup_gpio(codec, 0x01); |
20f7d928 TI |
1683 | } |
1684 | } | |
1685 | ||
118cb4a4 | 1686 | static void alc260_fixup_kn1(struct hda_codec *codec, |
1727a771 | 1687 | const struct hda_fixup *fix, int action) |
118cb4a4 TI |
1688 | { |
1689 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1690 | static const struct hda_pintbl pincfgs[] = { |
118cb4a4 TI |
1691 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
1692 | { 0x12, 0x90a60160 }, /* int mic */ | |
1693 | { 0x13, 0x02a19000 }, /* ext mic */ | |
1694 | { 0x18, 0x01446000 }, /* SPDIF out */ | |
1695 | /* disable bogus I/O pins */ | |
1696 | { 0x10, 0x411111f0 }, | |
1697 | { 0x11, 0x411111f0 }, | |
1698 | { 0x14, 0x411111f0 }, | |
1699 | { 0x15, 0x411111f0 }, | |
1700 | { 0x16, 0x411111f0 }, | |
1701 | { 0x17, 0x411111f0 }, | |
1702 | { 0x19, 0x411111f0 }, | |
1703 | { } | |
1704 | }; | |
1705 | ||
1706 | switch (action) { | |
1727a771 TI |
1707 | case HDA_FIXUP_ACT_PRE_PROBE: |
1708 | snd_hda_apply_pincfgs(codec, pincfgs); | |
118cb4a4 TI |
1709 | spec->init_amp = ALC_INIT_NONE; |
1710 | break; | |
1711 | } | |
1712 | } | |
1713 | ||
39aedee7 TI |
1714 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
1715 | const struct hda_fixup *fix, int action) | |
1716 | { | |
1717 | struct alc_spec *spec = codec->spec; | |
1c76aa5f | 1718 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
5ebd3bbd TI |
1719 | spec->init_amp = ALC_INIT_NONE; |
1720 | } | |
39aedee7 | 1721 | |
5ebd3bbd TI |
1722 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
1723 | const struct hda_fixup *fix, int action) | |
1724 | { | |
1725 | struct alc_spec *spec = codec->spec; | |
1726 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
f811c3cf | 1727 | spec->gen.add_jack_modes = 1; |
5ebd3bbd | 1728 | spec->gen.hp_mic = 1; |
e6e0ee50 | 1729 | } |
39aedee7 TI |
1730 | } |
1731 | ||
1727a771 | 1732 | static const struct hda_fixup alc260_fixups[] = { |
ca8f0424 | 1733 | [ALC260_FIXUP_HP_DC5750] = { |
1727a771 TI |
1734 | .type = HDA_FIXUP_PINS, |
1735 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
1736 | { 0x11, 0x90130110 }, /* speaker */ |
1737 | { } | |
1738 | } | |
1739 | }, | |
ca8f0424 | 1740 | [ALC260_FIXUP_HP_PIN_0F] = { |
1727a771 TI |
1741 | .type = HDA_FIXUP_PINS, |
1742 | .v.pins = (const struct hda_pintbl[]) { | |
ca8f0424 TI |
1743 | { 0x0f, 0x01214000 }, /* HP */ |
1744 | { } | |
1745 | } | |
1746 | }, | |
1747 | [ALC260_FIXUP_COEF] = { | |
1727a771 | 1748 | .type = HDA_FIXUP_VERBS, |
ca8f0424 | 1749 | .v.verbs = (const struct hda_verb[]) { |
e30cf2d2 RM |
1750 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1751 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, | |
ca8f0424 TI |
1752 | { } |
1753 | }, | |
ca8f0424 | 1754 | }, |
15317ab2 | 1755 | [ALC260_FIXUP_GPIO1] = { |
5579cd6f TI |
1756 | .type = HDA_FIXUP_FUNC, |
1757 | .v.func = alc_fixup_gpio1, | |
15317ab2 | 1758 | }, |
20f7d928 | 1759 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
1727a771 | 1760 | .type = HDA_FIXUP_FUNC, |
20f7d928 TI |
1761 | .v.func = alc260_fixup_gpio1_toggle, |
1762 | .chained = true, | |
1763 | .chain_id = ALC260_FIXUP_HP_PIN_0F, | |
1764 | }, | |
1765 | [ALC260_FIXUP_REPLACER] = { | |
1727a771 | 1766 | .type = HDA_FIXUP_VERBS, |
20f7d928 | 1767 | .v.verbs = (const struct hda_verb[]) { |
192a98e2 TI |
1768 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1769 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
20f7d928 TI |
1770 | { } |
1771 | }, | |
1772 | .chained = true, | |
1773 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, | |
1774 | }, | |
0a1c4fa2 | 1775 | [ALC260_FIXUP_HP_B1900] = { |
1727a771 | 1776 | .type = HDA_FIXUP_FUNC, |
0a1c4fa2 TI |
1777 | .v.func = alc260_fixup_gpio1_toggle, |
1778 | .chained = true, | |
1779 | .chain_id = ALC260_FIXUP_COEF, | |
118cb4a4 TI |
1780 | }, |
1781 | [ALC260_FIXUP_KN1] = { | |
1727a771 | 1782 | .type = HDA_FIXUP_FUNC, |
118cb4a4 TI |
1783 | .v.func = alc260_fixup_kn1, |
1784 | }, | |
39aedee7 TI |
1785 | [ALC260_FIXUP_FSC_S7020] = { |
1786 | .type = HDA_FIXUP_FUNC, | |
1787 | .v.func = alc260_fixup_fsc_s7020, | |
1788 | }, | |
5ebd3bbd TI |
1789 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
1790 | .type = HDA_FIXUP_FUNC, | |
1791 | .v.func = alc260_fixup_fsc_s7020_jwse, | |
1792 | .chained = true, | |
1793 | .chain_id = ALC260_FIXUP_FSC_S7020, | |
1794 | }, | |
d08c5ef2 TI |
1795 | [ALC260_FIXUP_VAIO_PINS] = { |
1796 | .type = HDA_FIXUP_PINS, | |
1797 | .v.pins = (const struct hda_pintbl[]) { | |
1798 | /* Pin configs are missing completely on some VAIOs */ | |
1799 | { 0x0f, 0x01211020 }, | |
1800 | { 0x10, 0x0001003f }, | |
1801 | { 0x11, 0x411111f0 }, | |
1802 | { 0x12, 0x01a15930 }, | |
1803 | { 0x13, 0x411111f0 }, | |
1804 | { 0x14, 0x411111f0 }, | |
1805 | { 0x15, 0x411111f0 }, | |
1806 | { 0x16, 0x411111f0 }, | |
1807 | { 0x17, 0x411111f0 }, | |
1808 | { 0x18, 0x411111f0 }, | |
1809 | { 0x19, 0x411111f0 }, | |
1810 | { } | |
1811 | } | |
1812 | }, | |
1d045db9 TI |
1813 | }; |
1814 | ||
1815 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { | |
15317ab2 | 1816 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1817 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
15317ab2 | 1818 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1819 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
0a1c4fa2 | 1820 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
d08c5ef2 | 1821 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
0f5a5b85 | 1822 | SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), |
39aedee7 | 1823 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
b1f58085 | 1824 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
118cb4a4 | 1825 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
20f7d928 | 1826 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
ca8f0424 | 1827 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
1d045db9 TI |
1828 | {} |
1829 | }; | |
1830 | ||
5ebd3bbd TI |
1831 | static const struct hda_model_fixup alc260_fixup_models[] = { |
1832 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, | |
1833 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, | |
1834 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, | |
1835 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, | |
1836 | {} | |
1837 | }; | |
1838 | ||
1d045db9 TI |
1839 | /* |
1840 | */ | |
1d045db9 | 1841 | static int patch_alc260(struct hda_codec *codec) |
977ddd6b | 1842 | { |
1d045db9 | 1843 | struct alc_spec *spec; |
c3c2c9e7 | 1844 | int err; |
1d045db9 | 1845 | |
3de95173 TI |
1846 | err = alc_alloc_spec(codec, 0x07); |
1847 | if (err < 0) | |
1848 | return err; | |
1d045db9 | 1849 | |
3de95173 | 1850 | spec = codec->spec; |
ea46c3c8 TI |
1851 | /* as quite a few machines require HP amp for speaker outputs, |
1852 | * it's easier to enable it unconditionally; even if it's unneeded, | |
1853 | * it's almost harmless. | |
1854 | */ | |
1855 | spec->gen.prefer_hp_amp = 1; | |
7504b6cd | 1856 | spec->gen.beep_nid = 0x01; |
1d045db9 | 1857 | |
225068ab TI |
1858 | spec->shutup = alc_eapd_shutup; |
1859 | ||
c9af753f TI |
1860 | alc_pre_init(codec); |
1861 | ||
5ebd3bbd TI |
1862 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
1863 | alc260_fixups); | |
1727a771 | 1864 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
977ddd6b | 1865 | |
c3c2c9e7 TI |
1866 | /* automatic parse from the BIOS config */ |
1867 | err = alc260_parse_auto_config(codec); | |
1868 | if (err < 0) | |
1869 | goto error; | |
977ddd6b | 1870 | |
fea80fae TI |
1871 | if (!spec->gen.no_analog) { |
1872 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); | |
1873 | if (err < 0) | |
1874 | goto error; | |
1875 | } | |
977ddd6b | 1876 | |
1727a771 | 1877 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1878 | |
1d045db9 | 1879 | return 0; |
e16fb6d1 TI |
1880 | |
1881 | error: | |
1882 | alc_free(codec); | |
1883 | return err; | |
6981d184 TI |
1884 | } |
1885 | ||
1d045db9 TI |
1886 | |
1887 | /* | |
1888 | * ALC882/883/885/888/889 support | |
1889 | * | |
1890 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible | |
1891 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
1892 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
1893 | * 6-channel independent captures. | |
1894 | * | |
1895 | * In addition, an independent DAC for the multi-playback (not used in this | |
1896 | * driver yet). | |
1897 | */ | |
1d045db9 TI |
1898 | |
1899 | /* | |
1900 | * Pin config fixes | |
1901 | */ | |
ff818c24 | 1902 | enum { |
5c0ebfbe TI |
1903 | ALC882_FIXUP_ABIT_AW9D_MAX, |
1904 | ALC882_FIXUP_LENOVO_Y530, | |
1905 | ALC882_FIXUP_PB_M5210, | |
1906 | ALC882_FIXUP_ACER_ASPIRE_7736, | |
1907 | ALC882_FIXUP_ASUS_W90V, | |
8f239214 | 1908 | ALC889_FIXUP_CD, |
b2c53e20 | 1909 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
5c0ebfbe | 1910 | ALC889_FIXUP_VAIO_TT, |
0e7cc2e7 | 1911 | ALC888_FIXUP_EEE1601, |
4841b8e6 | 1912 | ALC886_FIXUP_EAPD, |
177943a3 | 1913 | ALC882_FIXUP_EAPD, |
7a6069bf | 1914 | ALC883_FIXUP_EAPD, |
8812c4f9 | 1915 | ALC883_FIXUP_ACER_EAPD, |
1a97b7f2 TI |
1916 | ALC882_FIXUP_GPIO1, |
1917 | ALC882_FIXUP_GPIO2, | |
eb844d51 | 1918 | ALC882_FIXUP_GPIO3, |
68ef0561 TI |
1919 | ALC889_FIXUP_COEF, |
1920 | ALC882_FIXUP_ASUS_W2JC, | |
c3e837bb TI |
1921 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
1922 | ALC882_FIXUP_ACER_ASPIRE_8930G, | |
1923 | ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
5671087f | 1924 | ALC885_FIXUP_MACPRO_GPIO, |
02a237b2 | 1925 | ALC889_FIXUP_DAC_ROUTE, |
1a97b7f2 TI |
1926 | ALC889_FIXUP_MBP_VREF, |
1927 | ALC889_FIXUP_IMAC91_VREF, | |
e7729a41 | 1928 | ALC889_FIXUP_MBA11_VREF, |
0756f09c | 1929 | ALC889_FIXUP_MBA21_VREF, |
c20f31ec | 1930 | ALC889_FIXUP_MP11_VREF, |
9f660a1c | 1931 | ALC889_FIXUP_MP41_VREF, |
6e72aa5f | 1932 | ALC882_FIXUP_INV_DMIC, |
e427c237 | 1933 | ALC882_FIXUP_NO_PRIMARY_HP, |
1f0bbf03 | 1934 | ALC887_FIXUP_ASUS_BASS, |
eb9ca3ab | 1935 | ALC887_FIXUP_BASS_CHMAP, |
7beb3a6e | 1936 | ALC1220_FIXUP_GB_DUAL_CODECS, |
0202f5cd | 1937 | ALC1220_FIXUP_CLEVO_P950, |
80690a27 RS |
1938 | ALC1220_FIXUP_CLEVO_PB51ED, |
1939 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, | |
ca184355 JHP |
1940 | ALC887_FIXUP_ASUS_AUDIO, |
1941 | ALC887_FIXUP_ASUS_HMIC, | |
ff818c24 TI |
1942 | }; |
1943 | ||
68ef0561 | 1944 | static void alc889_fixup_coef(struct hda_codec *codec, |
1727a771 | 1945 | const struct hda_fixup *fix, int action) |
68ef0561 | 1946 | { |
1727a771 | 1947 | if (action != HDA_FIXUP_ACT_INIT) |
68ef0561 | 1948 | return; |
1df8874b | 1949 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
68ef0561 TI |
1950 | } |
1951 | ||
5671087f TI |
1952 | /* set up GPIO at initialization */ |
1953 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, | |
1727a771 | 1954 | const struct hda_fixup *fix, int action) |
5671087f | 1955 | { |
215c850c TI |
1956 | struct alc_spec *spec = codec->spec; |
1957 | ||
1958 | spec->gpio_write_delay = true; | |
1959 | alc_fixup_gpio3(codec, fix, action); | |
5671087f TI |
1960 | } |
1961 | ||
02a237b2 TI |
1962 | /* Fix the connection of some pins for ALC889: |
1963 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't | |
1964 | * work correctly (bko#42740) | |
1965 | */ | |
1966 | static void alc889_fixup_dac_route(struct hda_codec *codec, | |
1727a771 | 1967 | const struct hda_fixup *fix, int action) |
02a237b2 | 1968 | { |
1727a771 | 1969 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
ef8d60fb | 1970 | /* fake the connections during parsing the tree */ |
caf3c043 MM |
1971 | static const hda_nid_t conn1[] = { 0x0c, 0x0d }; |
1972 | static const hda_nid_t conn2[] = { 0x0e, 0x0f }; | |
1973 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); | |
1974 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); | |
1975 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); | |
1976 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); | |
1727a771 | 1977 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
ef8d60fb | 1978 | /* restore the connections */ |
caf3c043 MM |
1979 | static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
1980 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); | |
1981 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); | |
1982 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); | |
1983 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); | |
02a237b2 TI |
1984 | } |
1985 | } | |
1986 | ||
1a97b7f2 TI |
1987 | /* Set VREF on HP pin */ |
1988 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, | |
1727a771 | 1989 | const struct hda_fixup *fix, int action) |
1a97b7f2 | 1990 | { |
caf3c043 | 1991 | static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; |
1a97b7f2 | 1992 | struct alc_spec *spec = codec->spec; |
1a97b7f2 TI |
1993 | int i; |
1994 | ||
1727a771 | 1995 | if (action != HDA_FIXUP_ACT_INIT) |
1a97b7f2 TI |
1996 | return; |
1997 | for (i = 0; i < ARRAY_SIZE(nids); i++) { | |
1998 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); | |
1999 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) | |
2000 | continue; | |
d3f02d60 | 2001 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 2002 | val |= AC_PINCTL_VREF_80; |
cdd03ced | 2003 | snd_hda_set_pin_ctl(codec, nids[i], val); |
08c189f2 | 2004 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
2005 | break; |
2006 | } | |
2007 | } | |
2008 | ||
0756f09c TI |
2009 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
2010 | const hda_nid_t *nids, int num_nids) | |
1a97b7f2 TI |
2011 | { |
2012 | struct alc_spec *spec = codec->spec; | |
1a97b7f2 TI |
2013 | int i; |
2014 | ||
0756f09c | 2015 | for (i = 0; i < num_nids; i++) { |
1a97b7f2 | 2016 | unsigned int val; |
d3f02d60 | 2017 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 2018 | val |= AC_PINCTL_VREF_50; |
cdd03ced | 2019 | snd_hda_set_pin_ctl(codec, nids[i], val); |
1a97b7f2 | 2020 | } |
08c189f2 | 2021 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
2022 | } |
2023 | ||
0756f09c TI |
2024 | /* Set VREF on speaker pins on imac91 */ |
2025 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, | |
2026 | const struct hda_fixup *fix, int action) | |
2027 | { | |
caf3c043 | 2028 | static const hda_nid_t nids[] = { 0x18, 0x1a }; |
0756f09c TI |
2029 | |
2030 | if (action == HDA_FIXUP_ACT_INIT) | |
2031 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2032 | } | |
2033 | ||
e7729a41 AV |
2034 | /* Set VREF on speaker pins on mba11 */ |
2035 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, | |
2036 | const struct hda_fixup *fix, int action) | |
2037 | { | |
caf3c043 | 2038 | static const hda_nid_t nids[] = { 0x18 }; |
e7729a41 AV |
2039 | |
2040 | if (action == HDA_FIXUP_ACT_INIT) | |
2041 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2042 | } | |
2043 | ||
0756f09c TI |
2044 | /* Set VREF on speaker pins on mba21 */ |
2045 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, | |
2046 | const struct hda_fixup *fix, int action) | |
2047 | { | |
caf3c043 | 2048 | static const hda_nid_t nids[] = { 0x18, 0x19 }; |
0756f09c TI |
2049 | |
2050 | if (action == HDA_FIXUP_ACT_INIT) | |
2051 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2052 | } | |
2053 | ||
e427c237 | 2054 | /* Don't take HP output as primary |
d9111496 FLVC |
2055 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
2056 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 | |
e427c237 TI |
2057 | */ |
2058 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, | |
1727a771 | 2059 | const struct hda_fixup *fix, int action) |
e427c237 TI |
2060 | { |
2061 | struct alc_spec *spec = codec->spec; | |
da96fb5b | 2062 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
08c189f2 | 2063 | spec->gen.no_primary_hp = 1; |
da96fb5b TI |
2064 | spec->gen.no_multi_io = 1; |
2065 | } | |
e427c237 TI |
2066 | } |
2067 | ||
eb9ca3ab TI |
2068 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
2069 | const struct hda_fixup *fix, int action); | |
2070 | ||
7beb3a6e TI |
2071 | /* For dual-codec configuration, we need to disable some features to avoid |
2072 | * conflicts of kctls and PCM streams | |
2073 | */ | |
2074 | static void alc_fixup_dual_codecs(struct hda_codec *codec, | |
2075 | const struct hda_fixup *fix, int action) | |
2076 | { | |
2077 | struct alc_spec *spec = codec->spec; | |
2078 | ||
2079 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2080 | return; | |
2081 | /* disable vmaster */ | |
2082 | spec->gen.suppress_vmaster = 1; | |
2083 | /* auto-mute and auto-mic switch don't work with multiple codecs */ | |
2084 | spec->gen.suppress_auto_mute = 1; | |
2085 | spec->gen.suppress_auto_mic = 1; | |
2086 | /* disable aamix as well */ | |
2087 | spec->gen.mixer_nid = 0; | |
2088 | /* add location prefix to avoid conflicts */ | |
2089 | codec->force_pin_prefix = 1; | |
2090 | } | |
2091 | ||
2092 | static void rename_ctl(struct hda_codec *codec, const char *oldname, | |
2093 | const char *newname) | |
2094 | { | |
2095 | struct snd_kcontrol *kctl; | |
2096 | ||
2097 | kctl = snd_hda_find_mixer_ctl(codec, oldname); | |
2098 | if (kctl) | |
2099 | strcpy(kctl->id.name, newname); | |
2100 | } | |
2101 | ||
2102 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, | |
2103 | const struct hda_fixup *fix, | |
2104 | int action) | |
2105 | { | |
2106 | alc_fixup_dual_codecs(codec, fix, action); | |
2107 | switch (action) { | |
2108 | case HDA_FIXUP_ACT_PRE_PROBE: | |
2109 | /* override card longname to provide a unique UCM profile */ | |
2110 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); | |
2111 | break; | |
2112 | case HDA_FIXUP_ACT_BUILD: | |
2113 | /* rename Capture controls depending on the codec */ | |
2114 | rename_ctl(codec, "Capture Volume", | |
2115 | codec->addr == 0 ? | |
2116 | "Rear-Panel Capture Volume" : | |
2117 | "Front-Panel Capture Volume"); | |
2118 | rename_ctl(codec, "Capture Switch", | |
2119 | codec->addr == 0 ? | |
2120 | "Rear-Panel Capture Switch" : | |
2121 | "Front-Panel Capture Switch"); | |
2122 | break; | |
2123 | } | |
2124 | } | |
2125 | ||
0202f5cd P |
2126 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
2127 | const struct hda_fixup *fix, | |
2128 | int action) | |
2129 | { | |
caf3c043 | 2130 | static const hda_nid_t conn1[] = { 0x0c }; |
0202f5cd P |
2131 | |
2132 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2133 | return; | |
2134 | ||
2135 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); | |
2136 | /* We therefore want to make sure 0x14 (front headphone) and | |
2137 | * 0x1b (speakers) use the stereo DAC 0x02 | |
2138 | */ | |
caf3c043 MM |
2139 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
2140 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); | |
0202f5cd P |
2141 | } |
2142 | ||
7f665b1c JS |
2143 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
2144 | const struct hda_fixup *fix, int action); | |
2145 | ||
80690a27 | 2146 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
7f665b1c JS |
2147 | const struct hda_fixup *fix, |
2148 | int action) | |
2149 | { | |
2150 | alc1220_fixup_clevo_p950(codec, fix, action); | |
2151 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); | |
2152 | } | |
2153 | ||
ca184355 JHP |
2154 | static void alc887_asus_hp_automute_hook(struct hda_codec *codec, |
2155 | struct hda_jack_callback *jack) | |
2156 | { | |
2157 | struct alc_spec *spec = codec->spec; | |
2158 | unsigned int vref; | |
2159 | ||
2160 | snd_hda_gen_hp_automute(codec, jack); | |
2161 | ||
2162 | if (spec->gen.hp_jack_present) | |
2163 | vref = AC_PINCTL_VREF_80; | |
2164 | else | |
2165 | vref = AC_PINCTL_VREF_HIZ; | |
2166 | snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); | |
2167 | } | |
2168 | ||
2169 | static void alc887_fixup_asus_jack(struct hda_codec *codec, | |
2170 | const struct hda_fixup *fix, int action) | |
2171 | { | |
2172 | struct alc_spec *spec = codec->spec; | |
2173 | if (action != HDA_FIXUP_ACT_PROBE) | |
2174 | return; | |
2175 | snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); | |
2176 | spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; | |
2177 | } | |
2178 | ||
1727a771 | 2179 | static const struct hda_fixup alc882_fixups[] = { |
5c0ebfbe | 2180 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
1727a771 TI |
2181 | .type = HDA_FIXUP_PINS, |
2182 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2183 | { 0x15, 0x01080104 }, /* side */ |
2184 | { 0x16, 0x01011012 }, /* rear */ | |
2185 | { 0x17, 0x01016011 }, /* clfe */ | |
2785591a | 2186 | { } |
145a902b DH |
2187 | } |
2188 | }, | |
5c0ebfbe | 2189 | [ALC882_FIXUP_LENOVO_Y530] = { |
1727a771 TI |
2190 | .type = HDA_FIXUP_PINS, |
2191 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2192 | { 0x15, 0x99130112 }, /* rear int speakers */ |
2193 | { 0x16, 0x99130111 }, /* subwoofer */ | |
ac612407 DH |
2194 | { } |
2195 | } | |
2196 | }, | |
5c0ebfbe | 2197 | [ALC882_FIXUP_PB_M5210] = { |
fd108215 TI |
2198 | .type = HDA_FIXUP_PINCTLS, |
2199 | .v.pins = (const struct hda_pintbl[]) { | |
2200 | { 0x19, PIN_VREF50 }, | |
357f915e KY |
2201 | {} |
2202 | } | |
2203 | }, | |
5c0ebfbe | 2204 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
1727a771 | 2205 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 2206 | .v.func = alc_fixup_sku_ignore, |
6981d184 | 2207 | }, |
5c0ebfbe | 2208 | [ALC882_FIXUP_ASUS_W90V] = { |
1727a771 TI |
2209 | .type = HDA_FIXUP_PINS, |
2210 | .v.pins = (const struct hda_pintbl[]) { | |
5cdf745e TI |
2211 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
2212 | { } | |
2213 | } | |
2214 | }, | |
8f239214 | 2215 | [ALC889_FIXUP_CD] = { |
1727a771 TI |
2216 | .type = HDA_FIXUP_PINS, |
2217 | .v.pins = (const struct hda_pintbl[]) { | |
8f239214 MB |
2218 | { 0x1c, 0x993301f0 }, /* CD */ |
2219 | { } | |
2220 | } | |
2221 | }, | |
b2c53e20 DH |
2222 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
2223 | .type = HDA_FIXUP_PINS, | |
2224 | .v.pins = (const struct hda_pintbl[]) { | |
2225 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ | |
2226 | { } | |
2227 | }, | |
2228 | .chained = true, | |
2229 | .chain_id = ALC889_FIXUP_CD, | |
2230 | }, | |
5c0ebfbe | 2231 | [ALC889_FIXUP_VAIO_TT] = { |
1727a771 TI |
2232 | .type = HDA_FIXUP_PINS, |
2233 | .v.pins = (const struct hda_pintbl[]) { | |
5c0ebfbe TI |
2234 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
2235 | { } | |
2236 | } | |
2237 | }, | |
0e7cc2e7 | 2238 | [ALC888_FIXUP_EEE1601] = { |
1727a771 | 2239 | .type = HDA_FIXUP_VERBS, |
0e7cc2e7 TI |
2240 | .v.verbs = (const struct hda_verb[]) { |
2241 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2242 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, | |
2243 | { } | |
2244 | } | |
177943a3 | 2245 | }, |
4841b8e6 PH |
2246 | [ALC886_FIXUP_EAPD] = { |
2247 | .type = HDA_FIXUP_VERBS, | |
2248 | .v.verbs = (const struct hda_verb[]) { | |
2249 | /* change to EAPD mode */ | |
2250 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2251 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 }, | |
2252 | { } | |
2253 | } | |
2254 | }, | |
177943a3 | 2255 | [ALC882_FIXUP_EAPD] = { |
1727a771 | 2256 | .type = HDA_FIXUP_VERBS, |
177943a3 TI |
2257 | .v.verbs = (const struct hda_verb[]) { |
2258 | /* change to EAPD mode */ | |
2259 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2260 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
2261 | { } | |
2262 | } | |
2263 | }, | |
7a6069bf | 2264 | [ALC883_FIXUP_EAPD] = { |
1727a771 | 2265 | .type = HDA_FIXUP_VERBS, |
7a6069bf TI |
2266 | .v.verbs = (const struct hda_verb[]) { |
2267 | /* change to EAPD mode */ | |
2268 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2269 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2270 | { } | |
2271 | } | |
2272 | }, | |
8812c4f9 | 2273 | [ALC883_FIXUP_ACER_EAPD] = { |
1727a771 | 2274 | .type = HDA_FIXUP_VERBS, |
8812c4f9 TI |
2275 | .v.verbs = (const struct hda_verb[]) { |
2276 | /* eanable EAPD on Acer laptops */ | |
2277 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2278 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2279 | { } | |
2280 | } | |
2281 | }, | |
1a97b7f2 | 2282 | [ALC882_FIXUP_GPIO1] = { |
5579cd6f TI |
2283 | .type = HDA_FIXUP_FUNC, |
2284 | .v.func = alc_fixup_gpio1, | |
1a97b7f2 TI |
2285 | }, |
2286 | [ALC882_FIXUP_GPIO2] = { | |
5579cd6f TI |
2287 | .type = HDA_FIXUP_FUNC, |
2288 | .v.func = alc_fixup_gpio2, | |
1a97b7f2 | 2289 | }, |
eb844d51 | 2290 | [ALC882_FIXUP_GPIO3] = { |
5579cd6f TI |
2291 | .type = HDA_FIXUP_FUNC, |
2292 | .v.func = alc_fixup_gpio3, | |
eb844d51 | 2293 | }, |
68ef0561 | 2294 | [ALC882_FIXUP_ASUS_W2JC] = { |
5579cd6f TI |
2295 | .type = HDA_FIXUP_FUNC, |
2296 | .v.func = alc_fixup_gpio1, | |
68ef0561 TI |
2297 | .chained = true, |
2298 | .chain_id = ALC882_FIXUP_EAPD, | |
2299 | }, | |
2300 | [ALC889_FIXUP_COEF] = { | |
1727a771 | 2301 | .type = HDA_FIXUP_FUNC, |
68ef0561 TI |
2302 | .v.func = alc889_fixup_coef, |
2303 | }, | |
c3e837bb | 2304 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
1727a771 TI |
2305 | .type = HDA_FIXUP_PINS, |
2306 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2307 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2308 | { 0x17, 0x99130112 }, /* surround speaker */ | |
2309 | { } | |
038d4fef TI |
2310 | }, |
2311 | .chained = true, | |
2312 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb TI |
2313 | }, |
2314 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { | |
1727a771 TI |
2315 | .type = HDA_FIXUP_PINS, |
2316 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2317 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2318 | { 0x1b, 0x99130112 }, /* surround speaker */ | |
2319 | { } | |
2320 | }, | |
2321 | .chained = true, | |
2322 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
2323 | }, | |
2324 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { | |
2325 | /* additional init verbs for Acer Aspire 8930G */ | |
1727a771 | 2326 | .type = HDA_FIXUP_VERBS, |
c3e837bb TI |
2327 | .v.verbs = (const struct hda_verb[]) { |
2328 | /* Enable all DACs */ | |
2329 | /* DAC DISABLE/MUTE 1? */ | |
2330 | /* setting bits 1-5 disables DAC nids 0x02-0x06 | |
2331 | * apparently. Init=0x38 */ | |
2332 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, | |
2333 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2334 | /* DAC DISABLE/MUTE 2? */ | |
2335 | /* some bit here disables the other DACs. | |
2336 | * Init=0x4900 */ | |
2337 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, | |
2338 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2339 | /* DMIC fix | |
2340 | * This laptop has a stereo digital microphone. | |
2341 | * The mics are only 1cm apart which makes the stereo | |
2342 | * useless. However, either the mic or the ALC889 | |
2343 | * makes the signal become a difference/sum signal | |
2344 | * instead of standard stereo, which is annoying. | |
2345 | * So instead we flip this bit which makes the | |
2346 | * codec replicate the sum signal to both channels, | |
2347 | * turning it into a normal mono mic. | |
2348 | */ | |
2349 | /* DMIC_CONTROL? Init value = 0x0001 */ | |
2350 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2351 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, | |
2352 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2353 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2354 | { } | |
038d4fef TI |
2355 | }, |
2356 | .chained = true, | |
2357 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb | 2358 | }, |
5671087f | 2359 | [ALC885_FIXUP_MACPRO_GPIO] = { |
1727a771 | 2360 | .type = HDA_FIXUP_FUNC, |
5671087f TI |
2361 | .v.func = alc885_fixup_macpro_gpio, |
2362 | }, | |
02a237b2 | 2363 | [ALC889_FIXUP_DAC_ROUTE] = { |
1727a771 | 2364 | .type = HDA_FIXUP_FUNC, |
02a237b2 TI |
2365 | .v.func = alc889_fixup_dac_route, |
2366 | }, | |
1a97b7f2 | 2367 | [ALC889_FIXUP_MBP_VREF] = { |
1727a771 | 2368 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2369 | .v.func = alc889_fixup_mbp_vref, |
2370 | .chained = true, | |
2371 | .chain_id = ALC882_FIXUP_GPIO1, | |
2372 | }, | |
2373 | [ALC889_FIXUP_IMAC91_VREF] = { | |
1727a771 | 2374 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2375 | .v.func = alc889_fixup_imac91_vref, |
2376 | .chained = true, | |
2377 | .chain_id = ALC882_FIXUP_GPIO1, | |
2378 | }, | |
e7729a41 AV |
2379 | [ALC889_FIXUP_MBA11_VREF] = { |
2380 | .type = HDA_FIXUP_FUNC, | |
2381 | .v.func = alc889_fixup_mba11_vref, | |
2382 | .chained = true, | |
2383 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2384 | }, | |
0756f09c TI |
2385 | [ALC889_FIXUP_MBA21_VREF] = { |
2386 | .type = HDA_FIXUP_FUNC, | |
2387 | .v.func = alc889_fixup_mba21_vref, | |
2388 | .chained = true, | |
2389 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2390 | }, | |
c20f31ec TI |
2391 | [ALC889_FIXUP_MP11_VREF] = { |
2392 | .type = HDA_FIXUP_FUNC, | |
2393 | .v.func = alc889_fixup_mba11_vref, | |
2394 | .chained = true, | |
2395 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2396 | }, | |
9f660a1c MK |
2397 | [ALC889_FIXUP_MP41_VREF] = { |
2398 | .type = HDA_FIXUP_FUNC, | |
2399 | .v.func = alc889_fixup_mbp_vref, | |
2400 | .chained = true, | |
2401 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2402 | }, | |
6e72aa5f | 2403 | [ALC882_FIXUP_INV_DMIC] = { |
1727a771 | 2404 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2405 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2406 | }, |
e427c237 | 2407 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
1727a771 | 2408 | .type = HDA_FIXUP_FUNC, |
e427c237 TI |
2409 | .v.func = alc882_fixup_no_primary_hp, |
2410 | }, | |
1f0bbf03 TI |
2411 | [ALC887_FIXUP_ASUS_BASS] = { |
2412 | .type = HDA_FIXUP_PINS, | |
2413 | .v.pins = (const struct hda_pintbl[]) { | |
2414 | {0x16, 0x99130130}, /* bass speaker */ | |
2415 | {} | |
2416 | }, | |
eb9ca3ab TI |
2417 | .chained = true, |
2418 | .chain_id = ALC887_FIXUP_BASS_CHMAP, | |
2419 | }, | |
2420 | [ALC887_FIXUP_BASS_CHMAP] = { | |
2421 | .type = HDA_FIXUP_FUNC, | |
2422 | .v.func = alc_fixup_bass_chmap, | |
1f0bbf03 | 2423 | }, |
7beb3a6e TI |
2424 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
2425 | .type = HDA_FIXUP_FUNC, | |
2426 | .v.func = alc1220_fixup_gb_dual_codecs, | |
2427 | }, | |
0202f5cd P |
2428 | [ALC1220_FIXUP_CLEVO_P950] = { |
2429 | .type = HDA_FIXUP_FUNC, | |
2430 | .v.func = alc1220_fixup_clevo_p950, | |
2431 | }, | |
80690a27 | 2432 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
7f665b1c | 2433 | .type = HDA_FIXUP_FUNC, |
80690a27 | 2434 | .v.func = alc1220_fixup_clevo_pb51ed, |
7f665b1c | 2435 | }, |
80690a27 | 2436 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
7f665b1c JS |
2437 | .type = HDA_FIXUP_PINS, |
2438 | .v.pins = (const struct hda_pintbl[]) { | |
2439 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
2440 | {} | |
2441 | }, | |
2442 | .chained = true, | |
80690a27 | 2443 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
7f665b1c | 2444 | }, |
ca184355 JHP |
2445 | [ALC887_FIXUP_ASUS_AUDIO] = { |
2446 | .type = HDA_FIXUP_PINS, | |
2447 | .v.pins = (const struct hda_pintbl[]) { | |
2448 | { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ | |
2449 | { 0x19, 0x22219420 }, | |
2450 | {} | |
2451 | }, | |
2452 | }, | |
2453 | [ALC887_FIXUP_ASUS_HMIC] = { | |
2454 | .type = HDA_FIXUP_FUNC, | |
2455 | .v.func = alc887_fixup_asus_jack, | |
2456 | .chained = true, | |
2457 | .chain_id = ALC887_FIXUP_ASUS_AUDIO, | |
2458 | }, | |
ff818c24 TI |
2459 | }; |
2460 | ||
1d045db9 | 2461 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
8812c4f9 TI |
2462 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
2463 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
b5d724b1 | 2464 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
8812c4f9 TI |
2465 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
2466 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
2467 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), | |
2468 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), | |
c3e837bb TI |
2469 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
2470 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2471 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", | |
2472 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2473 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", | |
2474 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
2475 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", | |
2476 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
b265047a TI |
2477 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
2478 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2479 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), | |
c3e837bb TI |
2480 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
2481 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2482 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", | |
2483 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
f5c53d89 TI |
2484 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
2485 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
02a237b2 | 2486 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
fe97da1f | 2487 | SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), |
ac9b1cdd | 2488 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
177943a3 | 2489 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
5c0ebfbe | 2490 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
68ef0561 | 2491 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
ca184355 | 2492 | SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), |
0e7cc2e7 | 2493 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
1f0bbf03 | 2494 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
85bcf96c | 2495 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
b7529c18 TI |
2496 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
2497 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), | |
ac9b1cdd | 2498 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
e427c237 | 2499 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
3f3c3714 | 2500 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
5671087f TI |
2501 | |
2502 | /* All Apple entries are in codec SSIDs */ | |
1a97b7f2 TI |
2503 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
2504 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), | |
2505 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
c20f31ec | 2506 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
5671087f TI |
2507 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
2508 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), | |
1a97b7f2 TI |
2509 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
2510 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2511 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
e7729a41 | 2512 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
0756f09c | 2513 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
1a97b7f2 TI |
2514 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
2515 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2516 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
1a97b7f2 TI |
2517 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
2518 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), | |
2519 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), | |
9f660a1c | 2520 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), |
05193639 | 2521 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
1a97b7f2 TI |
2522 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
2523 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), | |
649ccd08 | 2524 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
5671087f | 2525 | |
7a6069bf | 2526 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
4841b8e6 | 2527 | SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), |
b2c53e20 | 2528 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
7beb3a6e | 2529 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
0d45e86d | 2530 | SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), |
d9e8fe0c | 2531 | SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), |
a0b03952 | 2532 | SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
a655e2b1 | 2533 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
09926202 | 2534 | SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), |
1d3aa4a5 | 2535 | SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), |
7dafba37 | 2536 | SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), |
cc5049ae | 2537 | SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), |
d2c3b14e | 2538 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
26af1772 | 2539 | SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS), |
63691587 | 2540 | SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
d2c3b14e | 2541 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
5c0ebfbe | 2542 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
13e1a4cd TI |
2543 | SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2544 | SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2545 | SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2546 | SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2547 | SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2548 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2549 | SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2550 | SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2551 | SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2552 | SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
0202f5cd | 2553 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
b5acfe15 | 2554 | SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), |
13e1a4cd | 2555 | SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), |
f3d737b6 | 2556 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
2f0d520a | 2557 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
b5acfe15 PH |
2558 | SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950), |
2559 | SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950), | |
2560 | SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950), | |
2561 | SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950), | |
503d90b3 RS |
2562 | SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), |
2563 | SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), | |
b5acfe15 | 2564 | SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950), |
7a6069bf TI |
2565 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
2566 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), | |
ac9b1cdd | 2567 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
68ef0561 | 2568 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
ff818c24 TI |
2569 | {} |
2570 | }; | |
2571 | ||
1727a771 | 2572 | static const struct hda_model_fixup alc882_fixup_models[] = { |
772c2917 TI |
2573 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
2574 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, | |
2575 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, | |
2576 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, | |
2577 | {.id = ALC889_FIXUP_CD, .name = "cd"}, | |
2578 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, | |
2579 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, | |
2580 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, | |
2581 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, | |
2582 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, | |
2583 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, | |
2584 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, | |
2585 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, | |
2586 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, | |
2587 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, | |
912093bc TI |
2588 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
2589 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, | |
2590 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, | |
772c2917 TI |
2591 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
2592 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, | |
2593 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, | |
2594 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, | |
2595 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, | |
2596 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, | |
2597 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, | |
2598 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, | |
6e72aa5f | 2599 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e427c237 | 2600 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
772c2917 | 2601 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
ba90d6a6 | 2602 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
772c2917 | 2603 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
912093bc TI |
2604 | {} |
2605 | }; | |
2606 | ||
119b75c1 HW |
2607 | static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = { |
2608 | SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950, | |
2609 | {0x14, 0x01014010}, | |
2610 | {0x15, 0x01011012}, | |
2611 | {0x16, 0x01016011}, | |
2612 | {0x18, 0x01a19040}, | |
2613 | {0x19, 0x02a19050}, | |
2614 | {0x1a, 0x0181304f}, | |
2615 | {0x1b, 0x0221401f}, | |
2616 | {0x1e, 0x01456130}), | |
2617 | SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950, | |
2618 | {0x14, 0x01015010}, | |
2619 | {0x15, 0x01011012}, | |
2620 | {0x16, 0x01011011}, | |
2621 | {0x18, 0x01a11040}, | |
2622 | {0x19, 0x02a19050}, | |
2623 | {0x1a, 0x0181104f}, | |
2624 | {0x1b, 0x0221401f}, | |
2625 | {0x1e, 0x01451130}), | |
2626 | {} | |
2627 | }; | |
2628 | ||
f6a92248 | 2629 | /* |
1d045db9 | 2630 | * BIOS auto configuration |
f6a92248 | 2631 | */ |
1d045db9 TI |
2632 | /* almost identical with ALC880 parser... */ |
2633 | static int alc882_parse_auto_config(struct hda_codec *codec) | |
2634 | { | |
1d045db9 | 2635 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2636 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2637 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); | |
1d045db9 | 2638 | } |
b896b4eb | 2639 | |
1d045db9 TI |
2640 | /* |
2641 | */ | |
1d045db9 | 2642 | static int patch_alc882(struct hda_codec *codec) |
f6a92248 KY |
2643 | { |
2644 | struct alc_spec *spec; | |
1a97b7f2 | 2645 | int err; |
f6a92248 | 2646 | |
3de95173 TI |
2647 | err = alc_alloc_spec(codec, 0x0b); |
2648 | if (err < 0) | |
2649 | return err; | |
f6a92248 | 2650 | |
3de95173 | 2651 | spec = codec->spec; |
1f0f4b80 | 2652 | |
7639a06c | 2653 | switch (codec->core.vendor_id) { |
1d045db9 TI |
2654 | case 0x10ec0882: |
2655 | case 0x10ec0885: | |
acf08081 | 2656 | case 0x10ec0900: |
6d9ffcff | 2657 | case 0x10ec0b00: |
a535ad57 | 2658 | case 0x10ec1220: |
1d045db9 TI |
2659 | break; |
2660 | default: | |
2661 | /* ALC883 and variants */ | |
2662 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); | |
2663 | break; | |
c793bec5 | 2664 | } |
977ddd6b | 2665 | |
c9af753f TI |
2666 | alc_pre_init(codec); |
2667 | ||
1727a771 | 2668 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
912093bc | 2669 | alc882_fixups); |
119b75c1 | 2670 | snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true); |
1727a771 | 2671 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ff818c24 | 2672 | |
1d045db9 TI |
2673 | alc_auto_parse_customize_define(codec); |
2674 | ||
7504b6cd TI |
2675 | if (has_cdefine_beep(codec)) |
2676 | spec->gen.beep_nid = 0x01; | |
2677 | ||
1a97b7f2 TI |
2678 | /* automatic parse from the BIOS config */ |
2679 | err = alc882_parse_auto_config(codec); | |
2680 | if (err < 0) | |
2681 | goto error; | |
f6a92248 | 2682 | |
fea80fae TI |
2683 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
2684 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
2685 | if (err < 0) | |
2686 | goto error; | |
2687 | } | |
f6a92248 | 2688 | |
1727a771 | 2689 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2690 | |
f6a92248 | 2691 | return 0; |
e16fb6d1 TI |
2692 | |
2693 | error: | |
2694 | alc_free(codec); | |
2695 | return err; | |
f6a92248 KY |
2696 | } |
2697 | ||
df694daa | 2698 | |
df694daa | 2699 | /* |
1d045db9 | 2700 | * ALC262 support |
df694daa | 2701 | */ |
1d045db9 | 2702 | static int alc262_parse_auto_config(struct hda_codec *codec) |
df694daa | 2703 | { |
1d045db9 | 2704 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2705 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2706 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); | |
df694daa KY |
2707 | } |
2708 | ||
df694daa | 2709 | /* |
1d045db9 | 2710 | * Pin config fixes |
df694daa | 2711 | */ |
cfc9b06f | 2712 | enum { |
ea4e7af1 | 2713 | ALC262_FIXUP_FSC_H270, |
7513e6da | 2714 | ALC262_FIXUP_FSC_S7110, |
ea4e7af1 TI |
2715 | ALC262_FIXUP_HP_Z200, |
2716 | ALC262_FIXUP_TYAN, | |
c470150c | 2717 | ALC262_FIXUP_LENOVO_3000, |
b42590b8 TI |
2718 | ALC262_FIXUP_BENQ, |
2719 | ALC262_FIXUP_BENQ_T31, | |
6e72aa5f | 2720 | ALC262_FIXUP_INV_DMIC, |
b5c6611f | 2721 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
cfc9b06f TI |
2722 | }; |
2723 | ||
1727a771 | 2724 | static const struct hda_fixup alc262_fixups[] = { |
ea4e7af1 | 2725 | [ALC262_FIXUP_FSC_H270] = { |
1727a771 TI |
2726 | .type = HDA_FIXUP_PINS, |
2727 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2728 | { 0x14, 0x99130110 }, /* speaker */ |
2729 | { 0x15, 0x0221142f }, /* front HP */ | |
2730 | { 0x1b, 0x0121141f }, /* rear HP */ | |
2731 | { } | |
2732 | } | |
2733 | }, | |
7513e6da TI |
2734 | [ALC262_FIXUP_FSC_S7110] = { |
2735 | .type = HDA_FIXUP_PINS, | |
2736 | .v.pins = (const struct hda_pintbl[]) { | |
2737 | { 0x15, 0x90170110 }, /* speaker */ | |
2738 | { } | |
2739 | }, | |
2740 | .chained = true, | |
2741 | .chain_id = ALC262_FIXUP_BENQ, | |
2742 | }, | |
ea4e7af1 | 2743 | [ALC262_FIXUP_HP_Z200] = { |
1727a771 TI |
2744 | .type = HDA_FIXUP_PINS, |
2745 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 | 2746 | { 0x16, 0x99130120 }, /* internal speaker */ |
73413b12 TI |
2747 | { } |
2748 | } | |
cfc9b06f | 2749 | }, |
ea4e7af1 | 2750 | [ALC262_FIXUP_TYAN] = { |
1727a771 TI |
2751 | .type = HDA_FIXUP_PINS, |
2752 | .v.pins = (const struct hda_pintbl[]) { | |
ea4e7af1 TI |
2753 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
2754 | { } | |
2755 | } | |
2756 | }, | |
c470150c | 2757 | [ALC262_FIXUP_LENOVO_3000] = { |
fd108215 TI |
2758 | .type = HDA_FIXUP_PINCTLS, |
2759 | .v.pins = (const struct hda_pintbl[]) { | |
2760 | { 0x19, PIN_VREF50 }, | |
b42590b8 TI |
2761 | {} |
2762 | }, | |
2763 | .chained = true, | |
2764 | .chain_id = ALC262_FIXUP_BENQ, | |
2765 | }, | |
2766 | [ALC262_FIXUP_BENQ] = { | |
1727a771 | 2767 | .type = HDA_FIXUP_VERBS, |
b42590b8 | 2768 | .v.verbs = (const struct hda_verb[]) { |
c470150c TI |
2769 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
2770 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2771 | {} | |
2772 | } | |
2773 | }, | |
b42590b8 | 2774 | [ALC262_FIXUP_BENQ_T31] = { |
1727a771 | 2775 | .type = HDA_FIXUP_VERBS, |
b42590b8 TI |
2776 | .v.verbs = (const struct hda_verb[]) { |
2777 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2778 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2779 | {} | |
2780 | } | |
2781 | }, | |
6e72aa5f | 2782 | [ALC262_FIXUP_INV_DMIC] = { |
1727a771 | 2783 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2784 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2785 | }, |
b5c6611f ML |
2786 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
2787 | .type = HDA_FIXUP_FUNC, | |
2788 | .v.func = alc_fixup_no_depop_delay, | |
2789 | }, | |
cfc9b06f TI |
2790 | }; |
2791 | ||
1d045db9 | 2792 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
ea4e7af1 | 2793 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
7513e6da | 2794 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
3dcd3be3 | 2795 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
ea4e7af1 | 2796 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
275ec0cb | 2797 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
ea4e7af1 | 2798 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
c470150c | 2799 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
b42590b8 TI |
2800 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
2801 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), | |
b5c6611f | 2802 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
cfc9b06f TI |
2803 | {} |
2804 | }; | |
df694daa | 2805 | |
1727a771 | 2806 | static const struct hda_model_fixup alc262_fixup_models[] = { |
6e72aa5f | 2807 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e43c44d6 TI |
2808 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
2809 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, | |
2810 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, | |
2811 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, | |
2812 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, | |
2813 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, | |
2814 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, | |
2815 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, | |
6e72aa5f TI |
2816 | {} |
2817 | }; | |
1d045db9 | 2818 | |
1d045db9 TI |
2819 | /* |
2820 | */ | |
1d045db9 | 2821 | static int patch_alc262(struct hda_codec *codec) |
df694daa KY |
2822 | { |
2823 | struct alc_spec *spec; | |
df694daa KY |
2824 | int err; |
2825 | ||
3de95173 TI |
2826 | err = alc_alloc_spec(codec, 0x0b); |
2827 | if (err < 0) | |
2828 | return err; | |
df694daa | 2829 | |
3de95173 | 2830 | spec = codec->spec; |
08c189f2 | 2831 | spec->gen.shared_mic_vref_pin = 0x18; |
1d045db9 | 2832 | |
225068ab TI |
2833 | spec->shutup = alc_eapd_shutup; |
2834 | ||
1d045db9 TI |
2835 | #if 0 |
2836 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is | |
2837 | * under-run | |
2838 | */ | |
98b24883 | 2839 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
1d045db9 | 2840 | #endif |
1d045db9 TI |
2841 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
2842 | ||
c9af753f TI |
2843 | alc_pre_init(codec); |
2844 | ||
1727a771 | 2845 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
6e72aa5f | 2846 | alc262_fixups); |
1727a771 | 2847 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
9c7f852e | 2848 | |
af741c15 TI |
2849 | alc_auto_parse_customize_define(codec); |
2850 | ||
7504b6cd TI |
2851 | if (has_cdefine_beep(codec)) |
2852 | spec->gen.beep_nid = 0x01; | |
2853 | ||
42399f7a TI |
2854 | /* automatic parse from the BIOS config */ |
2855 | err = alc262_parse_auto_config(codec); | |
2856 | if (err < 0) | |
2857 | goto error; | |
df694daa | 2858 | |
fea80fae TI |
2859 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
2860 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
2861 | if (err < 0) | |
2862 | goto error; | |
2863 | } | |
2134ea4f | 2864 | |
1727a771 | 2865 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2866 | |
1da177e4 | 2867 | return 0; |
e16fb6d1 TI |
2868 | |
2869 | error: | |
2870 | alc_free(codec); | |
2871 | return err; | |
1da177e4 LT |
2872 | } |
2873 | ||
f32610ed | 2874 | /* |
1d045db9 | 2875 | * ALC268 |
f32610ed | 2876 | */ |
1d045db9 | 2877 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
a717777d TI |
2878 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
2879 | struct snd_ctl_elem_value *ucontrol) | |
2880 | { | |
2881 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | |
2882 | unsigned long pval; | |
2883 | int err; | |
2884 | ||
2885 | mutex_lock(&codec->control_mutex); | |
2886 | pval = kcontrol->private_value; | |
2887 | kcontrol->private_value = (pval & ~0xff) | 0x0f; | |
2888 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2889 | if (err >= 0) { | |
2890 | kcontrol->private_value = (pval & ~0xff) | 0x10; | |
2891 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2892 | } | |
2893 | kcontrol->private_value = pval; | |
2894 | mutex_unlock(&codec->control_mutex); | |
2895 | return err; | |
2896 | } | |
f32610ed | 2897 | |
1d045db9 TI |
2898 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
2899 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), | |
a717777d TI |
2900 | { |
2901 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | |
2902 | .name = "Beep Playback Switch", | |
2903 | .subdevice = HDA_SUBDEV_AMP_FLAG, | |
2904 | .info = snd_hda_mixer_amp_switch_info, | |
2905 | .get = snd_hda_mixer_amp_switch_get, | |
2906 | .put = alc268_beep_switch_put, | |
2907 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) | |
2908 | }, | |
f32610ed JS |
2909 | }; |
2910 | ||
1d045db9 TI |
2911 | /* set PCBEEP vol = 0, mute connections */ |
2912 | static const struct hda_verb alc268_beep_init_verbs[] = { | |
2913 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | |
2914 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2915 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2916 | { } | |
f32610ed JS |
2917 | }; |
2918 | ||
6e72aa5f TI |
2919 | enum { |
2920 | ALC268_FIXUP_INV_DMIC, | |
cb766404 | 2921 | ALC268_FIXUP_HP_EAPD, |
24eff328 | 2922 | ALC268_FIXUP_SPDIF, |
6e72aa5f TI |
2923 | }; |
2924 | ||
1727a771 | 2925 | static const struct hda_fixup alc268_fixups[] = { |
6e72aa5f | 2926 | [ALC268_FIXUP_INV_DMIC] = { |
1727a771 | 2927 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2928 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2929 | }, |
cb766404 | 2930 | [ALC268_FIXUP_HP_EAPD] = { |
1727a771 | 2931 | .type = HDA_FIXUP_VERBS, |
cb766404 TI |
2932 | .v.verbs = (const struct hda_verb[]) { |
2933 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
2934 | {} | |
2935 | } | |
2936 | }, | |
24eff328 TI |
2937 | [ALC268_FIXUP_SPDIF] = { |
2938 | .type = HDA_FIXUP_PINS, | |
2939 | .v.pins = (const struct hda_pintbl[]) { | |
2940 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ | |
2941 | {} | |
2942 | } | |
2943 | }, | |
6e72aa5f TI |
2944 | }; |
2945 | ||
1727a771 | 2946 | static const struct hda_model_fixup alc268_fixup_models[] = { |
6e72aa5f | 2947 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
cb766404 | 2948 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
03bf11c9 | 2949 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
cb766404 TI |
2950 | {} |
2951 | }; | |
2952 | ||
2953 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { | |
24eff328 | 2954 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
fcd8f3b1 | 2955 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), |
cb766404 TI |
2956 | /* below is codec SSID since multiple Toshiba laptops have the |
2957 | * same PCI SSID 1179:ff00 | |
2958 | */ | |
2959 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), | |
6e72aa5f TI |
2960 | {} |
2961 | }; | |
2962 | ||
f32610ed JS |
2963 | /* |
2964 | * BIOS auto configuration | |
2965 | */ | |
1d045db9 | 2966 | static int alc268_parse_auto_config(struct hda_codec *codec) |
f32610ed | 2967 | { |
3e6179b8 | 2968 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
7504b6cd | 2969 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
f32610ed JS |
2970 | } |
2971 | ||
1d045db9 TI |
2972 | /* |
2973 | */ | |
1d045db9 | 2974 | static int patch_alc268(struct hda_codec *codec) |
f32610ed JS |
2975 | { |
2976 | struct alc_spec *spec; | |
a5cb463a | 2977 | int i, err; |
f32610ed | 2978 | |
1d045db9 | 2979 | /* ALC268 has no aa-loopback mixer */ |
3de95173 TI |
2980 | err = alc_alloc_spec(codec, 0); |
2981 | if (err < 0) | |
2982 | return err; | |
2983 | ||
2984 | spec = codec->spec; | |
2722b535 TI |
2985 | if (has_cdefine_beep(codec)) |
2986 | spec->gen.beep_nid = 0x01; | |
1f0f4b80 | 2987 | |
225068ab TI |
2988 | spec->shutup = alc_eapd_shutup; |
2989 | ||
c9af753f TI |
2990 | alc_pre_init(codec); |
2991 | ||
1727a771 TI |
2992 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
2993 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
6e72aa5f | 2994 | |
6ebb8053 TI |
2995 | /* automatic parse from the BIOS config */ |
2996 | err = alc268_parse_auto_config(codec); | |
e16fb6d1 TI |
2997 | if (err < 0) |
2998 | goto error; | |
f32610ed | 2999 | |
7504b6cd TI |
3000 | if (err > 0 && !spec->gen.no_analog && |
3001 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { | |
a5cb463a TI |
3002 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
3003 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, | |
3004 | &alc268_beep_mixer[i])) { | |
3005 | err = -ENOMEM; | |
3006 | goto error; | |
3007 | } | |
3008 | } | |
7504b6cd | 3009 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
1d045db9 TI |
3010 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
3011 | /* override the amp caps for beep generator */ | |
3012 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, | |
3013 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | | |
3014 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
3015 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
3016 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
2f893286 KY |
3017 | } |
3018 | ||
1727a771 | 3019 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
6e72aa5f | 3020 | |
f32610ed | 3021 | return 0; |
e16fb6d1 TI |
3022 | |
3023 | error: | |
3024 | alc_free(codec); | |
3025 | return err; | |
f32610ed JS |
3026 | } |
3027 | ||
bc9f98a9 | 3028 | /* |
1d045db9 | 3029 | * ALC269 |
bc9f98a9 | 3030 | */ |
08c189f2 | 3031 | |
1d045db9 | 3032 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
1d045db9 | 3033 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 KY |
3034 | }; |
3035 | ||
1d045db9 | 3036 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
1d045db9 | 3037 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 | 3038 | }; |
291702f0 | 3039 | |
1d045db9 TI |
3040 | /* different alc269-variants */ |
3041 | enum { | |
3042 | ALC269_TYPE_ALC269VA, | |
3043 | ALC269_TYPE_ALC269VB, | |
3044 | ALC269_TYPE_ALC269VC, | |
adcc70b2 | 3045 | ALC269_TYPE_ALC269VD, |
065380f0 KY |
3046 | ALC269_TYPE_ALC280, |
3047 | ALC269_TYPE_ALC282, | |
2af02be7 | 3048 | ALC269_TYPE_ALC283, |
065380f0 | 3049 | ALC269_TYPE_ALC284, |
4731d5de | 3050 | ALC269_TYPE_ALC293, |
7fc7d047 | 3051 | ALC269_TYPE_ALC286, |
506b62c3 | 3052 | ALC269_TYPE_ALC298, |
1d04c9de | 3053 | ALC269_TYPE_ALC255, |
4344aec8 | 3054 | ALC269_TYPE_ALC256, |
f429e7e4 | 3055 | ALC269_TYPE_ALC257, |
0a6f0600 | 3056 | ALC269_TYPE_ALC215, |
4231430d | 3057 | ALC269_TYPE_ALC225, |
dcd4f0db | 3058 | ALC269_TYPE_ALC294, |
1078bef0 | 3059 | ALC269_TYPE_ALC300, |
f0778871 | 3060 | ALC269_TYPE_ALC623, |
6fbae35a | 3061 | ALC269_TYPE_ALC700, |
bc9f98a9 KY |
3062 | }; |
3063 | ||
3064 | /* | |
1d045db9 | 3065 | * BIOS auto configuration |
bc9f98a9 | 3066 | */ |
1d045db9 TI |
3067 | static int alc269_parse_auto_config(struct hda_codec *codec) |
3068 | { | |
1d045db9 | 3069 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
3070 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
3071 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
3072 | struct alc_spec *spec = codec->spec; | |
adcc70b2 KY |
3073 | const hda_nid_t *ssids; |
3074 | ||
3075 | switch (spec->codec_variant) { | |
3076 | case ALC269_TYPE_ALC269VA: | |
3077 | case ALC269_TYPE_ALC269VC: | |
065380f0 KY |
3078 | case ALC269_TYPE_ALC280: |
3079 | case ALC269_TYPE_ALC284: | |
4731d5de | 3080 | case ALC269_TYPE_ALC293: |
adcc70b2 KY |
3081 | ssids = alc269va_ssids; |
3082 | break; | |
3083 | case ALC269_TYPE_ALC269VB: | |
3084 | case ALC269_TYPE_ALC269VD: | |
065380f0 | 3085 | case ALC269_TYPE_ALC282: |
2af02be7 | 3086 | case ALC269_TYPE_ALC283: |
7fc7d047 | 3087 | case ALC269_TYPE_ALC286: |
506b62c3 | 3088 | case ALC269_TYPE_ALC298: |
1d04c9de | 3089 | case ALC269_TYPE_ALC255: |
4344aec8 | 3090 | case ALC269_TYPE_ALC256: |
f429e7e4 | 3091 | case ALC269_TYPE_ALC257: |
0a6f0600 | 3092 | case ALC269_TYPE_ALC215: |
4231430d | 3093 | case ALC269_TYPE_ALC225: |
dcd4f0db | 3094 | case ALC269_TYPE_ALC294: |
1078bef0 | 3095 | case ALC269_TYPE_ALC300: |
f0778871 | 3096 | case ALC269_TYPE_ALC623: |
6fbae35a | 3097 | case ALC269_TYPE_ALC700: |
adcc70b2 KY |
3098 | ssids = alc269_ssids; |
3099 | break; | |
3100 | default: | |
3101 | ssids = alc269_ssids; | |
3102 | break; | |
3103 | } | |
bc9f98a9 | 3104 | |
3e6179b8 | 3105 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
1d045db9 | 3106 | } |
bc9f98a9 | 3107 | |
476c02e0 HW |
3108 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
3109 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, | |
3110 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, | |
3111 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, | |
3112 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, | |
3113 | {} | |
3114 | }; | |
3115 | ||
3116 | static void alc_headset_btn_callback(struct hda_codec *codec, | |
3117 | struct hda_jack_callback *jack) | |
3118 | { | |
3119 | int report = 0; | |
3120 | ||
3121 | if (jack->unsol_res & (7 << 13)) | |
3122 | report |= SND_JACK_BTN_0; | |
3123 | ||
3124 | if (jack->unsol_res & (1 << 16 | 3 << 8)) | |
3125 | report |= SND_JACK_BTN_1; | |
3126 | ||
3127 | /* Volume up key */ | |
3128 | if (jack->unsol_res & (7 << 23)) | |
3129 | report |= SND_JACK_BTN_2; | |
3130 | ||
3131 | /* Volume down key */ | |
3132 | if (jack->unsol_res & (7 << 10)) | |
3133 | report |= SND_JACK_BTN_3; | |
3134 | ||
04f7791b | 3135 | snd_hda_jack_set_button_state(codec, jack->nid, report); |
476c02e0 HW |
3136 | } |
3137 | ||
3138 | static void alc_disable_headset_jack_key(struct hda_codec *codec) | |
3139 | { | |
3140 | struct alc_spec *spec = codec->spec; | |
3141 | ||
3142 | if (!spec->has_hs_key) | |
3143 | return; | |
3144 | ||
3145 | switch (codec->core.vendor_id) { | |
3146 | case 0x10ec0215: | |
3147 | case 0x10ec0225: | |
3148 | case 0x10ec0285: | |
c72b9bfe | 3149 | case 0x10ec0287: |
476c02e0 HW |
3150 | case 0x10ec0295: |
3151 | case 0x10ec0289: | |
3152 | case 0x10ec0299: | |
3153 | alc_write_coef_idx(codec, 0x48, 0x0); | |
3154 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); | |
3155 | alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); | |
3156 | break; | |
1948fc06 | 3157 | case 0x10ec0230: |
476c02e0 HW |
3158 | case 0x10ec0236: |
3159 | case 0x10ec0256: | |
3160 | alc_write_coef_idx(codec, 0x48, 0x0); | |
3161 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); | |
3162 | break; | |
3163 | } | |
3164 | } | |
3165 | ||
3166 | static void alc_enable_headset_jack_key(struct hda_codec *codec) | |
3167 | { | |
3168 | struct alc_spec *spec = codec->spec; | |
3169 | ||
3170 | if (!spec->has_hs_key) | |
3171 | return; | |
3172 | ||
3173 | switch (codec->core.vendor_id) { | |
3174 | case 0x10ec0215: | |
3175 | case 0x10ec0225: | |
3176 | case 0x10ec0285: | |
c72b9bfe | 3177 | case 0x10ec0287: |
476c02e0 HW |
3178 | case 0x10ec0295: |
3179 | case 0x10ec0289: | |
3180 | case 0x10ec0299: | |
3181 | alc_write_coef_idx(codec, 0x48, 0xd011); | |
3182 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); | |
3183 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); | |
3184 | break; | |
1948fc06 | 3185 | case 0x10ec0230: |
476c02e0 HW |
3186 | case 0x10ec0236: |
3187 | case 0x10ec0256: | |
3188 | alc_write_coef_idx(codec, 0x48, 0xd011); | |
3189 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); | |
3190 | break; | |
3191 | } | |
3192 | } | |
3193 | ||
3194 | static void alc_fixup_headset_jack(struct hda_codec *codec, | |
3195 | const struct hda_fixup *fix, int action) | |
3196 | { | |
3197 | struct alc_spec *spec = codec->spec; | |
04f7791b | 3198 | hda_nid_t hp_pin; |
476c02e0 HW |
3199 | |
3200 | switch (action) { | |
3201 | case HDA_FIXUP_ACT_PRE_PROBE: | |
3202 | spec->has_hs_key = 1; | |
3203 | snd_hda_jack_detect_enable_callback(codec, 0x55, | |
3204 | alc_headset_btn_callback); | |
476c02e0 | 3205 | break; |
04f7791b HW |
3206 | case HDA_FIXUP_ACT_BUILD: |
3207 | hp_pin = alc_get_hp_pin(spec); | |
3208 | if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55, | |
3209 | alc_headset_btn_keymap, | |
3210 | hp_pin)) | |
3211 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", | |
3212 | false, SND_JACK_HEADSET, | |
3213 | alc_headset_btn_keymap); | |
3214 | ||
476c02e0 HW |
3215 | alc_enable_headset_jack_key(codec); |
3216 | break; | |
3217 | } | |
3218 | } | |
3219 | ||
1387e2d1 | 3220 | static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) |
1d045db9 | 3221 | { |
98b24883 | 3222 | alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); |
1d045db9 | 3223 | } |
291702f0 | 3224 | |
1d045db9 TI |
3225 | static void alc269_shutup(struct hda_codec *codec) |
3226 | { | |
adcc70b2 KY |
3227 | struct alc_spec *spec = codec->spec; |
3228 | ||
1387e2d1 KY |
3229 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3230 | alc269vb_toggle_power_output(codec, 0); | |
3231 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
3232 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { | |
1d045db9 TI |
3233 | msleep(150); |
3234 | } | |
c0ca5ece | 3235 | alc_shutup_pins(codec); |
1d045db9 | 3236 | } |
291702f0 | 3237 | |
6b0f95c4 | 3238 | static const struct coef_fw alc282_coefs[] = { |
54db6c39 | 3239 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
32fa7e49 | 3240 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
3241 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
3242 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
3243 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
3244 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
3245 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
3246 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ | |
3247 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
3248 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
3249 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ | |
3250 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ | |
3251 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ | |
3252 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ | |
3253 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
3254 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
3255 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
3256 | WRITE_COEF(0x63, 0x2902), /* PLL */ | |
3257 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ | |
3258 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ | |
3259 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ | |
3260 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ | |
3261 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ | |
3262 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ | |
3263 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ | |
3264 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ | |
3265 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ | |
3266 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ | |
3267 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ | |
3268 | {} | |
3269 | }; | |
3270 | ||
cb149cb3 KY |
3271 | static void alc282_restore_default_value(struct hda_codec *codec) |
3272 | { | |
54db6c39 | 3273 | alc_process_coef_fw(codec, alc282_coefs); |
cb149cb3 KY |
3274 | } |
3275 | ||
7b5c7a02 KY |
3276 | static void alc282_init(struct hda_codec *codec) |
3277 | { | |
3278 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3279 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
3280 | bool hp_pin_sense; |
3281 | int coef78; | |
3282 | ||
cb149cb3 KY |
3283 | alc282_restore_default_value(codec); |
3284 | ||
7b5c7a02 KY |
3285 | if (!hp_pin) |
3286 | return; | |
3287 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3288 | coef78 = alc_read_coef_idx(codec, 0x78); | |
3289 | ||
3290 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ | |
3291 | /* Headphone capless set to high power mode */ | |
3292 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
3293 | ||
3294 | if (hp_pin_sense) | |
3295 | msleep(2); | |
3296 | ||
3297 | snd_hda_codec_write(codec, hp_pin, 0, | |
3298 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3299 | ||
3300 | if (hp_pin_sense) | |
3301 | msleep(85); | |
3302 | ||
3303 | snd_hda_codec_write(codec, hp_pin, 0, | |
3304 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3305 | ||
3306 | if (hp_pin_sense) | |
3307 | msleep(100); | |
3308 | ||
3309 | /* Headphone capless set to normal mode */ | |
3310 | alc_write_coef_idx(codec, 0x78, coef78); | |
3311 | } | |
3312 | ||
3313 | static void alc282_shutup(struct hda_codec *codec) | |
3314 | { | |
3315 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3316 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
3317 | bool hp_pin_sense; |
3318 | int coef78; | |
3319 | ||
3320 | if (!hp_pin) { | |
3321 | alc269_shutup(codec); | |
3322 | return; | |
3323 | } | |
3324 | ||
3325 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3326 | coef78 = alc_read_coef_idx(codec, 0x78); | |
3327 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
3328 | ||
3329 | if (hp_pin_sense) | |
3330 | msleep(2); | |
3331 | ||
3332 | snd_hda_codec_write(codec, hp_pin, 0, | |
3333 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3334 | ||
3335 | if (hp_pin_sense) | |
3336 | msleep(85); | |
3337 | ||
c0ca5ece TI |
3338 | if (!spec->no_shutup_pins) |
3339 | snd_hda_codec_write(codec, hp_pin, 0, | |
3340 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
7b5c7a02 KY |
3341 | |
3342 | if (hp_pin_sense) | |
3343 | msleep(100); | |
3344 | ||
3345 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3346 | alc_shutup_pins(codec); |
7b5c7a02 KY |
3347 | alc_write_coef_idx(codec, 0x78, coef78); |
3348 | } | |
3349 | ||
6b0f95c4 | 3350 | static const struct coef_fw alc283_coefs[] = { |
54db6c39 | 3351 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
56779864 | 3352 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
3353 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
3354 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
3355 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
3356 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
3357 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
3358 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ | |
3359 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
3360 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
3361 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ | |
3362 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ | |
3363 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ | |
3364 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ | |
3365 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
3366 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
3367 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
3368 | WRITE_COEF(0x2e, 0x2902), /* PLL */ | |
3369 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ | |
3370 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ | |
3371 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ | |
3372 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ | |
3373 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ | |
3374 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ | |
3375 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ | |
3376 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ | |
3377 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ | |
3378 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ | |
3379 | WRITE_COEF(0x49, 0x0), /* test mode */ | |
3380 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ | |
3381 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ | |
3382 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ | |
56779864 | 3383 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
54db6c39 TI |
3384 | {} |
3385 | }; | |
3386 | ||
6bd55b04 KY |
3387 | static void alc283_restore_default_value(struct hda_codec *codec) |
3388 | { | |
54db6c39 | 3389 | alc_process_coef_fw(codec, alc283_coefs); |
6bd55b04 KY |
3390 | } |
3391 | ||
2af02be7 KY |
3392 | static void alc283_init(struct hda_codec *codec) |
3393 | { | |
3394 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3395 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3396 | bool hp_pin_sense; |
2af02be7 | 3397 | |
6bd55b04 KY |
3398 | alc283_restore_default_value(codec); |
3399 | ||
2af02be7 KY |
3400 | if (!hp_pin) |
3401 | return; | |
a59d7199 KY |
3402 | |
3403 | msleep(30); | |
2af02be7 KY |
3404 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
3405 | ||
3406 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ | |
3407 | /* Headphone capless set to high power mode */ | |
3408 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3409 | ||
3410 | snd_hda_codec_write(codec, hp_pin, 0, | |
3411 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3412 | ||
3413 | if (hp_pin_sense) | |
3414 | msleep(85); | |
3415 | ||
3416 | snd_hda_codec_write(codec, hp_pin, 0, | |
3417 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3418 | ||
3419 | if (hp_pin_sense) | |
3420 | msleep(85); | |
3421 | /* Index 0x46 Combo jack auto switch control 2 */ | |
3422 | /* 3k pull low control for Headset jack. */ | |
98b24883 | 3423 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
2af02be7 KY |
3424 | /* Headphone capless set to normal mode */ |
3425 | alc_write_coef_idx(codec, 0x43, 0x9614); | |
3426 | } | |
3427 | ||
3428 | static void alc283_shutup(struct hda_codec *codec) | |
3429 | { | |
3430 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3431 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3432 | bool hp_pin_sense; |
2af02be7 KY |
3433 | |
3434 | if (!hp_pin) { | |
3435 | alc269_shutup(codec); | |
3436 | return; | |
3437 | } | |
3438 | ||
3439 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3440 | ||
3441 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3442 | ||
b450b17c HP |
3443 | /*depop hp during suspend*/ |
3444 | alc_write_coef_idx(codec, 0x06, 0x2100); | |
3445 | ||
2af02be7 KY |
3446 | snd_hda_codec_write(codec, hp_pin, 0, |
3447 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3448 | ||
3449 | if (hp_pin_sense) | |
88011c09 | 3450 | msleep(100); |
2af02be7 | 3451 | |
c0ca5ece TI |
3452 | if (!spec->no_shutup_pins) |
3453 | snd_hda_codec_write(codec, hp_pin, 0, | |
3454 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
2af02be7 | 3455 | |
98b24883 | 3456 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
2af02be7 KY |
3457 | |
3458 | if (hp_pin_sense) | |
88011c09 | 3459 | msleep(100); |
0435b3ff | 3460 | alc_auto_setup_eapd(codec, false); |
c0ca5ece | 3461 | alc_shutup_pins(codec); |
2af02be7 KY |
3462 | alc_write_coef_idx(codec, 0x43, 0x9614); |
3463 | } | |
3464 | ||
4a219ef8 KY |
3465 | static void alc256_init(struct hda_codec *codec) |
3466 | { | |
3467 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3468 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3469 | bool hp_pin_sense; |
3470 | ||
3471 | if (!hp_pin) | |
6447c962 | 3472 | hp_pin = 0x21; |
4a219ef8 KY |
3473 | |
3474 | msleep(30); | |
3475 | ||
3476 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3477 | ||
3478 | if (hp_pin_sense) | |
3479 | msleep(2); | |
3480 | ||
3481 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
6447c962 KY |
3482 | if (spec->ultra_low_power) { |
3483 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); | |
3484 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); | |
3485 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); | |
3486 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); | |
3487 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); | |
3488 | msleep(30); | |
3489 | } | |
4a219ef8 KY |
3490 | |
3491 | snd_hda_codec_write(codec, hp_pin, 0, | |
3492 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3493 | ||
6447c962 | 3494 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3495 | msleep(85); |
3496 | ||
3497 | snd_hda_codec_write(codec, hp_pin, 0, | |
3498 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3499 | ||
6447c962 | 3500 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3501 | msleep(100); |
3502 | ||
3503 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); | |
3504 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
88d42b2b KY |
3505 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
3506 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); | |
c4473744 TH |
3507 | /* |
3508 | * Expose headphone mic (or possibly Line In on some machines) instead | |
3509 | * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See | |
3510 | * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of | |
3511 | * this register. | |
3512 | */ | |
3513 | alc_write_coef_idx(codec, 0x36, 0x5757); | |
4a219ef8 KY |
3514 | } |
3515 | ||
3516 | static void alc256_shutup(struct hda_codec *codec) | |
3517 | { | |
3518 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3519 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3520 | bool hp_pin_sense; |
3521 | ||
6447c962 KY |
3522 | if (!hp_pin) |
3523 | hp_pin = 0x21; | |
4a219ef8 KY |
3524 | |
3525 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3526 | ||
3527 | if (hp_pin_sense) | |
3528 | msleep(2); | |
3529 | ||
3530 | snd_hda_codec_write(codec, hp_pin, 0, | |
3531 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3532 | ||
6447c962 | 3533 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3534 | msleep(85); |
3535 | ||
1c9609e3 TI |
3536 | /* 3k pull low control for Headset jack. */ |
3537 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ | |
3f742490 HW |
3538 | /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly |
3539 | * when booting with headset plugged. So skip setting it for the codec alc257 | |
3540 | */ | |
3541 | if (codec->core.vendor_id != 0x10ec0257) | |
3542 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); | |
1c9609e3 | 3543 | |
c0ca5ece TI |
3544 | if (!spec->no_shutup_pins) |
3545 | snd_hda_codec_write(codec, hp_pin, 0, | |
3546 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
4a219ef8 | 3547 | |
6447c962 | 3548 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3549 | msleep(100); |
3550 | ||
3551 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3552 | alc_shutup_pins(codec); |
6447c962 KY |
3553 | if (spec->ultra_low_power) { |
3554 | msleep(50); | |
3555 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); | |
3556 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); | |
3557 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); | |
3558 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); | |
3559 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); | |
3560 | msleep(30); | |
3561 | } | |
4a219ef8 KY |
3562 | } |
3563 | ||
da911b1f KY |
3564 | static void alc225_init(struct hda_codec *codec) |
3565 | { | |
3566 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3567 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
da911b1f KY |
3568 | bool hp1_pin_sense, hp2_pin_sense; |
3569 | ||
3570 | if (!hp_pin) | |
d3ba58bb | 3571 | hp_pin = 0x21; |
da911b1f KY |
3572 | msleep(30); |
3573 | ||
3574 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3575 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3576 | ||
3577 | if (hp1_pin_sense || hp2_pin_sense) | |
3578 | msleep(2); | |
3579 | ||
3580 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
d3ba58bb KY |
3581 | if (spec->ultra_low_power) { |
3582 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); | |
3583 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); | |
3584 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); | |
3585 | msleep(30); | |
3586 | } | |
da911b1f | 3587 | |
d3ba58bb | 3588 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3589 | snd_hda_codec_write(codec, hp_pin, 0, |
3590 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3591 | if (hp2_pin_sense) | |
3592 | snd_hda_codec_write(codec, 0x16, 0, | |
3593 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3594 | ||
d3ba58bb | 3595 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3596 | msleep(85); |
3597 | ||
d3ba58bb | 3598 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3599 | snd_hda_codec_write(codec, hp_pin, 0, |
3600 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3601 | if (hp2_pin_sense) | |
3602 | snd_hda_codec_write(codec, 0x16, 0, | |
3603 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3604 | ||
d3ba58bb | 3605 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3606 | msleep(100); |
3607 | ||
3608 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); | |
3609 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
3610 | } | |
3611 | ||
3612 | static void alc225_shutup(struct hda_codec *codec) | |
3613 | { | |
3614 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3615 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
da911b1f KY |
3616 | bool hp1_pin_sense, hp2_pin_sense; |
3617 | ||
d3ba58bb KY |
3618 | if (!hp_pin) |
3619 | hp_pin = 0x21; | |
476c02e0 HW |
3620 | |
3621 | alc_disable_headset_jack_key(codec); | |
da911b1f KY |
3622 | /* 3k pull low control for Headset jack. */ |
3623 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); | |
3624 | ||
3625 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3626 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3627 | ||
3628 | if (hp1_pin_sense || hp2_pin_sense) | |
3629 | msleep(2); | |
3630 | ||
d3ba58bb | 3631 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3632 | snd_hda_codec_write(codec, hp_pin, 0, |
3633 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3634 | if (hp2_pin_sense) | |
3635 | snd_hda_codec_write(codec, 0x16, 0, | |
3636 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3637 | ||
d3ba58bb | 3638 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3639 | msleep(85); |
3640 | ||
d3ba58bb | 3641 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3642 | snd_hda_codec_write(codec, hp_pin, 0, |
3643 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3644 | if (hp2_pin_sense) | |
3645 | snd_hda_codec_write(codec, 0x16, 0, | |
3646 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3647 | ||
d3ba58bb | 3648 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3649 | msleep(100); |
3650 | ||
3651 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3652 | alc_shutup_pins(codec); |
d3ba58bb KY |
3653 | if (spec->ultra_low_power) { |
3654 | msleep(50); | |
3655 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); | |
3656 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); | |
3657 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); | |
3658 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); | |
3659 | msleep(30); | |
3660 | } | |
476c02e0 HW |
3661 | |
3662 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); | |
3663 | alc_enable_headset_jack_key(codec); | |
da911b1f KY |
3664 | } |
3665 | ||
c2d6af53 KY |
3666 | static void alc_default_init(struct hda_codec *codec) |
3667 | { | |
3668 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3669 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3670 | bool hp_pin_sense; |
3671 | ||
3672 | if (!hp_pin) | |
3673 | return; | |
3674 | ||
3675 | msleep(30); | |
3676 | ||
3677 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3678 | ||
3679 | if (hp_pin_sense) | |
3680 | msleep(2); | |
3681 | ||
3682 | snd_hda_codec_write(codec, hp_pin, 0, | |
3683 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3684 | ||
3685 | if (hp_pin_sense) | |
3686 | msleep(85); | |
3687 | ||
3688 | snd_hda_codec_write(codec, hp_pin, 0, | |
3689 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3690 | ||
3691 | if (hp_pin_sense) | |
3692 | msleep(100); | |
3693 | } | |
3694 | ||
3695 | static void alc_default_shutup(struct hda_codec *codec) | |
3696 | { | |
3697 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3698 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3699 | bool hp_pin_sense; |
3700 | ||
3701 | if (!hp_pin) { | |
3702 | alc269_shutup(codec); | |
3703 | return; | |
3704 | } | |
3705 | ||
3706 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3707 | ||
3708 | if (hp_pin_sense) | |
3709 | msleep(2); | |
3710 | ||
3711 | snd_hda_codec_write(codec, hp_pin, 0, | |
3712 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3713 | ||
3714 | if (hp_pin_sense) | |
3715 | msleep(85); | |
3716 | ||
c0ca5ece TI |
3717 | if (!spec->no_shutup_pins) |
3718 | snd_hda_codec_write(codec, hp_pin, 0, | |
3719 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
c2d6af53 KY |
3720 | |
3721 | if (hp_pin_sense) | |
3722 | msleep(100); | |
3723 | ||
3724 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3725 | alc_shutup_pins(codec); |
c2d6af53 KY |
3726 | } |
3727 | ||
693abe11 KY |
3728 | static void alc294_hp_init(struct hda_codec *codec) |
3729 | { | |
3730 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3731 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
693abe11 KY |
3732 | int i, val; |
3733 | ||
3734 | if (!hp_pin) | |
3735 | return; | |
3736 | ||
3737 | snd_hda_codec_write(codec, hp_pin, 0, | |
3738 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3739 | ||
3740 | msleep(100); | |
3741 | ||
c0ca5ece TI |
3742 | if (!spec->no_shutup_pins) |
3743 | snd_hda_codec_write(codec, hp_pin, 0, | |
3744 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
693abe11 KY |
3745 | |
3746 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ | |
3747 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ | |
3748 | ||
3749 | /* Wait for depop procedure finish */ | |
3750 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3751 | for (i = 0; i < 20 && val & 0x0080; i++) { | |
3752 | msleep(50); | |
3753 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3754 | } | |
3755 | /* Set HP depop to auto mode */ | |
3756 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); | |
3757 | msleep(50); | |
3758 | } | |
3759 | ||
3760 | static void alc294_init(struct hda_codec *codec) | |
3761 | { | |
3762 | struct alc_spec *spec = codec->spec; | |
3763 | ||
f6ef4e0e TI |
3764 | /* required only at boot or S4 resume time */ |
3765 | if (!spec->done_hp_init || | |
3766 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { | |
693abe11 KY |
3767 | alc294_hp_init(codec); |
3768 | spec->done_hp_init = true; | |
3769 | } | |
3770 | alc_default_init(codec); | |
3771 | } | |
3772 | ||
ad60d502 KY |
3773 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
3774 | unsigned int val) | |
3775 | { | |
3776 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3777 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ | |
3778 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ | |
3779 | } | |
3780 | ||
3781 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) | |
3782 | { | |
3783 | unsigned int val; | |
3784 | ||
3785 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3786 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3787 | & 0xffff; | |
3788 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3789 | << 16; | |
3790 | return val; | |
3791 | } | |
3792 | ||
3793 | static void alc5505_dsp_halt(struct hda_codec *codec) | |
3794 | { | |
3795 | unsigned int val; | |
3796 | ||
3797 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ | |
3798 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ | |
3799 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ | |
3800 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ | |
3801 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ | |
3802 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ | |
3803 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ | |
3804 | val = alc5505_coef_get(codec, 0x6220); | |
3805 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ | |
3806 | } | |
3807 | ||
3808 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) | |
3809 | { | |
3810 | alc5505_coef_set(codec, 0x61b8, 0x04133302); | |
3811 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); | |
3812 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); | |
3813 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); | |
3814 | alc5505_coef_set(codec, 0x6220, 0x2002010f); | |
3815 | alc5505_coef_set(codec, 0x880c, 0x00000004); | |
3816 | } | |
3817 | ||
3818 | static void alc5505_dsp_init(struct hda_codec *codec) | |
3819 | { | |
3820 | unsigned int val; | |
3821 | ||
3822 | alc5505_dsp_halt(codec); | |
3823 | alc5505_dsp_back_from_halt(codec); | |
3824 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ | |
3825 | alc5505_coef_set(codec, 0x61b0, 0x5b16); | |
3826 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ | |
3827 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); | |
3828 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ | |
3829 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); | |
3830 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ | |
3831 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); | |
3832 | alc5505_coef_set(codec, 0x61b8, 0x04173302); | |
3833 | alc5505_coef_set(codec, 0x61b8, 0x04163302); | |
3834 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ | |
3835 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ | |
3836 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ | |
3837 | ||
3838 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ | |
3839 | if (val <= 3) | |
3840 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ | |
3841 | else | |
3842 | alc5505_coef_set(codec, 0x6220, 0x6002018f); | |
3843 | ||
3844 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ | |
3845 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ | |
3846 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ | |
3847 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ | |
3848 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ | |
3849 | alc5505_coef_set(codec, 0x880c, 0x00000003); | |
3850 | alc5505_coef_set(codec, 0x880c, 0x00000010); | |
cd63a5ff TI |
3851 | |
3852 | #ifdef HALT_REALTEK_ALC5505 | |
3853 | alc5505_dsp_halt(codec); | |
3854 | #endif | |
ad60d502 KY |
3855 | } |
3856 | ||
cd63a5ff | 3857 | #ifdef HALT_REALTEK_ALC5505 |
8a71821f PLB |
3858 | #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ |
3859 | #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ | |
cd63a5ff TI |
3860 | #else |
3861 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) | |
3862 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) | |
3863 | #endif | |
3864 | ||
2a43952a | 3865 | #ifdef CONFIG_PM |
ad60d502 KY |
3866 | static int alc269_suspend(struct hda_codec *codec) |
3867 | { | |
3868 | struct alc_spec *spec = codec->spec; | |
3869 | ||
3870 | if (spec->has_alc5505_dsp) | |
cd63a5ff | 3871 | alc5505_dsp_suspend(codec); |
ad60d502 KY |
3872 | return alc_suspend(codec); |
3873 | } | |
3874 | ||
1d045db9 TI |
3875 | static int alc269_resume(struct hda_codec *codec) |
3876 | { | |
adcc70b2 KY |
3877 | struct alc_spec *spec = codec->spec; |
3878 | ||
1387e2d1 KY |
3879 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3880 | alc269vb_toggle_power_output(codec, 0); | |
3881 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3882 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 TI |
3883 | msleep(150); |
3884 | } | |
8c427226 | 3885 | |
1d045db9 | 3886 | codec->patch_ops.init(codec); |
f1d4e28b | 3887 | |
1387e2d1 KY |
3888 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3889 | alc269vb_toggle_power_output(codec, 1); | |
3890 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3891 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 TI |
3892 | msleep(200); |
3893 | } | |
f1d4e28b | 3894 | |
1a462be5 | 3895 | snd_hda_regmap_sync(codec); |
1d045db9 | 3896 | hda_call_check_power_status(codec, 0x01); |
f475371a HW |
3897 | |
3898 | /* on some machine, the BIOS will clear the codec gpio data when enter | |
3899 | * suspend, and won't restore the data after resume, so we restore it | |
3900 | * in the driver. | |
3901 | */ | |
d261eec8 TI |
3902 | if (spec->gpio_data) |
3903 | alc_write_gpio_data(codec); | |
f475371a | 3904 | |
ad60d502 | 3905 | if (spec->has_alc5505_dsp) |
cd63a5ff | 3906 | alc5505_dsp_resume(codec); |
c5177c86 | 3907 | |
1d045db9 TI |
3908 | return 0; |
3909 | } | |
2a43952a | 3910 | #endif /* CONFIG_PM */ |
f1d4e28b | 3911 | |
108cc108 | 3912 | static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, |
1727a771 | 3913 | const struct hda_fixup *fix, int action) |
108cc108 DH |
3914 | { |
3915 | struct alc_spec *spec = codec->spec; | |
3916 | ||
1727a771 | 3917 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
108cc108 DH |
3918 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
3919 | } | |
3920 | ||
fdcc968a JMG |
3921 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
3922 | const struct hda_fixup *fix, | |
3923 | int action) | |
3924 | { | |
3925 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); | |
3926 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); | |
3927 | ||
3928 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) | |
3929 | snd_hda_codec_set_pincfg(codec, 0x19, | |
3930 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | | |
3931 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); | |
3932 | } | |
3933 | ||
1d045db9 | 3934 | static void alc269_fixup_hweq(struct hda_codec *codec, |
1727a771 | 3935 | const struct hda_fixup *fix, int action) |
1d045db9 | 3936 | { |
98b24883 TI |
3937 | if (action == HDA_FIXUP_ACT_INIT) |
3938 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); | |
1d045db9 | 3939 | } |
f1d4e28b | 3940 | |
7c478f03 DH |
3941 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
3942 | const struct hda_fixup *fix, int action) | |
3943 | { | |
3944 | struct alc_spec *spec = codec->spec; | |
3945 | ||
3946 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
3947 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
3948 | } | |
3949 | ||
1d045db9 | 3950 | static void alc271_fixup_dmic(struct hda_codec *codec, |
1727a771 | 3951 | const struct hda_fixup *fix, int action) |
1d045db9 TI |
3952 | { |
3953 | static const struct hda_verb verbs[] = { | |
3954 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, | |
3955 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, | |
3956 | {} | |
3957 | }; | |
3958 | unsigned int cfg; | |
f1d4e28b | 3959 | |
7639a06c TI |
3960 | if (strcmp(codec->core.chip_name, "ALC271X") && |
3961 | strcmp(codec->core.chip_name, "ALC269VB")) | |
1d045db9 TI |
3962 | return; |
3963 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); | |
3964 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) | |
3965 | snd_hda_sequence_write(codec, verbs); | |
3966 | } | |
f1d4e28b | 3967 | |
c8426b27 TI |
3968 | /* Fix the speaker amp after resume, etc */ |
3969 | static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec, | |
3970 | const struct hda_fixup *fix, | |
3971 | int action) | |
3972 | { | |
3973 | if (action == HDA_FIXUP_ACT_INIT) | |
3974 | alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000); | |
3975 | } | |
3976 | ||
017f2a10 | 3977 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
1727a771 | 3978 | const struct hda_fixup *fix, int action) |
017f2a10 TI |
3979 | { |
3980 | struct alc_spec *spec = codec->spec; | |
3981 | ||
1727a771 | 3982 | if (action != HDA_FIXUP_ACT_PROBE) |
017f2a10 TI |
3983 | return; |
3984 | ||
3985 | /* Due to a hardware problem on Lenovo Ideadpad, we need to | |
3986 | * fix the sample rate of analog I/O to 44.1kHz | |
3987 | */ | |
08c189f2 TI |
3988 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
3989 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; | |
017f2a10 TI |
3990 | } |
3991 | ||
adabb3ec | 3992 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
1727a771 | 3993 | const struct hda_fixup *fix, int action) |
adabb3ec | 3994 | { |
adabb3ec TI |
3995 | /* The digital-mic unit sends PDM (differential signal) instead of |
3996 | * the standard PCM, thus you can't record a valid mono stream as is. | |
3997 | * Below is a workaround specific to ALC269 to control the dmic | |
3998 | * signal source as mono. | |
3999 | */ | |
98b24883 TI |
4000 | if (action == HDA_FIXUP_ACT_INIT) |
4001 | alc_update_coef_idx(codec, 0x07, 0, 0x80); | |
adabb3ec TI |
4002 | } |
4003 | ||
24519911 TI |
4004 | static void alc269_quanta_automute(struct hda_codec *codec) |
4005 | { | |
08c189f2 | 4006 | snd_hda_gen_update_outputs(codec); |
24519911 | 4007 | |
1687ccc8 TI |
4008 | alc_write_coef_idx(codec, 0x0c, 0x680); |
4009 | alc_write_coef_idx(codec, 0x0c, 0x480); | |
24519911 TI |
4010 | } |
4011 | ||
4012 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, | |
1727a771 | 4013 | const struct hda_fixup *fix, int action) |
24519911 TI |
4014 | { |
4015 | struct alc_spec *spec = codec->spec; | |
1727a771 | 4016 | if (action != HDA_FIXUP_ACT_PROBE) |
24519911 | 4017 | return; |
08c189f2 | 4018 | spec->gen.automute_hook = alc269_quanta_automute; |
24519911 TI |
4019 | } |
4020 | ||
d240d1dc | 4021 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 4022 | struct hda_jack_callback *jack) |
d240d1dc DH |
4023 | { |
4024 | struct alc_spec *spec = codec->spec; | |
4025 | int vref; | |
4026 | msleep(200); | |
4027 | snd_hda_gen_hp_automute(codec, jack); | |
4028 | ||
4029 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
4030 | msleep(100); | |
4031 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
4032 | vref); | |
4033 | msleep(500); | |
4034 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
4035 | vref); | |
4036 | } | |
4037 | ||
a2ef03fe TE |
4038 | /* |
4039 | * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) | |
4040 | */ | |
4041 | struct hda_alc298_mbxinit { | |
4042 | unsigned char value_0x23; | |
4043 | unsigned char value_0x25; | |
4044 | }; | |
4045 | ||
4046 | static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, | |
4047 | const struct hda_alc298_mbxinit *initval, | |
4048 | bool first) | |
4049 | { | |
4050 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); | |
4051 | alc_write_coef_idx(codec, 0x26, 0xb000); | |
4052 | ||
4053 | if (first) | |
4054 | snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); | |
4055 | ||
4056 | snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); | |
4057 | alc_write_coef_idx(codec, 0x26, 0xf000); | |
4058 | alc_write_coef_idx(codec, 0x23, initval->value_0x23); | |
4059 | ||
4060 | if (initval->value_0x23 != 0x1e) | |
4061 | alc_write_coef_idx(codec, 0x25, initval->value_0x25); | |
4062 | ||
4063 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); | |
4064 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); | |
4065 | } | |
4066 | ||
4067 | static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, | |
4068 | const struct hda_fixup *fix, | |
4069 | int action) | |
4070 | { | |
4071 | /* Initialization magic */ | |
4072 | static const struct hda_alc298_mbxinit dac_init[] = { | |
4073 | {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, | |
4074 | {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, | |
4075 | {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, | |
4076 | {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, | |
4077 | {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, | |
4078 | {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, | |
4079 | {0x2f, 0x00}, | |
4080 | {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, | |
4081 | {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, | |
4082 | {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, | |
4083 | {} | |
4084 | }; | |
4085 | const struct hda_alc298_mbxinit *seq; | |
4086 | ||
4087 | if (action != HDA_FIXUP_ACT_INIT) | |
4088 | return; | |
4089 | ||
4090 | /* Start */ | |
4091 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); | |
4092 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); | |
4093 | alc_write_coef_idx(codec, 0x26, 0xf000); | |
4094 | alc_write_coef_idx(codec, 0x22, 0x31); | |
4095 | alc_write_coef_idx(codec, 0x23, 0x0b); | |
4096 | alc_write_coef_idx(codec, 0x25, 0x00); | |
4097 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); | |
4098 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); | |
4099 | ||
4100 | for (seq = dac_init; seq->value_0x23; seq++) | |
4101 | alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); | |
4102 | } | |
4103 | ||
d240d1dc DH |
4104 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
4105 | const struct hda_fixup *fix, int action) | |
4106 | { | |
4107 | struct alc_spec *spec = codec->spec; | |
4108 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4109 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
4110 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; | |
4111 | } | |
4112 | } | |
4113 | ||
766538ac TI |
4114 | static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, |
4115 | bool polarity, bool on) | |
4116 | { | |
4117 | unsigned int pinval; | |
4118 | ||
4119 | if (!pin) | |
4120 | return; | |
4121 | if (polarity) | |
4122 | on = !on; | |
4123 | pinval = snd_hda_codec_get_pin_target(codec, pin); | |
4124 | pinval &= ~AC_PINCTL_VREFEN; | |
4125 | pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; | |
4126 | /* temporarily power up/down for setting VREF */ | |
4127 | snd_hda_power_up_pm(codec); | |
4128 | snd_hda_set_pin_ctl_cache(codec, pin, pinval); | |
4129 | snd_hda_power_down_pm(codec); | |
4130 | } | |
d240d1dc | 4131 | |
08fb0d0e | 4132 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
8d3d1ece TI |
4133 | static int vref_mute_led_set(struct led_classdev *led_cdev, |
4134 | enum led_brightness brightness) | |
6d3cd5d4 | 4135 | { |
8d3d1ece | 4136 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
08fb0d0e | 4137 | struct alc_spec *spec = codec->spec; |
08fb0d0e | 4138 | |
766538ac TI |
4139 | alc_update_vref_led(codec, spec->mute_led_nid, |
4140 | spec->mute_led_polarity, brightness); | |
8d3d1ece | 4141 | return 0; |
6d3cd5d4 DH |
4142 | } |
4143 | ||
d5b6b65e DH |
4144 | /* Make sure the led works even in runtime suspend */ |
4145 | static unsigned int led_power_filter(struct hda_codec *codec, | |
4146 | hda_nid_t nid, | |
4147 | unsigned int power_state) | |
4148 | { | |
4149 | struct alc_spec *spec = codec->spec; | |
4150 | ||
50dd9050 HW |
4151 | if (power_state != AC_PWRST_D3 || nid == 0 || |
4152 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) | |
d5b6b65e DH |
4153 | return power_state; |
4154 | ||
4155 | /* Set pin ctl again, it might have just been set to 0 */ | |
4156 | snd_hda_set_pin_ctl(codec, nid, | |
4157 | snd_hda_codec_get_pin_target(codec, nid)); | |
4158 | ||
cffd3966 | 4159 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
d5b6b65e DH |
4160 | } |
4161 | ||
08fb0d0e TI |
4162 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
4163 | const struct hda_fixup *fix, int action) | |
6d3cd5d4 DH |
4164 | { |
4165 | struct alc_spec *spec = codec->spec; | |
08fb0d0e TI |
4166 | const struct dmi_device *dev = NULL; |
4167 | ||
4168 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
4169 | return; | |
4170 | ||
4171 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { | |
4172 | int pol, pin; | |
4173 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) | |
4174 | continue; | |
4175 | if (pin < 0x0a || pin >= 0x10) | |
4176 | break; | |
4177 | spec->mute_led_polarity = pol; | |
4178 | spec->mute_led_nid = pin - 0x0a + 0x18; | |
8d3d1ece | 4179 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
d5b6b65e | 4180 | codec->power_filter = led_power_filter; |
4e76a883 TI |
4181 | codec_dbg(codec, |
4182 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, | |
08fb0d0e | 4183 | spec->mute_led_polarity); |
6d3cd5d4 DH |
4184 | break; |
4185 | } | |
4186 | } | |
4187 | ||
85c467dc TI |
4188 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
4189 | const struct hda_fixup *fix, | |
4190 | int action, hda_nid_t pin) | |
d06ac143 DH |
4191 | { |
4192 | struct alc_spec *spec = codec->spec; | |
85c467dc | 4193 | |
d06ac143 DH |
4194 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
4195 | spec->mute_led_polarity = 0; | |
85c467dc | 4196 | spec->mute_led_nid = pin; |
8d3d1ece | 4197 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
d5b6b65e | 4198 | codec->power_filter = led_power_filter; |
d06ac143 DH |
4199 | } |
4200 | } | |
4201 | ||
85c467dc TI |
4202 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
4203 | const struct hda_fixup *fix, int action) | |
4204 | { | |
4205 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); | |
4206 | } | |
4207 | ||
08fb0d0e TI |
4208 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
4209 | const struct hda_fixup *fix, int action) | |
420b0feb | 4210 | { |
85c467dc | 4211 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
420b0feb TI |
4212 | } |
4213 | ||
7f783bd5 TB |
4214 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
4215 | const struct hda_fixup *fix, int action) | |
4216 | { | |
85c467dc | 4217 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
7f783bd5 TB |
4218 | } |
4219 | ||
0f32fd19 TI |
4220 | /* update LED status via GPIO */ |
4221 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, | |
dbd13179 | 4222 | int polarity, bool enabled) |
9f5c6faf | 4223 | { |
dbd13179 | 4224 | if (polarity) |
0f32fd19 | 4225 | enabled = !enabled; |
d261eec8 | 4226 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
9f5c6faf TI |
4227 | } |
4228 | ||
0f32fd19 | 4229 | /* turn on/off mute LED via GPIO per vmaster hook */ |
8d3d1ece TI |
4230 | static int gpio_mute_led_set(struct led_classdev *led_cdev, |
4231 | enum led_brightness brightness) | |
9f5c6faf | 4232 | { |
8d3d1ece | 4233 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
9f5c6faf | 4234 | struct alc_spec *spec = codec->spec; |
9f5c6faf | 4235 | |
dbd13179 | 4236 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, |
8d3d1ece TI |
4237 | spec->mute_led_polarity, !brightness); |
4238 | return 0; | |
0f32fd19 | 4239 | } |
9f5c6faf | 4240 | |
0f32fd19 | 4241 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
87dc3648 KHF |
4242 | static int micmute_led_set(struct led_classdev *led_cdev, |
4243 | enum led_brightness brightness) | |
4244 | { | |
4245 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); | |
4246 | struct alc_spec *spec = codec->spec; | |
4247 | ||
4248 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, | |
40469064 | 4249 | spec->micmute_led_polarity, !brightness); |
87dc3648 KHF |
4250 | return 0; |
4251 | } | |
4252 | ||
01e4a275 TI |
4253 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
4254 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, | |
4255 | int action, | |
4256 | unsigned int mute_mask, | |
4257 | unsigned int micmute_mask) | |
9f5c6faf TI |
4258 | { |
4259 | struct alc_spec *spec = codec->spec; | |
9f5c6faf | 4260 | |
01e4a275 TI |
4261 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
4262 | ||
4263 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
4264 | return; | |
4265 | if (mute_mask) { | |
4266 | spec->gpio_mute_led_mask = mute_mask; | |
8d3d1ece | 4267 | snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); |
01e4a275 TI |
4268 | } |
4269 | if (micmute_mask) { | |
4270 | spec->gpio_mic_led_mask = micmute_mask; | |
7cdf8c49 | 4271 | snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); |
9f5c6faf TI |
4272 | } |
4273 | } | |
4274 | ||
e7d66cf7 JS |
4275 | static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, |
4276 | const struct hda_fixup *fix, int action) | |
4277 | { | |
4278 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); | |
4279 | } | |
4280 | ||
01e4a275 | 4281 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
eaa8e5ef KY |
4282 | const struct hda_fixup *fix, int action) |
4283 | { | |
01e4a275 TI |
4284 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
4285 | } | |
eaa8e5ef | 4286 | |
f5a88b0a KHF |
4287 | static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, |
4288 | const struct hda_fixup *fix, int action) | |
4289 | { | |
3e0650ab | 4290 | alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); |
f5a88b0a KHF |
4291 | } |
4292 | ||
01e4a275 TI |
4293 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
4294 | const struct hda_fixup *fix, int action) | |
4295 | { | |
4296 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); | |
9f5c6faf TI |
4297 | } |
4298 | ||
a0ccbc53 KY |
4299 | static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, |
4300 | const struct hda_fixup *fix, int action) | |
4301 | { | |
4302 | alc_fixup_hp_gpio_led(codec, action, 0x10, 0); | |
4303 | } | |
4304 | ||
8a503555 TI |
4305 | /* turn on/off mic-mute LED per capture hook via VREF change */ |
4306 | static int vref_micmute_led_set(struct led_classdev *led_cdev, | |
4307 | enum led_brightness brightness) | |
9c5dc3bf | 4308 | { |
8a503555 | 4309 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
9c5dc3bf | 4310 | struct alc_spec *spec = codec->spec; |
9c5dc3bf | 4311 | |
766538ac TI |
4312 | alc_update_vref_led(codec, spec->cap_mute_led_nid, |
4313 | spec->micmute_led_polarity, brightness); | |
8a503555 | 4314 | return 0; |
9c5dc3bf KY |
4315 | } |
4316 | ||
4317 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, | |
4318 | const struct hda_fixup *fix, int action) | |
4319 | { | |
4320 | struct alc_spec *spec = codec->spec; | |
9c5dc3bf | 4321 | |
01e4a275 | 4322 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
9c5dc3bf | 4323 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
01e4a275 TI |
4324 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
4325 | * enable headphone amp | |
4326 | */ | |
4327 | spec->gpio_mask |= 0x10; | |
4328 | spec->gpio_dir |= 0x10; | |
9c5dc3bf | 4329 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4330 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
50dd9050 | 4331 | codec->power_filter = led_power_filter; |
9c5dc3bf KY |
4332 | } |
4333 | } | |
4334 | ||
7a5255f1 DH |
4335 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
4336 | const struct hda_fixup *fix, int action) | |
4337 | { | |
7a5255f1 | 4338 | struct alc_spec *spec = codec->spec; |
7a5255f1 | 4339 | |
01e4a275 | 4340 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
7a5255f1 | 4341 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
7a5255f1 | 4342 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4343 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
7a5255f1 DH |
4344 | codec->power_filter = led_power_filter; |
4345 | } | |
4346 | } | |
4347 | ||
c3bb2b52 TI |
4348 | /* HP Spectre x360 14 model needs a unique workaround for enabling the amp; |
4349 | * it needs to toggle the GPIO0 once on and off at each time (bko#210633) | |
4350 | */ | |
4351 | static void alc245_fixup_hp_x360_amp(struct hda_codec *codec, | |
4352 | const struct hda_fixup *fix, int action) | |
4353 | { | |
4354 | struct alc_spec *spec = codec->spec; | |
4355 | ||
4356 | switch (action) { | |
4357 | case HDA_FIXUP_ACT_PRE_PROBE: | |
4358 | spec->gpio_mask |= 0x01; | |
4359 | spec->gpio_dir |= 0x01; | |
4360 | break; | |
4361 | case HDA_FIXUP_ACT_INIT: | |
4362 | /* need to toggle GPIO to enable the amp */ | |
4363 | alc_update_gpio_data(codec, 0x01, true); | |
4364 | msleep(100); | |
4365 | alc_update_gpio_data(codec, 0x01, false); | |
4366 | break; | |
4367 | } | |
4368 | } | |
4369 | ||
622464c8 TI |
4370 | /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */ |
4371 | static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo, | |
4372 | struct hda_codec *codec, | |
4373 | struct snd_pcm_substream *substream, | |
4374 | int action) | |
4375 | { | |
4376 | switch (action) { | |
4377 | case HDA_GEN_PCM_ACT_PREPARE: | |
4378 | alc_update_gpio_data(codec, 0x04, true); | |
4379 | break; | |
4380 | case HDA_GEN_PCM_ACT_CLEANUP: | |
4381 | alc_update_gpio_data(codec, 0x04, false); | |
4382 | break; | |
4383 | } | |
4384 | } | |
4385 | ||
4386 | static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec, | |
4387 | const struct hda_fixup *fix, | |
4388 | int action) | |
4389 | { | |
4390 | struct alc_spec *spec = codec->spec; | |
4391 | ||
4392 | if (action == HDA_FIXUP_ACT_PROBE) { | |
4393 | spec->gpio_mask |= 0x04; | |
4394 | spec->gpio_dir |= 0x04; | |
4395 | spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook; | |
4396 | } | |
4397 | } | |
4398 | ||
766538ac TI |
4399 | static void alc_update_coef_led(struct hda_codec *codec, |
4400 | struct alc_coef_led *led, | |
4401 | bool polarity, bool on) | |
4402 | { | |
4403 | if (polarity) | |
4404 | on = !on; | |
4405 | /* temporarily power up/down for setting COEF bit */ | |
4406 | alc_update_coef_idx(codec, led->idx, led->mask, | |
4407 | on ? led->on : led->off); | |
4408 | } | |
4409 | ||
431e76c3 | 4410 | /* update mute-LED according to the speaker mute state via COEF bit */ |
8d3d1ece TI |
4411 | static int coef_mute_led_set(struct led_classdev *led_cdev, |
4412 | enum led_brightness brightness) | |
431e76c3 | 4413 | { |
8d3d1ece | 4414 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
431e76c3 KY |
4415 | struct alc_spec *spec = codec->spec; |
4416 | ||
766538ac TI |
4417 | alc_update_coef_led(codec, &spec->mute_led_coef, |
4418 | spec->mute_led_polarity, brightness); | |
8d3d1ece | 4419 | return 0; |
431e76c3 KY |
4420 | } |
4421 | ||
4422 | static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, | |
4423 | const struct hda_fixup *fix, | |
4424 | int action) | |
4425 | { | |
4426 | struct alc_spec *spec = codec->spec; | |
4427 | ||
4428 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4429 | spec->mute_led_polarity = 0; | |
766538ac TI |
4430 | spec->mute_led_coef.idx = 0x0b; |
4431 | spec->mute_led_coef.mask = 1 << 3; | |
4432 | spec->mute_led_coef.on = 1 << 3; | |
4433 | spec->mute_led_coef.off = 0; | |
8d3d1ece | 4434 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
431e76c3 KY |
4435 | } |
4436 | } | |
4437 | ||
24164f43 KY |
4438 | static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
4439 | const struct hda_fixup *fix, | |
4440 | int action) | |
4441 | { | |
4442 | struct alc_spec *spec = codec->spec; | |
4443 | ||
4444 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4445 | spec->mute_led_polarity = 0; | |
766538ac TI |
4446 | spec->mute_led_coef.idx = 0x34; |
4447 | spec->mute_led_coef.mask = 1 << 5; | |
4448 | spec->mute_led_coef.on = 0; | |
4449 | spec->mute_led_coef.off = 1 << 5; | |
8d3d1ece | 4450 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
24164f43 KY |
4451 | } |
4452 | } | |
4453 | ||
431e76c3 | 4454 | /* turn on/off mic-mute LED per capture hook by coef bit */ |
8a503555 TI |
4455 | static int coef_micmute_led_set(struct led_classdev *led_cdev, |
4456 | enum led_brightness brightness) | |
431e76c3 | 4457 | { |
8a503555 | 4458 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
431e76c3 KY |
4459 | struct alc_spec *spec = codec->spec; |
4460 | ||
766538ac TI |
4461 | alc_update_coef_led(codec, &spec->mic_led_coef, |
4462 | spec->micmute_led_polarity, brightness); | |
8a503555 | 4463 | return 0; |
431e76c3 KY |
4464 | } |
4465 | ||
4466 | static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, | |
4467 | const struct hda_fixup *fix, int action) | |
4468 | { | |
4469 | struct alc_spec *spec = codec->spec; | |
4470 | ||
4471 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
766538ac TI |
4472 | spec->mic_led_coef.idx = 0x19; |
4473 | spec->mic_led_coef.mask = 1 << 13; | |
4474 | spec->mic_led_coef.on = 1 << 13; | |
4475 | spec->mic_led_coef.off = 0; | |
8a503555 | 4476 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
431e76c3 KY |
4477 | } |
4478 | } | |
4479 | ||
24164f43 KY |
4480 | static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
4481 | const struct hda_fixup *fix, int action) | |
4482 | { | |
4483 | struct alc_spec *spec = codec->spec; | |
4484 | ||
4485 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
766538ac TI |
4486 | spec->mic_led_coef.idx = 0x35; |
4487 | spec->mic_led_coef.mask = 3 << 2; | |
4488 | spec->mic_led_coef.on = 2 << 2; | |
4489 | spec->mic_led_coef.off = 1 << 2; | |
8a503555 | 4490 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
24164f43 KY |
4491 | } |
4492 | } | |
4493 | ||
431e76c3 KY |
4494 | static void alc285_fixup_hp_mute_led(struct hda_codec *codec, |
4495 | const struct hda_fixup *fix, int action) | |
4496 | { | |
4497 | alc285_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4498 | alc285_fixup_hp_coef_micmute_led(codec, fix, action); | |
4499 | } | |
4500 | ||
24164f43 KY |
4501 | static void alc236_fixup_hp_mute_led(struct hda_codec *codec, |
4502 | const struct hda_fixup *fix, int action) | |
4503 | { | |
4504 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4505 | alc236_fixup_hp_coef_micmute_led(codec, fix, action); | |
4506 | } | |
4507 | ||
75b62ab6 JW |
4508 | static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec, |
4509 | const struct hda_fixup *fix, int action) | |
4510 | { | |
4511 | struct alc_spec *spec = codec->spec; | |
4512 | ||
4513 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4514 | spec->cap_mute_led_nid = 0x1a; | |
4515 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); | |
4516 | codec->power_filter = led_power_filter; | |
4517 | } | |
4518 | } | |
4519 | ||
4520 | static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec, | |
4521 | const struct hda_fixup *fix, int action) | |
4522 | { | |
4523 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4524 | alc236_fixup_hp_micmute_led_vref(codec, fix, action); | |
4525 | } | |
4526 | ||
6a30abaa | 4527 | #if IS_REACHABLE(CONFIG_INPUT) |
33f4acd3 DH |
4528 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
4529 | struct hda_jack_callback *event) | |
4530 | { | |
4531 | struct alc_spec *spec = codec->spec; | |
4532 | ||
4533 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore | |
4534 | send both key on and key off event for every interrupt. */ | |
c7b60a89 | 4535 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); |
33f4acd3 | 4536 | input_sync(spec->kb_dev); |
c7b60a89 | 4537 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); |
33f4acd3 DH |
4538 | input_sync(spec->kb_dev); |
4539 | } | |
33f4acd3 | 4540 | |
3694cb29 K |
4541 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
4542 | { | |
4543 | struct alc_spec *spec = codec->spec; | |
c7b60a89 | 4544 | int i; |
3694cb29 K |
4545 | |
4546 | spec->kb_dev = input_allocate_device(); | |
4547 | if (!spec->kb_dev) { | |
4548 | codec_err(codec, "Out of memory (input_allocate_device)\n"); | |
4549 | return -ENOMEM; | |
4550 | } | |
c7b60a89 HW |
4551 | |
4552 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; | |
4553 | ||
3694cb29 K |
4554 | spec->kb_dev->name = "Microphone Mute Button"; |
4555 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); | |
c7b60a89 HW |
4556 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
4557 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); | |
4558 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; | |
4559 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) | |
4560 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); | |
3694cb29 K |
4561 | |
4562 | if (input_register_device(spec->kb_dev)) { | |
4563 | codec_err(codec, "input_register_device failed\n"); | |
4564 | input_free_device(spec->kb_dev); | |
4565 | spec->kb_dev = NULL; | |
4566 | return -ENOMEM; | |
4567 | } | |
4568 | ||
4569 | return 0; | |
4570 | } | |
4571 | ||
01e4a275 TI |
4572 | /* GPIO1 = set according to SKU external amp |
4573 | * GPIO2 = mic mute hotkey | |
4574 | * GPIO3 = mute LED | |
4575 | * GPIO4 = mic mute LED | |
4576 | */ | |
33f4acd3 DH |
4577 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
4578 | const struct hda_fixup *fix, int action) | |
4579 | { | |
33f4acd3 DH |
4580 | struct alc_spec *spec = codec->spec; |
4581 | ||
01e4a275 | 4582 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
33f4acd3 | 4583 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
1c76aa5f | 4584 | spec->init_amp = ALC_INIT_DEFAULT; |
3694cb29 | 4585 | if (alc_register_micmute_input_device(codec) != 0) |
33f4acd3 | 4586 | return; |
33f4acd3 | 4587 | |
01e4a275 TI |
4588 | spec->gpio_mask |= 0x06; |
4589 | spec->gpio_dir |= 0x02; | |
4590 | spec->gpio_data |= 0x02; | |
7639a06c | 4591 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
33f4acd3 | 4592 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
7639a06c | 4593 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
33f4acd3 | 4594 | gpio2_mic_hotkey_event); |
33f4acd3 DH |
4595 | return; |
4596 | } | |
4597 | ||
4598 | if (!spec->kb_dev) | |
4599 | return; | |
4600 | ||
4601 | switch (action) { | |
33f4acd3 DH |
4602 | case HDA_FIXUP_ACT_FREE: |
4603 | input_unregister_device(spec->kb_dev); | |
33f4acd3 DH |
4604 | spec->kb_dev = NULL; |
4605 | } | |
33f4acd3 DH |
4606 | } |
4607 | ||
01e4a275 TI |
4608 | /* Line2 = mic mute hotkey |
4609 | * GPIO2 = mic mute LED | |
4610 | */ | |
3694cb29 K |
4611 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
4612 | const struct hda_fixup *fix, int action) | |
4613 | { | |
3694cb29 K |
4614 | struct alc_spec *spec = codec->spec; |
4615 | ||
01e4a275 | 4616 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
3694cb29 | 4617 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
1c76aa5f | 4618 | spec->init_amp = ALC_INIT_DEFAULT; |
3694cb29 K |
4619 | if (alc_register_micmute_input_device(codec) != 0) |
4620 | return; | |
4621 | ||
3694cb29 K |
4622 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
4623 | gpio2_mic_hotkey_event); | |
3694cb29 K |
4624 | return; |
4625 | } | |
4626 | ||
4627 | if (!spec->kb_dev) | |
4628 | return; | |
4629 | ||
4630 | switch (action) { | |
3694cb29 K |
4631 | case HDA_FIXUP_ACT_FREE: |
4632 | input_unregister_device(spec->kb_dev); | |
4633 | spec->kb_dev = NULL; | |
4634 | } | |
4635 | } | |
c469652b TI |
4636 | #else /* INPUT */ |
4637 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL | |
4638 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL | |
4639 | #endif /* INPUT */ | |
3694cb29 | 4640 | |
9c5dc3bf KY |
4641 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
4642 | const struct hda_fixup *fix, int action) | |
4643 | { | |
4644 | struct alc_spec *spec = codec->spec; | |
4645 | ||
1bce62a6 | 4646 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
9c5dc3bf | 4647 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
9c5dc3bf | 4648 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4649 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
9c5dc3bf KY |
4650 | } |
4651 | } | |
4652 | ||
6b0f95c4 | 4653 | static const struct coef_fw alc225_pre_hsmode[] = { |
5a36767a KY |
4654 | UPDATE_COEF(0x4a, 1<<8, 0), |
4655 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), | |
4656 | UPDATE_COEF(0x63, 3<<14, 3<<14), | |
4657 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4658 | UPDATE_COEF(0x4a, 3<<10, 3<<10), | |
4659 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | |
4660 | UPDATE_COEF(0x4a, 3<<10, 0), | |
4661 | {} | |
4662 | }; | |
4663 | ||
73bdd597 DH |
4664 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
4665 | { | |
92666d45 | 4666 | struct alc_spec *spec = codec->spec; |
6b0f95c4 | 4667 | static const struct coef_fw coef0255[] = { |
717f43d8 | 4668 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
54db6c39 TI |
4669 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
4670 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
4671 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ | |
4672 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ | |
4673 | {} | |
4674 | }; | |
6b0f95c4 | 4675 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 4676 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
717f43d8 KY |
4677 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
4678 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ | |
4679 | WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ | |
4680 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
e69e7e03 KY |
4681 | {} |
4682 | }; | |
6b0f95c4 | 4683 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4684 | WRITE_COEF(0x1b, 0x0c0b), |
4685 | WRITE_COEF(0x45, 0xc429), | |
4686 | UPDATE_COEF(0x35, 0x4000, 0), | |
4687 | WRITE_COEF(0x06, 0x2104), | |
4688 | WRITE_COEF(0x1a, 0x0001), | |
4689 | WRITE_COEF(0x26, 0x0004), | |
4690 | WRITE_COEF(0x32, 0x42a3), | |
4691 | {} | |
4692 | }; | |
6b0f95c4 | 4693 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
4694 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
4695 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4696 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4697 | UPDATE_COEF(0x66, 0x0008, 0), | |
4698 | UPDATE_COEF(0x67, 0x2000, 0), | |
4699 | {} | |
4700 | }; | |
6b0f95c4 | 4701 | static const struct coef_fw coef0298[] = { |
89542936 KY |
4702 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
4703 | {} | |
4704 | }; | |
6b0f95c4 | 4705 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4706 | WRITE_COEF(0x76, 0x000e), |
4707 | WRITE_COEF(0x6c, 0x2400), | |
4708 | WRITE_COEF(0x18, 0x7308), | |
4709 | WRITE_COEF(0x6b, 0xc429), | |
4710 | {} | |
4711 | }; | |
6b0f95c4 | 4712 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4713 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
4714 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ | |
4715 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ | |
4716 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ | |
4717 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ | |
4718 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ | |
4719 | {} | |
4720 | }; | |
6b0f95c4 | 4721 | static const struct coef_fw coef0668[] = { |
54db6c39 TI |
4722 | WRITE_COEF(0x15, 0x0d40), |
4723 | WRITE_COEF(0xb7, 0x802b), | |
4724 | {} | |
4725 | }; | |
6b0f95c4 | 4726 | static const struct coef_fw coef0225[] = { |
5a36767a | 4727 | UPDATE_COEF(0x63, 3<<14, 0), |
4cc9b9d6 KY |
4728 | {} |
4729 | }; | |
6b0f95c4 | 4730 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4731 | UPDATE_COEF(0x4a, 0x0100, 0), |
4732 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), | |
4733 | UPDATE_COEF(0x6b, 0xf000, 0x5000), | |
4734 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4735 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), | |
4736 | WRITE_COEF(0x45, 0x5289), | |
4737 | UPDATE_COEF(0x4a, 0x0c00, 0), | |
4738 | {} | |
4739 | }; | |
54db6c39 | 4740 | |
92666d45 KY |
4741 | if (spec->no_internal_mic_pin) { |
4742 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); | |
4743 | return; | |
4744 | } | |
4745 | ||
7639a06c | 4746 | switch (codec->core.vendor_id) { |
9a22a8f5 | 4747 | case 0x10ec0255: |
e69e7e03 KY |
4748 | alc_process_coef_fw(codec, coef0255); |
4749 | break; | |
1948fc06 | 4750 | case 0x10ec0230: |
736f20a7 | 4751 | case 0x10ec0236: |
7081adf3 | 4752 | case 0x10ec0256: |
e69e7e03 | 4753 | alc_process_coef_fw(codec, coef0256); |
9a22a8f5 | 4754 | break; |
71683c32 KY |
4755 | case 0x10ec0234: |
4756 | case 0x10ec0274: | |
4757 | case 0x10ec0294: | |
4758 | alc_process_coef_fw(codec, coef0274); | |
4759 | break; | |
13fd08a3 | 4760 | case 0x10ec0233: |
73bdd597 | 4761 | case 0x10ec0283: |
54db6c39 | 4762 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4763 | break; |
f3b70332 KY |
4764 | case 0x10ec0286: |
4765 | case 0x10ec0288: | |
89542936 KY |
4766 | alc_process_coef_fw(codec, coef0288); |
4767 | break; | |
1a5bc8d9 | 4768 | case 0x10ec0298: |
89542936 | 4769 | alc_process_coef_fw(codec, coef0298); |
f3b70332 KY |
4770 | alc_process_coef_fw(codec, coef0288); |
4771 | break; | |
73bdd597 | 4772 | case 0x10ec0292: |
54db6c39 | 4773 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4774 | break; |
a22aa26f | 4775 | case 0x10ec0293: |
54db6c39 | 4776 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4777 | break; |
73bdd597 | 4778 | case 0x10ec0668: |
54db6c39 | 4779 | alc_process_coef_fw(codec, coef0668); |
73bdd597 | 4780 | break; |
c2b691ee | 4781 | case 0x10ec0215: |
4cc9b9d6 | 4782 | case 0x10ec0225: |
c2b691ee | 4783 | case 0x10ec0285: |
7d727869 | 4784 | case 0x10ec0295: |
c2b691ee | 4785 | case 0x10ec0289: |
28f1f9b2 | 4786 | case 0x10ec0299: |
4d4b0c52 | 4787 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4788 | alc_process_coef_fw(codec, coef0225); |
4789 | break; | |
78f4f7c2 KY |
4790 | case 0x10ec0867: |
4791 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
4792 | break; | |
73bdd597 | 4793 | } |
4e76a883 | 4794 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
73bdd597 DH |
4795 | } |
4796 | ||
4797 | ||
4798 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |
4799 | hda_nid_t mic_pin) | |
4800 | { | |
6b0f95c4 | 4801 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
4802 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
4803 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ | |
4804 | {} | |
4805 | }; | |
6b0f95c4 | 4806 | static const struct coef_fw coef0256[] = { |
717f43d8 KY |
4807 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ |
4808 | WRITE_COEFEX(0x57, 0x03, 0x09a3), | |
4809 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ | |
4810 | {} | |
4811 | }; | |
6b0f95c4 | 4812 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4813 | UPDATE_COEF(0x35, 0, 1<<14), |
4814 | WRITE_COEF(0x06, 0x2100), | |
4815 | WRITE_COEF(0x1a, 0x0021), | |
4816 | WRITE_COEF(0x26, 0x008c), | |
4817 | {} | |
4818 | }; | |
6b0f95c4 | 4819 | static const struct coef_fw coef0288[] = { |
89542936 | 4820 | UPDATE_COEF(0x4f, 0x00c0, 0), |
f3b70332 KY |
4821 | UPDATE_COEF(0x50, 0x2000, 0), |
4822 | UPDATE_COEF(0x56, 0x0006, 0), | |
4823 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | |
4824 | UPDATE_COEF(0x66, 0x0008, 0x0008), | |
4825 | UPDATE_COEF(0x67, 0x2000, 0x2000), | |
4826 | {} | |
4827 | }; | |
6b0f95c4 | 4828 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4829 | WRITE_COEF(0x19, 0xa208), |
4830 | WRITE_COEF(0x2e, 0xacf0), | |
4831 | {} | |
4832 | }; | |
6b0f95c4 | 4833 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4834 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
4835 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ | |
4836 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
4837 | {} | |
4838 | }; | |
6b0f95c4 | 4839 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
4840 | WRITE_COEF(0xb7, 0x802b), |
4841 | WRITE_COEF(0xb5, 0x1040), | |
4842 | UPDATE_COEF(0xc3, 0, 1<<12), | |
4843 | {} | |
4844 | }; | |
6b0f95c4 | 4845 | static const struct coef_fw coef0225[] = { |
4cc9b9d6 KY |
4846 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
4847 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4848 | UPDATE_COEF(0x63, 3<<14, 0), | |
4849 | {} | |
4850 | }; | |
6b0f95c4 | 4851 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4852 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
4853 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4854 | UPDATE_COEF(0x6b, 0xf000, 0), | |
4855 | {} | |
4856 | }; | |
54db6c39 | 4857 | |
7639a06c | 4858 | switch (codec->core.vendor_id) { |
9a22a8f5 KY |
4859 | case 0x10ec0255: |
4860 | alc_write_coef_idx(codec, 0x45, 0xc489); | |
4861 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4862 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
4863 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4864 | break; | |
1948fc06 | 4865 | case 0x10ec0230: |
717f43d8 KY |
4866 | case 0x10ec0236: |
4867 | case 0x10ec0256: | |
4868 | alc_write_coef_idx(codec, 0x45, 0xc489); | |
4869 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4870 | alc_process_coef_fw(codec, coef0256); | |
4871 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4872 | break; | |
71683c32 KY |
4873 | case 0x10ec0234: |
4874 | case 0x10ec0274: | |
4875 | case 0x10ec0294: | |
4876 | alc_write_coef_idx(codec, 0x45, 0x4689); | |
4877 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4878 | alc_process_coef_fw(codec, coef0274); | |
4879 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4880 | break; | |
13fd08a3 | 4881 | case 0x10ec0233: |
73bdd597 DH |
4882 | case 0x10ec0283: |
4883 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4884 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4885 | alc_process_coef_fw(codec, coef0233); |
73bdd597 DH |
4886 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4887 | break; | |
f3b70332 KY |
4888 | case 0x10ec0286: |
4889 | case 0x10ec0288: | |
1a5bc8d9 | 4890 | case 0x10ec0298: |
f3b70332 KY |
4891 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
4892 | alc_process_coef_fw(codec, coef0288); | |
4893 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4894 | break; | |
73bdd597 DH |
4895 | case 0x10ec0292: |
4896 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4897 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4898 | break; |
a22aa26f KY |
4899 | case 0x10ec0293: |
4900 | /* Set to TRS mode */ | |
4901 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4902 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4903 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
4904 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4905 | break; | |
78f4f7c2 KY |
4906 | case 0x10ec0867: |
4907 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); | |
c0dbbdad | 4908 | fallthrough; |
9eb5d0e6 | 4909 | case 0x10ec0221: |
1f8b46cd DH |
4910 | case 0x10ec0662: |
4911 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4912 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4913 | break; | |
73bdd597 DH |
4914 | case 0x10ec0668: |
4915 | alc_write_coef_idx(codec, 0x11, 0x0001); | |
4916 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4917 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
4918 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4919 | break; | |
c2b691ee | 4920 | case 0x10ec0215: |
4cc9b9d6 | 4921 | case 0x10ec0225: |
c2b691ee | 4922 | case 0x10ec0285: |
7d727869 | 4923 | case 0x10ec0295: |
c2b691ee | 4924 | case 0x10ec0289: |
28f1f9b2 | 4925 | case 0x10ec0299: |
5a36767a | 4926 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4927 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
4928 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4929 | alc_process_coef_fw(codec, coef0225); | |
4930 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4931 | break; | |
73bdd597 | 4932 | } |
4e76a883 | 4933 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
73bdd597 DH |
4934 | } |
4935 | ||
4936 | static void alc_headset_mode_default(struct hda_codec *codec) | |
4937 | { | |
6b0f95c4 | 4938 | static const struct coef_fw coef0225[] = { |
5a36767a KY |
4939 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
4940 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), | |
4941 | UPDATE_COEF(0x49, 3<<8, 0<<8), | |
4942 | UPDATE_COEF(0x4a, 3<<4, 3<<4), | |
4943 | UPDATE_COEF(0x63, 3<<14, 0), | |
4944 | UPDATE_COEF(0x67, 0xf000, 0x3000), | |
2ae95577 DH |
4945 | {} |
4946 | }; | |
6b0f95c4 | 4947 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
4948 | WRITE_COEF(0x45, 0xc089), |
4949 | WRITE_COEF(0x45, 0xc489), | |
4950 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4951 | WRITE_COEF(0x49, 0x0049), | |
4952 | {} | |
4953 | }; | |
6b0f95c4 | 4954 | static const struct coef_fw coef0256[] = { |
717f43d8 KY |
4955 | WRITE_COEF(0x45, 0xc489), |
4956 | WRITE_COEFEX(0x57, 0x03, 0x0da3), | |
4957 | WRITE_COEF(0x49, 0x0049), | |
4958 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
4959 | WRITE_COEF(0x06, 0x6100), | |
4960 | {} | |
4961 | }; | |
6b0f95c4 | 4962 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4963 | WRITE_COEF(0x06, 0x2100), |
4964 | WRITE_COEF(0x32, 0x4ea3), | |
4965 | {} | |
4966 | }; | |
6b0f95c4 | 4967 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
4968 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
4969 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4970 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4971 | UPDATE_COEF(0x66, 0x0008, 0), | |
4972 | UPDATE_COEF(0x67, 0x2000, 0), | |
4973 | {} | |
4974 | }; | |
6b0f95c4 | 4975 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4976 | WRITE_COEF(0x76, 0x000e), |
4977 | WRITE_COEF(0x6c, 0x2400), | |
4978 | WRITE_COEF(0x6b, 0xc429), | |
4979 | WRITE_COEF(0x18, 0x7308), | |
4980 | {} | |
4981 | }; | |
6b0f95c4 | 4982 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4983 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
4984 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ | |
4985 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
4986 | {} | |
4987 | }; | |
6b0f95c4 | 4988 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
4989 | WRITE_COEF(0x11, 0x0041), |
4990 | WRITE_COEF(0x15, 0x0d40), | |
4991 | WRITE_COEF(0xb7, 0x802b), | |
4992 | {} | |
4993 | }; | |
6b0f95c4 | 4994 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4995 | WRITE_COEF(0x45, 0x4289), |
4996 | UPDATE_COEF(0x4a, 0x0010, 0x0010), | |
4997 | UPDATE_COEF(0x6b, 0x0f00, 0), | |
4998 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
4999 | {} | |
5000 | }; | |
54db6c39 | 5001 | |
7639a06c | 5002 | switch (codec->core.vendor_id) { |
c2b691ee | 5003 | case 0x10ec0215: |
2ae95577 | 5004 | case 0x10ec0225: |
c2b691ee | 5005 | case 0x10ec0285: |
7d727869 | 5006 | case 0x10ec0295: |
c2b691ee | 5007 | case 0x10ec0289: |
28f1f9b2 | 5008 | case 0x10ec0299: |
5a36767a | 5009 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
2ae95577 DH |
5010 | alc_process_coef_fw(codec, coef0225); |
5011 | break; | |
9a22a8f5 | 5012 | case 0x10ec0255: |
54db6c39 | 5013 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 5014 | break; |
1948fc06 | 5015 | case 0x10ec0230: |
717f43d8 KY |
5016 | case 0x10ec0236: |
5017 | case 0x10ec0256: | |
5018 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); | |
5019 | alc_write_coef_idx(codec, 0x45, 0xc089); | |
5020 | msleep(50); | |
5021 | alc_process_coef_fw(codec, coef0256); | |
5022 | break; | |
71683c32 KY |
5023 | case 0x10ec0234: |
5024 | case 0x10ec0274: | |
5025 | case 0x10ec0294: | |
5026 | alc_process_coef_fw(codec, coef0274); | |
5027 | break; | |
13fd08a3 | 5028 | case 0x10ec0233: |
73bdd597 | 5029 | case 0x10ec0283: |
54db6c39 | 5030 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 5031 | break; |
f3b70332 KY |
5032 | case 0x10ec0286: |
5033 | case 0x10ec0288: | |
1a5bc8d9 | 5034 | case 0x10ec0298: |
f3b70332 KY |
5035 | alc_process_coef_fw(codec, coef0288); |
5036 | break; | |
73bdd597 | 5037 | case 0x10ec0292: |
54db6c39 | 5038 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 5039 | break; |
a22aa26f | 5040 | case 0x10ec0293: |
54db6c39 | 5041 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5042 | break; |
73bdd597 | 5043 | case 0x10ec0668: |
54db6c39 | 5044 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5045 | break; |
78f4f7c2 KY |
5046 | case 0x10ec0867: |
5047 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5048 | break; | |
73bdd597 | 5049 | } |
4e76a883 | 5050 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
73bdd597 DH |
5051 | } |
5052 | ||
5053 | /* Iphone type */ | |
5054 | static void alc_headset_mode_ctia(struct hda_codec *codec) | |
5055 | { | |
89542936 KY |
5056 | int val; |
5057 | ||
6b0f95c4 | 5058 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5059 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
5060 | WRITE_COEF(0x1b, 0x0c2b), | |
5061 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
5062 | {} | |
5063 | }; | |
6b0f95c4 | 5064 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 5065 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
717f43d8 | 5066 | WRITE_COEF(0x1b, 0x0e6b), |
e69e7e03 KY |
5067 | {} |
5068 | }; | |
6b0f95c4 | 5069 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
5070 | WRITE_COEF(0x45, 0xd429), |
5071 | WRITE_COEF(0x1b, 0x0c2b), | |
5072 | WRITE_COEF(0x32, 0x4ea3), | |
5073 | {} | |
5074 | }; | |
6b0f95c4 | 5075 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5076 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5077 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5078 | UPDATE_COEF(0x66, 0x0008, 0), | |
5079 | UPDATE_COEF(0x67, 0x2000, 0), | |
5080 | {} | |
5081 | }; | |
6b0f95c4 | 5082 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
5083 | WRITE_COEF(0x6b, 0xd429), |
5084 | WRITE_COEF(0x76, 0x0008), | |
5085 | WRITE_COEF(0x18, 0x7388), | |
5086 | {} | |
5087 | }; | |
6b0f95c4 | 5088 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5089 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
5090 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
5091 | {} | |
5092 | }; | |
6b0f95c4 | 5093 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5094 | WRITE_COEF(0x11, 0x0001), |
5095 | WRITE_COEF(0x15, 0x0d60), | |
5096 | WRITE_COEF(0xc3, 0x0000), | |
5097 | {} | |
5098 | }; | |
6b0f95c4 | 5099 | static const struct coef_fw coef0225_1[] = { |
4cc9b9d6 | 5100 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
5a36767a KY |
5101 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
5102 | {} | |
5103 | }; | |
6b0f95c4 | 5104 | static const struct coef_fw coef0225_2[] = { |
5a36767a KY |
5105 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
5106 | UPDATE_COEF(0x63, 3<<14, 1<<14), | |
4cc9b9d6 KY |
5107 | {} |
5108 | }; | |
54db6c39 | 5109 | |
7639a06c | 5110 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5111 | case 0x10ec0255: |
54db6c39 | 5112 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 5113 | break; |
1948fc06 | 5114 | case 0x10ec0230: |
736f20a7 | 5115 | case 0x10ec0236: |
e69e7e03 KY |
5116 | case 0x10ec0256: |
5117 | alc_process_coef_fw(codec, coef0256); | |
5118 | break; | |
71683c32 KY |
5119 | case 0x10ec0234: |
5120 | case 0x10ec0274: | |
5121 | case 0x10ec0294: | |
5122 | alc_write_coef_idx(codec, 0x45, 0xd689); | |
5123 | break; | |
13fd08a3 | 5124 | case 0x10ec0233: |
73bdd597 | 5125 | case 0x10ec0283: |
54db6c39 | 5126 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 5127 | break; |
1a5bc8d9 | 5128 | case 0x10ec0298: |
89542936 KY |
5129 | val = alc_read_coef_idx(codec, 0x50); |
5130 | if (val & (1 << 12)) { | |
5131 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
5132 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
5133 | msleep(300); | |
5134 | } else { | |
5135 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
5136 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
5137 | msleep(300); | |
5138 | } | |
5139 | break; | |
f3b70332 KY |
5140 | case 0x10ec0286: |
5141 | case 0x10ec0288: | |
5142 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
5143 | msleep(300); | |
5144 | alc_process_coef_fw(codec, coef0288); | |
5145 | break; | |
73bdd597 | 5146 | case 0x10ec0292: |
54db6c39 | 5147 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 5148 | break; |
a22aa26f | 5149 | case 0x10ec0293: |
54db6c39 | 5150 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5151 | break; |
73bdd597 | 5152 | case 0x10ec0668: |
54db6c39 | 5153 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5154 | break; |
c2b691ee | 5155 | case 0x10ec0215: |
4cc9b9d6 | 5156 | case 0x10ec0225: |
c2b691ee | 5157 | case 0x10ec0285: |
7d727869 | 5158 | case 0x10ec0295: |
c2b691ee | 5159 | case 0x10ec0289: |
28f1f9b2 | 5160 | case 0x10ec0299: |
5a36767a KY |
5161 | val = alc_read_coef_idx(codec, 0x45); |
5162 | if (val & (1 << 9)) | |
5163 | alc_process_coef_fw(codec, coef0225_2); | |
5164 | else | |
5165 | alc_process_coef_fw(codec, coef0225_1); | |
4cc9b9d6 | 5166 | break; |
78f4f7c2 KY |
5167 | case 0x10ec0867: |
5168 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5169 | break; | |
73bdd597 | 5170 | } |
4e76a883 | 5171 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
73bdd597 DH |
5172 | } |
5173 | ||
5174 | /* Nokia type */ | |
5175 | static void alc_headset_mode_omtp(struct hda_codec *codec) | |
5176 | { | |
6b0f95c4 | 5177 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5178 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
5179 | WRITE_COEF(0x1b, 0x0c2b), | |
5180 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
5181 | {} | |
5182 | }; | |
6b0f95c4 | 5183 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 5184 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
717f43d8 | 5185 | WRITE_COEF(0x1b, 0x0e6b), |
e69e7e03 KY |
5186 | {} |
5187 | }; | |
6b0f95c4 | 5188 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
5189 | WRITE_COEF(0x45, 0xe429), |
5190 | WRITE_COEF(0x1b, 0x0c2b), | |
5191 | WRITE_COEF(0x32, 0x4ea3), | |
5192 | {} | |
5193 | }; | |
6b0f95c4 | 5194 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5195 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5196 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5197 | UPDATE_COEF(0x66, 0x0008, 0), | |
5198 | UPDATE_COEF(0x67, 0x2000, 0), | |
5199 | {} | |
5200 | }; | |
6b0f95c4 | 5201 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
5202 | WRITE_COEF(0x6b, 0xe429), |
5203 | WRITE_COEF(0x76, 0x0008), | |
5204 | WRITE_COEF(0x18, 0x7388), | |
5205 | {} | |
5206 | }; | |
6b0f95c4 | 5207 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5208 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
5209 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
5210 | {} | |
5211 | }; | |
6b0f95c4 | 5212 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5213 | WRITE_COEF(0x11, 0x0001), |
5214 | WRITE_COEF(0x15, 0x0d50), | |
5215 | WRITE_COEF(0xc3, 0x0000), | |
5216 | {} | |
5217 | }; | |
6b0f95c4 | 5218 | static const struct coef_fw coef0225[] = { |
4cc9b9d6 | 5219 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
5a36767a | 5220 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4cc9b9d6 KY |
5221 | {} |
5222 | }; | |
54db6c39 | 5223 | |
7639a06c | 5224 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5225 | case 0x10ec0255: |
54db6c39 | 5226 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 5227 | break; |
1948fc06 | 5228 | case 0x10ec0230: |
736f20a7 | 5229 | case 0x10ec0236: |
e69e7e03 KY |
5230 | case 0x10ec0256: |
5231 | alc_process_coef_fw(codec, coef0256); | |
5232 | break; | |
71683c32 KY |
5233 | case 0x10ec0234: |
5234 | case 0x10ec0274: | |
5235 | case 0x10ec0294: | |
5236 | alc_write_coef_idx(codec, 0x45, 0xe689); | |
5237 | break; | |
13fd08a3 | 5238 | case 0x10ec0233: |
73bdd597 | 5239 | case 0x10ec0283: |
54db6c39 | 5240 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 5241 | break; |
1a5bc8d9 KY |
5242 | case 0x10ec0298: |
5243 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ | |
89542936 KY |
5244 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
5245 | msleep(300); | |
5246 | break; | |
f3b70332 KY |
5247 | case 0x10ec0286: |
5248 | case 0x10ec0288: | |
5249 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); | |
5250 | msleep(300); | |
5251 | alc_process_coef_fw(codec, coef0288); | |
5252 | break; | |
73bdd597 | 5253 | case 0x10ec0292: |
54db6c39 | 5254 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 5255 | break; |
a22aa26f | 5256 | case 0x10ec0293: |
54db6c39 | 5257 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5258 | break; |
73bdd597 | 5259 | case 0x10ec0668: |
54db6c39 | 5260 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5261 | break; |
c2b691ee | 5262 | case 0x10ec0215: |
4cc9b9d6 | 5263 | case 0x10ec0225: |
c2b691ee | 5264 | case 0x10ec0285: |
7d727869 | 5265 | case 0x10ec0295: |
c2b691ee | 5266 | case 0x10ec0289: |
28f1f9b2 | 5267 | case 0x10ec0299: |
4cc9b9d6 KY |
5268 | alc_process_coef_fw(codec, coef0225); |
5269 | break; | |
73bdd597 | 5270 | } |
4e76a883 | 5271 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
73bdd597 DH |
5272 | } |
5273 | ||
5274 | static void alc_determine_headset_type(struct hda_codec *codec) | |
5275 | { | |
5276 | int val; | |
5277 | bool is_ctia = false; | |
5278 | struct alc_spec *spec = codec->spec; | |
6b0f95c4 | 5279 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5280 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
5281 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref | |
5282 | conteol) */ | |
5283 | {} | |
5284 | }; | |
6b0f95c4 | 5285 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5286 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
5287 | {} | |
5288 | }; | |
6b0f95c4 | 5289 | static const struct coef_fw coef0298[] = { |
89542936 KY |
5290 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5291 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5292 | UPDATE_COEF(0x66, 0x0008, 0), | |
5293 | UPDATE_COEF(0x67, 0x2000, 0), | |
5294 | UPDATE_COEF(0x19, 0x1300, 0x1300), | |
5295 | {} | |
5296 | }; | |
6b0f95c4 | 5297 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5298 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
5299 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ | |
5300 | {} | |
5301 | }; | |
6b0f95c4 | 5302 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5303 | WRITE_COEF(0x11, 0x0001), |
5304 | WRITE_COEF(0xb7, 0x802b), | |
5305 | WRITE_COEF(0x15, 0x0d60), | |
5306 | WRITE_COEF(0xc3, 0x0c00), | |
5307 | {} | |
5308 | }; | |
6b0f95c4 | 5309 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
5310 | UPDATE_COEF(0x4a, 0x0010, 0), |
5311 | UPDATE_COEF(0x4a, 0x8000, 0), | |
5312 | WRITE_COEF(0x45, 0xd289), | |
5313 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
5314 | {} | |
5315 | }; | |
73bdd597 | 5316 | |
92666d45 KY |
5317 | if (spec->no_internal_mic_pin) { |
5318 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); | |
5319 | return; | |
5320 | } | |
5321 | ||
7639a06c | 5322 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5323 | case 0x10ec0255: |
717f43d8 KY |
5324 | alc_process_coef_fw(codec, coef0255); |
5325 | msleep(300); | |
5326 | val = alc_read_coef_idx(codec, 0x46); | |
5327 | is_ctia = (val & 0x0070) == 0x0070; | |
5328 | break; | |
1948fc06 | 5329 | case 0x10ec0230: |
717f43d8 | 5330 | case 0x10ec0236: |
7081adf3 | 5331 | case 0x10ec0256: |
717f43d8 KY |
5332 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
5333 | alc_write_coef_idx(codec, 0x06, 0x6104); | |
5334 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); | |
5335 | ||
5336 | snd_hda_codec_write(codec, 0x21, 0, | |
5337 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5338 | msleep(80); | |
5339 | snd_hda_codec_write(codec, 0x21, 0, | |
5340 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5341 | ||
54db6c39 | 5342 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
5343 | msleep(300); |
5344 | val = alc_read_coef_idx(codec, 0x46); | |
5345 | is_ctia = (val & 0x0070) == 0x0070; | |
717f43d8 KY |
5346 | |
5347 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); | |
5348 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5349 | ||
5350 | snd_hda_codec_write(codec, 0x21, 0, | |
5351 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
5352 | msleep(80); | |
5353 | snd_hda_codec_write(codec, 0x21, 0, | |
5354 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
9a22a8f5 | 5355 | break; |
71683c32 KY |
5356 | case 0x10ec0234: |
5357 | case 0x10ec0274: | |
5358 | case 0x10ec0294: | |
5359 | alc_process_coef_fw(codec, coef0274); | |
febf2256 | 5360 | msleep(850); |
71683c32 KY |
5361 | val = alc_read_coef_idx(codec, 0x46); |
5362 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5363 | break; | |
13fd08a3 | 5364 | case 0x10ec0233: |
73bdd597 DH |
5365 | case 0x10ec0283: |
5366 | alc_write_coef_idx(codec, 0x45, 0xd029); | |
5367 | msleep(300); | |
5368 | val = alc_read_coef_idx(codec, 0x46); | |
5369 | is_ctia = (val & 0x0070) == 0x0070; | |
5370 | break; | |
1a5bc8d9 | 5371 | case 0x10ec0298: |
89542936 KY |
5372 | snd_hda_codec_write(codec, 0x21, 0, |
5373 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5374 | msleep(100); | |
5375 | snd_hda_codec_write(codec, 0x21, 0, | |
5376 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5377 | msleep(200); | |
5378 | ||
5379 | val = alc_read_coef_idx(codec, 0x50); | |
5380 | if (val & (1 << 12)) { | |
5381 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
5382 | alc_process_coef_fw(codec, coef0288); | |
5383 | msleep(350); | |
5384 | val = alc_read_coef_idx(codec, 0x50); | |
5385 | is_ctia = (val & 0x0070) == 0x0070; | |
5386 | } else { | |
5387 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
5388 | alc_process_coef_fw(codec, coef0288); | |
5389 | msleep(350); | |
5390 | val = alc_read_coef_idx(codec, 0x50); | |
5391 | is_ctia = (val & 0x0070) == 0x0070; | |
5392 | } | |
5393 | alc_process_coef_fw(codec, coef0298); | |
5394 | snd_hda_codec_write(codec, 0x21, 0, | |
5395 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); | |
5396 | msleep(75); | |
5397 | snd_hda_codec_write(codec, 0x21, 0, | |
5398 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
5399 | break; | |
f3b70332 KY |
5400 | case 0x10ec0286: |
5401 | case 0x10ec0288: | |
5402 | alc_process_coef_fw(codec, coef0288); | |
5403 | msleep(350); | |
5404 | val = alc_read_coef_idx(codec, 0x50); | |
5405 | is_ctia = (val & 0x0070) == 0x0070; | |
5406 | break; | |
73bdd597 DH |
5407 | case 0x10ec0292: |
5408 | alc_write_coef_idx(codec, 0x6b, 0xd429); | |
5409 | msleep(300); | |
5410 | val = alc_read_coef_idx(codec, 0x6c); | |
5411 | is_ctia = (val & 0x001c) == 0x001c; | |
5412 | break; | |
a22aa26f | 5413 | case 0x10ec0293: |
54db6c39 | 5414 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
5415 | msleep(300); |
5416 | val = alc_read_coef_idx(codec, 0x46); | |
5417 | is_ctia = (val & 0x0070) == 0x0070; | |
5418 | break; | |
73bdd597 | 5419 | case 0x10ec0668: |
54db6c39 | 5420 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
5421 | msleep(300); |
5422 | val = alc_read_coef_idx(codec, 0xbe); | |
5423 | is_ctia = (val & 0x1c02) == 0x1c02; | |
5424 | break; | |
c2b691ee | 5425 | case 0x10ec0215: |
4cc9b9d6 | 5426 | case 0x10ec0225: |
c2b691ee | 5427 | case 0x10ec0285: |
7d727869 | 5428 | case 0x10ec0295: |
c2b691ee | 5429 | case 0x10ec0289: |
28f1f9b2 | 5430 | case 0x10ec0299: |
da911b1f KY |
5431 | snd_hda_codec_write(codec, 0x21, 0, |
5432 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5433 | msleep(80); | |
5434 | snd_hda_codec_write(codec, 0x21, 0, | |
5435 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5436 | ||
5a36767a KY |
5437 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
5438 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); | |
5439 | val = alc_read_coef_idx(codec, 0x45); | |
5440 | if (val & (1 << 9)) { | |
5441 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
5442 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); | |
5443 | msleep(800); | |
5444 | val = alc_read_coef_idx(codec, 0x46); | |
5445 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5446 | } else { | |
5447 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
5448 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); | |
5449 | msleep(800); | |
5450 | val = alc_read_coef_idx(codec, 0x46); | |
5451 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5452 | } | |
5453 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); | |
5454 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); | |
5455 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
da911b1f KY |
5456 | |
5457 | snd_hda_codec_write(codec, 0x21, 0, | |
5458 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
5459 | msleep(80); | |
5460 | snd_hda_codec_write(codec, 0x21, 0, | |
5461 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
4cc9b9d6 | 5462 | break; |
78f4f7c2 KY |
5463 | case 0x10ec0867: |
5464 | is_ctia = true; | |
5465 | break; | |
73bdd597 DH |
5466 | } |
5467 | ||
4e76a883 | 5468 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
73bdd597 DH |
5469 | is_ctia ? "yes" : "no"); |
5470 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; | |
5471 | } | |
5472 | ||
5473 | static void alc_update_headset_mode(struct hda_codec *codec) | |
5474 | { | |
5475 | struct alc_spec *spec = codec->spec; | |
5476 | ||
5477 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; | |
35a39f98 | 5478 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
73bdd597 DH |
5479 | |
5480 | int new_headset_mode; | |
5481 | ||
5482 | if (!snd_hda_jack_detect(codec, hp_pin)) | |
5483 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; | |
5484 | else if (mux_pin == spec->headset_mic_pin) | |
5485 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; | |
5486 | else if (mux_pin == spec->headphone_mic_pin) | |
5487 | new_headset_mode = ALC_HEADSET_MODE_MIC; | |
5488 | else | |
5489 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; | |
5490 | ||
5959a6bc DH |
5491 | if (new_headset_mode == spec->current_headset_mode) { |
5492 | snd_hda_gen_update_outputs(codec); | |
73bdd597 | 5493 | return; |
5959a6bc | 5494 | } |
73bdd597 DH |
5495 | |
5496 | switch (new_headset_mode) { | |
5497 | case ALC_HEADSET_MODE_UNPLUGGED: | |
5498 | alc_headset_mode_unplugged(codec); | |
aeac1a0d KY |
5499 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
5500 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; | |
73bdd597 DH |
5501 | spec->gen.hp_jack_present = false; |
5502 | break; | |
5503 | case ALC_HEADSET_MODE_HEADSET: | |
5504 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) | |
5505 | alc_determine_headset_type(codec); | |
5506 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) | |
5507 | alc_headset_mode_ctia(codec); | |
5508 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) | |
5509 | alc_headset_mode_omtp(codec); | |
5510 | spec->gen.hp_jack_present = true; | |
5511 | break; | |
5512 | case ALC_HEADSET_MODE_MIC: | |
5513 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); | |
5514 | spec->gen.hp_jack_present = false; | |
5515 | break; | |
5516 | case ALC_HEADSET_MODE_HEADPHONE: | |
5517 | alc_headset_mode_default(codec); | |
5518 | spec->gen.hp_jack_present = true; | |
5519 | break; | |
5520 | } | |
5521 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { | |
5522 | snd_hda_set_pin_ctl_cache(codec, hp_pin, | |
5523 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); | |
1f8b46cd | 5524 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
73bdd597 DH |
5525 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
5526 | PIN_VREFHIZ); | |
5527 | } | |
5528 | spec->current_headset_mode = new_headset_mode; | |
5529 | ||
5530 | snd_hda_gen_update_outputs(codec); | |
5531 | } | |
5532 | ||
5533 | static void alc_update_headset_mode_hook(struct hda_codec *codec, | |
7fe30711 TI |
5534 | struct snd_kcontrol *kcontrol, |
5535 | struct snd_ctl_elem_value *ucontrol) | |
73bdd597 DH |
5536 | { |
5537 | alc_update_headset_mode(codec); | |
5538 | } | |
5539 | ||
1a4f69d5 TI |
5540 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
5541 | struct hda_jack_callback *jack) | |
73bdd597 | 5542 | { |
73bdd597 | 5543 | snd_hda_gen_hp_automute(codec, jack); |
e54f30be | 5544 | alc_update_headset_mode(codec); |
73bdd597 DH |
5545 | } |
5546 | ||
5547 | static void alc_probe_headset_mode(struct hda_codec *codec) | |
5548 | { | |
5549 | int i; | |
5550 | struct alc_spec *spec = codec->spec; | |
5551 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5552 | ||
5553 | /* Find mic pins */ | |
5554 | for (i = 0; i < cfg->num_inputs; i++) { | |
5555 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) | |
5556 | spec->headset_mic_pin = cfg->inputs[i].pin; | |
5557 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) | |
5558 | spec->headphone_mic_pin = cfg->inputs[i].pin; | |
5559 | } | |
5560 | ||
0bed2aa3 | 5561 | WARN_ON(spec->gen.cap_sync_hook); |
73bdd597 DH |
5562 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
5563 | spec->gen.automute_hook = alc_update_headset_mode; | |
5564 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; | |
5565 | } | |
5566 | ||
5567 | static void alc_fixup_headset_mode(struct hda_codec *codec, | |
5568 | const struct hda_fixup *fix, int action) | |
5569 | { | |
5570 | struct alc_spec *spec = codec->spec; | |
5571 | ||
5572 | switch (action) { | |
5573 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5574 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; | |
5575 | break; | |
5576 | case HDA_FIXUP_ACT_PROBE: | |
5577 | alc_probe_headset_mode(codec); | |
5578 | break; | |
5579 | case HDA_FIXUP_ACT_INIT: | |
aeac1a0d KY |
5580 | if (is_s3_resume(codec) || is_s4_resume(codec)) { |
5581 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; | |
5582 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; | |
5583 | } | |
73bdd597 DH |
5584 | alc_update_headset_mode(codec); |
5585 | break; | |
5586 | } | |
5587 | } | |
5588 | ||
5589 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, | |
5590 | const struct hda_fixup *fix, int action) | |
5591 | { | |
5592 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5593 | struct alc_spec *spec = codec->spec; | |
5594 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5595 | } | |
5596 | else | |
5597 | alc_fixup_headset_mode(codec, fix, action); | |
5598 | } | |
5599 | ||
31278997 KY |
5600 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
5601 | { | |
5602 | /* Set to iphone type */ | |
6b0f95c4 | 5603 | static const struct coef_fw alc255fw[] = { |
54db6c39 TI |
5604 | WRITE_COEF(0x1b, 0x880b), |
5605 | WRITE_COEF(0x45, 0xd089), | |
5606 | WRITE_COEF(0x1b, 0x080b), | |
5607 | WRITE_COEF(0x46, 0x0004), | |
5608 | WRITE_COEF(0x1b, 0x0c0b), | |
5609 | {} | |
5610 | }; | |
6b0f95c4 | 5611 | static const struct coef_fw alc256fw[] = { |
e69e7e03 KY |
5612 | WRITE_COEF(0x1b, 0x884b), |
5613 | WRITE_COEF(0x45, 0xd089), | |
5614 | WRITE_COEF(0x1b, 0x084b), | |
5615 | WRITE_COEF(0x46, 0x0004), | |
5616 | WRITE_COEF(0x1b, 0x0c4b), | |
5617 | {} | |
5618 | }; | |
5619 | switch (codec->core.vendor_id) { | |
5620 | case 0x10ec0255: | |
5621 | alc_process_coef_fw(codec, alc255fw); | |
5622 | break; | |
1948fc06 | 5623 | case 0x10ec0230: |
736f20a7 | 5624 | case 0x10ec0236: |
e69e7e03 KY |
5625 | case 0x10ec0256: |
5626 | alc_process_coef_fw(codec, alc256fw); | |
5627 | break; | |
5628 | } | |
31278997 KY |
5629 | msleep(30); |
5630 | } | |
5631 | ||
9a22a8f5 KY |
5632 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
5633 | const struct hda_fixup *fix, int action) | |
5634 | { | |
5635 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
31278997 | 5636 | alc255_set_default_jack_type(codec); |
9a22a8f5 KY |
5637 | } |
5638 | alc_fixup_headset_mode(codec, fix, action); | |
5639 | } | |
5640 | ||
31278997 KY |
5641 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
5642 | const struct hda_fixup *fix, int action) | |
5643 | { | |
5644 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5645 | struct alc_spec *spec = codec->spec; | |
5646 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5647 | alc255_set_default_jack_type(codec); | |
5648 | } | |
5649 | else | |
5650 | alc_fixup_headset_mode(codec, fix, action); | |
5651 | } | |
5652 | ||
e1e62b98 KY |
5653 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
5654 | struct hda_jack_callback *jack) | |
5655 | { | |
5656 | struct alc_spec *spec = codec->spec; | |
e1e62b98 KY |
5657 | |
5658 | alc_update_headset_jack_cb(codec, jack); | |
5659 | /* Headset Mic enable or disable, only for Dell Dino */ | |
d44a6864 | 5660 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
e1e62b98 KY |
5661 | } |
5662 | ||
5663 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, | |
5664 | const struct hda_fixup *fix, int action) | |
5665 | { | |
5666 | alc_fixup_headset_mode(codec, fix, action); | |
5667 | if (action == HDA_FIXUP_ACT_PROBE) { | |
5668 | struct alc_spec *spec = codec->spec; | |
d44a6864 TI |
5669 | /* toggled via hp_automute_hook */ |
5670 | spec->gpio_mask |= 0x40; | |
5671 | spec->gpio_dir |= 0x40; | |
e1e62b98 KY |
5672 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
5673 | } | |
5674 | } | |
5675 | ||
493a52a9 HW |
5676 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
5677 | const struct hda_fixup *fix, int action) | |
5678 | { | |
5679 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5680 | struct alc_spec *spec = codec->spec; | |
5681 | spec->gen.auto_mute_via_amp = 1; | |
5682 | } | |
5683 | } | |
5684 | ||
9b745ab8 TI |
5685 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
5686 | const struct hda_fixup *fix, int action) | |
5687 | { | |
efe55732 | 5688 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
9b745ab8 | 5689 | struct alc_spec *spec = codec->spec; |
c0ca5ece | 5690 | spec->no_shutup_pins = 1; |
9b745ab8 TI |
5691 | } |
5692 | } | |
5693 | ||
5e6db669 GM |
5694 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
5695 | const struct hda_fixup *fix, int action) | |
5696 | { | |
5697 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5698 | struct alc_spec *spec = codec->spec; | |
5699 | /* Disable AA-loopback as it causes white noise */ | |
5700 | spec->gen.mixer_nid = 0; | |
5701 | } | |
5702 | } | |
5703 | ||
7f57d803 TI |
5704 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
5705 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, | |
5706 | const struct hda_fixup *fix, int action) | |
5707 | { | |
5708 | static const struct hda_pintbl pincfgs[] = { | |
5709 | { 0x16, 0x21211010 }, /* dock headphone */ | |
5710 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5711 | { } | |
5712 | }; | |
5713 | struct alc_spec *spec = codec->spec; | |
5714 | ||
5715 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
871b9066 | 5716 | spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */ |
7f57d803 TI |
5717 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
5718 | codec->power_save_node = 0; /* avoid click noises */ | |
5719 | snd_hda_apply_pincfgs(codec, pincfgs); | |
5720 | } | |
5721 | } | |
5722 | ||
61fcf8ec KY |
5723 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
5724 | const struct hda_fixup *fix, int action) | |
5725 | { | |
5726 | static const struct hda_pintbl pincfgs[] = { | |
5727 | { 0x17, 0x21211010 }, /* dock headphone */ | |
5728 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5729 | { } | |
5730 | }; | |
5731 | struct alc_spec *spec = codec->spec; | |
5732 | ||
5733 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5734 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
71db96dd TI |
5735 | snd_hda_apply_pincfgs(codec, pincfgs); |
5736 | } else if (action == HDA_FIXUP_ACT_INIT) { | |
61fcf8ec KY |
5737 | /* Enable DOCK device */ |
5738 | snd_hda_codec_write(codec, 0x17, 0, | |
5739 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
5740 | /* Enable DOCK device */ | |
5741 | snd_hda_codec_write(codec, 0x19, 0, | |
5742 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
61fcf8ec KY |
5743 | } |
5744 | } | |
5745 | ||
399c01aa TI |
5746 | static void alc_fixup_tpt470_dacs(struct hda_codec *codec, |
5747 | const struct hda_fixup *fix, int action) | |
5748 | { | |
5749 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise | |
5750 | * the speaker output becomes too low by some reason on Thinkpads with | |
5751 | * ALC298 codec | |
5752 | */ | |
5753 | static const hda_nid_t preferred_pairs[] = { | |
5754 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, | |
5755 | 0 | |
5756 | }; | |
5757 | struct alc_spec *spec = codec->spec; | |
5758 | ||
5759 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
5760 | spec->gen.preferred_dacs = preferred_pairs; | |
5761 | } | |
5762 | ||
8eedd3a7 TI |
5763 | static void alc295_fixup_asus_dacs(struct hda_codec *codec, |
5764 | const struct hda_fixup *fix, int action) | |
5765 | { | |
5766 | static const hda_nid_t preferred_pairs[] = { | |
5767 | 0x17, 0x02, 0x21, 0x03, 0 | |
5768 | }; | |
5769 | struct alc_spec *spec = codec->spec; | |
5770 | ||
5771 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
5772 | spec->gen.preferred_dacs = preferred_pairs; | |
5773 | } | |
5774 | ||
9476d369 | 5775 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
033b0a7c GM |
5776 | { |
5777 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 5778 | int hp_pin = alc_get_hp_pin(spec); |
033b0a7c | 5779 | |
9476d369 GM |
5780 | /* Prevent pop noises when headphones are plugged in */ |
5781 | snd_hda_codec_write(codec, hp_pin, 0, | |
5782 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5783 | msleep(20); | |
033b0a7c GM |
5784 | } |
5785 | ||
5786 | static void alc_fixup_dell_xps13(struct hda_codec *codec, | |
5787 | const struct hda_fixup *fix, int action) | |
5788 | { | |
3e1b0c4a TI |
5789 | struct alc_spec *spec = codec->spec; |
5790 | struct hda_input_mux *imux = &spec->gen.input_mux; | |
5791 | int i; | |
f38663ab | 5792 | |
3e1b0c4a TI |
5793 | switch (action) { |
5794 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5795 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise | |
5796 | * it causes a click noise at start up | |
5797 | */ | |
5798 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
efe55732 | 5799 | spec->shutup = alc_shutup_dell_xps13; |
3e1b0c4a TI |
5800 | break; |
5801 | case HDA_FIXUP_ACT_PROBE: | |
f38663ab GM |
5802 | /* Make the internal mic the default input source. */ |
5803 | for (i = 0; i < imux->num_items; i++) { | |
5804 | if (spec->gen.imux_pins[i] == 0x12) { | |
5805 | spec->gen.cur_mux[0] = i; | |
5806 | break; | |
5807 | } | |
5808 | } | |
3e1b0c4a | 5809 | break; |
033b0a7c GM |
5810 | } |
5811 | } | |
5812 | ||
1f8b46cd DH |
5813 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
5814 | const struct hda_fixup *fix, int action) | |
5815 | { | |
5816 | struct alc_spec *spec = codec->spec; | |
5817 | ||
5818 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5819 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5820 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ | |
b40eda64 DH |
5821 | |
5822 | /* Disable boost for mic-in permanently. (This code is only called | |
5823 | from quirks that guarantee that the headphone is at NID 0x1b.) */ | |
5824 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); | |
5825 | snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); | |
1f8b46cd DH |
5826 | } else |
5827 | alc_fixup_headset_mode(codec, fix, action); | |
5828 | } | |
5829 | ||
73bdd597 DH |
5830 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
5831 | const struct hda_fixup *fix, int action) | |
5832 | { | |
5833 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
73bdd597 | 5834 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
98b24883 | 5835 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
73bdd597 DH |
5836 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
5837 | } | |
5838 | alc_fixup_headset_mode(codec, fix, action); | |
5839 | } | |
5840 | ||
bde7bc60 CCC |
5841 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
5842 | static int find_ext_mic_pin(struct hda_codec *codec) | |
5843 | { | |
5844 | struct alc_spec *spec = codec->spec; | |
5845 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5846 | hda_nid_t nid; | |
5847 | unsigned int defcfg; | |
5848 | int i; | |
5849 | ||
5850 | for (i = 0; i < cfg->num_inputs; i++) { | |
5851 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5852 | continue; | |
5853 | nid = cfg->inputs[i].pin; | |
5854 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5855 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) | |
5856 | continue; | |
5857 | return nid; | |
5858 | } | |
5859 | ||
5860 | return 0; | |
5861 | } | |
5862 | ||
08a978db | 5863 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
1727a771 | 5864 | const struct hda_fixup *fix, |
08a978db DR |
5865 | int action) |
5866 | { | |
5867 | struct alc_spec *spec = codec->spec; | |
5868 | ||
0db75790 | 5869 | if (action == HDA_FIXUP_ACT_PROBE) { |
bde7bc60 | 5870 | int mic_pin = find_ext_mic_pin(codec); |
35a39f98 | 5871 | int hp_pin = alc_get_hp_pin(spec); |
bde7bc60 CCC |
5872 | |
5873 | if (snd_BUG_ON(!mic_pin || !hp_pin)) | |
0db75790 | 5874 | return; |
bde7bc60 | 5875 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
0db75790 | 5876 | } |
08a978db | 5877 | } |
693b613d | 5878 | |
3e0d611b DH |
5879 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
5880 | const struct hda_fixup *fix, | |
5881 | int action) | |
5882 | { | |
5883 | struct alc_spec *spec = codec->spec; | |
5884 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5885 | int i; | |
5886 | ||
5887 | /* The mic boosts on level 2 and 3 are too noisy | |
5888 | on the internal mic input. | |
5889 | Therefore limit the boost to 0 or 1. */ | |
5890 | ||
5891 | if (action != HDA_FIXUP_ACT_PROBE) | |
5892 | return; | |
5893 | ||
5894 | for (i = 0; i < cfg->num_inputs; i++) { | |
5895 | hda_nid_t nid = cfg->inputs[i].pin; | |
5896 | unsigned int defcfg; | |
5897 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5898 | continue; | |
5899 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5900 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) | |
5901 | continue; | |
5902 | ||
5903 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, | |
5904 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | | |
5905 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
5906 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
5907 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
5908 | } | |
5909 | } | |
5910 | ||
cd217a63 | 5911 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 5912 | struct hda_jack_callback *jack) |
cd217a63 KY |
5913 | { |
5914 | struct alc_spec *spec = codec->spec; | |
5915 | int vref; | |
5916 | ||
5917 | msleep(200); | |
5918 | snd_hda_gen_hp_automute(codec, jack); | |
5919 | ||
5920 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
5921 | ||
5922 | msleep(600); | |
5923 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
5924 | vref); | |
5925 | } | |
5926 | ||
cd217a63 KY |
5927 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
5928 | const struct hda_fixup *fix, int action) | |
5929 | { | |
5930 | struct alc_spec *spec = codec->spec; | |
cd217a63 KY |
5931 | |
5932 | switch (action) { | |
5933 | case HDA_FIXUP_ACT_PRE_PROBE: | |
0202e99c | 5934 | snd_hda_override_wcaps(codec, 0x03, 0); |
d2e92709 TI |
5935 | /* Disable AA-loopback as it causes white noise */ |
5936 | spec->gen.mixer_nid = 0; | |
38070219 | 5937 | break; |
0202e99c | 5938 | case HDA_FIXUP_ACT_INIT: |
de9481cb KY |
5939 | /* MIC2-VREF control */ |
5940 | /* Set to manual mode */ | |
98b24883 | 5941 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
0202e99c | 5942 | /* Enable Line1 input control by verb */ |
98b24883 | 5943 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
0202e99c KY |
5944 | break; |
5945 | } | |
5946 | } | |
5947 | ||
5948 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, | |
5949 | const struct hda_fixup *fix, int action) | |
5950 | { | |
5951 | struct alc_spec *spec = codec->spec; | |
0202e99c KY |
5952 | |
5953 | switch (action) { | |
5954 | case HDA_FIXUP_ACT_PRE_PROBE: | |
cd217a63 | 5955 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
38070219 KY |
5956 | break; |
5957 | case HDA_FIXUP_ACT_INIT: | |
cd217a63 KY |
5958 | /* MIC2-VREF control */ |
5959 | /* Set to manual mode */ | |
98b24883 | 5960 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
cd217a63 KY |
5961 | break; |
5962 | } | |
5963 | } | |
5964 | ||
7bba2157 TI |
5965 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
5966 | static void asus_tx300_automute(struct hda_codec *codec) | |
5967 | { | |
5968 | struct alc_spec *spec = codec->spec; | |
5969 | snd_hda_gen_update_outputs(codec); | |
5970 | if (snd_hda_jack_detect(codec, 0x1b)) | |
5971 | spec->gen.mute_bits |= (1ULL << 0x14); | |
5972 | } | |
5973 | ||
5974 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, | |
5975 | const struct hda_fixup *fix, int action) | |
5976 | { | |
5977 | struct alc_spec *spec = codec->spec; | |
7bba2157 TI |
5978 | static const struct hda_pintbl dock_pins[] = { |
5979 | { 0x1b, 0x21114000 }, /* dock speaker pin */ | |
5980 | {} | |
5981 | }; | |
7bba2157 TI |
5982 | |
5983 | switch (action) { | |
5984 | case HDA_FIXUP_ACT_PRE_PROBE: | |
1c76aa5f | 5985 | spec->init_amp = ALC_INIT_DEFAULT; |
ae065f1c TI |
5986 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
5987 | alc_setup_gpio(codec, 0x04); | |
7bba2157 TI |
5988 | snd_hda_apply_pincfgs(codec, dock_pins); |
5989 | spec->gen.auto_mute_via_amp = 1; | |
5990 | spec->gen.automute_hook = asus_tx300_automute; | |
5991 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
7bba2157 TI |
5992 | snd_hda_gen_hp_automute); |
5993 | break; | |
5579cd6f TI |
5994 | case HDA_FIXUP_ACT_PROBE: |
5995 | spec->init_amp = ALC_INIT_DEFAULT; | |
5996 | break; | |
7bba2157 TI |
5997 | case HDA_FIXUP_ACT_BUILD: |
5998 | /* this is a bit tricky; give more sane names for the main | |
5999 | * (tablet) speaker and the dock speaker, respectively | |
6000 | */ | |
56798e6b TI |
6001 | rename_ctl(codec, "Speaker Playback Switch", |
6002 | "Dock Speaker Playback Switch"); | |
6003 | rename_ctl(codec, "Bass Speaker Playback Switch", | |
6004 | "Speaker Playback Switch"); | |
7bba2157 TI |
6005 | break; |
6006 | } | |
6007 | } | |
6008 | ||
338cae56 DH |
6009 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
6010 | const struct hda_fixup *fix, int action) | |
6011 | { | |
0f4881dc DH |
6012 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
6013 | /* DAC node 0x03 is giving mono output. We therefore want to | |
6014 | make sure 0x14 (front speaker) and 0x15 (headphones) use the | |
6015 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ | |
caf3c043 MM |
6016 | static const hda_nid_t conn1[] = { 0x0c }; |
6017 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); | |
6018 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); | |
0f4881dc | 6019 | } |
338cae56 DH |
6020 | } |
6021 | ||
dd9aa335 HW |
6022 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
6023 | const struct hda_fixup *fix, int action) | |
6024 | { | |
6025 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
6026 | /* The speaker is routed to the Node 0x06 by a mistake, as a result | |
6027 | we can't adjust the speaker's volume since this node does not has | |
6028 | Amp-out capability. we change the speaker's route to: | |
6029 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( | |
6030 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust | |
6031 | speaker's volume now. */ | |
6032 | ||
caf3c043 MM |
6033 | static const hda_nid_t conn1[] = { 0x0c }; |
6034 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); | |
dd9aa335 HW |
6035 | } |
6036 | } | |
6037 | ||
e312a869 TI |
6038 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
6039 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, | |
6040 | const struct hda_fixup *fix, int action) | |
6041 | { | |
6042 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
caf3c043 MM |
6043 | static const hda_nid_t conn[] = { 0x02, 0x03 }; |
6044 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
e312a869 TI |
6045 | } |
6046 | } | |
6047 | ||
d2cd795c JK |
6048 | /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ |
6049 | static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, | |
6050 | const struct hda_fixup *fix, int action) | |
6051 | { | |
6052 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
caf3c043 MM |
6053 | static const hda_nid_t conn[] = { 0x02 }; |
6054 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
d2cd795c JK |
6055 | } |
6056 | } | |
6057 | ||
98973f2f KP |
6058 | /* Hook to update amp GPIO4 for automute */ |
6059 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, | |
6060 | struct hda_jack_callback *jack) | |
6061 | { | |
6062 | struct alc_spec *spec = codec->spec; | |
6063 | ||
6064 | snd_hda_gen_hp_automute(codec, jack); | |
6065 | /* mute_led_polarity is set to 0, so we pass inverted value here */ | |
dbd13179 KHF |
6066 | alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, |
6067 | !spec->gen.hp_jack_present); | |
98973f2f KP |
6068 | } |
6069 | ||
6070 | /* Manage GPIOs for HP EliteBook Folio 9480m. | |
6071 | * | |
6072 | * GPIO4 is the headphone amplifier power control | |
6073 | * GPIO3 is the audio output mute indicator LED | |
6074 | */ | |
6075 | ||
6076 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, | |
6077 | const struct hda_fixup *fix, | |
6078 | int action) | |
6079 | { | |
6080 | struct alc_spec *spec = codec->spec; | |
98973f2f | 6081 | |
01e4a275 | 6082 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
98973f2f | 6083 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
01e4a275 TI |
6084 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
6085 | spec->gpio_mask |= 0x10; | |
6086 | spec->gpio_dir |= 0x10; | |
98973f2f | 6087 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
98973f2f KP |
6088 | } |
6089 | } | |
6090 | ||
ae065f1c TI |
6091 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
6092 | const struct hda_fixup *fix, | |
6093 | int action) | |
6094 | { | |
6095 | struct alc_spec *spec = codec->spec; | |
6096 | ||
6097 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
6098 | spec->gpio_mask |= 0x04; | |
6099 | spec->gpio_dir |= 0x04; | |
6100 | /* set data bit low */ | |
6101 | } | |
6102 | } | |
6103 | ||
6a6660d0 TI |
6104 | /* Quirk for Thinkpad X1 7th and 8th Gen |
6105 | * The following fixed routing needed | |
6106 | * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly | |
6107 | * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC | |
6108 | * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp | |
6109 | */ | |
6110 | static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, | |
6111 | const struct hda_fixup *fix, int action) | |
6112 | { | |
6113 | static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ | |
6114 | static const hda_nid_t preferred_pairs[] = { | |
6115 | 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 | |
6116 | }; | |
6117 | struct alc_spec *spec = codec->spec; | |
6118 | ||
6119 | switch (action) { | |
6120 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6121 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
6122 | spec->gen.preferred_dacs = preferred_pairs; | |
6123 | break; | |
6124 | case HDA_FIXUP_ACT_BUILD: | |
6125 | /* The generic parser creates somewhat unintuitive volume ctls | |
6126 | * with the fixed routing above, and the shared DAC2 may be | |
6127 | * confusing for PA. | |
6128 | * Rename those to unique names so that PA doesn't touch them | |
6129 | * and use only Master volume. | |
6130 | */ | |
6131 | rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); | |
6132 | rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); | |
6133 | break; | |
6134 | } | |
6135 | } | |
6136 | ||
ca169cc2 KY |
6137 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
6138 | const struct hda_fixup *fix, | |
6139 | int action) | |
6140 | { | |
6141 | alc_fixup_dual_codecs(codec, fix, action); | |
6142 | switch (action) { | |
6143 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6144 | /* override card longname to provide a unique UCM profile */ | |
6145 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); | |
6146 | break; | |
6147 | case HDA_FIXUP_ACT_BUILD: | |
6148 | /* rename Capture controls depending on the codec */ | |
6149 | rename_ctl(codec, "Capture Volume", | |
6150 | codec->addr == 0 ? | |
6151 | "Rear-Panel Capture Volume" : | |
6152 | "Front-Panel Capture Volume"); | |
6153 | rename_ctl(codec, "Capture Switch", | |
6154 | codec->addr == 0 ? | |
6155 | "Rear-Panel Capture Switch" : | |
6156 | "Front-Panel Capture Switch"); | |
6157 | break; | |
6158 | } | |
6159 | } | |
6160 | ||
52e4e368 KHF |
6161 | static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, |
6162 | const struct hda_fixup *fix, int action) | |
6163 | { | |
6164 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6165 | return; | |
6166 | ||
6167 | codec->power_save_node = 1; | |
6168 | } | |
6169 | ||
92266651 KY |
6170 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
6171 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, | |
6172 | const struct hda_fixup *fix, int action) | |
6173 | { | |
6174 | struct alc_spec *spec = codec->spec; | |
caf3c043 | 6175 | static const hda_nid_t preferred_pairs[] = { |
92266651 KY |
6176 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
6177 | 0 | |
6178 | }; | |
6179 | ||
6180 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6181 | return; | |
6182 | ||
6183 | spec->gen.preferred_dacs = preferred_pairs; | |
0700d3d1 KY |
6184 | spec->gen.auto_mute_via_amp = 1; |
6185 | codec->power_save_node = 0; | |
92266651 KY |
6186 | } |
6187 | ||
c84bfedc TI |
6188 | /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */ |
6189 | static void alc289_fixup_asus_ga401(struct hda_codec *codec, | |
6190 | const struct hda_fixup *fix, int action) | |
6191 | { | |
6192 | static const hda_nid_t preferred_pairs[] = { | |
6193 | 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0 | |
6194 | }; | |
6195 | struct alc_spec *spec = codec->spec; | |
6196 | ||
6197 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
6198 | spec->gen.preferred_dacs = preferred_pairs; | |
6199 | spec->gen.obey_preferred_dacs = 1; | |
6200 | } | |
6201 | } | |
6202 | ||
c4cfcf6f HW |
6203 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
6204 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, | |
6205 | const struct hda_fixup *fix, int action) | |
6206 | { | |
6207 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6208 | return; | |
6209 | ||
6210 | snd_hda_override_wcaps(codec, 0x03, 0); | |
6211 | } | |
6212 | ||
8a8de09c KY |
6213 | static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) |
6214 | { | |
6215 | switch (codec->core.vendor_id) { | |
6216 | case 0x10ec0274: | |
6217 | case 0x10ec0294: | |
6218 | case 0x10ec0225: | |
6219 | case 0x10ec0295: | |
6220 | case 0x10ec0299: | |
6221 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ | |
6222 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); | |
6223 | break; | |
1948fc06 | 6224 | case 0x10ec0230: |
8a8de09c KY |
6225 | case 0x10ec0235: |
6226 | case 0x10ec0236: | |
6227 | case 0x10ec0255: | |
6228 | case 0x10ec0256: | |
6229 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ | |
6230 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); | |
6231 | break; | |
6232 | } | |
6233 | } | |
6234 | ||
8983eb60 KY |
6235 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
6236 | const struct hda_fixup *fix, int action) | |
6237 | { | |
d3ba58bb KY |
6238 | struct alc_spec *spec = codec->spec; |
6239 | ||
8983eb60 | 6240 | switch (action) { |
d3ba58bb KY |
6241 | case HDA_FIXUP_ACT_PRE_PROBE: |
6242 | spec->ultra_low_power = true; | |
6243 | break; | |
8983eb60 | 6244 | case HDA_FIXUP_ACT_INIT: |
8a8de09c | 6245 | alc_combo_jack_hp_jd_restart(codec); |
8983eb60 KY |
6246 | break; |
6247 | } | |
6248 | } | |
6249 | ||
d1dd4211 KY |
6250 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
6251 | const struct hda_fixup *fix, int action) | |
6252 | { | |
6253 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
6254 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
6255 | } | |
6256 | ||
c3cdf189 LJ |
6257 | |
6258 | static void alc294_gx502_toggle_output(struct hda_codec *codec, | |
6259 | struct hda_jack_callback *cb) | |
6260 | { | |
6261 | /* The Windows driver sets the codec up in a very different way where | |
6262 | * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it | |
6263 | */ | |
6264 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) | |
6265 | alc_write_coef_idx(codec, 0x10, 0x8a20); | |
6266 | else | |
6267 | alc_write_coef_idx(codec, 0x10, 0x0a20); | |
6268 | } | |
6269 | ||
6270 | static void alc294_fixup_gx502_hp(struct hda_codec *codec, | |
6271 | const struct hda_fixup *fix, int action) | |
6272 | { | |
6273 | /* Pin 0x21: headphones/headset mic */ | |
6274 | if (!is_jack_detectable(codec, 0x21)) | |
6275 | return; | |
6276 | ||
6277 | switch (action) { | |
6278 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6279 | snd_hda_jack_detect_enable_callback(codec, 0x21, | |
6280 | alc294_gx502_toggle_output); | |
6281 | break; | |
6282 | case HDA_FIXUP_ACT_INIT: | |
6283 | /* Make sure to start in a correct state, i.e. if | |
6284 | * headphones have been plugged in before powering up the system | |
6285 | */ | |
6286 | alc294_gx502_toggle_output(codec, NULL); | |
6287 | break; | |
6288 | } | |
6289 | } | |
6290 | ||
c1b55029 DC |
6291 | static void alc294_gu502_toggle_output(struct hda_codec *codec, |
6292 | struct hda_jack_callback *cb) | |
6293 | { | |
6294 | /* Windows sets 0x10 to 0x8420 for Node 0x20 which is | |
6295 | * responsible from changes between speakers and headphones | |
6296 | */ | |
6297 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) | |
6298 | alc_write_coef_idx(codec, 0x10, 0x8420); | |
6299 | else | |
6300 | alc_write_coef_idx(codec, 0x10, 0x0a20); | |
6301 | } | |
6302 | ||
6303 | static void alc294_fixup_gu502_hp(struct hda_codec *codec, | |
6304 | const struct hda_fixup *fix, int action) | |
6305 | { | |
6306 | if (!is_jack_detectable(codec, 0x21)) | |
6307 | return; | |
6308 | ||
6309 | switch (action) { | |
6310 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6311 | snd_hda_jack_detect_enable_callback(codec, 0x21, | |
6312 | alc294_gu502_toggle_output); | |
6313 | break; | |
6314 | case HDA_FIXUP_ACT_INIT: | |
6315 | alc294_gu502_toggle_output(codec, NULL); | |
6316 | break; | |
6317 | } | |
6318 | } | |
6319 | ||
56496253 KY |
6320 | static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, |
6321 | const struct hda_fixup *fix, int action) | |
6322 | { | |
6323 | if (action != HDA_FIXUP_ACT_INIT) | |
6324 | return; | |
6325 | ||
6326 | msleep(100); | |
6327 | alc_write_coef_idx(codec, 0x65, 0x0); | |
6328 | } | |
6329 | ||
8a8de09c KY |
6330 | static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, |
6331 | const struct hda_fixup *fix, int action) | |
6332 | { | |
6333 | switch (action) { | |
6334 | case HDA_FIXUP_ACT_INIT: | |
6335 | alc_combo_jack_hp_jd_restart(codec); | |
6336 | break; | |
6337 | } | |
6338 | } | |
6339 | ||
92666d45 KY |
6340 | static void alc_fixup_no_int_mic(struct hda_codec *codec, |
6341 | const struct hda_fixup *fix, int action) | |
6342 | { | |
6343 | struct alc_spec *spec = codec->spec; | |
6344 | ||
6345 | switch (action) { | |
6346 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6347 | /* Mic RING SLEEVE swap for combo jack */ | |
6348 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); | |
6349 | spec->no_internal_mic_pin = true; | |
6350 | break; | |
6351 | case HDA_FIXUP_ACT_INIT: | |
6352 | alc_combo_jack_hp_jd_restart(codec); | |
6353 | break; | |
6354 | } | |
6355 | } | |
6356 | ||
434591b2 ED |
6357 | static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, |
6358 | const struct hda_fixup *fix, int action) | |
6359 | { | |
6360 | static const hda_nid_t conn[] = { 0x02 }; | |
6361 | static const struct hda_pintbl pincfgs[] = { | |
6362 | { 0x14, 0x90170110 }, /* rear speaker */ | |
6363 | { } | |
6364 | }; | |
6365 | ||
6366 | switch (action) { | |
6367 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6368 | snd_hda_apply_pincfgs(codec, pincfgs); | |
6369 | /* force front speaker to DAC1 */ | |
6370 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
6371 | break; | |
6372 | } | |
6373 | } | |
6374 | ||
b317b032 TI |
6375 | /* for hda_fixup_thinkpad_acpi() */ |
6376 | #include "thinkpad_helper.c" | |
b67ae3f1 | 6377 | |
d5a6cabf TI |
6378 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
6379 | const struct hda_fixup *fix, int action) | |
6380 | { | |
6381 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ | |
6382 | hda_fixup_thinkpad_acpi(codec, fix, action); | |
6383 | } | |
6384 | ||
bbf8ff6b TB |
6385 | /* for alc295_fixup_hp_top_speakers */ |
6386 | #include "hp_x360_helper.c" | |
6387 | ||
26928ca1 TI |
6388 | /* for alc285_fixup_ideapad_s740_coef() */ |
6389 | #include "ideapad_s740_helper.c" | |
6390 | ||
1d045db9 | 6391 | enum { |
f73bbf63 | 6392 | ALC269_FIXUP_GPIO2, |
1d045db9 TI |
6393 | ALC269_FIXUP_SONY_VAIO, |
6394 | ALC275_FIXUP_SONY_VAIO_GPIO2, | |
6395 | ALC269_FIXUP_DELL_M101Z, | |
6396 | ALC269_FIXUP_SKU_IGNORE, | |
6397 | ALC269_FIXUP_ASUS_G73JW, | |
6398 | ALC269_FIXUP_LENOVO_EAPD, | |
6399 | ALC275_FIXUP_SONY_HWEQ, | |
e9bd7d5c | 6400 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
1d045db9 | 6401 | ALC271_FIXUP_DMIC, |
017f2a10 | 6402 | ALC269_FIXUP_PCM_44K, |
adabb3ec | 6403 | ALC269_FIXUP_STEREO_DMIC, |
7c478f03 | 6404 | ALC269_FIXUP_HEADSET_MIC, |
24519911 TI |
6405 | ALC269_FIXUP_QUANTA_MUTE, |
6406 | ALC269_FIXUP_LIFEBOOK, | |
2041d564 | 6407 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
cc7016ab | 6408 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
4df3fd17 | 6409 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
fdcc968a | 6410 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
a4297b5d TI |
6411 | ALC269_FIXUP_AMIC, |
6412 | ALC269_FIXUP_DMIC, | |
6413 | ALC269VB_FIXUP_AMIC, | |
6414 | ALC269VB_FIXUP_DMIC, | |
08fb0d0e | 6415 | ALC269_FIXUP_HP_MUTE_LED, |
d06ac143 | 6416 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
08fb0d0e | 6417 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
7f783bd5 | 6418 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
9f5c6faf | 6419 | ALC269_FIXUP_HP_GPIO_LED, |
9c5dc3bf KY |
6420 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
6421 | ALC269_FIXUP_HP_LINE1_MIC1_LED, | |
693b613d | 6422 | ALC269_FIXUP_INV_DMIC, |
108cc108 | 6423 | ALC269_FIXUP_LENOVO_DOCK, |
b590b38c | 6424 | ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, |
9b745ab8 | 6425 | ALC269_FIXUP_NO_SHUTUP, |
88cfcf86 | 6426 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
108cc108 | 6427 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
73bdd597 DH |
6428 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
6429 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, | |
338cae56 | 6430 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
fcc6c877 | 6431 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
73bdd597 DH |
6432 | ALC269_FIXUP_HEADSET_MODE, |
6433 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, | |
7819717b | 6434 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
d240d1dc DH |
6435 | ALC269_FIXUP_ASUS_X101_FUNC, |
6436 | ALC269_FIXUP_ASUS_X101_VERB, | |
6437 | ALC269_FIXUP_ASUS_X101, | |
08a978db DR |
6438 | ALC271_FIXUP_AMIC_MIC2, |
6439 | ALC271_FIXUP_HP_GATE_MIC_JACK, | |
b1e8972e | 6440 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
42397004 | 6441 | ALC269_FIXUP_ACER_AC700, |
3e0d611b | 6442 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
2cede303 | 6443 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
23870831 | 6444 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
8e35cd4a | 6445 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
02b504d9 | 6446 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
cd217a63 | 6447 | ALC283_FIXUP_CHROME_BOOK, |
0202e99c | 6448 | ALC283_FIXUP_SENSE_COMBO_JACK, |
7bba2157 | 6449 | ALC282_FIXUP_ASUS_TX300, |
1bb3e062 | 6450 | ALC283_FIXUP_INT_MIC, |
338cae56 | 6451 | ALC290_FIXUP_MONO_SPEAKERS, |
0f4881dc DH |
6452 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
6453 | ALC290_FIXUP_SUBWOOFER, | |
6454 | ALC290_FIXUP_SUBWOOFER_HSJACK, | |
b67ae3f1 | 6455 | ALC269_FIXUP_THINKPAD_ACPI, |
56f27013 | 6456 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
5824ce8d | 6457 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
615966ad | 6458 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
9a22a8f5 | 6459 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
31278997 | 6460 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
9a22a8f5 | 6461 | ALC255_FIXUP_HEADSET_MODE, |
31278997 | 6462 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
a22aa26f | 6463 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
1c37c223 | 6464 | ALC292_FIXUP_TPT440_DOCK, |
9a811230 | 6465 | ALC292_FIXUP_TPT440, |
abaa2274 | 6466 | ALC283_FIXUP_HEADSET_MIC, |
b3802783 | 6467 | ALC255_FIXUP_MIC_MUTE_LED, |
1a22e775 | 6468 | ALC282_FIXUP_ASPIRE_V5_PINS, |
c8426b27 | 6469 | ALC269VB_FIXUP_ASPIRE_E1_COEF, |
7a5255f1 | 6470 | ALC280_FIXUP_HP_GPIO4, |
eaa8e5ef | 6471 | ALC286_FIXUP_HP_GPIO_LED, |
33f4acd3 | 6472 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
b4b33f9d | 6473 | ALC280_FIXUP_HP_DOCK_PINS, |
04d5466a | 6474 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
98973f2f | 6475 | ALC280_FIXUP_HP_9480M, |
c3bb2b52 | 6476 | ALC245_FIXUP_HP_X360_AMP, |
e1e62b98 KY |
6477 | ALC288_FIXUP_DELL_HEADSET_MODE, |
6478 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, | |
831bfdf9 HW |
6479 | ALC288_FIXUP_DELL_XPS_13, |
6480 | ALC288_FIXUP_DISABLE_AAMIX, | |
5fab5829 | 6481 | ALC292_FIXUP_DELL_E7X_AAMIX, |
8b99aba7 TI |
6482 | ALC292_FIXUP_DELL_E7X, |
6483 | ALC292_FIXUP_DISABLE_AAMIX, | |
c04017ea | 6484 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
54324221 | 6485 | ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
977e6276 | 6486 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
2f726aec | 6487 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
6ed1131f | 6488 | ALC275_FIXUP_DELL_XPS, |
23adc192 | 6489 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
3694cb29 | 6490 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
3b43b71f | 6491 | ALC255_FIXUP_DELL_SPK_NOISE, |
d1dd4211 | 6492 | ALC225_FIXUP_DISABLE_MIC_VREF, |
2ae95577 | 6493 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
e312a869 | 6494 | ALC295_FIXUP_DISABLE_DAC3, |
d2cd795c | 6495 | ALC285_FIXUP_SPEAKER2_TO_DAC1, |
f883982d | 6496 | ALC280_FIXUP_HP_HEADSET_MIC, |
e549d190 | 6497 | ALC221_FIXUP_HP_FRONT_MIC, |
c636b95e | 6498 | ALC292_FIXUP_TPT460, |
dd9aa335 | 6499 | ALC298_FIXUP_SPK_VOLUME, |
f86de9b1 | 6500 | ALC298_FIXUP_LENOVO_SPK_VOLUME, |
fd06c77e | 6501 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
823ff161 | 6502 | ALC269_FIXUP_ATIV_BOOK_8, |
9eb5d0e6 | 6503 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
c1732ede CC |
6504 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
6505 | ALC256_FIXUP_ASUS_MIC, | |
eeed4cd1 | 6506 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
216d7aeb CC |
6507 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
6508 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, | |
ca169cc2 | 6509 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
ea5c7eba | 6510 | ALC233_FIXUP_ACER_HEADSET_MIC, |
f33f79f3 | 6511 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
5f364135 | 6512 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
52e4e368 | 6513 | ALC225_FIXUP_S3_POP_NOISE, |
b84e8436 | 6514 | ALC700_FIXUP_INTEL_REFERENCE, |
92266651 KY |
6515 | ALC274_FIXUP_DELL_BIND_DACS, |
6516 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, | |
399c01aa | 6517 | ALC298_FIXUP_TPT470_DOCK_FIX, |
61fcf8ec | 6518 | ALC298_FIXUP_TPT470_DOCK, |
ae104a21 | 6519 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
f0ba9d69 | 6520 | ALC255_FIXUP_DELL_HEADSET_MIC, |
0fbf21c3 | 6521 | ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, |
a2ef03fe | 6522 | ALC298_FIXUP_HUAWEI_MBX_STEREO, |
bbf8ff6b | 6523 | ALC295_FIXUP_HP_X360, |
8a328ac1 | 6524 | ALC221_FIXUP_HP_HEADSET_MIC, |
c4cfcf6f | 6525 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
e8ed64b0 | 6526 | ALC295_FIXUP_HP_AUTO_MUTE, |
33aaebd4 | 6527 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
d8ae458e | 6528 | ALC294_FIXUP_ASUS_MIC, |
4e051106 JHP |
6529 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
6530 | ALC294_FIXUP_ASUS_SPK, | |
89e3a568 | 6531 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
c8c6ee61 | 6532 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
cbc05fd6 | 6533 | ALC255_FIXUP_ACER_HEADSET_MIC, |
10f5b1b8 | 6534 | ALC295_FIXUP_CHROME_BOOK, |
8983eb60 | 6535 | ALC225_FIXUP_HEADSET_JACK, |
136824ef KY |
6536 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
6537 | ALC225_FIXUP_WYSE_AUTO_MUTE, | |
6538 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, | |
667a8f73 | 6539 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
8c8967a7 | 6540 | ALC256_FIXUP_ASUS_HEADSET_MIC, |
e1037354 | 6541 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
e2a829b3 | 6542 | ALC299_FIXUP_PREDATOR_SPK, |
bd9c10bc | 6543 | ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, |
e79c2269 KY |
6544 | ALC289_FIXUP_DELL_SPK2, |
6545 | ALC289_FIXUP_DUAL_SPK, | |
48e01504 CC |
6546 | ALC294_FIXUP_SPK2_TO_DAC1, |
6547 | ALC294_FIXUP_ASUS_DUAL_SPK, | |
6a6660d0 | 6548 | ALC285_FIXUP_THINKPAD_X1_GEN7, |
76f7dec0 | 6549 | ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
8b33a134 | 6550 | ALC294_FIXUP_ASUS_HPE, |
1b94e59d | 6551 | ALC294_FIXUP_ASUS_COEF_1B, |
c3cdf189 LJ |
6552 | ALC294_FIXUP_ASUS_GX502_HP, |
6553 | ALC294_FIXUP_ASUS_GX502_PINS, | |
6554 | ALC294_FIXUP_ASUS_GX502_VERBS, | |
c1b55029 DC |
6555 | ALC294_FIXUP_ASUS_GU502_HP, |
6556 | ALC294_FIXUP_ASUS_GU502_PINS, | |
6557 | ALC294_FIXUP_ASUS_GU502_VERBS, | |
f5a88b0a | 6558 | ALC285_FIXUP_HP_GPIO_LED, |
431e76c3 | 6559 | ALC285_FIXUP_HP_MUTE_LED, |
e7d66cf7 | 6560 | ALC236_FIXUP_HP_GPIO_LED, |
24164f43 | 6561 | ALC236_FIXUP_HP_MUTE_LED, |
75b62ab6 | 6562 | ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, |
14425f1f | 6563 | ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, |
9e43342b | 6564 | ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
8eae7e9b | 6565 | ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, |
6e15d126 | 6566 | ALC269VC_FIXUP_ACER_HEADSET_MIC, |
781c90c0 | 6567 | ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, |
293a92c1 | 6568 | ALC289_FIXUP_ASUS_GA401, |
4b43d05a | 6569 | ALC289_FIXUP_ASUS_GA502, |
f50a121d | 6570 | ALC256_FIXUP_ACER_MIC_NO_PRESENCE, |
56496253 | 6571 | ALC285_FIXUP_HP_GPIO_AMP_INIT, |
f1ec5be1 HC |
6572 | ALC269_FIXUP_CZC_B20, |
6573 | ALC269_FIXUP_CZC_TMI, | |
6574 | ALC269_FIXUP_CZC_L101, | |
6575 | ALC269_FIXUP_LEMOTE_A1802, | |
6576 | ALC269_FIXUP_LEMOTE_A190X, | |
e2d2fded | 6577 | ALC256_FIXUP_INTEL_NUC8_RUGGED, |
d1ee66c5 PC |
6578 | ALC233_FIXUP_INTEL_NUC8_DMIC, |
6579 | ALC233_FIXUP_INTEL_NUC8_BOOST, | |
73e7161e | 6580 | ALC256_FIXUP_INTEL_NUC10, |
fc19d559 | 6581 | ALC255_FIXUP_XIAOMI_HEADSET_MIC, |
13468bfa | 6582 | ALC274_FIXUP_HP_MIC, |
8a8de09c | 6583 | ALC274_FIXUP_HP_HEADSET_MIC, |
622464c8 | 6584 | ALC274_FIXUP_HP_ENVY_GPIO, |
ef9ce66f | 6585 | ALC256_FIXUP_ASUS_HPE, |
446b8185 | 6586 | ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, |
a0ccbc53 | 6587 | ALC287_FIXUP_HP_GPIO_LED, |
9e885770 | 6588 | ALC256_FIXUP_HP_HEADSET_MIC, |
92666d45 | 6589 | ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
34cdf405 | 6590 | ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
495dc763 | 6591 | ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST, |
d0e18561 | 6592 | ALC256_FIXUP_ACER_HEADSET_MIC, |
26928ca1 | 6593 | ALC285_FIXUP_IDEAPAD_S740_COEF, |
bd15b155 | 6594 | ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST, |
8eedd3a7 | 6595 | ALC295_FIXUP_ASUS_DACS, |
5d84b531 | 6596 | ALC295_FIXUP_HP_OMEN, |
f2be77fe | 6597 | ALC285_FIXUP_HP_SPECTRE_X360, |
9ebaef05 | 6598 | ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, |
29c8f40b | 6599 | ALC623_FIXUP_LENOVO_THINKSTATION_P340, |
57c9e21a | 6600 | ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, |
f1d4e28b KY |
6601 | }; |
6602 | ||
1727a771 | 6603 | static const struct hda_fixup alc269_fixups[] = { |
f73bbf63 KHF |
6604 | [ALC269_FIXUP_GPIO2] = { |
6605 | .type = HDA_FIXUP_FUNC, | |
6606 | .v.func = alc_fixup_gpio2, | |
6607 | }, | |
1d045db9 | 6608 | [ALC269_FIXUP_SONY_VAIO] = { |
fd108215 TI |
6609 | .type = HDA_FIXUP_PINCTLS, |
6610 | .v.pins = (const struct hda_pintbl[]) { | |
6611 | {0x19, PIN_VREFGRD}, | |
1d045db9 TI |
6612 | {} |
6613 | } | |
f1d4e28b | 6614 | }, |
1d045db9 | 6615 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
ae065f1c TI |
6616 | .type = HDA_FIXUP_FUNC, |
6617 | .v.func = alc275_fixup_gpio4_off, | |
1d045db9 TI |
6618 | .chained = true, |
6619 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
6620 | }, | |
6621 | [ALC269_FIXUP_DELL_M101Z] = { | |
1727a771 | 6622 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
6623 | .v.verbs = (const struct hda_verb[]) { |
6624 | /* Enables internal speaker */ | |
6625 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, | |
6626 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, | |
6627 | {} | |
6628 | } | |
6629 | }, | |
6630 | [ALC269_FIXUP_SKU_IGNORE] = { | |
1727a771 | 6631 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 6632 | .v.func = alc_fixup_sku_ignore, |
1d045db9 TI |
6633 | }, |
6634 | [ALC269_FIXUP_ASUS_G73JW] = { | |
1727a771 TI |
6635 | .type = HDA_FIXUP_PINS, |
6636 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
6637 | { 0x17, 0x99130111 }, /* subwoofer */ |
6638 | { } | |
6639 | } | |
6640 | }, | |
6641 | [ALC269_FIXUP_LENOVO_EAPD] = { | |
1727a771 | 6642 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
6643 | .v.verbs = (const struct hda_verb[]) { |
6644 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
6645 | {} | |
6646 | } | |
6647 | }, | |
6648 | [ALC275_FIXUP_SONY_HWEQ] = { | |
1727a771 | 6649 | .type = HDA_FIXUP_FUNC, |
1d045db9 TI |
6650 | .v.func = alc269_fixup_hweq, |
6651 | .chained = true, | |
6652 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 | |
6653 | }, | |
e9bd7d5c TI |
6654 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
6655 | .type = HDA_FIXUP_FUNC, | |
6656 | .v.func = alc_fixup_disable_aamix, | |
6657 | .chained = true, | |
6658 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
6659 | }, | |
1d045db9 | 6660 | [ALC271_FIXUP_DMIC] = { |
1727a771 | 6661 | .type = HDA_FIXUP_FUNC, |
1d045db9 | 6662 | .v.func = alc271_fixup_dmic, |
f1d4e28b | 6663 | }, |
017f2a10 | 6664 | [ALC269_FIXUP_PCM_44K] = { |
1727a771 | 6665 | .type = HDA_FIXUP_FUNC, |
017f2a10 | 6666 | .v.func = alc269_fixup_pcm_44k, |
012e7eb1 DH |
6667 | .chained = true, |
6668 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
017f2a10 | 6669 | }, |
adabb3ec | 6670 | [ALC269_FIXUP_STEREO_DMIC] = { |
1727a771 | 6671 | .type = HDA_FIXUP_FUNC, |
adabb3ec TI |
6672 | .v.func = alc269_fixup_stereo_dmic, |
6673 | }, | |
7c478f03 DH |
6674 | [ALC269_FIXUP_HEADSET_MIC] = { |
6675 | .type = HDA_FIXUP_FUNC, | |
6676 | .v.func = alc269_fixup_headset_mic, | |
6677 | }, | |
24519911 | 6678 | [ALC269_FIXUP_QUANTA_MUTE] = { |
1727a771 | 6679 | .type = HDA_FIXUP_FUNC, |
24519911 TI |
6680 | .v.func = alc269_fixup_quanta_mute, |
6681 | }, | |
6682 | [ALC269_FIXUP_LIFEBOOK] = { | |
1727a771 TI |
6683 | .type = HDA_FIXUP_PINS, |
6684 | .v.pins = (const struct hda_pintbl[]) { | |
24519911 TI |
6685 | { 0x1a, 0x2101103f }, /* dock line-out */ |
6686 | { 0x1b, 0x23a11040 }, /* dock mic-in */ | |
6687 | { } | |
6688 | }, | |
6689 | .chained = true, | |
6690 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
6691 | }, | |
2041d564 DH |
6692 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
6693 | .type = HDA_FIXUP_PINS, | |
6694 | .v.pins = (const struct hda_pintbl[]) { | |
6695 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ | |
6696 | { } | |
6697 | }, | |
6698 | }, | |
cc7016ab TI |
6699 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
6700 | .type = HDA_FIXUP_PINS, | |
6701 | .v.pins = (const struct hda_pintbl[]) { | |
6702 | { 0x21, 0x0221102f }, /* HP out */ | |
6703 | { } | |
6704 | }, | |
6705 | }, | |
4df3fd17 TI |
6706 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
6707 | .type = HDA_FIXUP_FUNC, | |
6708 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, | |
6709 | }, | |
fdcc968a JMG |
6710 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
6711 | .type = HDA_FIXUP_FUNC, | |
6712 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, | |
6713 | }, | |
a4297b5d | 6714 | [ALC269_FIXUP_AMIC] = { |
1727a771 TI |
6715 | .type = HDA_FIXUP_PINS, |
6716 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6717 | { 0x14, 0x99130110 }, /* speaker */ |
6718 | { 0x15, 0x0121401f }, /* HP out */ | |
6719 | { 0x18, 0x01a19c20 }, /* mic */ | |
6720 | { 0x19, 0x99a3092f }, /* int-mic */ | |
6721 | { } | |
6722 | }, | |
6723 | }, | |
6724 | [ALC269_FIXUP_DMIC] = { | |
1727a771 TI |
6725 | .type = HDA_FIXUP_PINS, |
6726 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6727 | { 0x12, 0x99a3092f }, /* int-mic */ |
6728 | { 0x14, 0x99130110 }, /* speaker */ | |
6729 | { 0x15, 0x0121401f }, /* HP out */ | |
6730 | { 0x18, 0x01a19c20 }, /* mic */ | |
6731 | { } | |
6732 | }, | |
6733 | }, | |
6734 | [ALC269VB_FIXUP_AMIC] = { | |
1727a771 TI |
6735 | .type = HDA_FIXUP_PINS, |
6736 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6737 | { 0x14, 0x99130110 }, /* speaker */ |
6738 | { 0x18, 0x01a19c20 }, /* mic */ | |
6739 | { 0x19, 0x99a3092f }, /* int-mic */ | |
6740 | { 0x21, 0x0121401f }, /* HP out */ | |
6741 | { } | |
6742 | }, | |
6743 | }, | |
2267ea97 | 6744 | [ALC269VB_FIXUP_DMIC] = { |
1727a771 TI |
6745 | .type = HDA_FIXUP_PINS, |
6746 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6747 | { 0x12, 0x99a3092f }, /* int-mic */ |
6748 | { 0x14, 0x99130110 }, /* speaker */ | |
6749 | { 0x18, 0x01a19c20 }, /* mic */ | |
6750 | { 0x21, 0x0121401f }, /* HP out */ | |
6751 | { } | |
6752 | }, | |
6753 | }, | |
08fb0d0e | 6754 | [ALC269_FIXUP_HP_MUTE_LED] = { |
1727a771 | 6755 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 6756 | .v.func = alc269_fixup_hp_mute_led, |
6d3cd5d4 | 6757 | }, |
d06ac143 DH |
6758 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
6759 | .type = HDA_FIXUP_FUNC, | |
6760 | .v.func = alc269_fixup_hp_mute_led_mic1, | |
6761 | }, | |
08fb0d0e | 6762 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
1727a771 | 6763 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 6764 | .v.func = alc269_fixup_hp_mute_led_mic2, |
420b0feb | 6765 | }, |
7f783bd5 TB |
6766 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
6767 | .type = HDA_FIXUP_FUNC, | |
6768 | .v.func = alc269_fixup_hp_mute_led_mic3, | |
e8ed64b0 GKK |
6769 | .chained = true, |
6770 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE | |
7f783bd5 | 6771 | }, |
9f5c6faf TI |
6772 | [ALC269_FIXUP_HP_GPIO_LED] = { |
6773 | .type = HDA_FIXUP_FUNC, | |
6774 | .v.func = alc269_fixup_hp_gpio_led, | |
6775 | }, | |
9c5dc3bf KY |
6776 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
6777 | .type = HDA_FIXUP_FUNC, | |
6778 | .v.func = alc269_fixup_hp_gpio_mic1_led, | |
6779 | }, | |
6780 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { | |
6781 | .type = HDA_FIXUP_FUNC, | |
6782 | .v.func = alc269_fixup_hp_line1_mic1_led, | |
6783 | }, | |
693b613d | 6784 | [ALC269_FIXUP_INV_DMIC] = { |
1727a771 | 6785 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 6786 | .v.func = alc_fixup_inv_dmic, |
693b613d | 6787 | }, |
9b745ab8 TI |
6788 | [ALC269_FIXUP_NO_SHUTUP] = { |
6789 | .type = HDA_FIXUP_FUNC, | |
6790 | .v.func = alc_fixup_no_shutup, | |
6791 | }, | |
108cc108 | 6792 | [ALC269_FIXUP_LENOVO_DOCK] = { |
1727a771 TI |
6793 | .type = HDA_FIXUP_PINS, |
6794 | .v.pins = (const struct hda_pintbl[]) { | |
108cc108 DH |
6795 | { 0x19, 0x23a11040 }, /* dock mic */ |
6796 | { 0x1b, 0x2121103f }, /* dock headphone */ | |
6797 | { } | |
6798 | }, | |
6799 | .chained = true, | |
6800 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT | |
6801 | }, | |
b590b38c TI |
6802 | [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { |
6803 | .type = HDA_FIXUP_FUNC, | |
6804 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6805 | .chained = true, | |
6806 | .chain_id = ALC269_FIXUP_LENOVO_DOCK, | |
6807 | }, | |
108cc108 | 6808 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
1727a771 | 6809 | .type = HDA_FIXUP_FUNC, |
108cc108 | 6810 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
52129000 DH |
6811 | .chained = true, |
6812 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
108cc108 | 6813 | }, |
73bdd597 DH |
6814 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6815 | .type = HDA_FIXUP_PINS, | |
6816 | .v.pins = (const struct hda_pintbl[]) { | |
6817 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6818 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6819 | { } | |
6820 | }, | |
6821 | .chained = true, | |
6822 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6823 | }, | |
6824 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { | |
6825 | .type = HDA_FIXUP_PINS, | |
6826 | .v.pins = (const struct hda_pintbl[]) { | |
6827 | { 0x16, 0x21014020 }, /* dock line out */ | |
6828 | { 0x19, 0x21a19030 }, /* dock mic */ | |
6829 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6830 | { } | |
6831 | }, | |
6832 | .chained = true, | |
6833 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6834 | }, | |
338cae56 DH |
6835 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
6836 | .type = HDA_FIXUP_PINS, | |
6837 | .v.pins = (const struct hda_pintbl[]) { | |
6838 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6839 | { } | |
6840 | }, | |
6841 | .chained = true, | |
6842 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6843 | }, | |
fcc6c877 KY |
6844 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
6845 | .type = HDA_FIXUP_PINS, | |
6846 | .v.pins = (const struct hda_pintbl[]) { | |
6847 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6848 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6849 | { } | |
6850 | }, | |
6851 | .chained = true, | |
6852 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6853 | }, | |
73bdd597 DH |
6854 | [ALC269_FIXUP_HEADSET_MODE] = { |
6855 | .type = HDA_FIXUP_FUNC, | |
6856 | .v.func = alc_fixup_headset_mode, | |
6676f308 | 6857 | .chained = true, |
b3802783 | 6858 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
73bdd597 DH |
6859 | }, |
6860 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { | |
6861 | .type = HDA_FIXUP_FUNC, | |
6862 | .v.func = alc_fixup_headset_mode_no_hp_mic, | |
6863 | }, | |
7819717b TI |
6864 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
6865 | .type = HDA_FIXUP_PINS, | |
6866 | .v.pins = (const struct hda_pintbl[]) { | |
6867 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ | |
6868 | { } | |
6869 | }, | |
6870 | .chained = true, | |
6871 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
6872 | }, | |
88cfcf86 DH |
6873 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
6874 | .type = HDA_FIXUP_PINS, | |
6875 | .v.pins = (const struct hda_pintbl[]) { | |
6876 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6877 | { } | |
6878 | }, | |
fbc78ad6 DH |
6879 | .chained = true, |
6880 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
88cfcf86 | 6881 | }, |
0fbf21c3 | 6882 | [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { |
8ac51bbc AB |
6883 | .type = HDA_FIXUP_PINS, |
6884 | .v.pins = (const struct hda_pintbl[]) { | |
6885 | {0x12, 0x90a60130}, | |
6886 | {0x13, 0x40000000}, | |
6887 | {0x14, 0x90170110}, | |
6888 | {0x18, 0x411111f0}, | |
6889 | {0x19, 0x04a11040}, | |
6890 | {0x1a, 0x411111f0}, | |
6891 | {0x1b, 0x90170112}, | |
6892 | {0x1d, 0x40759a05}, | |
6893 | {0x1e, 0x411111f0}, | |
6894 | {0x21, 0x04211020}, | |
6895 | { } | |
6896 | }, | |
e2744fd7 AB |
6897 | .chained = true, |
6898 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED | |
8ac51bbc | 6899 | }, |
a2ef03fe TE |
6900 | [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { |
6901 | .type = HDA_FIXUP_FUNC, | |
6902 | .v.func = alc298_fixup_huawei_mbx_stereo, | |
6903 | .chained = true, | |
6904 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED | |
6905 | }, | |
d240d1dc DH |
6906 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
6907 | .type = HDA_FIXUP_FUNC, | |
6908 | .v.func = alc269_fixup_x101_headset_mic, | |
6909 | }, | |
6910 | [ALC269_FIXUP_ASUS_X101_VERB] = { | |
6911 | .type = HDA_FIXUP_VERBS, | |
6912 | .v.verbs = (const struct hda_verb[]) { | |
6913 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, | |
6914 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, | |
6915 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, | |
6916 | { } | |
6917 | }, | |
6918 | .chained = true, | |
6919 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC | |
6920 | }, | |
6921 | [ALC269_FIXUP_ASUS_X101] = { | |
6922 | .type = HDA_FIXUP_PINS, | |
6923 | .v.pins = (const struct hda_pintbl[]) { | |
6924 | { 0x18, 0x04a1182c }, /* Headset mic */ | |
6925 | { } | |
6926 | }, | |
6927 | .chained = true, | |
6928 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB | |
6929 | }, | |
08a978db | 6930 | [ALC271_FIXUP_AMIC_MIC2] = { |
1727a771 TI |
6931 | .type = HDA_FIXUP_PINS, |
6932 | .v.pins = (const struct hda_pintbl[]) { | |
08a978db DR |
6933 | { 0x14, 0x99130110 }, /* speaker */ |
6934 | { 0x19, 0x01a19c20 }, /* mic */ | |
6935 | { 0x1b, 0x99a7012f }, /* int-mic */ | |
6936 | { 0x21, 0x0121401f }, /* HP out */ | |
6937 | { } | |
6938 | }, | |
6939 | }, | |
6940 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { | |
1727a771 | 6941 | .type = HDA_FIXUP_FUNC, |
08a978db DR |
6942 | .v.func = alc271_hp_gate_mic_jack, |
6943 | .chained = true, | |
6944 | .chain_id = ALC271_FIXUP_AMIC_MIC2, | |
6945 | }, | |
b1e8972e OR |
6946 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
6947 | .type = HDA_FIXUP_FUNC, | |
6948 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6949 | .chained = true, | |
6950 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, | |
6951 | }, | |
42397004 DR |
6952 | [ALC269_FIXUP_ACER_AC700] = { |
6953 | .type = HDA_FIXUP_PINS, | |
6954 | .v.pins = (const struct hda_pintbl[]) { | |
6955 | { 0x12, 0x99a3092f }, /* int-mic */ | |
6956 | { 0x14, 0x99130110 }, /* speaker */ | |
6957 | { 0x18, 0x03a11c20 }, /* mic */ | |
6958 | { 0x1e, 0x0346101e }, /* SPDIF1 */ | |
6959 | { 0x21, 0x0321101f }, /* HP out */ | |
6960 | { } | |
6961 | }, | |
6962 | .chained = true, | |
6963 | .chain_id = ALC271_FIXUP_DMIC, | |
6964 | }, | |
3e0d611b DH |
6965 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
6966 | .type = HDA_FIXUP_FUNC, | |
6967 | .v.func = alc269_fixup_limit_int_mic_boost, | |
2793769f DH |
6968 | .chained = true, |
6969 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
3e0d611b | 6970 | }, |
2cede303 OR |
6971 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
6972 | .type = HDA_FIXUP_FUNC, | |
6973 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6974 | .chained = true, | |
6975 | .chain_id = ALC269VB_FIXUP_DMIC, | |
6976 | }, | |
23870831 TI |
6977 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
6978 | .type = HDA_FIXUP_VERBS, | |
6979 | .v.verbs = (const struct hda_verb[]) { | |
6980 | /* class-D output amp +5dB */ | |
6981 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, | |
6982 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, | |
6983 | {} | |
6984 | }, | |
6985 | .chained = true, | |
6986 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, | |
6987 | }, | |
8e35cd4a DH |
6988 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
6989 | .type = HDA_FIXUP_FUNC, | |
6990 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6991 | .chained = true, | |
6992 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
6993 | }, | |
02b504d9 AA |
6994 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
6995 | .type = HDA_FIXUP_PINS, | |
6996 | .v.pins = (const struct hda_pintbl[]) { | |
6997 | { 0x12, 0x99a3092f }, /* int-mic */ | |
6998 | { 0x18, 0x03a11d20 }, /* mic */ | |
6999 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ | |
7000 | { } | |
7001 | }, | |
7002 | }, | |
cd217a63 KY |
7003 | [ALC283_FIXUP_CHROME_BOOK] = { |
7004 | .type = HDA_FIXUP_FUNC, | |
7005 | .v.func = alc283_fixup_chromebook, | |
7006 | }, | |
0202e99c KY |
7007 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
7008 | .type = HDA_FIXUP_FUNC, | |
7009 | .v.func = alc283_fixup_sense_combo_jack, | |
7010 | .chained = true, | |
7011 | .chain_id = ALC283_FIXUP_CHROME_BOOK, | |
7012 | }, | |
7bba2157 TI |
7013 | [ALC282_FIXUP_ASUS_TX300] = { |
7014 | .type = HDA_FIXUP_FUNC, | |
7015 | .v.func = alc282_fixup_asus_tx300, | |
7016 | }, | |
1bb3e062 KY |
7017 | [ALC283_FIXUP_INT_MIC] = { |
7018 | .type = HDA_FIXUP_VERBS, | |
7019 | .v.verbs = (const struct hda_verb[]) { | |
7020 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, | |
7021 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, | |
7022 | { } | |
7023 | }, | |
7024 | .chained = true, | |
7025 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
7026 | }, | |
0f4881dc DH |
7027 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
7028 | .type = HDA_FIXUP_PINS, | |
7029 | .v.pins = (const struct hda_pintbl[]) { | |
7030 | { 0x17, 0x90170112 }, /* subwoofer */ | |
7031 | { } | |
7032 | }, | |
7033 | .chained = true, | |
7034 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, | |
7035 | }, | |
7036 | [ALC290_FIXUP_SUBWOOFER] = { | |
7037 | .type = HDA_FIXUP_PINS, | |
7038 | .v.pins = (const struct hda_pintbl[]) { | |
7039 | { 0x17, 0x90170112 }, /* subwoofer */ | |
7040 | { } | |
7041 | }, | |
7042 | .chained = true, | |
7043 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, | |
7044 | }, | |
338cae56 DH |
7045 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
7046 | .type = HDA_FIXUP_FUNC, | |
7047 | .v.func = alc290_fixup_mono_speakers, | |
0f4881dc DH |
7048 | }, |
7049 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { | |
7050 | .type = HDA_FIXUP_FUNC, | |
7051 | .v.func = alc290_fixup_mono_speakers, | |
338cae56 DH |
7052 | .chained = true, |
7053 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, | |
7054 | }, | |
b67ae3f1 DH |
7055 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
7056 | .type = HDA_FIXUP_FUNC, | |
d5a6cabf | 7057 | .v.func = alc_fixup_thinkpad_acpi, |
09da111a TI |
7058 | .chained = true, |
7059 | .chain_id = ALC269_FIXUP_SKU_IGNORE, | |
b67ae3f1 | 7060 | }, |
56f27013 DH |
7061 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
7062 | .type = HDA_FIXUP_FUNC, | |
7063 | .v.func = alc_fixup_inv_dmic, | |
7064 | .chained = true, | |
7065 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
7066 | }, | |
5824ce8d | 7067 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
17d30460 HW |
7068 | .type = HDA_FIXUP_PINS, |
7069 | .v.pins = (const struct hda_pintbl[]) { | |
7070 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7071 | { } | |
5824ce8d CC |
7072 | }, |
7073 | .chained = true, | |
17d30460 | 7074 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
5824ce8d | 7075 | }, |
615966ad CC |
7076 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7077 | .type = HDA_FIXUP_PINS, | |
7078 | .v.pins = (const struct hda_pintbl[]) { | |
7079 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7080 | { } | |
7081 | }, | |
7082 | .chained = true, | |
7083 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
7084 | }, | |
9a22a8f5 KY |
7085 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7086 | .type = HDA_FIXUP_PINS, | |
7087 | .v.pins = (const struct hda_pintbl[]) { | |
7088 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7089 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7090 | { } | |
7091 | }, | |
7092 | .chained = true, | |
7093 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
7094 | }, | |
31278997 KY |
7095 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
7096 | .type = HDA_FIXUP_PINS, | |
7097 | .v.pins = (const struct hda_pintbl[]) { | |
7098 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7099 | { } | |
7100 | }, | |
7101 | .chained = true, | |
7102 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7103 | }, | |
9a22a8f5 KY |
7104 | [ALC255_FIXUP_HEADSET_MODE] = { |
7105 | .type = HDA_FIXUP_FUNC, | |
7106 | .v.func = alc_fixup_headset_mode_alc255, | |
4a83d42a | 7107 | .chained = true, |
b3802783 | 7108 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
9a22a8f5 | 7109 | }, |
31278997 KY |
7110 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
7111 | .type = HDA_FIXUP_FUNC, | |
7112 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, | |
7113 | }, | |
a22aa26f KY |
7114 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7115 | .type = HDA_FIXUP_PINS, | |
7116 | .v.pins = (const struct hda_pintbl[]) { | |
7117 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7118 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7119 | { } | |
7120 | }, | |
7121 | .chained = true, | |
7122 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7123 | }, | |
1c37c223 | 7124 | [ALC292_FIXUP_TPT440_DOCK] = { |
ec56af67 | 7125 | .type = HDA_FIXUP_FUNC, |
7f57d803 | 7126 | .v.func = alc_fixup_tpt440_dock, |
1c37c223 TI |
7127 | .chained = true, |
7128 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
7129 | }, | |
9a811230 TI |
7130 | [ALC292_FIXUP_TPT440] = { |
7131 | .type = HDA_FIXUP_FUNC, | |
157f0b7f | 7132 | .v.func = alc_fixup_disable_aamix, |
9a811230 TI |
7133 | .chained = true, |
7134 | .chain_id = ALC292_FIXUP_TPT440_DOCK, | |
7135 | }, | |
abaa2274 | 7136 | [ALC283_FIXUP_HEADSET_MIC] = { |
9dc12862 DD |
7137 | .type = HDA_FIXUP_PINS, |
7138 | .v.pins = (const struct hda_pintbl[]) { | |
7139 | { 0x19, 0x04a110f0 }, | |
7140 | { }, | |
7141 | }, | |
7142 | }, | |
b3802783 | 7143 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
00ef9940 | 7144 | .type = HDA_FIXUP_FUNC, |
8a503555 | 7145 | .v.func = alc_fixup_micmute_led, |
00ef9940 | 7146 | }, |
1a22e775 TI |
7147 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
7148 | .type = HDA_FIXUP_PINS, | |
7149 | .v.pins = (const struct hda_pintbl[]) { | |
7150 | { 0x12, 0x90a60130 }, | |
7151 | { 0x14, 0x90170110 }, | |
7152 | { 0x17, 0x40000008 }, | |
7153 | { 0x18, 0x411111f0 }, | |
0420694d | 7154 | { 0x19, 0x01a1913c }, |
1a22e775 TI |
7155 | { 0x1a, 0x411111f0 }, |
7156 | { 0x1b, 0x411111f0 }, | |
7157 | { 0x1d, 0x40f89b2d }, | |
7158 | { 0x1e, 0x411111f0 }, | |
7159 | { 0x21, 0x0321101f }, | |
7160 | { }, | |
7161 | }, | |
7162 | }, | |
c8426b27 TI |
7163 | [ALC269VB_FIXUP_ASPIRE_E1_COEF] = { |
7164 | .type = HDA_FIXUP_FUNC, | |
7165 | .v.func = alc269vb_fixup_aspire_e1_coef, | |
7166 | }, | |
7a5255f1 DH |
7167 | [ALC280_FIXUP_HP_GPIO4] = { |
7168 | .type = HDA_FIXUP_FUNC, | |
7169 | .v.func = alc280_fixup_hp_gpio4, | |
7170 | }, | |
eaa8e5ef KY |
7171 | [ALC286_FIXUP_HP_GPIO_LED] = { |
7172 | .type = HDA_FIXUP_FUNC, | |
7173 | .v.func = alc286_fixup_hp_gpio_led, | |
7174 | }, | |
33f4acd3 DH |
7175 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
7176 | .type = HDA_FIXUP_FUNC, | |
7177 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, | |
7178 | }, | |
b4b33f9d TC |
7179 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
7180 | .type = HDA_FIXUP_PINS, | |
7181 | .v.pins = (const struct hda_pintbl[]) { | |
7182 | { 0x1b, 0x21011020 }, /* line-out */ | |
7183 | { 0x1a, 0x01a1903c }, /* headset mic */ | |
7184 | { 0x18, 0x2181103f }, /* line-in */ | |
7185 | { }, | |
7186 | }, | |
7187 | .chained = true, | |
7188 | .chain_id = ALC280_FIXUP_HP_GPIO4 | |
7189 | }, | |
04d5466a JK |
7190 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
7191 | .type = HDA_FIXUP_PINS, | |
7192 | .v.pins = (const struct hda_pintbl[]) { | |
7193 | { 0x1b, 0x21011020 }, /* line-out */ | |
7194 | { 0x18, 0x2181103f }, /* line-in */ | |
7195 | { }, | |
7196 | }, | |
7197 | .chained = true, | |
7198 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED | |
7199 | }, | |
98973f2f KP |
7200 | [ALC280_FIXUP_HP_9480M] = { |
7201 | .type = HDA_FIXUP_FUNC, | |
7202 | .v.func = alc280_fixup_hp_9480m, | |
7203 | }, | |
c3bb2b52 TI |
7204 | [ALC245_FIXUP_HP_X360_AMP] = { |
7205 | .type = HDA_FIXUP_FUNC, | |
7206 | .v.func = alc245_fixup_hp_x360_amp, | |
7207 | }, | |
e1e62b98 KY |
7208 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
7209 | .type = HDA_FIXUP_FUNC, | |
7210 | .v.func = alc_fixup_headset_mode_dell_alc288, | |
7211 | .chained = true, | |
b3802783 | 7212 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
e1e62b98 KY |
7213 | }, |
7214 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { | |
7215 | .type = HDA_FIXUP_PINS, | |
7216 | .v.pins = (const struct hda_pintbl[]) { | |
7217 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7218 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7219 | { } | |
7220 | }, | |
7221 | .chained = true, | |
7222 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE | |
7223 | }, | |
831bfdf9 HW |
7224 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
7225 | .type = HDA_FIXUP_FUNC, | |
7226 | .v.func = alc_fixup_disable_aamix, | |
7227 | .chained = true, | |
d44a6864 | 7228 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
831bfdf9 HW |
7229 | }, |
7230 | [ALC288_FIXUP_DELL_XPS_13] = { | |
7231 | .type = HDA_FIXUP_FUNC, | |
7232 | .v.func = alc_fixup_dell_xps13, | |
7233 | .chained = true, | |
7234 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX | |
7235 | }, | |
8b99aba7 TI |
7236 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
7237 | .type = HDA_FIXUP_FUNC, | |
7238 | .v.func = alc_fixup_disable_aamix, | |
831bfdf9 HW |
7239 | .chained = true, |
7240 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE | |
8b99aba7 | 7241 | }, |
c04017ea DH |
7242 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
7243 | .type = HDA_FIXUP_FUNC, | |
7244 | .v.func = alc_fixup_disable_aamix, | |
7245 | .chained = true, | |
7246 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE | |
7247 | }, | |
5fab5829 | 7248 | [ALC292_FIXUP_DELL_E7X_AAMIX] = { |
8b99aba7 TI |
7249 | .type = HDA_FIXUP_FUNC, |
7250 | .v.func = alc_fixup_dell_xps13, | |
7251 | .chained = true, | |
7252 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX | |
7253 | }, | |
5fab5829 TI |
7254 | [ALC292_FIXUP_DELL_E7X] = { |
7255 | .type = HDA_FIXUP_FUNC, | |
8a503555 | 7256 | .v.func = alc_fixup_micmute_led, |
5fab5829 TI |
7257 | /* micmute fixup must be applied at last */ |
7258 | .chained_before = true, | |
7259 | .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, | |
7260 | }, | |
54324221 JM |
7261 | [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { |
7262 | .type = HDA_FIXUP_PINS, | |
7263 | .v.pins = (const struct hda_pintbl[]) { | |
7264 | { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ | |
7265 | { } | |
7266 | }, | |
7267 | .chained_before = true, | |
7268 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
7269 | }, | |
977e6276 KY |
7270 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7271 | .type = HDA_FIXUP_PINS, | |
7272 | .v.pins = (const struct hda_pintbl[]) { | |
7273 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7274 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7275 | { } | |
7276 | }, | |
7277 | .chained = true, | |
7278 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7279 | }, | |
2f726aec HW |
7280 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
7281 | .type = HDA_FIXUP_PINS, | |
7282 | .v.pins = (const struct hda_pintbl[]) { | |
7283 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7284 | { } | |
7285 | }, | |
7286 | .chained = true, | |
7287 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7288 | }, | |
6ed1131f KY |
7289 | [ALC275_FIXUP_DELL_XPS] = { |
7290 | .type = HDA_FIXUP_VERBS, | |
7291 | .v.verbs = (const struct hda_verb[]) { | |
7292 | /* Enables internal speaker */ | |
7293 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, | |
7294 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, | |
7295 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, | |
7296 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, | |
7297 | {} | |
7298 | } | |
7299 | }, | |
23adc192 HW |
7300 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
7301 | .type = HDA_FIXUP_FUNC, | |
7302 | .v.func = alc_fixup_disable_aamix, | |
7303 | .chained = true, | |
7304 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
7305 | }, | |
3694cb29 K |
7306 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
7307 | .type = HDA_FIXUP_FUNC, | |
7308 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, | |
7309 | }, | |
d1ee66c5 PC |
7310 | [ALC233_FIXUP_INTEL_NUC8_DMIC] = { |
7311 | .type = HDA_FIXUP_FUNC, | |
7312 | .v.func = alc_fixup_inv_dmic, | |
7313 | .chained = true, | |
7314 | .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST, | |
7315 | }, | |
7316 | [ALC233_FIXUP_INTEL_NUC8_BOOST] = { | |
7317 | .type = HDA_FIXUP_FUNC, | |
7318 | .v.func = alc269_fixup_limit_int_mic_boost | |
7319 | }, | |
3b43b71f KHF |
7320 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
7321 | .type = HDA_FIXUP_FUNC, | |
7322 | .v.func = alc_fixup_disable_aamix, | |
7323 | .chained = true, | |
7324 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7325 | }, | |
d1dd4211 KY |
7326 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
7327 | .type = HDA_FIXUP_FUNC, | |
7328 | .v.func = alc_fixup_disable_mic_vref, | |
7329 | .chained = true, | |
7330 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
7331 | }, | |
2ae95577 DH |
7332 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7333 | .type = HDA_FIXUP_VERBS, | |
7334 | .v.verbs = (const struct hda_verb[]) { | |
7335 | /* Disable pass-through path for FRONT 14h */ | |
7336 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
7337 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
7338 | {} | |
7339 | }, | |
7340 | .chained = true, | |
d1dd4211 | 7341 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
2ae95577 | 7342 | }, |
f883982d TI |
7343 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
7344 | .type = HDA_FIXUP_FUNC, | |
7345 | .v.func = alc_fixup_disable_aamix, | |
7346 | .chained = true, | |
7347 | .chain_id = ALC269_FIXUP_HEADSET_MIC, | |
7348 | }, | |
e549d190 HW |
7349 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
7350 | .type = HDA_FIXUP_PINS, | |
7351 | .v.pins = (const struct hda_pintbl[]) { | |
7352 | { 0x19, 0x02a19020 }, /* Front Mic */ | |
7353 | { } | |
7354 | }, | |
7355 | }, | |
c636b95e SE |
7356 | [ALC292_FIXUP_TPT460] = { |
7357 | .type = HDA_FIXUP_FUNC, | |
7358 | .v.func = alc_fixup_tpt440_dock, | |
7359 | .chained = true, | |
7360 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, | |
7361 | }, | |
dd9aa335 HW |
7362 | [ALC298_FIXUP_SPK_VOLUME] = { |
7363 | .type = HDA_FIXUP_FUNC, | |
7364 | .v.func = alc298_fixup_speaker_volume, | |
59ec4b57 | 7365 | .chained = true, |
2f726aec | 7366 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
dd9aa335 | 7367 | }, |
f86de9b1 KY |
7368 | [ALC298_FIXUP_LENOVO_SPK_VOLUME] = { |
7369 | .type = HDA_FIXUP_FUNC, | |
7370 | .v.func = alc298_fixup_speaker_volume, | |
7371 | }, | |
e312a869 TI |
7372 | [ALC295_FIXUP_DISABLE_DAC3] = { |
7373 | .type = HDA_FIXUP_FUNC, | |
7374 | .v.func = alc295_fixup_disable_dac3, | |
7375 | }, | |
d2cd795c JK |
7376 | [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { |
7377 | .type = HDA_FIXUP_FUNC, | |
7378 | .v.func = alc285_fixup_speaker2_to_dac1, | |
c37c0ab0 HW |
7379 | .chained = true, |
7380 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
d2cd795c | 7381 | }, |
fd06c77e KHF |
7382 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
7383 | .type = HDA_FIXUP_PINS, | |
7384 | .v.pins = (const struct hda_pintbl[]) { | |
7385 | { 0x1b, 0x90170151 }, | |
7386 | { } | |
7387 | }, | |
7388 | .chained = true, | |
7389 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7390 | }, | |
823ff161 GM |
7391 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
7392 | .type = HDA_FIXUP_FUNC, | |
7393 | .v.func = alc_fixup_auto_mute_via_amp, | |
7394 | .chained = true, | |
7395 | .chain_id = ALC269_FIXUP_NO_SHUTUP | |
7396 | }, | |
9eb5d0e6 KY |
7397 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
7398 | .type = HDA_FIXUP_PINS, | |
7399 | .v.pins = (const struct hda_pintbl[]) { | |
7400 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7401 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7402 | { } | |
7403 | }, | |
7404 | .chained = true, | |
7405 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7406 | }, | |
c1732ede CC |
7407 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
7408 | .type = HDA_FIXUP_FUNC, | |
7409 | .v.func = alc_fixup_headset_mode, | |
7410 | }, | |
7411 | [ALC256_FIXUP_ASUS_MIC] = { | |
7412 | .type = HDA_FIXUP_PINS, | |
7413 | .v.pins = (const struct hda_pintbl[]) { | |
7414 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
7415 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7416 | { } | |
7417 | }, | |
7418 | .chained = true, | |
7419 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7420 | }, | |
eeed4cd1 | 7421 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
ae065f1c TI |
7422 | .type = HDA_FIXUP_FUNC, |
7423 | /* Set up GPIO2 for the speaker amp */ | |
7424 | .v.func = alc_fixup_gpio4, | |
eeed4cd1 | 7425 | }, |
216d7aeb CC |
7426 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7427 | .type = HDA_FIXUP_PINS, | |
7428 | .v.pins = (const struct hda_pintbl[]) { | |
7429 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7430 | { } | |
7431 | }, | |
7432 | .chained = true, | |
7433 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7434 | }, | |
7435 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { | |
7436 | .type = HDA_FIXUP_VERBS, | |
7437 | .v.verbs = (const struct hda_verb[]) { | |
7438 | /* Enables internal speaker */ | |
7439 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, | |
7440 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, | |
7441 | {} | |
7442 | }, | |
7443 | .chained = true, | |
7444 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | |
7445 | }, | |
ca169cc2 KY |
7446 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
7447 | .type = HDA_FIXUP_FUNC, | |
7448 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
f73bbf63 KHF |
7449 | .chained = true, |
7450 | .chain_id = ALC269_FIXUP_GPIO2 | |
ca169cc2 | 7451 | }, |
ea5c7eba JHP |
7452 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
7453 | .type = HDA_FIXUP_VERBS, | |
7454 | .v.verbs = (const struct hda_verb[]) { | |
7455 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
7456 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
7457 | { } | |
7458 | }, | |
7459 | .chained = true, | |
7460 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | |
7461 | }, | |
f33f79f3 HW |
7462 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
7463 | .type = HDA_FIXUP_PINS, | |
7464 | .v.pins = (const struct hda_pintbl[]) { | |
7465 | /* Change the mic location from front to right, otherwise there are | |
7466 | two front mics with the same name, pulseaudio can't handle them. | |
7467 | This is just a temporary workaround, after applying this fixup, | |
7468 | there will be one "Front Mic" and one "Mic" in this machine. | |
7469 | */ | |
7470 | { 0x1a, 0x04a19040 }, | |
7471 | { } | |
7472 | }, | |
7473 | }, | |
5f364135 KY |
7474 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
7475 | .type = HDA_FIXUP_PINS, | |
7476 | .v.pins = (const struct hda_pintbl[]) { | |
7477 | { 0x16, 0x0101102f }, /* Rear Headset HP */ | |
7478 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ | |
7479 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ | |
7480 | { 0x1b, 0x02011020 }, | |
7481 | { } | |
7482 | }, | |
7483 | .chained = true, | |
52e4e368 KHF |
7484 | .chain_id = ALC225_FIXUP_S3_POP_NOISE |
7485 | }, | |
7486 | [ALC225_FIXUP_S3_POP_NOISE] = { | |
7487 | .type = HDA_FIXUP_FUNC, | |
7488 | .v.func = alc225_fixup_s3_pop_noise, | |
7489 | .chained = true, | |
5f364135 KY |
7490 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
7491 | }, | |
b84e8436 PH |
7492 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
7493 | .type = HDA_FIXUP_VERBS, | |
7494 | .v.verbs = (const struct hda_verb[]) { | |
7495 | /* Enables internal speaker */ | |
7496 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, | |
7497 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, | |
7498 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, | |
7499 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, | |
7500 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, | |
7501 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, | |
7502 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, | |
7503 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, | |
7504 | {} | |
7505 | } | |
7506 | }, | |
92266651 KY |
7507 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
7508 | .type = HDA_FIXUP_FUNC, | |
7509 | .v.func = alc274_fixup_bind_dacs, | |
7510 | .chained = true, | |
7511 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
7512 | }, | |
7513 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { | |
7514 | .type = HDA_FIXUP_PINS, | |
7515 | .v.pins = (const struct hda_pintbl[]) { | |
7516 | { 0x1b, 0x0401102f }, | |
7517 | { } | |
7518 | }, | |
7519 | .chained = true, | |
7520 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS | |
7521 | }, | |
399c01aa | 7522 | [ALC298_FIXUP_TPT470_DOCK_FIX] = { |
61fcf8ec KY |
7523 | .type = HDA_FIXUP_FUNC, |
7524 | .v.func = alc_fixup_tpt470_dock, | |
7525 | .chained = true, | |
7526 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE | |
7527 | }, | |
399c01aa TI |
7528 | [ALC298_FIXUP_TPT470_DOCK] = { |
7529 | .type = HDA_FIXUP_FUNC, | |
7530 | .v.func = alc_fixup_tpt470_dacs, | |
7531 | .chained = true, | |
7532 | .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX | |
7533 | }, | |
ae104a21 KY |
7534 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
7535 | .type = HDA_FIXUP_PINS, | |
7536 | .v.pins = (const struct hda_pintbl[]) { | |
7537 | { 0x14, 0x0201101f }, | |
7538 | { } | |
7539 | }, | |
7540 | .chained = true, | |
7541 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7542 | }, | |
f0ba9d69 KY |
7543 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
7544 | .type = HDA_FIXUP_PINS, | |
7545 | .v.pins = (const struct hda_pintbl[]) { | |
7546 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7547 | { } | |
7548 | }, | |
3ce0d5aa HW |
7549 | .chained = true, |
7550 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
f0ba9d69 | 7551 | }, |
bbf8ff6b TB |
7552 | [ALC295_FIXUP_HP_X360] = { |
7553 | .type = HDA_FIXUP_FUNC, | |
7554 | .v.func = alc295_fixup_hp_top_speakers, | |
7555 | .chained = true, | |
7556 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 | |
8a328ac1 KY |
7557 | }, |
7558 | [ALC221_FIXUP_HP_HEADSET_MIC] = { | |
7559 | .type = HDA_FIXUP_PINS, | |
7560 | .v.pins = (const struct hda_pintbl[]) { | |
7561 | { 0x19, 0x0181313f}, | |
7562 | { } | |
7563 | }, | |
7564 | .chained = true, | |
7565 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7566 | }, | |
c4cfcf6f HW |
7567 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
7568 | .type = HDA_FIXUP_FUNC, | |
7569 | .v.func = alc285_fixup_invalidate_dacs, | |
6ba189c5 HW |
7570 | .chained = true, |
7571 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
c4cfcf6f | 7572 | }, |
e8ed64b0 GKK |
7573 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
7574 | .type = HDA_FIXUP_FUNC, | |
7575 | .v.func = alc_fixup_auto_mute_via_amp, | |
7576 | }, | |
33aaebd4 CC |
7577 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
7578 | .type = HDA_FIXUP_PINS, | |
7579 | .v.pins = (const struct hda_pintbl[]) { | |
7580 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7581 | { } | |
7582 | }, | |
7583 | .chained = true, | |
7584 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7585 | }, | |
d8ae458e CC |
7586 | [ALC294_FIXUP_ASUS_MIC] = { |
7587 | .type = HDA_FIXUP_PINS, | |
7588 | .v.pins = (const struct hda_pintbl[]) { | |
7589 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
7590 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7591 | { } | |
7592 | }, | |
7593 | .chained = true, | |
ef9ddb9d | 7594 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
d8ae458e | 7595 | }, |
4e051106 JHP |
7596 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
7597 | .type = HDA_FIXUP_PINS, | |
7598 | .v.pins = (const struct hda_pintbl[]) { | |
82b01149 | 7599 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
4e051106 JHP |
7600 | { } |
7601 | }, | |
7602 | .chained = true, | |
ef9ddb9d | 7603 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
4e051106 JHP |
7604 | }, |
7605 | [ALC294_FIXUP_ASUS_SPK] = { | |
7606 | .type = HDA_FIXUP_VERBS, | |
7607 | .v.verbs = (const struct hda_verb[]) { | |
7608 | /* Set EAPD high */ | |
7609 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, | |
7610 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, | |
473fbe13 KY |
7611 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
7612 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, | |
4e051106 JHP |
7613 | { } |
7614 | }, | |
7615 | .chained = true, | |
7616 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7617 | }, | |
c8a9afa6 | 7618 | [ALC295_FIXUP_CHROME_BOOK] = { |
e854747d | 7619 | .type = HDA_FIXUP_FUNC, |
c8a9afa6 | 7620 | .v.func = alc295_fixup_chromebook, |
8983eb60 KY |
7621 | .chained = true, |
7622 | .chain_id = ALC225_FIXUP_HEADSET_JACK | |
7623 | }, | |
7624 | [ALC225_FIXUP_HEADSET_JACK] = { | |
7625 | .type = HDA_FIXUP_FUNC, | |
7626 | .v.func = alc_fixup_headset_jack, | |
e854747d | 7627 | }, |
89e3a568 JS |
7628 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
7629 | .type = HDA_FIXUP_PINS, | |
7630 | .v.pins = (const struct hda_pintbl[]) { | |
7631 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7632 | { } | |
7633 | }, | |
7634 | .chained = true, | |
7635 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7636 | }, | |
c8c6ee61 HW |
7637 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
7638 | .type = HDA_FIXUP_VERBS, | |
7639 | .v.verbs = (const struct hda_verb[]) { | |
7640 | /* Disable PCBEEP-IN passthrough */ | |
7641 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
7642 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
7643 | { } | |
7644 | }, | |
7645 | .chained = true, | |
7646 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE | |
7647 | }, | |
cbc05fd6 JHP |
7648 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
7649 | .type = HDA_FIXUP_PINS, | |
7650 | .v.pins = (const struct hda_pintbl[]) { | |
7651 | { 0x19, 0x03a11130 }, | |
7652 | { 0x1a, 0x90a60140 }, /* use as internal mic */ | |
7653 | { } | |
7654 | }, | |
7655 | .chained = true, | |
7656 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7657 | }, | |
136824ef KY |
7658 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
7659 | .type = HDA_FIXUP_PINS, | |
7660 | .v.pins = (const struct hda_pintbl[]) { | |
7661 | { 0x16, 0x01011020 }, /* Rear Line out */ | |
7662 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ | |
7663 | { } | |
7664 | }, | |
7665 | .chained = true, | |
7666 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE | |
7667 | }, | |
7668 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { | |
7669 | .type = HDA_FIXUP_FUNC, | |
7670 | .v.func = alc_fixup_auto_mute_via_amp, | |
7671 | .chained = true, | |
7672 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF | |
7673 | }, | |
7674 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { | |
7675 | .type = HDA_FIXUP_FUNC, | |
7676 | .v.func = alc_fixup_disable_mic_vref, | |
7677 | .chained = true, | |
7678 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7679 | }, | |
667a8f73 JHP |
7680 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
7681 | .type = HDA_FIXUP_VERBS, | |
7682 | .v.verbs = (const struct hda_verb[]) { | |
7683 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, | |
7684 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, | |
7685 | { } | |
7686 | }, | |
7687 | .chained = true, | |
7688 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE | |
7689 | }, | |
8c8967a7 DD |
7690 | [ALC256_FIXUP_ASUS_HEADSET_MIC] = { |
7691 | .type = HDA_FIXUP_PINS, | |
7692 | .v.pins = (const struct hda_pintbl[]) { | |
7693 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | |
7694 | { } | |
7695 | }, | |
7696 | .chained = true, | |
7697 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7698 | }, | |
e1037354 JHP |
7699 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7700 | .type = HDA_FIXUP_PINS, | |
7701 | .v.pins = (const struct hda_pintbl[]) { | |
7702 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7703 | { } | |
7704 | }, | |
7705 | .chained = true, | |
7706 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7707 | }, | |
e2a829b3 BR |
7708 | [ALC299_FIXUP_PREDATOR_SPK] = { |
7709 | .type = HDA_FIXUP_PINS, | |
7710 | .v.pins = (const struct hda_pintbl[]) { | |
7711 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ | |
7712 | { } | |
7713 | } | |
7714 | }, | |
bd9c10bc | 7715 | [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { |
60083f9e JHP |
7716 | .type = HDA_FIXUP_PINS, |
7717 | .v.pins = (const struct hda_pintbl[]) { | |
bd9c10bc JMG |
7718 | { 0x19, 0x04a11040 }, |
7719 | { 0x21, 0x04211020 }, | |
60083f9e JHP |
7720 | { } |
7721 | }, | |
7722 | .chained = true, | |
bd9c10bc | 7723 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
60083f9e | 7724 | }, |
e79c2269 | 7725 | [ALC289_FIXUP_DELL_SPK2] = { |
bd9c10bc JMG |
7726 | .type = HDA_FIXUP_PINS, |
7727 | .v.pins = (const struct hda_pintbl[]) { | |
e79c2269 | 7728 | { 0x17, 0x90170130 }, /* bass spk */ |
bd9c10bc JMG |
7729 | { } |
7730 | }, | |
7731 | .chained = true, | |
e79c2269 | 7732 | .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE |
bd9c10bc | 7733 | }, |
e79c2269 KY |
7734 | [ALC289_FIXUP_DUAL_SPK] = { |
7735 | .type = HDA_FIXUP_FUNC, | |
7736 | .v.func = alc285_fixup_speaker2_to_dac1, | |
7737 | .chained = true, | |
7738 | .chain_id = ALC289_FIXUP_DELL_SPK2 | |
7739 | }, | |
48e01504 CC |
7740 | [ALC294_FIXUP_SPK2_TO_DAC1] = { |
7741 | .type = HDA_FIXUP_FUNC, | |
7742 | .v.func = alc285_fixup_speaker2_to_dac1, | |
7743 | .chained = true, | |
7744 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7745 | }, | |
7746 | [ALC294_FIXUP_ASUS_DUAL_SPK] = { | |
436e2550 JHP |
7747 | .type = HDA_FIXUP_FUNC, |
7748 | /* The GPIO must be pulled to initialize the AMP */ | |
7749 | .v.func = alc_fixup_gpio4, | |
7750 | .chained = true, | |
48e01504 | 7751 | .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 |
436e2550 | 7752 | }, |
6a6660d0 TI |
7753 | [ALC285_FIXUP_THINKPAD_X1_GEN7] = { |
7754 | .type = HDA_FIXUP_FUNC, | |
7755 | .v.func = alc285_fixup_thinkpad_x1_gen7, | |
7756 | .chained = true, | |
7757 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
7758 | }, | |
76f7dec0 KY |
7759 | [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { |
7760 | .type = HDA_FIXUP_FUNC, | |
7761 | .v.func = alc_fixup_headset_jack, | |
7762 | .chained = true, | |
6a6660d0 | 7763 | .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 |
76f7dec0 | 7764 | }, |
8b33a134 JHP |
7765 | [ALC294_FIXUP_ASUS_HPE] = { |
7766 | .type = HDA_FIXUP_VERBS, | |
7767 | .v.verbs = (const struct hda_verb[]) { | |
7768 | /* Set EAPD high */ | |
7769 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, | |
7770 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, | |
7771 | { } | |
7772 | }, | |
7773 | .chained = true, | |
7774 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7775 | }, | |
c3cdf189 LJ |
7776 | [ALC294_FIXUP_ASUS_GX502_PINS] = { |
7777 | .type = HDA_FIXUP_PINS, | |
7778 | .v.pins = (const struct hda_pintbl[]) { | |
7779 | { 0x19, 0x03a11050 }, /* front HP mic */ | |
7780 | { 0x1a, 0x01a11830 }, /* rear external mic */ | |
7781 | { 0x21, 0x03211020 }, /* front HP out */ | |
7782 | { } | |
7783 | }, | |
7784 | .chained = true, | |
7785 | .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS | |
7786 | }, | |
7787 | [ALC294_FIXUP_ASUS_GX502_VERBS] = { | |
7788 | .type = HDA_FIXUP_VERBS, | |
7789 | .v.verbs = (const struct hda_verb[]) { | |
7790 | /* set 0x15 to HP-OUT ctrl */ | |
7791 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, | |
7792 | /* unmute the 0x15 amp */ | |
7793 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, | |
7794 | { } | |
7795 | }, | |
7796 | .chained = true, | |
7797 | .chain_id = ALC294_FIXUP_ASUS_GX502_HP | |
7798 | }, | |
7799 | [ALC294_FIXUP_ASUS_GX502_HP] = { | |
7800 | .type = HDA_FIXUP_FUNC, | |
7801 | .v.func = alc294_fixup_gx502_hp, | |
7802 | }, | |
c1b55029 DC |
7803 | [ALC294_FIXUP_ASUS_GU502_PINS] = { |
7804 | .type = HDA_FIXUP_PINS, | |
7805 | .v.pins = (const struct hda_pintbl[]) { | |
7806 | { 0x19, 0x01a11050 }, /* rear HP mic */ | |
7807 | { 0x1a, 0x01a11830 }, /* rear external mic */ | |
7808 | { 0x21, 0x012110f0 }, /* rear HP out */ | |
7809 | { } | |
7810 | }, | |
7811 | .chained = true, | |
7812 | .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS | |
7813 | }, | |
7814 | [ALC294_FIXUP_ASUS_GU502_VERBS] = { | |
7815 | .type = HDA_FIXUP_VERBS, | |
7816 | .v.verbs = (const struct hda_verb[]) { | |
7817 | /* set 0x15 to HP-OUT ctrl */ | |
7818 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, | |
7819 | /* unmute the 0x15 amp */ | |
7820 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, | |
7821 | /* set 0x1b to HP-OUT */ | |
7822 | { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, | |
7823 | { } | |
7824 | }, | |
7825 | .chained = true, | |
7826 | .chain_id = ALC294_FIXUP_ASUS_GU502_HP | |
7827 | }, | |
7828 | [ALC294_FIXUP_ASUS_GU502_HP] = { | |
7829 | .type = HDA_FIXUP_FUNC, | |
7830 | .v.func = alc294_fixup_gu502_hp, | |
7831 | }, | |
1b94e59d TI |
7832 | [ALC294_FIXUP_ASUS_COEF_1B] = { |
7833 | .type = HDA_FIXUP_VERBS, | |
7834 | .v.verbs = (const struct hda_verb[]) { | |
7835 | /* Set bit 10 to correct noisy output after reboot from | |
7836 | * Windows 10 (due to pop noise reduction?) | |
7837 | */ | |
7838 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, | |
7839 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, | |
7840 | { } | |
7841 | }, | |
7842 | }, | |
f5a88b0a KHF |
7843 | [ALC285_FIXUP_HP_GPIO_LED] = { |
7844 | .type = HDA_FIXUP_FUNC, | |
7845 | .v.func = alc285_fixup_hp_gpio_led, | |
7846 | }, | |
431e76c3 KY |
7847 | [ALC285_FIXUP_HP_MUTE_LED] = { |
7848 | .type = HDA_FIXUP_FUNC, | |
7849 | .v.func = alc285_fixup_hp_mute_led, | |
7850 | }, | |
e7d66cf7 JS |
7851 | [ALC236_FIXUP_HP_GPIO_LED] = { |
7852 | .type = HDA_FIXUP_FUNC, | |
7853 | .v.func = alc236_fixup_hp_gpio_led, | |
7854 | }, | |
24164f43 KY |
7855 | [ALC236_FIXUP_HP_MUTE_LED] = { |
7856 | .type = HDA_FIXUP_FUNC, | |
7857 | .v.func = alc236_fixup_hp_mute_led, | |
7858 | }, | |
75b62ab6 JW |
7859 | [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = { |
7860 | .type = HDA_FIXUP_FUNC, | |
7861 | .v.func = alc236_fixup_hp_mute_led_micmute_vref, | |
7862 | }, | |
14425f1f MP |
7863 | [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { |
7864 | .type = HDA_FIXUP_VERBS, | |
7865 | .v.verbs = (const struct hda_verb[]) { | |
7866 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, | |
7867 | { } | |
7868 | }, | |
7869 | }, | |
9e43342b CC |
7870 | [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7871 | .type = HDA_FIXUP_PINS, | |
7872 | .v.pins = (const struct hda_pintbl[]) { | |
7873 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7874 | { } | |
7875 | }, | |
7876 | .chained = true, | |
7877 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7878 | }, | |
8eae7e9b JHP |
7879 | [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { |
7880 | .type = HDA_FIXUP_PINS, | |
7881 | .v.pins = (const struct hda_pintbl[]) { | |
7882 | { 0x14, 0x90100120 }, /* use as internal speaker */ | |
7883 | { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ | |
7884 | { 0x1a, 0x01011020 }, /* use as line out */ | |
7885 | { }, | |
7886 | }, | |
7887 | .chained = true, | |
7888 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7889 | }, | |
6e15d126 JHP |
7890 | [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { |
7891 | .type = HDA_FIXUP_PINS, | |
7892 | .v.pins = (const struct hda_pintbl[]) { | |
7893 | { 0x18, 0x02a11030 }, /* use as headset mic */ | |
7894 | { } | |
7895 | }, | |
7896 | .chained = true, | |
7897 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7898 | }, | |
781c90c0 JHP |
7899 | [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { |
7900 | .type = HDA_FIXUP_PINS, | |
7901 | .v.pins = (const struct hda_pintbl[]) { | |
7902 | { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ | |
7903 | { } | |
7904 | }, | |
7905 | .chained = true, | |
7906 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7907 | }, | |
293a92c1 | 7908 | [ALC289_FIXUP_ASUS_GA401] = { |
c84bfedc TI |
7909 | .type = HDA_FIXUP_FUNC, |
7910 | .v.func = alc289_fixup_asus_ga401, | |
7911 | .chained = true, | |
7912 | .chain_id = ALC289_FIXUP_ASUS_GA502, | |
ff53664d | 7913 | }, |
4b43d05a AS |
7914 | [ALC289_FIXUP_ASUS_GA502] = { |
7915 | .type = HDA_FIXUP_PINS, | |
7916 | .v.pins = (const struct hda_pintbl[]) { | |
7917 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | |
7918 | { } | |
7919 | }, | |
7920 | }, | |
f50a121d JHP |
7921 | [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { |
7922 | .type = HDA_FIXUP_PINS, | |
7923 | .v.pins = (const struct hda_pintbl[]) { | |
7924 | { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ | |
7925 | { } | |
7926 | }, | |
7927 | .chained = true, | |
7928 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7929 | }, | |
56496253 KY |
7930 | [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { |
7931 | .type = HDA_FIXUP_FUNC, | |
7932 | .v.func = alc285_fixup_hp_gpio_amp_init, | |
7933 | .chained = true, | |
7934 | .chain_id = ALC285_FIXUP_HP_GPIO_LED | |
7935 | }, | |
f1ec5be1 HC |
7936 | [ALC269_FIXUP_CZC_B20] = { |
7937 | .type = HDA_FIXUP_PINS, | |
7938 | .v.pins = (const struct hda_pintbl[]) { | |
7939 | { 0x12, 0x411111f0 }, | |
7940 | { 0x14, 0x90170110 }, /* speaker */ | |
7941 | { 0x15, 0x032f1020 }, /* HP out */ | |
7942 | { 0x17, 0x411111f0 }, | |
7943 | { 0x18, 0x03ab1040 }, /* mic */ | |
7944 | { 0x19, 0xb7a7013f }, | |
7945 | { 0x1a, 0x0181305f }, | |
7946 | { 0x1b, 0x411111f0 }, | |
7947 | { 0x1d, 0x411111f0 }, | |
7948 | { 0x1e, 0x411111f0 }, | |
7949 | { } | |
7950 | }, | |
7951 | .chain_id = ALC269_FIXUP_DMIC, | |
7952 | }, | |
7953 | [ALC269_FIXUP_CZC_TMI] = { | |
7954 | .type = HDA_FIXUP_PINS, | |
7955 | .v.pins = (const struct hda_pintbl[]) { | |
7956 | { 0x12, 0x4000c000 }, | |
7957 | { 0x14, 0x90170110 }, /* speaker */ | |
7958 | { 0x15, 0x0421401f }, /* HP out */ | |
7959 | { 0x17, 0x411111f0 }, | |
7960 | { 0x18, 0x04a19020 }, /* mic */ | |
7961 | { 0x19, 0x411111f0 }, | |
7962 | { 0x1a, 0x411111f0 }, | |
7963 | { 0x1b, 0x411111f0 }, | |
7964 | { 0x1d, 0x40448505 }, | |
7965 | { 0x1e, 0x411111f0 }, | |
7966 | { 0x20, 0x8000ffff }, | |
7967 | { } | |
7968 | }, | |
7969 | .chain_id = ALC269_FIXUP_DMIC, | |
7970 | }, | |
7971 | [ALC269_FIXUP_CZC_L101] = { | |
7972 | .type = HDA_FIXUP_PINS, | |
7973 | .v.pins = (const struct hda_pintbl[]) { | |
7974 | { 0x12, 0x40000000 }, | |
7975 | { 0x14, 0x01014010 }, /* speaker */ | |
7976 | { 0x15, 0x411111f0 }, /* HP out */ | |
7977 | { 0x16, 0x411111f0 }, | |
7978 | { 0x18, 0x01a19020 }, /* mic */ | |
7979 | { 0x19, 0x02a19021 }, | |
7980 | { 0x1a, 0x0181302f }, | |
7981 | { 0x1b, 0x0221401f }, | |
7982 | { 0x1c, 0x411111f0 }, | |
7983 | { 0x1d, 0x4044c601 }, | |
7984 | { 0x1e, 0x411111f0 }, | |
7985 | { } | |
7986 | }, | |
7987 | .chain_id = ALC269_FIXUP_DMIC, | |
7988 | }, | |
7989 | [ALC269_FIXUP_LEMOTE_A1802] = { | |
7990 | .type = HDA_FIXUP_PINS, | |
7991 | .v.pins = (const struct hda_pintbl[]) { | |
7992 | { 0x12, 0x40000000 }, | |
7993 | { 0x14, 0x90170110 }, /* speaker */ | |
7994 | { 0x17, 0x411111f0 }, | |
7995 | { 0x18, 0x03a19040 }, /* mic1 */ | |
7996 | { 0x19, 0x90a70130 }, /* mic2 */ | |
7997 | { 0x1a, 0x411111f0 }, | |
7998 | { 0x1b, 0x411111f0 }, | |
7999 | { 0x1d, 0x40489d2d }, | |
8000 | { 0x1e, 0x411111f0 }, | |
8001 | { 0x20, 0x0003ffff }, | |
8002 | { 0x21, 0x03214020 }, | |
8003 | { } | |
8004 | }, | |
8005 | .chain_id = ALC269_FIXUP_DMIC, | |
8006 | }, | |
8007 | [ALC269_FIXUP_LEMOTE_A190X] = { | |
8008 | .type = HDA_FIXUP_PINS, | |
8009 | .v.pins = (const struct hda_pintbl[]) { | |
8010 | { 0x14, 0x99130110 }, /* speaker */ | |
8011 | { 0x15, 0x0121401f }, /* HP out */ | |
8012 | { 0x18, 0x01a19c20 }, /* rear mic */ | |
8013 | { 0x19, 0x99a3092f }, /* front mic */ | |
8014 | { 0x1b, 0x0201401f }, /* front lineout */ | |
8015 | { } | |
8016 | }, | |
8017 | .chain_id = ALC269_FIXUP_DMIC, | |
8018 | }, | |
e2d2fded KHF |
8019 | [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { |
8020 | .type = HDA_FIXUP_PINS, | |
8021 | .v.pins = (const struct hda_pintbl[]) { | |
8022 | { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
8023 | { } | |
8024 | }, | |
8025 | .chained = true, | |
8026 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
8027 | }, | |
73e7161e WS |
8028 | [ALC256_FIXUP_INTEL_NUC10] = { |
8029 | .type = HDA_FIXUP_PINS, | |
8030 | .v.pins = (const struct hda_pintbl[]) { | |
8031 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
8032 | { } | |
8033 | }, | |
8034 | .chained = true, | |
8035 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
8036 | }, | |
fc19d559 HW |
8037 | [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { |
8038 | .type = HDA_FIXUP_VERBS, | |
8039 | .v.verbs = (const struct hda_verb[]) { | |
8040 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
8041 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
8042 | { } | |
8043 | }, | |
8044 | .chained = true, | |
c84bfedc | 8045 | .chain_id = ALC289_FIXUP_ASUS_GA502 |
fc19d559 | 8046 | }, |
13468bfa HW |
8047 | [ALC274_FIXUP_HP_MIC] = { |
8048 | .type = HDA_FIXUP_VERBS, | |
8049 | .v.verbs = (const struct hda_verb[]) { | |
8050 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
8051 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
8052 | { } | |
8053 | }, | |
8054 | }, | |
8a8de09c KY |
8055 | [ALC274_FIXUP_HP_HEADSET_MIC] = { |
8056 | .type = HDA_FIXUP_FUNC, | |
8057 | .v.func = alc274_fixup_hp_headset_mic, | |
8058 | .chained = true, | |
8059 | .chain_id = ALC274_FIXUP_HP_MIC | |
8060 | }, | |
622464c8 TI |
8061 | [ALC274_FIXUP_HP_ENVY_GPIO] = { |
8062 | .type = HDA_FIXUP_FUNC, | |
8063 | .v.func = alc274_fixup_hp_envy_gpio, | |
8064 | }, | |
ef9ce66f KY |
8065 | [ALC256_FIXUP_ASUS_HPE] = { |
8066 | .type = HDA_FIXUP_VERBS, | |
8067 | .v.verbs = (const struct hda_verb[]) { | |
8068 | /* Set EAPD high */ | |
8069 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, | |
8070 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, | |
8071 | { } | |
8072 | }, | |
8073 | .chained = true, | |
8074 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
8075 | }, | |
446b8185 KY |
8076 | [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = { |
8077 | .type = HDA_FIXUP_FUNC, | |
8078 | .v.func = alc_fixup_headset_jack, | |
8079 | .chained = true, | |
8080 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
8081 | }, | |
a0ccbc53 KY |
8082 | [ALC287_FIXUP_HP_GPIO_LED] = { |
8083 | .type = HDA_FIXUP_FUNC, | |
8084 | .v.func = alc287_fixup_hp_gpio_led, | |
8085 | }, | |
9e885770 KY |
8086 | [ALC256_FIXUP_HP_HEADSET_MIC] = { |
8087 | .type = HDA_FIXUP_FUNC, | |
8088 | .v.func = alc274_fixup_hp_headset_mic, | |
8089 | }, | |
92666d45 KY |
8090 | [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = { |
8091 | .type = HDA_FIXUP_FUNC, | |
8092 | .v.func = alc_fixup_no_int_mic, | |
8093 | .chained = true, | |
8094 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
8095 | }, | |
34cdf405 CC |
8096 | [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = { |
8097 | .type = HDA_FIXUP_PINS, | |
8098 | .v.pins = (const struct hda_pintbl[]) { | |
8099 | { 0x1b, 0x411111f0 }, | |
8100 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
8101 | { }, | |
8102 | }, | |
8103 | .chained = true, | |
8104 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
8105 | }, | |
495dc763 CC |
8106 | [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = { |
8107 | .type = HDA_FIXUP_FUNC, | |
8108 | .v.func = alc269_fixup_limit_int_mic_boost, | |
8109 | .chained = true, | |
8110 | .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, | |
8111 | }, | |
d0e18561 CC |
8112 | [ALC256_FIXUP_ACER_HEADSET_MIC] = { |
8113 | .type = HDA_FIXUP_PINS, | |
8114 | .v.pins = (const struct hda_pintbl[]) { | |
8115 | { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */ | |
8116 | { 0x1a, 0x90a1092f }, /* use as internal mic */ | |
8117 | { } | |
8118 | }, | |
8119 | .chained = true, | |
8120 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
8121 | }, | |
26928ca1 TI |
8122 | [ALC285_FIXUP_IDEAPAD_S740_COEF] = { |
8123 | .type = HDA_FIXUP_FUNC, | |
8124 | .v.func = alc285_fixup_ideapad_s740_coef, | |
8125 | .chained = true, | |
8126 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
8127 | }, | |
bd15b155 KHF |
8128 | [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { |
8129 | .type = HDA_FIXUP_FUNC, | |
8130 | .v.func = alc269_fixup_limit_int_mic_boost, | |
8131 | .chained = true, | |
8132 | .chain_id = ALC285_FIXUP_HP_MUTE_LED, | |
8133 | }, | |
8eedd3a7 TI |
8134 | [ALC295_FIXUP_ASUS_DACS] = { |
8135 | .type = HDA_FIXUP_FUNC, | |
8136 | .v.func = alc295_fixup_asus_dacs, | |
8137 | }, | |
5d84b531 TI |
8138 | [ALC295_FIXUP_HP_OMEN] = { |
8139 | .type = HDA_FIXUP_PINS, | |
8140 | .v.pins = (const struct hda_pintbl[]) { | |
8141 | { 0x12, 0xb7a60130 }, | |
8142 | { 0x13, 0x40000000 }, | |
8143 | { 0x14, 0x411111f0 }, | |
8144 | { 0x16, 0x411111f0 }, | |
8145 | { 0x17, 0x90170110 }, | |
8146 | { 0x18, 0x411111f0 }, | |
8147 | { 0x19, 0x02a11030 }, | |
8148 | { 0x1a, 0x411111f0 }, | |
8149 | { 0x1b, 0x04a19030 }, | |
8150 | { 0x1d, 0x40600001 }, | |
8151 | { 0x1e, 0x411111f0 }, | |
8152 | { 0x21, 0x03211020 }, | |
8153 | {} | |
8154 | }, | |
8155 | .chained = true, | |
8156 | .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED, | |
8157 | }, | |
f2be77fe | 8158 | [ALC285_FIXUP_HP_SPECTRE_X360] = { |
434591b2 ED |
8159 | .type = HDA_FIXUP_FUNC, |
8160 | .v.func = alc285_fixup_hp_spectre_x360, | |
f2be77fe | 8161 | }, |
9ebaef05 HW |
8162 | [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { |
8163 | .type = HDA_FIXUP_FUNC, | |
8164 | .v.func = alc285_fixup_ideapad_s740_coef, | |
8165 | .chained = true, | |
8166 | .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, | |
8167 | }, | |
29c8f40b PU |
8168 | [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = { |
8169 | .type = HDA_FIXUP_FUNC, | |
8170 | .v.func = alc_fixup_no_shutup, | |
8171 | .chained = true, | |
8172 | .chain_id = ALC283_FIXUP_HEADSET_MIC, | |
8173 | }, | |
57c9e21a HW |
8174 | [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = { |
8175 | .type = HDA_FIXUP_PINS, | |
8176 | .v.pins = (const struct hda_pintbl[]) { | |
8177 | { 0x21, 0x03211030 }, /* Change the Headphone location to Left */ | |
8178 | { } | |
8179 | }, | |
8180 | .chained = true, | |
8181 | .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC | |
8182 | }, | |
f1d4e28b KY |
8183 | }; |
8184 | ||
1d045db9 | 8185 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
a6b92b66 | 8186 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
693b613d DH |
8187 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
8188 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), | |
aaedfb47 | 8189 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
7819717b | 8190 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
aaedfb47 DH |
8191 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
8192 | SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), | |
02322ac9 | 8193 | SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
b1e8972e | 8194 | SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
1a22e775 | 8195 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
433f894e | 8196 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
c8426b27 | 8197 | SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF), |
13be30f1 | 8198 | SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK), |
705b65f1 | 8199 | SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6e15d126 | 8200 | SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), |
b9c2fa52 | 8201 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
495dc763 | 8202 | SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), |
c7531e31 CC |
8203 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
8204 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), | |
13be30f1 CC |
8205 | SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK), |
8206 | SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK), | |
e2a829b3 | 8207 | SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), |
8eae7e9b | 8208 | SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), |
781c90c0 | 8209 | SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), |
d0e18561 | 8210 | SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC), |
667a8f73 JHP |
8211 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
8212 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
8213 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
d0e18561 | 8214 | SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC), |
2733cceb | 8215 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
ea5c7eba | 8216 | SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), |
cbc05fd6 | 8217 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), |
f50a121d | 8218 | SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), |
57c9e21a | 8219 | SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), |
aaedfb47 | 8220 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
6ed1131f | 8221 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
86f799b8 | 8222 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
cf52103a | 8223 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
8b99aba7 TI |
8224 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
8225 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), | |
0f4881dc | 8226 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
73bdd597 DH |
8227 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
8228 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
8229 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
0f4881dc DH |
8230 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
8231 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), | |
98070576 | 8232 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
4275554d | 8233 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
0f4881dc | 8234 | SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), |
a22aa26f KY |
8235 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
8236 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
831bfdf9 | 8237 | SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), |
afecb146 | 8238 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
3a05d12f | 8239 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
8b72415d | 8240 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
b734304f KY |
8241 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
8242 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
c04017ea DH |
8243 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
8244 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
8245 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
8246 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
8247 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
fd06c77e | 8248 | SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
3b43b71f | 8249 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), |
c0ca5ece | 8250 | SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), |
709ae62e | 8251 | SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), |
dd9aa335 | 8252 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
493de342 | 8253 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
aa143ad3 | 8254 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
5f364135 | 8255 | SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), |
40e2c4e5 KY |
8256 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
8257 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), | |
f0ba9d69 KY |
8258 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
8259 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | |
ae104a21 | 8260 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
136824ef | 8261 | SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), |
da484d00 | 8262 | SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), |
c2a7c55a | 8263 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
e79c2269 | 8264 | SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
aa143ad3 | 8265 | SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
78def224 KY |
8266 | SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
8267 | SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), | |
92666d45 KY |
8268 | SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), |
8269 | SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), | |
c1e89523 | 8270 | SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), |
a22aa26f KY |
8271 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
8272 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
08fb0d0e | 8273 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
9f5c6faf | 8274 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
8e35cd4a | 8275 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
7976eb49 | 8276 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 8277 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 8278 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
45461e3b TI |
8279 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
8280 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), | |
8281 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8282 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf KY |
8283 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
8284 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
8285 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
8286 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
9c5dc3bf | 8287 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
9c5dc3bf KY |
8288 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
8289 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8290 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8291 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8292 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf | 8293 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
04d5466a | 8294 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
45461e3b | 8295 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
c60666bd | 8296 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
8297 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8298 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8299 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
45461e3b TI |
8300 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8301 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8302 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8303 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8304 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), | |
9c5dc3bf | 8305 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
45461e3b | 8306 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
9c5dc3bf | 8307 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
45461e3b | 8308 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
9c5dc3bf | 8309 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
c60666bd | 8310 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 8311 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 8312 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 8313 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
45461e3b TI |
8314 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8315 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8316 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8317 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8318 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd | 8319 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
8320 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8321 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
45461e3b TI |
8322 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8323 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), | |
8324 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8325 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8a02b164 KY |
8326 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8327 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8328 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8329 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
167897f4 JK |
8330 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
8331 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
1c9d9dfd KY |
8332 | SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC), |
8333 | SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC), | |
563785ed | 8334 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
e549d190 | 8335 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
bbf8ff6b | 8336 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
aeedad25 | 8337 | SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
167897f4 JK |
8338 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
8339 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
56e40eb6 | 8340 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
901be145 | 8341 | SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
190d0381 | 8342 | SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
5d84b531 | 8343 | SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), |
d33cd42d | 8344 | SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
f2be77fe | 8345 | SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), |
b2c22910 | 8346 | SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
622464c8 | 8347 | SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), |
15d295b5 | 8348 | SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
61d3e874 | 8349 | SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
a598098c | 8350 | SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), |
b2c22910 | 8351 | SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), |
75b62ab6 | 8352 | SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), |
56496253 | 8353 | SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
08befca4 | 8354 | SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), |
431e76c3 | 8355 | SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), |
24164f43 | 8356 | SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
91bc1568 JS |
8357 | SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation", |
8358 | ALC285_FIXUP_HP_GPIO_AMP_INIT), | |
8359 | SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", | |
8360 | ALC285_FIXUP_HP_GPIO_AMP_INIT), | |
48422958 | 8361 | SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), |
e7d66cf7 | 8362 | SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
417eadfd | 8363 | SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
a0ccbc53 KY |
8364 | SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), |
8365 | SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), | |
c3bb2b52 | 8366 | SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), |
53b861be | 8367 | SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
c3d2c882 | 8368 | SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
dfb06401 | 8369 | SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
ca688339 | 8370 | SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
50dbfae9 | 8371 | SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
e650c1a9 | 8372 | SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
bbe183e0 | 8373 | SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
600dd2a7 | 8374 | SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), |
0e68c4b1 | 8375 | SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), |
bd15b155 | 8376 | SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), |
c1732ede | 8377 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
7bba2157 | 8378 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
3e0d611b | 8379 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
9cf6533e | 8380 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
c1732ede | 8381 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
4eab0ea1 | 8382 | SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
3e0d611b | 8383 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4eab0ea1 | 8384 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
3cd0ed63 | 8385 | SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
5cfca596 | 8386 | SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), |
4eab0ea1 TI |
8387 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
8388 | SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), | |
c1732ede | 8389 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
3cd0ed63 | 8390 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
c1732ede | 8391 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
2cede303 | 8392 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
23870831 | 8393 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), |
3e0d611b | 8394 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
8eedd3a7 | 8395 | SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), |
48e01504 | 8396 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), |
3cd0ed63 | 8397 | SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), |
8c8967a7 | 8398 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), |
4963d66b | 8399 | SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), |
158ae2f5 | 8400 | SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), |
5de3b943 | 8401 | SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), |
8b33a134 | 8402 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), |
7900e817 | 8403 | SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), |
017f2a10 | 8404 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
28e8af8a | 8405 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
1b94e59d | 8406 | SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), |
693b613d | 8407 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
615966ad | 8408 | SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
4eab0ea1 | 8409 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
c1732ede | 8410 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
ef9ce66f | 8411 | SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), |
4b43d05a | 8412 | SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), |
c1b55029 | 8413 | SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), |
76fae618 | 8414 | SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), |
293a92c1 | 8415 | SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), |
eeed4cd1 | 8416 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
adabb3ec TI |
8417 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
8418 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), | |
8419 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
8420 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
d240d1dc | 8421 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
1d045db9 TI |
8422 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
8423 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
8424 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
e9bd7d5c | 8425 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
cab561f8 TI |
8426 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
8427 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), | |
24519911 | 8428 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
4df3fd17 | 8429 | SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), |
cc7016ab | 8430 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
fdcc968a | 8431 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
c656f747 | 8432 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
2041d564 | 8433 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
b84e8436 | 8434 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
c656f747 | 8435 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
6fa38ef1 | 8436 | SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
ce2e79b2 PH |
8437 | SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
8438 | SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), | |
0fca97a2 | 8439 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
a33cc48d | 8440 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
14425f1f MP |
8441 | SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
8442 | SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), | |
f70fff83 | 8443 | SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
8bcea6cb | 8444 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
823ff161 | 8445 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
568e4e82 | 8446 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
c656f747 | 8447 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
abaa2274 AA |
8448 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
8449 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), | |
8cd65271 | 8450 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
6ca653e3 | 8451 | SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), |
b5acfe15 | 8452 | SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
745f260b | 8453 | SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
b5acfe15 PH |
8454 | SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8455 | SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8456 | SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8457 | SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8458 | SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8459 | SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8460 | SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8461 | SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8462 | SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8463 | SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8464 | SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8465 | SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8466 | SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8467 | SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8468 | SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8469 | SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
1d5cfca2 | 8470 | SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
b5acfe15 | 8471 | SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
1d5cfca2 PH |
8472 | SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8473 | SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
b5acfe15 PH |
8474 | SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8475 | SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8476 | SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8477 | SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8478 | SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
1d5cfca2 PH |
8479 | SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8480 | SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8481 | SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8482 | SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
b5acfe15 PH |
8483 | SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8484 | SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8485 | SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8486 | SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8487 | SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
745f260b WS |
8488 | SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8489 | SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8490 | SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), | |
8491 | SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), | |
8492 | SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), | |
b5acfe15 PH |
8493 | SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8494 | SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8495 | SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8496 | SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8497 | SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8498 | SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8499 | SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
1d5cfca2 | 8500 | SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
b5acfe15 PH |
8501 | SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8502 | SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
745f260b WS |
8503 | SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8504 | SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
1d5cfca2 PH |
8505 | SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8506 | SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8507 | SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8508 | SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8509 | SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8510 | SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
ca169cc2 | 8511 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
29c8f40b | 8512 | SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), |
1d045db9 TI |
8513 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
8514 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), | |
8515 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | |
8516 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), | |
8517 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), | |
f552ff54 | 8518 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
b590b38c | 8519 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), |
c8415a48 | 8520 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
4407be6b | 8521 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
108cc108 | 8522 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
aaedfb47 | 8523 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
9a811230 | 8524 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
1c37c223 | 8525 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
a12137e7 | 8526 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
59a51a6b | 8527 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
6d16941a | 8528 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
7c21539c | 8529 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
a4a9e082 | 8530 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
b6903c0e | 8531 | SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), |
d05ea7da | 8532 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
c0278669 | 8533 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
61fcf8ec KY |
8534 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8535 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
dab38e43 | 8536 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
c636b95e | 8537 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8538 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
8539 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8540 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
e4c07b3b | 8541 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8542 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8543 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8544 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
85981dfd | 8545 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
9774dc21 | 8546 | SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
ca707b3f | 8547 | SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
446b8185 KY |
8548 | SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), |
8549 | SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), | |
3694cb29 | 8550 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
6ef2f68f | 8551 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
f33f79f3 | 8552 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
bef33e19 | 8553 | SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
e41fc8c5 | 8554 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
65811834 | 8555 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
8da5bbfc | 8556 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
2a36c16e | 8557 | SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
8a6c55d0 AM |
8558 | SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
8559 | SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), | |
f86de9b1 | 8560 | SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), |
26928ca1 | 8561 | SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), |
9ebaef05 | 8562 | SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), |
56f27013 | 8563 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
fedb2245 | 8564 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
56df90b6 | 8565 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
f552ff54 | 8566 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
a4a9e082 | 8567 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
1bb3e062 | 8568 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
c497d9f9 | 8569 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
cd5302c0 | 8570 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
f2aa1110 | 8571 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
80b311d3 | 8572 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
09ea9976 | 8573 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
037e1197 | 8574 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
23adc192 | 8575 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
0f087ee3 | 8576 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
9cd25743 | 8577 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
0f087ee3 | 8578 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8579 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8580 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8581 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
cd5302c0 | 8582 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
61fcf8ec KY |
8583 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8584 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
1d045db9 | 8585 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
0fbf21c3 | 8586 | SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), |
f1ec5be1 HC |
8587 | SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), |
8588 | SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), | |
8589 | SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), | |
02b504d9 | 8590 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
c656f747 TI |
8591 | SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
8592 | SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), | |
fc19d559 | 8593 | SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
b95bc12e | 8594 | SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), |
695d1ec3 | 8595 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
e1c86210 | 8596 | SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
d1ee66c5 | 8597 | SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), |
e2d2fded | 8598 | SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), |
73e7161e | 8599 | SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), |
a4297b5d | 8600 | |
a7f3eedc | 8601 | #if 0 |
a4297b5d TI |
8602 | /* Below is a quirk table taken from the old code. |
8603 | * Basically the device should work as is without the fixup table. | |
8604 | * If BIOS doesn't give a proper info, enable the corresponding | |
8605 | * fixup entry. | |
7d7eb9ea | 8606 | */ |
a4297b5d TI |
8607 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
8608 | ALC269_FIXUP_AMIC), | |
8609 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), | |
a4297b5d TI |
8610 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
8611 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), | |
8612 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), | |
8613 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), | |
8614 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), | |
8615 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), | |
8616 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), | |
8617 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), | |
8618 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), | |
8619 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), | |
8620 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), | |
8621 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), | |
8622 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), | |
8623 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), | |
8624 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), | |
8625 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), | |
8626 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), | |
8627 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), | |
8628 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), | |
8629 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), | |
8630 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), | |
8631 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), | |
8632 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), | |
8633 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), | |
8634 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), | |
8635 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), | |
8636 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), | |
8637 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), | |
8638 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), | |
8639 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), | |
8640 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), | |
8641 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), | |
8642 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), | |
8643 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), | |
8644 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), | |
8645 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), | |
8646 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), | |
8647 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), | |
8648 | #endif | |
8649 | {} | |
8650 | }; | |
8651 | ||
214eef76 DH |
8652 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
8653 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), | |
8654 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), | |
8655 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | |
8656 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), | |
0fbf21c3 | 8657 | SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), |
214eef76 DH |
8658 | {} |
8659 | }; | |
8660 | ||
1727a771 | 8661 | static const struct hda_model_fixup alc269_fixup_models[] = { |
a4297b5d TI |
8662 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
8663 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, | |
6e72aa5f TI |
8664 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
8665 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, | |
8666 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, | |
7c478f03 | 8667 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
b016951e TI |
8668 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
8669 | {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, | |
108cc108 | 8670 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
b590b38c | 8671 | {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, |
9f5c6faf | 8672 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
04d5466a | 8673 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, |
e32aa85a DH |
8674 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
8675 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, | |
a26d96c7 TI |
8676 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
8677 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, | |
be8ef16a | 8678 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
0202e99c | 8679 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
1c37c223 | 8680 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
9a811230 | 8681 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
c636b95e | 8682 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
399c01aa | 8683 | {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, |
a26d96c7 | 8684 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
ba90d6a6 | 8685 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
28d1d6d2 | 8686 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
a26d96c7 TI |
8687 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
8688 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, | |
8689 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, | |
8690 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, | |
8691 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, | |
8692 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, | |
8693 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, | |
8694 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, | |
8695 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, | |
8696 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, | |
8697 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, | |
8698 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, | |
8699 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, | |
8700 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, | |
8701 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, | |
8702 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, | |
8703 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, | |
8704 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, | |
8705 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, | |
8706 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, | |
8707 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, | |
8708 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, | |
8709 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, | |
8710 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, | |
8711 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, | |
8712 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, | |
8713 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, | |
8714 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, | |
8715 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, | |
8716 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, | |
8717 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, | |
8718 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, | |
8719 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, | |
8720 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, | |
8721 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, | |
8722 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, | |
8723 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, | |
8724 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, | |
8725 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, | |
8726 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, | |
b3802783 | 8727 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
a26d96c7 | 8728 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
c8426b27 | 8729 | {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"}, |
a26d96c7 TI |
8730 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
8731 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, | |
8732 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, | |
8733 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, | |
8734 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, | |
8735 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, | |
8736 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, | |
8737 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, | |
8738 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, | |
8739 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, | |
8740 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, | |
8741 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, | |
8742 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, | |
8743 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, | |
a26d96c7 TI |
8744 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
8745 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, | |
8746 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, | |
82aa0d7e | 8747 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
a26d96c7 | 8748 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
d2cd795c | 8749 | {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, |
a26d96c7 TI |
8750 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
8751 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, | |
8752 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, | |
8753 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, | |
8754 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, | |
8755 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, | |
8756 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, | |
8757 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, | |
8758 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, | |
8759 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, | |
8760 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, | |
8761 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, | |
8762 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, | |
8763 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, | |
8764 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, | |
8765 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, | |
8766 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, | |
8983eb60 KY |
8767 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
8768 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, | |
e2a829b3 | 8769 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
a2ef03fe | 8770 | {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, |
bd9c10bc | 8771 | {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, |
23dc9586 | 8772 | {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, |
fc19d559 | 8773 | {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, |
13468bfa | 8774 | {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, |
c3bb2b52 | 8775 | {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, |
5d84b531 | 8776 | {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, |
f2be77fe | 8777 | {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, |
9ebaef05 | 8778 | {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, |
29c8f40b | 8779 | {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, |
57c9e21a | 8780 | {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, |
1d045db9 | 8781 | {} |
6dda9f4a | 8782 | }; |
cfc5a845 | 8783 | #define ALC225_STANDARD_PINS \ |
cfc5a845 | 8784 | {0x21, 0x04211020} |
6dda9f4a | 8785 | |
e8191a8e HW |
8786 | #define ALC256_STANDARD_PINS \ |
8787 | {0x12, 0x90a60140}, \ | |
8788 | {0x14, 0x90170110}, \ | |
e8191a8e HW |
8789 | {0x21, 0x02211020} |
8790 | ||
fea185e2 | 8791 | #define ALC282_STANDARD_PINS \ |
11580297 | 8792 | {0x14, 0x90170110} |
e1e62b98 | 8793 | |
fea185e2 | 8794 | #define ALC290_STANDARD_PINS \ |
11580297 | 8795 | {0x12, 0x99a30130} |
fea185e2 DH |
8796 | |
8797 | #define ALC292_STANDARD_PINS \ | |
8798 | {0x14, 0x90170110}, \ | |
11580297 | 8799 | {0x15, 0x0221401f} |
977e6276 | 8800 | |
3f640970 HW |
8801 | #define ALC295_STANDARD_PINS \ |
8802 | {0x12, 0xb7a60130}, \ | |
8803 | {0x14, 0x90170110}, \ | |
3f640970 HW |
8804 | {0x21, 0x04211020} |
8805 | ||
703867e2 WS |
8806 | #define ALC298_STANDARD_PINS \ |
8807 | {0x12, 0x90a60130}, \ | |
8808 | {0x21, 0x03211020} | |
8809 | ||
e1918938 | 8810 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
8a328ac1 KY |
8811 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
8812 | {0x14, 0x01014020}, | |
8813 | {0x17, 0x90170110}, | |
8814 | {0x18, 0x02a11030}, | |
8815 | {0x19, 0x0181303F}, | |
8816 | {0x21, 0x0221102f}), | |
5824ce8d CC |
8817 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
8818 | {0x12, 0x90a601c0}, | |
8819 | {0x14, 0x90171120}, | |
8820 | {0x21, 0x02211030}), | |
615966ad CC |
8821 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
8822 | {0x14, 0x90170110}, | |
8823 | {0x1b, 0x90a70130}, | |
8824 | {0x21, 0x03211020}), | |
8825 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, | |
8826 | {0x1a, 0x90a70130}, | |
8827 | {0x1b, 0x90170110}, | |
8828 | {0x21, 0x03211020}), | |
2ae95577 | 8829 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 8830 | ALC225_STANDARD_PINS, |
8a132099 | 8831 | {0x12, 0xb7a60130}, |
cfc5a845 | 8832 | {0x14, 0x901701a0}), |
2ae95577 | 8833 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 8834 | ALC225_STANDARD_PINS, |
8a132099 | 8835 | {0x12, 0xb7a60130}, |
cfc5a845 | 8836 | {0x14, 0x901701b0}), |
8a132099 HW |
8837 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
8838 | ALC225_STANDARD_PINS, | |
8839 | {0x12, 0xb7a60150}, | |
8840 | {0x14, 0x901701a0}), | |
8841 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8842 | ALC225_STANDARD_PINS, | |
8843 | {0x12, 0xb7a60150}, | |
8844 | {0x14, 0x901701b0}), | |
8845 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8846 | ALC225_STANDARD_PINS, | |
8847 | {0x12, 0xb7a60130}, | |
8848 | {0x1b, 0x90170110}), | |
0ce48e17 KHF |
8849 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
8850 | {0x1b, 0x01111010}, | |
8851 | {0x1e, 0x01451130}, | |
8852 | {0x21, 0x02211020}), | |
986376b6 HW |
8853 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
8854 | {0x12, 0x90a60140}, | |
8855 | {0x14, 0x90170110}, | |
8856 | {0x19, 0x02a11030}, | |
8857 | {0x21, 0x02211020}), | |
e41fc8c5 HW |
8858 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
8859 | {0x14, 0x90170110}, | |
8860 | {0x19, 0x02a11030}, | |
8861 | {0x1a, 0x02a11040}, | |
8862 | {0x1b, 0x01014020}, | |
8863 | {0x21, 0x0221101f}), | |
d06fb562 HW |
8864 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
8865 | {0x14, 0x90170110}, | |
8866 | {0x19, 0x02a11030}, | |
8867 | {0x1a, 0x02a11040}, | |
8868 | {0x1b, 0x01011020}, | |
8869 | {0x21, 0x0221101f}), | |
c6b17f10 HW |
8870 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
8871 | {0x14, 0x90170110}, | |
8872 | {0x19, 0x02a11020}, | |
8873 | {0x1a, 0x02a11030}, | |
8874 | {0x21, 0x0221101f}), | |
92666d45 KY |
8875 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
8876 | {0x21, 0x02211010}), | |
9e885770 KY |
8877 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
8878 | {0x14, 0x90170110}, | |
8879 | {0x19, 0x02a11020}, | |
8880 | {0x21, 0x02211030}), | |
c77900e6 | 8881 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
c77900e6 | 8882 | {0x14, 0x90170110}, |
c77900e6 | 8883 | {0x21, 0x02211020}), |
86c72d1c HW |
8884 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8885 | {0x14, 0x90170130}, | |
8886 | {0x21, 0x02211040}), | |
76c2132e DH |
8887 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8888 | {0x12, 0x90a60140}, | |
8889 | {0x14, 0x90170110}, | |
76c2132e DH |
8890 | {0x21, 0x02211020}), |
8891 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8892 | {0x12, 0x90a60160}, | |
8893 | {0x14, 0x90170120}, | |
76c2132e | 8894 | {0x21, 0x02211030}), |
392c9da2 HW |
8895 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8896 | {0x14, 0x90170110}, | |
8897 | {0x1b, 0x02011020}, | |
8898 | {0x21, 0x0221101f}), | |
6aecd871 HW |
8899 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8900 | {0x14, 0x90170110}, | |
8901 | {0x1b, 0x01011020}, | |
8902 | {0x21, 0x0221101f}), | |
cba59972 | 8903 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
cba59972 | 8904 | {0x14, 0x90170130}, |
cba59972 | 8905 | {0x1b, 0x01014020}, |
cba59972 | 8906 | {0x21, 0x0221103f}), |
6aecd871 HW |
8907 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8908 | {0x14, 0x90170130}, | |
8909 | {0x1b, 0x01011020}, | |
8910 | {0x21, 0x0221103f}), | |
59ec4b57 HW |
8911 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8912 | {0x14, 0x90170130}, | |
8913 | {0x1b, 0x02011020}, | |
8914 | {0x21, 0x0221103f}), | |
e9c28e16 | 8915 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
e9c28e16 | 8916 | {0x14, 0x90170150}, |
e9c28e16 | 8917 | {0x1b, 0x02011020}, |
e9c28e16 WS |
8918 | {0x21, 0x0221105f}), |
8919 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
e9c28e16 | 8920 | {0x14, 0x90170110}, |
e9c28e16 | 8921 | {0x1b, 0x01014020}, |
e9c28e16 | 8922 | {0x21, 0x0221101f}), |
76c2132e DH |
8923 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8924 | {0x12, 0x90a60160}, | |
8925 | {0x14, 0x90170120}, | |
8926 | {0x17, 0x90170140}, | |
76c2132e DH |
8927 | {0x21, 0x0321102f}), |
8928 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8929 | {0x12, 0x90a60160}, | |
8930 | {0x14, 0x90170130}, | |
76c2132e DH |
8931 | {0x21, 0x02211040}), |
8932 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8933 | {0x12, 0x90a60160}, | |
8934 | {0x14, 0x90170140}, | |
76c2132e DH |
8935 | {0x21, 0x02211050}), |
8936 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8937 | {0x12, 0x90a60170}, | |
8938 | {0x14, 0x90170120}, | |
76c2132e DH |
8939 | {0x21, 0x02211030}), |
8940 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
8941 | {0x12, 0x90a60170}, | |
8942 | {0x14, 0x90170130}, | |
76c2132e | 8943 | {0x21, 0x02211040}), |
0a1f90a9 HW |
8944 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8945 | {0x12, 0x90a60170}, | |
8946 | {0x14, 0x90171130}, | |
8947 | {0x21, 0x02211040}), | |
70658b99 | 8948 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
70658b99 HW |
8949 | {0x12, 0x90a60170}, |
8950 | {0x14, 0x90170140}, | |
70658b99 | 8951 | {0x21, 0x02211050}), |
9b5a4e39 | 8952 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9b5a4e39 DH |
8953 | {0x12, 0x90a60180}, |
8954 | {0x14, 0x90170130}, | |
9b5a4e39 | 8955 | {0x21, 0x02211040}), |
f90d83b3 AK |
8956 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8957 | {0x12, 0x90a60180}, | |
8958 | {0x14, 0x90170120}, | |
8959 | {0x21, 0x02211030}), | |
989dbe4a HW |
8960 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
8961 | {0x1b, 0x01011020}, | |
8962 | {0x21, 0x02211010}), | |
c1732ede CC |
8963 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
8964 | {0x14, 0x90170110}, | |
8965 | {0x1b, 0x90a70130}, | |
8966 | {0x21, 0x04211020}), | |
8967 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, | |
8968 | {0x14, 0x90170110}, | |
8969 | {0x1b, 0x90a70130}, | |
8970 | {0x21, 0x03211020}), | |
a806ef1c CC |
8971 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
8972 | {0x12, 0x90a60130}, | |
8973 | {0x14, 0x90170110}, | |
8974 | {0x21, 0x03211020}), | |
6ac371aa JHP |
8975 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
8976 | {0x12, 0x90a60130}, | |
8977 | {0x14, 0x90170110}, | |
8978 | {0x21, 0x04211020}), | |
e1037354 JHP |
8979 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
8980 | {0x1a, 0x90a70130}, | |
8981 | {0x1b, 0x90170110}, | |
8982 | {0x21, 0x03211020}), | |
9e885770 KY |
8983 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
8984 | {0x14, 0x90170110}, | |
8985 | {0x19, 0x02a11020}, | |
8986 | {0x21, 0x0221101f}), | |
8a8de09c KY |
8987 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, |
8988 | {0x17, 0x90170110}, | |
8989 | {0x19, 0x03a11030}, | |
8990 | {0x21, 0x03211020}), | |
cf51eb9d DH |
8991 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
8992 | {0x12, 0x90a60130}, | |
cf51eb9d DH |
8993 | {0x14, 0x90170110}, |
8994 | {0x15, 0x0421101f}, | |
11580297 | 8995 | {0x1a, 0x04a11020}), |
0279661b HW |
8996 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
8997 | {0x12, 0x90a60140}, | |
0279661b HW |
8998 | {0x14, 0x90170110}, |
8999 | {0x15, 0x0421101f}, | |
0279661b | 9000 | {0x18, 0x02811030}, |
0279661b | 9001 | {0x1a, 0x04a1103f}, |
11580297 | 9002 | {0x1b, 0x02011020}), |
42304474 | 9003 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9004 | ALC282_STANDARD_PINS, |
42304474 | 9005 | {0x12, 0x99a30130}, |
42304474 | 9006 | {0x19, 0x03a11020}, |
42304474 | 9007 | {0x21, 0x0321101f}), |
2c609999 | 9008 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9009 | ALC282_STANDARD_PINS, |
2c609999 | 9010 | {0x12, 0x99a30130}, |
2c609999 | 9011 | {0x19, 0x03a11020}, |
2c609999 HW |
9012 | {0x21, 0x03211040}), |
9013 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 9014 | ALC282_STANDARD_PINS, |
2c609999 | 9015 | {0x12, 0x99a30130}, |
2c609999 | 9016 | {0x19, 0x03a11030}, |
2c609999 HW |
9017 | {0x21, 0x03211020}), |
9018 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 9019 | ALC282_STANDARD_PINS, |
2c609999 | 9020 | {0x12, 0x99a30130}, |
2c609999 | 9021 | {0x19, 0x04a11020}, |
2c609999 | 9022 | {0x21, 0x0421101f}), |
200afc09 | 9023 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, |
aec856d0 | 9024 | ALC282_STANDARD_PINS, |
200afc09 | 9025 | {0x12, 0x90a60140}, |
200afc09 | 9026 | {0x19, 0x04a11030}, |
200afc09 | 9027 | {0x21, 0x04211020}), |
34cdf405 CC |
9028 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
9029 | ALC282_STANDARD_PINS, | |
9030 | {0x12, 0x90a609c0}, | |
9031 | {0x18, 0x03a11830}, | |
9032 | {0x19, 0x04a19831}, | |
9033 | {0x1a, 0x0481303f}, | |
9034 | {0x1b, 0x04211020}, | |
9035 | {0x21, 0x0321101f}), | |
9036 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, | |
9037 | ALC282_STANDARD_PINS, | |
9038 | {0x12, 0x90a60940}, | |
9039 | {0x18, 0x03a11830}, | |
9040 | {0x19, 0x04a19831}, | |
9041 | {0x1a, 0x0481303f}, | |
9042 | {0x1b, 0x04211020}, | |
9043 | {0x21, 0x0321101f}), | |
76c2132e | 9044 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9045 | ALC282_STANDARD_PINS, |
76c2132e | 9046 | {0x12, 0x90a60130}, |
76c2132e DH |
9047 | {0x21, 0x0321101f}), |
9048 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9049 | {0x12, 0x90a60160}, | |
9050 | {0x14, 0x90170120}, | |
76c2132e | 9051 | {0x21, 0x02211030}), |
bc262179 | 9052 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9053 | ALC282_STANDARD_PINS, |
bc262179 | 9054 | {0x12, 0x90a60130}, |
bc262179 | 9055 | {0x19, 0x03a11020}, |
bc262179 | 9056 | {0x21, 0x0321101f}), |
c8c6ee61 | 9057 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
266fd994 SL |
9058 | {0x12, 0x90a60130}, |
9059 | {0x14, 0x90170110}, | |
9060 | {0x19, 0x04a11040}, | |
9061 | {0x21, 0x04211020}), | |
9062 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, | |
9063 | {0x14, 0x90170110}, | |
9064 | {0x19, 0x04a11040}, | |
9065 | {0x1d, 0x40600001}, | |
9066 | {0x21, 0x04211020}), | |
9067 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, | |
c4cfcf6f HW |
9068 | {0x14, 0x90170110}, |
9069 | {0x19, 0x04a11040}, | |
9070 | {0x21, 0x04211020}), | |
c72b9bfe HW |
9071 | SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
9072 | {0x14, 0x90170110}, | |
9073 | {0x17, 0x90170111}, | |
9074 | {0x19, 0x03a11030}, | |
9075 | {0x21, 0x03211020}), | |
33aaebd4 CC |
9076 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
9077 | {0x12, 0x90a60130}, | |
9078 | {0x17, 0x90170110}, | |
9079 | {0x21, 0x02211020}), | |
d44a6864 | 9080 | SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
e1e62b98 | 9081 | {0x12, 0x90a60120}, |
e1e62b98 | 9082 | {0x14, 0x90170110}, |
e1e62b98 | 9083 | {0x21, 0x0321101f}), |
e4442bcf | 9084 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9085 | ALC290_STANDARD_PINS, |
e4442bcf | 9086 | {0x15, 0x04211040}, |
e4442bcf | 9087 | {0x18, 0x90170112}, |
11580297 | 9088 | {0x1a, 0x04a11020}), |
e4442bcf | 9089 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9090 | ALC290_STANDARD_PINS, |
e4442bcf | 9091 | {0x15, 0x04211040}, |
e4442bcf | 9092 | {0x18, 0x90170110}, |
11580297 | 9093 | {0x1a, 0x04a11020}), |
e4442bcf | 9094 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9095 | ALC290_STANDARD_PINS, |
e4442bcf | 9096 | {0x15, 0x0421101f}, |
11580297 | 9097 | {0x1a, 0x04a11020}), |
e4442bcf | 9098 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9099 | ALC290_STANDARD_PINS, |
e4442bcf | 9100 | {0x15, 0x04211020}, |
11580297 | 9101 | {0x1a, 0x04a11040}), |
e4442bcf | 9102 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9103 | ALC290_STANDARD_PINS, |
e4442bcf HW |
9104 | {0x14, 0x90170110}, |
9105 | {0x15, 0x04211020}, | |
11580297 | 9106 | {0x1a, 0x04a11040}), |
e4442bcf | 9107 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9108 | ALC290_STANDARD_PINS, |
e4442bcf HW |
9109 | {0x14, 0x90170110}, |
9110 | {0x15, 0x04211020}, | |
11580297 | 9111 | {0x1a, 0x04a11020}), |
e4442bcf | 9112 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9113 | ALC290_STANDARD_PINS, |
e4442bcf HW |
9114 | {0x14, 0x90170110}, |
9115 | {0x15, 0x0421101f}, | |
11580297 | 9116 | {0x1a, 0x04a11020}), |
e8818fa8 | 9117 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 9118 | ALC292_STANDARD_PINS, |
e8818fa8 | 9119 | {0x12, 0x90a60140}, |
e8818fa8 | 9120 | {0x16, 0x01014020}, |
11580297 | 9121 | {0x19, 0x01a19030}), |
e8818fa8 | 9122 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 9123 | ALC292_STANDARD_PINS, |
e8818fa8 | 9124 | {0x12, 0x90a60140}, |
e8818fa8 HW |
9125 | {0x16, 0x01014020}, |
9126 | {0x18, 0x02a19031}, | |
11580297 | 9127 | {0x19, 0x01a1903e}), |
76c2132e | 9128 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
aec856d0 | 9129 | ALC292_STANDARD_PINS, |
11580297 | 9130 | {0x12, 0x90a60140}), |
76c2132e | 9131 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9132 | ALC292_STANDARD_PINS, |
76c2132e | 9133 | {0x13, 0x90a60140}, |
76c2132e | 9134 | {0x16, 0x21014020}, |
11580297 | 9135 | {0x19, 0x21a19030}), |
e03fdbde | 9136 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9137 | ALC292_STANDARD_PINS, |
11580297 | 9138 | {0x13, 0x90a60140}), |
eeacd80f JHP |
9139 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE, |
9140 | {0x17, 0x90170110}, | |
9141 | {0x21, 0x04211020}), | |
d8ae458e CC |
9142 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
9143 | {0x14, 0x90170110}, | |
9144 | {0x1b, 0x90a70130}, | |
9145 | {0x21, 0x04211020}), | |
8bb37a2a JHP |
9146 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
9147 | {0x12, 0x90a60130}, | |
9148 | {0x17, 0x90170110}, | |
9149 | {0x21, 0x03211020}), | |
0bea4cc8 JHP |
9150 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
9151 | {0x12, 0x90a60130}, | |
9152 | {0x17, 0x90170110}, | |
9153 | {0x21, 0x04211020}), | |
3887c26c TI |
9154 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
9155 | {0x12, 0x90a60130}, | |
9156 | {0x17, 0x90170110}, | |
9157 | {0x21, 0x03211020}), | |
9e43342b | 9158 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
ad97d667 JHP |
9159 | {0x12, 0x90a60120}, |
9160 | {0x17, 0x90170110}, | |
9161 | {0x21, 0x04211030}), | |
9162 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, | |
9e43342b CC |
9163 | {0x12, 0x90a60130}, |
9164 | {0x17, 0x90170110}, | |
9165 | {0x21, 0x03211020}), | |
9166 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, | |
9167 | {0x12, 0x90a60130}, | |
9168 | {0x17, 0x90170110}, | |
9169 | {0x21, 0x03211020}), | |
fbc57129 | 9170 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
0a29c57b KY |
9171 | {0x14, 0x90170110}, |
9172 | {0x21, 0x04211020}), | |
fbc57129 KY |
9173 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
9174 | {0x14, 0x90170110}, | |
9175 | {0x21, 0x04211030}), | |
3f640970 | 9176 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
f771d5bb HW |
9177 | ALC295_STANDARD_PINS, |
9178 | {0x17, 0x21014020}, | |
9179 | {0x18, 0x21a19030}), | |
9180 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9181 | ALC295_STANDARD_PINS, | |
9182 | {0x17, 0x21014040}, | |
9183 | {0x18, 0x21a19050}), | |
3f307834 HW |
9184 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
9185 | ALC295_STANDARD_PINS), | |
9f502ff5 TI |
9186 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
9187 | ALC298_STANDARD_PINS, | |
9188 | {0x17, 0x90170110}), | |
977e6276 | 9189 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
703867e2 WS |
9190 | ALC298_STANDARD_PINS, |
9191 | {0x17, 0x90170140}), | |
9192 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9193 | ALC298_STANDARD_PINS, | |
9f502ff5 | 9194 | {0x17, 0x90170150}), |
9f1bc2c4 KHF |
9195 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
9196 | {0x12, 0xb7a60140}, | |
9197 | {0x13, 0xb7a60150}, | |
9198 | {0x17, 0x90170110}, | |
9199 | {0x1a, 0x03011020}, | |
9200 | {0x21, 0x03211030}), | |
54324221 JM |
9201 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
9202 | {0x12, 0xb7a60140}, | |
9203 | {0x17, 0x90170110}, | |
9204 | {0x1a, 0x03a11030}, | |
9205 | {0x21, 0x03211020}), | |
fcc6c877 KY |
9206 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
9207 | ALC225_STANDARD_PINS, | |
9208 | {0x12, 0xb7a60130}, | |
fcc6c877 | 9209 | {0x17, 0x90170110}), |
573fcbfd HW |
9210 | SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, |
9211 | {0x14, 0x01014010}, | |
9212 | {0x17, 0x90170120}, | |
9213 | {0x18, 0x02a11030}, | |
9214 | {0x19, 0x02a1103f}, | |
9215 | {0x21, 0x0221101f}), | |
e1918938 HW |
9216 | {} |
9217 | }; | |
6dda9f4a | 9218 | |
7c0a6939 HW |
9219 | /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match |
9220 | * more machines, don't need to match all valid pins, just need to match | |
9221 | * all the pins defined in the tbl. Just because of this reason, it is possible | |
9222 | * that a single machine matches multiple tbls, so there is one limitation: | |
9223 | * at most one tbl is allowed to define for the same vendor and same codec | |
9224 | */ | |
9225 | static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { | |
9226 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, | |
9227 | {0x19, 0x40000000}, | |
9228 | {0x1b, 0x40000000}), | |
aed8c7f4 HW |
9229 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9230 | {0x19, 0x40000000}, | |
9231 | {0x1a, 0x40000000}), | |
d64ebdbf HW |
9232 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9233 | {0x19, 0x40000000}, | |
9234 | {0x1a, 0x40000000}), | |
5815bdfd HW |
9235 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
9236 | {0x19, 0x40000000}, | |
9237 | {0x1a, 0x40000000}), | |
7c0a6939 HW |
9238 | {} |
9239 | }; | |
9240 | ||
546bb678 | 9241 | static void alc269_fill_coef(struct hda_codec *codec) |
1d045db9 | 9242 | { |
526af6eb | 9243 | struct alc_spec *spec = codec->spec; |
1d045db9 | 9244 | int val; |
ebb83eeb | 9245 | |
526af6eb | 9246 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
546bb678 | 9247 | return; |
526af6eb | 9248 | |
1bb7e43e | 9249 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
1d045db9 TI |
9250 | alc_write_coef_idx(codec, 0xf, 0x960b); |
9251 | alc_write_coef_idx(codec, 0xe, 0x8817); | |
9252 | } | |
ebb83eeb | 9253 | |
1bb7e43e | 9254 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
1d045db9 TI |
9255 | alc_write_coef_idx(codec, 0xf, 0x960b); |
9256 | alc_write_coef_idx(codec, 0xe, 0x8814); | |
9257 | } | |
ebb83eeb | 9258 | |
1bb7e43e | 9259 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 | 9260 | /* Power up output pin */ |
98b24883 | 9261 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
1d045db9 | 9262 | } |
ebb83eeb | 9263 | |
1bb7e43e | 9264 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 | 9265 | val = alc_read_coef_idx(codec, 0xd); |
f3ee07d8 | 9266 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
1d045db9 TI |
9267 | /* Capless ramp up clock control */ |
9268 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); | |
9269 | } | |
9270 | val = alc_read_coef_idx(codec, 0x17); | |
f3ee07d8 | 9271 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
1d045db9 TI |
9272 | /* Class D power on reset */ |
9273 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); | |
9274 | } | |
9275 | } | |
ebb83eeb | 9276 | |
98b24883 TI |
9277 | /* HP */ |
9278 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); | |
1d045db9 | 9279 | } |
a7f2371f | 9280 | |
1d045db9 TI |
9281 | /* |
9282 | */ | |
1d045db9 TI |
9283 | static int patch_alc269(struct hda_codec *codec) |
9284 | { | |
9285 | struct alc_spec *spec; | |
3de95173 | 9286 | int err; |
f1d4e28b | 9287 | |
3de95173 | 9288 | err = alc_alloc_spec(codec, 0x0b); |
e16fb6d1 | 9289 | if (err < 0) |
3de95173 TI |
9290 | return err; |
9291 | ||
9292 | spec = codec->spec; | |
08c189f2 | 9293 | spec->gen.shared_mic_vref_pin = 0x18; |
317d9313 | 9294 | codec->power_save_node = 0; |
e16fb6d1 | 9295 | |
225068ab TI |
9296 | #ifdef CONFIG_PM |
9297 | codec->patch_ops.suspend = alc269_suspend; | |
9298 | codec->patch_ops.resume = alc269_resume; | |
9299 | #endif | |
c2d6af53 KY |
9300 | spec->shutup = alc_default_shutup; |
9301 | spec->init_hook = alc_default_init; | |
225068ab | 9302 | |
7639a06c | 9303 | switch (codec->core.vendor_id) { |
065380f0 | 9304 | case 0x10ec0269: |
1d045db9 | 9305 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
1bb7e43e TI |
9306 | switch (alc_get_coef0(codec) & 0x00f0) { |
9307 | case 0x0010: | |
5100cd07 TI |
9308 | if (codec->bus->pci && |
9309 | codec->bus->pci->subsystem_vendor == 0x1025 && | |
e16fb6d1 | 9310 | spec->cdefine.platform_type == 1) |
20ca0c35 | 9311 | err = alc_codec_rename(codec, "ALC271X"); |
1d045db9 | 9312 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
1bb7e43e TI |
9313 | break; |
9314 | case 0x0020: | |
5100cd07 TI |
9315 | if (codec->bus->pci && |
9316 | codec->bus->pci->subsystem_vendor == 0x17aa && | |
e16fb6d1 | 9317 | codec->bus->pci->subsystem_device == 0x21f3) |
20ca0c35 | 9318 | err = alc_codec_rename(codec, "ALC3202"); |
1d045db9 | 9319 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
1bb7e43e | 9320 | break; |
adcc70b2 KY |
9321 | case 0x0030: |
9322 | spec->codec_variant = ALC269_TYPE_ALC269VD; | |
9323 | break; | |
1bb7e43e | 9324 | default: |
1d045db9 | 9325 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
1bb7e43e | 9326 | } |
e16fb6d1 TI |
9327 | if (err < 0) |
9328 | goto error; | |
c2d6af53 | 9329 | spec->shutup = alc269_shutup; |
546bb678 | 9330 | spec->init_hook = alc269_fill_coef; |
1d045db9 | 9331 | alc269_fill_coef(codec); |
065380f0 KY |
9332 | break; |
9333 | ||
9334 | case 0x10ec0280: | |
9335 | case 0x10ec0290: | |
9336 | spec->codec_variant = ALC269_TYPE_ALC280; | |
9337 | break; | |
9338 | case 0x10ec0282: | |
065380f0 | 9339 | spec->codec_variant = ALC269_TYPE_ALC282; |
7b5c7a02 KY |
9340 | spec->shutup = alc282_shutup; |
9341 | spec->init_hook = alc282_init; | |
065380f0 | 9342 | break; |
2af02be7 KY |
9343 | case 0x10ec0233: |
9344 | case 0x10ec0283: | |
9345 | spec->codec_variant = ALC269_TYPE_ALC283; | |
9346 | spec->shutup = alc283_shutup; | |
9347 | spec->init_hook = alc283_init; | |
9348 | break; | |
065380f0 KY |
9349 | case 0x10ec0284: |
9350 | case 0x10ec0292: | |
9351 | spec->codec_variant = ALC269_TYPE_ALC284; | |
9352 | break; | |
161ebf29 | 9353 | case 0x10ec0293: |
4731d5de | 9354 | spec->codec_variant = ALC269_TYPE_ALC293; |
161ebf29 | 9355 | break; |
7fc7d047 | 9356 | case 0x10ec0286: |
7c665932 | 9357 | case 0x10ec0288: |
7fc7d047 KY |
9358 | spec->codec_variant = ALC269_TYPE_ALC286; |
9359 | break; | |
506b62c3 KY |
9360 | case 0x10ec0298: |
9361 | spec->codec_variant = ALC269_TYPE_ALC298; | |
9362 | break; | |
ea04a1db | 9363 | case 0x10ec0235: |
1d04c9de KY |
9364 | case 0x10ec0255: |
9365 | spec->codec_variant = ALC269_TYPE_ALC255; | |
ab3b8e51 KY |
9366 | spec->shutup = alc256_shutup; |
9367 | spec->init_hook = alc256_init; | |
1d04c9de | 9368 | break; |
1948fc06 | 9369 | case 0x10ec0230: |
736f20a7 | 9370 | case 0x10ec0236: |
4344aec8 KY |
9371 | case 0x10ec0256: |
9372 | spec->codec_variant = ALC269_TYPE_ALC256; | |
4a219ef8 KY |
9373 | spec->shutup = alc256_shutup; |
9374 | spec->init_hook = alc256_init; | |
7d1b6e29 | 9375 | spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ |
4344aec8 | 9376 | break; |
f429e7e4 KY |
9377 | case 0x10ec0257: |
9378 | spec->codec_variant = ALC269_TYPE_ALC257; | |
88d42b2b KY |
9379 | spec->shutup = alc256_shutup; |
9380 | spec->init_hook = alc256_init; | |
f429e7e4 KY |
9381 | spec->gen.mixer_nid = 0; |
9382 | break; | |
0a6f0600 | 9383 | case 0x10ec0215: |
7fbdcd83 | 9384 | case 0x10ec0245: |
0a6f0600 | 9385 | case 0x10ec0285: |
630e3612 | 9386 | case 0x10ec0287: |
0a6f0600 KY |
9387 | case 0x10ec0289: |
9388 | spec->codec_variant = ALC269_TYPE_ALC215; | |
1b6832be KY |
9389 | spec->shutup = alc225_shutup; |
9390 | spec->init_hook = alc225_init; | |
0a6f0600 KY |
9391 | spec->gen.mixer_nid = 0; |
9392 | break; | |
4231430d | 9393 | case 0x10ec0225: |
7d727869 | 9394 | case 0x10ec0295: |
28f1f9b2 | 9395 | case 0x10ec0299: |
4231430d | 9396 | spec->codec_variant = ALC269_TYPE_ALC225; |
da911b1f KY |
9397 | spec->shutup = alc225_shutup; |
9398 | spec->init_hook = alc225_init; | |
c1350bff | 9399 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
4231430d | 9400 | break; |
dcd4f0db KY |
9401 | case 0x10ec0234: |
9402 | case 0x10ec0274: | |
9403 | case 0x10ec0294: | |
9404 | spec->codec_variant = ALC269_TYPE_ALC294; | |
532a7784 | 9405 | spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ |
71683c32 | 9406 | alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ |
693abe11 | 9407 | spec->init_hook = alc294_init; |
dcd4f0db | 9408 | break; |
1078bef0 KY |
9409 | case 0x10ec0300: |
9410 | spec->codec_variant = ALC269_TYPE_ALC300; | |
9411 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ | |
dcd4f0db | 9412 | break; |
f0778871 KY |
9413 | case 0x10ec0623: |
9414 | spec->codec_variant = ALC269_TYPE_ALC623; | |
9415 | break; | |
6fbae35a KY |
9416 | case 0x10ec0700: |
9417 | case 0x10ec0701: | |
9418 | case 0x10ec0703: | |
83629532 | 9419 | case 0x10ec0711: |
6fbae35a KY |
9420 | spec->codec_variant = ALC269_TYPE_ALC700; |
9421 | spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ | |
2d7fe618 | 9422 | alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ |
693abe11 | 9423 | spec->init_hook = alc294_init; |
6fbae35a KY |
9424 | break; |
9425 | ||
1d045db9 | 9426 | } |
6dda9f4a | 9427 | |
ad60d502 | 9428 | if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { |
97a26570 | 9429 | spec->has_alc5505_dsp = 1; |
ad60d502 KY |
9430 | spec->init_hook = alc5505_dsp_init; |
9431 | } | |
9432 | ||
c9af753f TI |
9433 | alc_pre_init(codec); |
9434 | ||
efe55732 TI |
9435 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
9436 | alc269_fixup_tbl, alc269_fixups); | |
0fc1e447 | 9437 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); |
7c0a6939 | 9438 | snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); |
efe55732 TI |
9439 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
9440 | alc269_fixups); | |
9441 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
9442 | ||
9443 | alc_auto_parse_customize_define(codec); | |
9444 | ||
9445 | if (has_cdefine_beep(codec)) | |
9446 | spec->gen.beep_nid = 0x01; | |
9447 | ||
a4297b5d TI |
9448 | /* automatic parse from the BIOS config */ |
9449 | err = alc269_parse_auto_config(codec); | |
e16fb6d1 TI |
9450 | if (err < 0) |
9451 | goto error; | |
6dda9f4a | 9452 | |
fea80fae TI |
9453 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
9454 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); | |
9455 | if (err < 0) | |
9456 | goto error; | |
9457 | } | |
f1d4e28b | 9458 | |
1727a771 | 9459 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 9460 | |
1d045db9 | 9461 | return 0; |
e16fb6d1 TI |
9462 | |
9463 | error: | |
9464 | alc_free(codec); | |
9465 | return err; | |
1d045db9 | 9466 | } |
f1d4e28b | 9467 | |
1d045db9 TI |
9468 | /* |
9469 | * ALC861 | |
9470 | */ | |
622e84cd | 9471 | |
1d045db9 | 9472 | static int alc861_parse_auto_config(struct hda_codec *codec) |
6dda9f4a | 9473 | { |
1d045db9 | 9474 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
9475 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
9476 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); | |
604401a9 TI |
9477 | } |
9478 | ||
1d045db9 TI |
9479 | /* Pin config fixes */ |
9480 | enum { | |
e652f4c8 TI |
9481 | ALC861_FIXUP_FSC_AMILO_PI1505, |
9482 | ALC861_FIXUP_AMP_VREF_0F, | |
9483 | ALC861_FIXUP_NO_JACK_DETECT, | |
9484 | ALC861_FIXUP_ASUS_A6RP, | |
6ddf0fd1 | 9485 | ALC660_FIXUP_ASUS_W7J, |
1d045db9 | 9486 | }; |
7085ec12 | 9487 | |
31150f23 TI |
9488 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
9489 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, | |
1727a771 | 9490 | const struct hda_fixup *fix, int action) |
31150f23 TI |
9491 | { |
9492 | struct alc_spec *spec = codec->spec; | |
9493 | unsigned int val; | |
9494 | ||
1727a771 | 9495 | if (action != HDA_FIXUP_ACT_INIT) |
31150f23 | 9496 | return; |
d3f02d60 | 9497 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
31150f23 TI |
9498 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
9499 | val |= AC_PINCTL_IN_EN; | |
9500 | val |= AC_PINCTL_VREF_50; | |
cdd03ced | 9501 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
08c189f2 | 9502 | spec->gen.keep_vref_in_automute = 1; |
31150f23 TI |
9503 | } |
9504 | ||
e652f4c8 TI |
9505 | /* suppress the jack-detection */ |
9506 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, | |
1727a771 | 9507 | const struct hda_fixup *fix, int action) |
e652f4c8 | 9508 | { |
1727a771 | 9509 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
e652f4c8 | 9510 | codec->no_jack_detect = 1; |
7d7eb9ea | 9511 | } |
e652f4c8 | 9512 | |
1727a771 | 9513 | static const struct hda_fixup alc861_fixups[] = { |
e652f4c8 | 9514 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
1727a771 TI |
9515 | .type = HDA_FIXUP_PINS, |
9516 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
9517 | { 0x0b, 0x0221101f }, /* HP */ |
9518 | { 0x0f, 0x90170310 }, /* speaker */ | |
9519 | { } | |
9520 | } | |
9521 | }, | |
e652f4c8 | 9522 | [ALC861_FIXUP_AMP_VREF_0F] = { |
1727a771 | 9523 | .type = HDA_FIXUP_FUNC, |
31150f23 | 9524 | .v.func = alc861_fixup_asus_amp_vref_0f, |
3b25eb69 | 9525 | }, |
e652f4c8 | 9526 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 9527 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
9528 | .v.func = alc_fixup_no_jack_detect, |
9529 | }, | |
9530 | [ALC861_FIXUP_ASUS_A6RP] = { | |
1727a771 | 9531 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
9532 | .v.func = alc861_fixup_asus_amp_vref_0f, |
9533 | .chained = true, | |
9534 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, | |
6ddf0fd1 TI |
9535 | }, |
9536 | [ALC660_FIXUP_ASUS_W7J] = { | |
9537 | .type = HDA_FIXUP_VERBS, | |
9538 | .v.verbs = (const struct hda_verb[]) { | |
9539 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 | |
9540 | * for enabling outputs | |
9541 | */ | |
9542 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, | |
9543 | { } | |
9544 | }, | |
e652f4c8 | 9545 | } |
1d045db9 | 9546 | }; |
7085ec12 | 9547 | |
1d045db9 | 9548 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
6ddf0fd1 | 9549 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
e7ca237b | 9550 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
e652f4c8 TI |
9551 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
9552 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), | |
9553 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), | |
defce244 | 9554 | SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F), |
e652f4c8 | 9555 | SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), |
1d045db9 TI |
9556 | {} |
9557 | }; | |
3af9ee6b | 9558 | |
1d045db9 TI |
9559 | /* |
9560 | */ | |
1d045db9 | 9561 | static int patch_alc861(struct hda_codec *codec) |
7085ec12 | 9562 | { |
1d045db9 | 9563 | struct alc_spec *spec; |
1d045db9 | 9564 | int err; |
7085ec12 | 9565 | |
3de95173 TI |
9566 | err = alc_alloc_spec(codec, 0x15); |
9567 | if (err < 0) | |
9568 | return err; | |
1d045db9 | 9569 | |
3de95173 | 9570 | spec = codec->spec; |
2722b535 TI |
9571 | if (has_cdefine_beep(codec)) |
9572 | spec->gen.beep_nid = 0x23; | |
1d045db9 | 9573 | |
225068ab TI |
9574 | #ifdef CONFIG_PM |
9575 | spec->power_hook = alc_power_eapd; | |
9576 | #endif | |
9577 | ||
c9af753f TI |
9578 | alc_pre_init(codec); |
9579 | ||
1727a771 TI |
9580 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
9581 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
3af9ee6b | 9582 | |
cb4e4824 TI |
9583 | /* automatic parse from the BIOS config */ |
9584 | err = alc861_parse_auto_config(codec); | |
e16fb6d1 TI |
9585 | if (err < 0) |
9586 | goto error; | |
3af9ee6b | 9587 | |
fea80fae TI |
9588 | if (!spec->gen.no_analog) { |
9589 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); | |
9590 | if (err < 0) | |
9591 | goto error; | |
9592 | } | |
7085ec12 | 9593 | |
1727a771 | 9594 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 9595 | |
1d045db9 | 9596 | return 0; |
e16fb6d1 TI |
9597 | |
9598 | error: | |
9599 | alc_free(codec); | |
9600 | return err; | |
7085ec12 TI |
9601 | } |
9602 | ||
1d045db9 TI |
9603 | /* |
9604 | * ALC861-VD support | |
9605 | * | |
9606 | * Based on ALC882 | |
9607 | * | |
9608 | * In addition, an independent DAC | |
9609 | */ | |
1d045db9 | 9610 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
bc9f98a9 | 9611 | { |
1d045db9 | 9612 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
9613 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
9614 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); | |
ce764ab2 TI |
9615 | } |
9616 | ||
1d045db9 | 9617 | enum { |
8fdcb6fe TI |
9618 | ALC660VD_FIX_ASUS_GPIO1, |
9619 | ALC861VD_FIX_DALLAS, | |
1d045db9 | 9620 | }; |
ce764ab2 | 9621 | |
8fdcb6fe TI |
9622 | /* exclude VREF80 */ |
9623 | static void alc861vd_fixup_dallas(struct hda_codec *codec, | |
1727a771 | 9624 | const struct hda_fixup *fix, int action) |
8fdcb6fe | 9625 | { |
1727a771 | 9626 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
b78562b1 TI |
9627 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
9628 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); | |
8fdcb6fe TI |
9629 | } |
9630 | } | |
9631 | ||
df73d83f TI |
9632 | /* reset GPIO1 */ |
9633 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, | |
9634 | const struct hda_fixup *fix, int action) | |
9635 | { | |
9636 | struct alc_spec *spec = codec->spec; | |
9637 | ||
9638 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
9639 | spec->gpio_mask |= 0x02; | |
9640 | alc_fixup_gpio(codec, action, 0x01); | |
9641 | } | |
9642 | ||
1727a771 | 9643 | static const struct hda_fixup alc861vd_fixups[] = { |
1d045db9 | 9644 | [ALC660VD_FIX_ASUS_GPIO1] = { |
df73d83f TI |
9645 | .type = HDA_FIXUP_FUNC, |
9646 | .v.func = alc660vd_fixup_asus_gpio1, | |
1d045db9 | 9647 | }, |
8fdcb6fe | 9648 | [ALC861VD_FIX_DALLAS] = { |
1727a771 | 9649 | .type = HDA_FIXUP_FUNC, |
8fdcb6fe TI |
9650 | .v.func = alc861vd_fixup_dallas, |
9651 | }, | |
1d045db9 | 9652 | }; |
ce764ab2 | 9653 | |
1d045db9 | 9654 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
8fdcb6fe | 9655 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
1d045db9 | 9656 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
8fdcb6fe | 9657 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
1d045db9 TI |
9658 | {} |
9659 | }; | |
ce764ab2 | 9660 | |
1d045db9 TI |
9661 | /* |
9662 | */ | |
1d045db9 | 9663 | static int patch_alc861vd(struct hda_codec *codec) |
ce764ab2 | 9664 | { |
1d045db9 | 9665 | struct alc_spec *spec; |
cb4e4824 | 9666 | int err; |
ce764ab2 | 9667 | |
3de95173 TI |
9668 | err = alc_alloc_spec(codec, 0x0b); |
9669 | if (err < 0) | |
9670 | return err; | |
1d045db9 | 9671 | |
3de95173 | 9672 | spec = codec->spec; |
2722b535 TI |
9673 | if (has_cdefine_beep(codec)) |
9674 | spec->gen.beep_nid = 0x23; | |
1d045db9 | 9675 | |
225068ab TI |
9676 | spec->shutup = alc_eapd_shutup; |
9677 | ||
c9af753f TI |
9678 | alc_pre_init(codec); |
9679 | ||
1727a771 TI |
9680 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
9681 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
1d045db9 | 9682 | |
cb4e4824 TI |
9683 | /* automatic parse from the BIOS config */ |
9684 | err = alc861vd_parse_auto_config(codec); | |
e16fb6d1 TI |
9685 | if (err < 0) |
9686 | goto error; | |
ce764ab2 | 9687 | |
fea80fae TI |
9688 | if (!spec->gen.no_analog) { |
9689 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
9690 | if (err < 0) | |
9691 | goto error; | |
9692 | } | |
1d045db9 | 9693 | |
1727a771 | 9694 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 9695 | |
ce764ab2 | 9696 | return 0; |
e16fb6d1 TI |
9697 | |
9698 | error: | |
9699 | alc_free(codec); | |
9700 | return err; | |
ce764ab2 TI |
9701 | } |
9702 | ||
1d045db9 TI |
9703 | /* |
9704 | * ALC662 support | |
9705 | * | |
9706 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible | |
9707 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
9708 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
9709 | * 6-channel independent captures. | |
9710 | * | |
9711 | * In addition, an independent DAC for the multi-playback (not used in this | |
9712 | * driver yet). | |
9713 | */ | |
1d045db9 TI |
9714 | |
9715 | /* | |
9716 | * BIOS auto configuration | |
9717 | */ | |
9718 | ||
bc9f98a9 KY |
9719 | static int alc662_parse_auto_config(struct hda_codec *codec) |
9720 | { | |
4c6d72d1 | 9721 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
9722 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
9723 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
9724 | const hda_nid_t *ssids; | |
ee979a14 | 9725 | |
7639a06c TI |
9726 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
9727 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || | |
9728 | codec->core.vendor_id == 0x10ec0671) | |
3e6179b8 | 9729 | ssids = alc663_ssids; |
6227cdce | 9730 | else |
3e6179b8 TI |
9731 | ssids = alc662_ssids; |
9732 | return alc_parse_auto_config(codec, alc662_ignore, ssids); | |
bc9f98a9 KY |
9733 | } |
9734 | ||
6be7948f | 9735 | static void alc272_fixup_mario(struct hda_codec *codec, |
1727a771 | 9736 | const struct hda_fixup *fix, int action) |
6fc398cb | 9737 | { |
9bb1f06f | 9738 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
6fc398cb | 9739 | return; |
6be7948f TB |
9740 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
9741 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | | |
9742 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
9743 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
9744 | (0 << AC_AMPCAP_MUTE_SHIFT))) | |
4e76a883 | 9745 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
6be7948f TB |
9746 | } |
9747 | ||
8e383953 TI |
9748 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
9749 | { .channels = 2, | |
9750 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, | |
9751 | { .channels = 4, | |
9752 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, | |
9753 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ | |
9754 | { } | |
9755 | }; | |
9756 | ||
9757 | /* override the 2.1 chmap */ | |
eb9ca3ab | 9758 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
8e383953 TI |
9759 | const struct hda_fixup *fix, int action) |
9760 | { | |
9761 | if (action == HDA_FIXUP_ACT_BUILD) { | |
9762 | struct alc_spec *spec = codec->spec; | |
bbbc7e85 | 9763 | spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; |
8e383953 TI |
9764 | } |
9765 | } | |
9766 | ||
bf68665d TI |
9767 | /* avoid D3 for keeping GPIO up */ |
9768 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, | |
9769 | hda_nid_t nid, | |
9770 | unsigned int power_state) | |
9771 | { | |
9772 | struct alc_spec *spec = codec->spec; | |
d261eec8 | 9773 | if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) |
bf68665d TI |
9774 | return AC_PWRST_D0; |
9775 | return power_state; | |
9776 | } | |
9777 | ||
3e887f37 TI |
9778 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
9779 | const struct hda_fixup *fix, int action) | |
9780 | { | |
9781 | struct alc_spec *spec = codec->spec; | |
3e887f37 | 9782 | |
01e4a275 | 9783 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
3e887f37 | 9784 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
0f32fd19 | 9785 | spec->mute_led_polarity = 1; |
bf68665d | 9786 | codec->power_filter = gpio_led_power_filter; |
3e887f37 TI |
9787 | } |
9788 | } | |
9789 | ||
c6790c8e KY |
9790 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
9791 | struct hda_jack_callback *jack) | |
9792 | { | |
9793 | struct alc_spec *spec = codec->spec; | |
9794 | int vref; | |
9795 | msleep(200); | |
9796 | snd_hda_gen_hp_automute(codec, jack); | |
9797 | ||
9798 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
9799 | msleep(100); | |
9800 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
9801 | vref); | |
9802 | } | |
9803 | ||
9804 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, | |
9805 | const struct hda_fixup *fix, int action) | |
9806 | { | |
9807 | struct alc_spec *spec = codec->spec; | |
9808 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
9809 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
9810 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; | |
9811 | } | |
9812 | } | |
9813 | ||
00066e97 SB |
9814 | static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, |
9815 | struct hda_jack_callback *cb) | |
9816 | { | |
9817 | /* surround speakers at 0x1b already get muted automatically when | |
9818 | * headphones are plugged in, but we have to mute/unmute the remaining | |
9819 | * channels manually: | |
9820 | * 0x15 - front left/front right | |
9821 | * 0x18 - front center/ LFE | |
9822 | */ | |
9823 | if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { | |
9824 | snd_hda_set_pin_ctl_cache(codec, 0x15, 0); | |
9825 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); | |
9826 | } else { | |
9827 | snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); | |
9828 | snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); | |
9829 | } | |
9830 | } | |
9831 | ||
9832 | static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, | |
9833 | const struct hda_fixup *fix, int action) | |
9834 | { | |
9835 | /* Pin 0x1b: shared headphones jack and surround speakers */ | |
9836 | if (!is_jack_detectable(codec, 0x1b)) | |
9837 | return; | |
9838 | ||
9839 | switch (action) { | |
9840 | case HDA_FIXUP_ACT_PRE_PROBE: | |
9841 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
9842 | alc662_aspire_ethos_mute_speakers); | |
336820c4 TI |
9843 | /* subwoofer needs an extra GPIO setting to become audible */ |
9844 | alc_setup_gpio(codec, 0x02); | |
00066e97 SB |
9845 | break; |
9846 | case HDA_FIXUP_ACT_INIT: | |
9847 | /* Make sure to start in a correct state, i.e. if | |
9848 | * headphones have been plugged in before powering up the system | |
9849 | */ | |
9850 | alc662_aspire_ethos_mute_speakers(codec, NULL); | |
9851 | break; | |
9852 | } | |
9853 | } | |
9854 | ||
5af29028 KY |
9855 | static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, |
9856 | const struct hda_fixup *fix, int action) | |
9857 | { | |
9858 | struct alc_spec *spec = codec->spec; | |
9859 | ||
9860 | static const struct hda_pintbl pincfgs[] = { | |
9861 | { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ | |
9862 | { 0x1b, 0x0181304f }, | |
9863 | { } | |
9864 | }; | |
9865 | ||
9866 | switch (action) { | |
9867 | case HDA_FIXUP_ACT_PRE_PROBE: | |
9868 | spec->gen.mixer_nid = 0; | |
9869 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
9870 | snd_hda_apply_pincfgs(codec, pincfgs); | |
9871 | break; | |
9872 | case HDA_FIXUP_ACT_INIT: | |
9873 | alc_write_coef_idx(codec, 0x19, 0xa054); | |
9874 | break; | |
9875 | } | |
9876 | } | |
9877 | ||
6b0f95c4 | 9878 | static const struct coef_fw alc668_coefs[] = { |
f3f9185f KY |
9879 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
9880 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), | |
9881 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), | |
9882 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), | |
9883 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), | |
9884 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), | |
9885 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), | |
9886 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), | |
9887 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), | |
9888 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), | |
9889 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), | |
9890 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), | |
9891 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), | |
9892 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), | |
9893 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), | |
9894 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), | |
9895 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), | |
9896 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), | |
9897 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), | |
9898 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), | |
9899 | {} | |
9900 | }; | |
9901 | ||
9902 | static void alc668_restore_default_value(struct hda_codec *codec) | |
9903 | { | |
9904 | alc_process_coef_fw(codec, alc668_coefs); | |
9905 | } | |
9906 | ||
6cb3b707 | 9907 | enum { |
2df03514 | 9908 | ALC662_FIXUP_ASPIRE, |
3e887f37 | 9909 | ALC662_FIXUP_LED_GPIO1, |
6cb3b707 | 9910 | ALC662_FIXUP_IDEAPAD, |
6be7948f | 9911 | ALC272_FIXUP_MARIO, |
f1ec5be1 | 9912 | ALC662_FIXUP_CZC_ET26, |
d2ebd479 | 9913 | ALC662_FIXUP_CZC_P10T, |
94024cd1 | 9914 | ALC662_FIXUP_SKU_IGNORE, |
e59ea3ed | 9915 | ALC662_FIXUP_HP_RP5800, |
53c334ad TI |
9916 | ALC662_FIXUP_ASUS_MODE1, |
9917 | ALC662_FIXUP_ASUS_MODE2, | |
9918 | ALC662_FIXUP_ASUS_MODE3, | |
9919 | ALC662_FIXUP_ASUS_MODE4, | |
9920 | ALC662_FIXUP_ASUS_MODE5, | |
9921 | ALC662_FIXUP_ASUS_MODE6, | |
9922 | ALC662_FIXUP_ASUS_MODE7, | |
9923 | ALC662_FIXUP_ASUS_MODE8, | |
1565cc35 | 9924 | ALC662_FIXUP_NO_JACK_DETECT, |
edfe3bfc | 9925 | ALC662_FIXUP_ZOTAC_Z68, |
125821ae | 9926 | ALC662_FIXUP_INV_DMIC, |
1f8b46cd | 9927 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
73bdd597 | 9928 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 9929 | ALC662_FIXUP_HEADSET_MODE, |
73bdd597 | 9930 | ALC668_FIXUP_HEADSET_MODE, |
8e54b4ac | 9931 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
61a75f13 | 9932 | ALC662_FIXUP_BASS_16, |
a30c9aaa | 9933 | ALC662_FIXUP_BASS_1A, |
8e54b4ac | 9934 | ALC662_FIXUP_BASS_CHMAP, |
493a52a9 | 9935 | ALC668_FIXUP_AUTO_MUTE, |
5e6db669 | 9936 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
033b0a7c | 9937 | ALC668_FIXUP_DELL_XPS13, |
9d4dc584 | 9938 | ALC662_FIXUP_ASUS_Nx50, |
fc7438b1 | 9939 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 9940 | ALC668_FIXUP_ASUS_Nx51, |
5b7c5e1f | 9941 | ALC668_FIXUP_MIC_COEF, |
11ba6111 | 9942 | ALC668_FIXUP_ASUS_G751, |
78f4f7c2 KY |
9943 | ALC891_FIXUP_HEADSET_MODE, |
9944 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, | |
9b51fe3e | 9945 | ALC662_FIXUP_ACER_VERITON, |
1a3f0991 | 9946 | ALC892_FIXUP_ASROCK_MOBO, |
c6790c8e KY |
9947 | ALC662_FIXUP_USI_FUNC, |
9948 | ALC662_FIXUP_USI_HEADSET_MODE, | |
ca169cc2 | 9949 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
00066e97 | 9950 | ALC669_FIXUP_ACER_ASPIRE_ETHOS, |
00066e97 | 9951 | ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, |
5af29028 | 9952 | ALC671_FIXUP_HP_HEADSET_MIC2, |
d858c706 | 9953 | ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
a124458a | 9954 | ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
6cb3b707 DH |
9955 | }; |
9956 | ||
1727a771 | 9957 | static const struct hda_fixup alc662_fixups[] = { |
2df03514 | 9958 | [ALC662_FIXUP_ASPIRE] = { |
1727a771 TI |
9959 | .type = HDA_FIXUP_PINS, |
9960 | .v.pins = (const struct hda_pintbl[]) { | |
2df03514 DC |
9961 | { 0x15, 0x99130112 }, /* subwoofer */ |
9962 | { } | |
9963 | } | |
9964 | }, | |
3e887f37 TI |
9965 | [ALC662_FIXUP_LED_GPIO1] = { |
9966 | .type = HDA_FIXUP_FUNC, | |
9967 | .v.func = alc662_fixup_led_gpio1, | |
9968 | }, | |
6cb3b707 | 9969 | [ALC662_FIXUP_IDEAPAD] = { |
1727a771 TI |
9970 | .type = HDA_FIXUP_PINS, |
9971 | .v.pins = (const struct hda_pintbl[]) { | |
6cb3b707 DH |
9972 | { 0x17, 0x99130112 }, /* subwoofer */ |
9973 | { } | |
3e887f37 TI |
9974 | }, |
9975 | .chained = true, | |
9976 | .chain_id = ALC662_FIXUP_LED_GPIO1, | |
6cb3b707 | 9977 | }, |
6be7948f | 9978 | [ALC272_FIXUP_MARIO] = { |
1727a771 | 9979 | .type = HDA_FIXUP_FUNC, |
b5bfbc67 | 9980 | .v.func = alc272_fixup_mario, |
d2ebd479 | 9981 | }, |
f1ec5be1 HC |
9982 | [ALC662_FIXUP_CZC_ET26] = { |
9983 | .type = HDA_FIXUP_PINS, | |
9984 | .v.pins = (const struct hda_pintbl[]) { | |
9985 | {0x12, 0x403cc000}, | |
9986 | {0x14, 0x90170110}, /* speaker */ | |
9987 | {0x15, 0x411111f0}, | |
9988 | {0x16, 0x411111f0}, | |
9989 | {0x18, 0x01a19030}, /* mic */ | |
9990 | {0x19, 0x90a7013f}, /* int-mic */ | |
9991 | {0x1a, 0x01014020}, | |
9992 | {0x1b, 0x0121401f}, | |
9993 | {0x1c, 0x411111f0}, | |
9994 | {0x1d, 0x411111f0}, | |
9995 | {0x1e, 0x40478e35}, | |
9996 | {} | |
9997 | }, | |
9998 | .chained = true, | |
9999 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10000 | }, | |
d2ebd479 | 10001 | [ALC662_FIXUP_CZC_P10T] = { |
1727a771 | 10002 | .type = HDA_FIXUP_VERBS, |
d2ebd479 AA |
10003 | .v.verbs = (const struct hda_verb[]) { |
10004 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
10005 | {} | |
10006 | } | |
10007 | }, | |
94024cd1 | 10008 | [ALC662_FIXUP_SKU_IGNORE] = { |
1727a771 | 10009 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 10010 | .v.func = alc_fixup_sku_ignore, |
c6b35874 | 10011 | }, |
e59ea3ed | 10012 | [ALC662_FIXUP_HP_RP5800] = { |
1727a771 TI |
10013 | .type = HDA_FIXUP_PINS, |
10014 | .v.pins = (const struct hda_pintbl[]) { | |
e59ea3ed TI |
10015 | { 0x14, 0x0221201f }, /* HP out */ |
10016 | { } | |
10017 | }, | |
10018 | .chained = true, | |
10019 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10020 | }, | |
53c334ad | 10021 | [ALC662_FIXUP_ASUS_MODE1] = { |
1727a771 TI |
10022 | .type = HDA_FIXUP_PINS, |
10023 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10024 | { 0x14, 0x99130110 }, /* speaker */ |
10025 | { 0x18, 0x01a19c20 }, /* mic */ | |
10026 | { 0x19, 0x99a3092f }, /* int-mic */ | |
10027 | { 0x21, 0x0121401f }, /* HP out */ | |
10028 | { } | |
10029 | }, | |
10030 | .chained = true, | |
10031 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10032 | }, | |
10033 | [ALC662_FIXUP_ASUS_MODE2] = { | |
1727a771 TI |
10034 | .type = HDA_FIXUP_PINS, |
10035 | .v.pins = (const struct hda_pintbl[]) { | |
2996bdba TI |
10036 | { 0x14, 0x99130110 }, /* speaker */ |
10037 | { 0x18, 0x01a19820 }, /* mic */ | |
10038 | { 0x19, 0x99a3092f }, /* int-mic */ | |
10039 | { 0x1b, 0x0121401f }, /* HP out */ | |
10040 | { } | |
10041 | }, | |
53c334ad TI |
10042 | .chained = true, |
10043 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10044 | }, | |
10045 | [ALC662_FIXUP_ASUS_MODE3] = { | |
1727a771 TI |
10046 | .type = HDA_FIXUP_PINS, |
10047 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10048 | { 0x14, 0x99130110 }, /* speaker */ |
10049 | { 0x15, 0x0121441f }, /* HP */ | |
10050 | { 0x18, 0x01a19840 }, /* mic */ | |
10051 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10052 | { 0x21, 0x01211420 }, /* HP2 */ | |
10053 | { } | |
10054 | }, | |
10055 | .chained = true, | |
10056 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10057 | }, | |
10058 | [ALC662_FIXUP_ASUS_MODE4] = { | |
1727a771 TI |
10059 | .type = HDA_FIXUP_PINS, |
10060 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10061 | { 0x14, 0x99130110 }, /* speaker */ |
10062 | { 0x16, 0x99130111 }, /* speaker */ | |
10063 | { 0x18, 0x01a19840 }, /* mic */ | |
10064 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10065 | { 0x21, 0x0121441f }, /* HP */ | |
10066 | { } | |
10067 | }, | |
10068 | .chained = true, | |
10069 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10070 | }, | |
10071 | [ALC662_FIXUP_ASUS_MODE5] = { | |
1727a771 TI |
10072 | .type = HDA_FIXUP_PINS, |
10073 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10074 | { 0x14, 0x99130110 }, /* speaker */ |
10075 | { 0x15, 0x0121441f }, /* HP */ | |
10076 | { 0x16, 0x99130111 }, /* speaker */ | |
10077 | { 0x18, 0x01a19840 }, /* mic */ | |
10078 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10079 | { } | |
10080 | }, | |
10081 | .chained = true, | |
10082 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10083 | }, | |
10084 | [ALC662_FIXUP_ASUS_MODE6] = { | |
1727a771 TI |
10085 | .type = HDA_FIXUP_PINS, |
10086 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10087 | { 0x14, 0x99130110 }, /* speaker */ |
10088 | { 0x15, 0x01211420 }, /* HP2 */ | |
10089 | { 0x18, 0x01a19840 }, /* mic */ | |
10090 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10091 | { 0x1b, 0x0121441f }, /* HP */ | |
10092 | { } | |
10093 | }, | |
10094 | .chained = true, | |
10095 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10096 | }, | |
10097 | [ALC662_FIXUP_ASUS_MODE7] = { | |
1727a771 TI |
10098 | .type = HDA_FIXUP_PINS, |
10099 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10100 | { 0x14, 0x99130110 }, /* speaker */ |
10101 | { 0x17, 0x99130111 }, /* speaker */ | |
10102 | { 0x18, 0x01a19840 }, /* mic */ | |
10103 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10104 | { 0x1b, 0x01214020 }, /* HP */ | |
10105 | { 0x21, 0x0121401f }, /* HP */ | |
10106 | { } | |
10107 | }, | |
10108 | .chained = true, | |
10109 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10110 | }, | |
10111 | [ALC662_FIXUP_ASUS_MODE8] = { | |
1727a771 TI |
10112 | .type = HDA_FIXUP_PINS, |
10113 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10114 | { 0x14, 0x99130110 }, /* speaker */ |
10115 | { 0x12, 0x99a30970 }, /* int-mic */ | |
10116 | { 0x15, 0x01214020 }, /* HP */ | |
10117 | { 0x17, 0x99130111 }, /* speaker */ | |
10118 | { 0x18, 0x01a19840 }, /* mic */ | |
10119 | { 0x21, 0x0121401f }, /* HP */ | |
10120 | { } | |
10121 | }, | |
10122 | .chained = true, | |
10123 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
2996bdba | 10124 | }, |
1565cc35 | 10125 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 10126 | .type = HDA_FIXUP_FUNC, |
1565cc35 TI |
10127 | .v.func = alc_fixup_no_jack_detect, |
10128 | }, | |
edfe3bfc | 10129 | [ALC662_FIXUP_ZOTAC_Z68] = { |
1727a771 TI |
10130 | .type = HDA_FIXUP_PINS, |
10131 | .v.pins = (const struct hda_pintbl[]) { | |
edfe3bfc DH |
10132 | { 0x1b, 0x02214020 }, /* Front HP */ |
10133 | { } | |
10134 | } | |
10135 | }, | |
125821ae | 10136 | [ALC662_FIXUP_INV_DMIC] = { |
1727a771 | 10137 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 10138 | .v.func = alc_fixup_inv_dmic, |
125821ae | 10139 | }, |
033b0a7c GM |
10140 | [ALC668_FIXUP_DELL_XPS13] = { |
10141 | .type = HDA_FIXUP_FUNC, | |
10142 | .v.func = alc_fixup_dell_xps13, | |
10143 | .chained = true, | |
10144 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX | |
10145 | }, | |
5e6db669 GM |
10146 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
10147 | .type = HDA_FIXUP_FUNC, | |
10148 | .v.func = alc_fixup_disable_aamix, | |
10149 | .chained = true, | |
10150 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
10151 | }, | |
493a52a9 HW |
10152 | [ALC668_FIXUP_AUTO_MUTE] = { |
10153 | .type = HDA_FIXUP_FUNC, | |
10154 | .v.func = alc_fixup_auto_mute_via_amp, | |
10155 | .chained = true, | |
10156 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
10157 | }, | |
1f8b46cd DH |
10158 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
10159 | .type = HDA_FIXUP_PINS, | |
10160 | .v.pins = (const struct hda_pintbl[]) { | |
10161 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
10162 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ | |
10163 | { } | |
10164 | }, | |
10165 | .chained = true, | |
10166 | .chain_id = ALC662_FIXUP_HEADSET_MODE | |
10167 | }, | |
10168 | [ALC662_FIXUP_HEADSET_MODE] = { | |
10169 | .type = HDA_FIXUP_FUNC, | |
10170 | .v.func = alc_fixup_headset_mode_alc662, | |
10171 | }, | |
73bdd597 DH |
10172 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
10173 | .type = HDA_FIXUP_PINS, | |
10174 | .v.pins = (const struct hda_pintbl[]) { | |
10175 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
10176 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
10177 | { } | |
10178 | }, | |
10179 | .chained = true, | |
10180 | .chain_id = ALC668_FIXUP_HEADSET_MODE | |
10181 | }, | |
10182 | [ALC668_FIXUP_HEADSET_MODE] = { | |
10183 | .type = HDA_FIXUP_FUNC, | |
10184 | .v.func = alc_fixup_headset_mode_alc668, | |
10185 | }, | |
8e54b4ac | 10186 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
8e383953 | 10187 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 10188 | .v.func = alc_fixup_bass_chmap, |
8e383953 TI |
10189 | .chained = true, |
10190 | .chain_id = ALC662_FIXUP_ASUS_MODE4 | |
10191 | }, | |
61a75f13 DH |
10192 | [ALC662_FIXUP_BASS_16] = { |
10193 | .type = HDA_FIXUP_PINS, | |
10194 | .v.pins = (const struct hda_pintbl[]) { | |
10195 | {0x16, 0x80106111}, /* bass speaker */ | |
10196 | {} | |
10197 | }, | |
10198 | .chained = true, | |
10199 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
10200 | }, | |
a30c9aaa TI |
10201 | [ALC662_FIXUP_BASS_1A] = { |
10202 | .type = HDA_FIXUP_PINS, | |
10203 | .v.pins = (const struct hda_pintbl[]) { | |
10204 | {0x1a, 0x80106111}, /* bass speaker */ | |
10205 | {} | |
10206 | }, | |
8e54b4ac DH |
10207 | .chained = true, |
10208 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
a30c9aaa | 10209 | }, |
8e54b4ac | 10210 | [ALC662_FIXUP_BASS_CHMAP] = { |
a30c9aaa | 10211 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 10212 | .v.func = alc_fixup_bass_chmap, |
a30c9aaa | 10213 | }, |
9d4dc584 BM |
10214 | [ALC662_FIXUP_ASUS_Nx50] = { |
10215 | .type = HDA_FIXUP_FUNC, | |
10216 | .v.func = alc_fixup_auto_mute_via_amp, | |
10217 | .chained = true, | |
10218 | .chain_id = ALC662_FIXUP_BASS_1A | |
10219 | }, | |
fc7438b1 MP |
10220 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
10221 | .type = HDA_FIXUP_FUNC, | |
10222 | .v.func = alc_fixup_headset_mode_alc668, | |
10223 | .chain_id = ALC662_FIXUP_BASS_CHMAP | |
10224 | }, | |
3231e205 YP |
10225 | [ALC668_FIXUP_ASUS_Nx51] = { |
10226 | .type = HDA_FIXUP_PINS, | |
10227 | .v.pins = (const struct hda_pintbl[]) { | |
fc7438b1 MP |
10228 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
10229 | { 0x1a, 0x90170151 }, /* bass speaker */ | |
10230 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
3231e205 YP |
10231 | {} |
10232 | }, | |
10233 | .chained = true, | |
fc7438b1 | 10234 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 10235 | }, |
5b7c5e1f | 10236 | [ALC668_FIXUP_MIC_COEF] = { |
11ba6111 TI |
10237 | .type = HDA_FIXUP_VERBS, |
10238 | .v.verbs = (const struct hda_verb[]) { | |
10239 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, | |
10240 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, | |
10241 | {} | |
10242 | }, | |
10243 | }, | |
5b7c5e1f TI |
10244 | [ALC668_FIXUP_ASUS_G751] = { |
10245 | .type = HDA_FIXUP_PINS, | |
10246 | .v.pins = (const struct hda_pintbl[]) { | |
10247 | { 0x16, 0x0421101f }, /* HP */ | |
10248 | {} | |
10249 | }, | |
10250 | .chained = true, | |
10251 | .chain_id = ALC668_FIXUP_MIC_COEF | |
10252 | }, | |
78f4f7c2 KY |
10253 | [ALC891_FIXUP_HEADSET_MODE] = { |
10254 | .type = HDA_FIXUP_FUNC, | |
10255 | .v.func = alc_fixup_headset_mode, | |
10256 | }, | |
10257 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { | |
10258 | .type = HDA_FIXUP_PINS, | |
10259 | .v.pins = (const struct hda_pintbl[]) { | |
10260 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
10261 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
10262 | { } | |
10263 | }, | |
10264 | .chained = true, | |
10265 | .chain_id = ALC891_FIXUP_HEADSET_MODE | |
10266 | }, | |
9b51fe3e SB |
10267 | [ALC662_FIXUP_ACER_VERITON] = { |
10268 | .type = HDA_FIXUP_PINS, | |
10269 | .v.pins = (const struct hda_pintbl[]) { | |
10270 | { 0x15, 0x50170120 }, /* no internal speaker */ | |
10271 | { } | |
10272 | } | |
10273 | }, | |
1a3f0991 TI |
10274 | [ALC892_FIXUP_ASROCK_MOBO] = { |
10275 | .type = HDA_FIXUP_PINS, | |
10276 | .v.pins = (const struct hda_pintbl[]) { | |
10277 | { 0x15, 0x40f000f0 }, /* disabled */ | |
10278 | { 0x16, 0x40f000f0 }, /* disabled */ | |
1a3f0991 TI |
10279 | { } |
10280 | } | |
10281 | }, | |
c6790c8e KY |
10282 | [ALC662_FIXUP_USI_FUNC] = { |
10283 | .type = HDA_FIXUP_FUNC, | |
10284 | .v.func = alc662_fixup_usi_headset_mic, | |
10285 | }, | |
10286 | [ALC662_FIXUP_USI_HEADSET_MODE] = { | |
10287 | .type = HDA_FIXUP_PINS, | |
10288 | .v.pins = (const struct hda_pintbl[]) { | |
10289 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ | |
10290 | { 0x18, 0x01a1903d }, | |
10291 | { } | |
10292 | }, | |
10293 | .chained = true, | |
10294 | .chain_id = ALC662_FIXUP_USI_FUNC | |
10295 | }, | |
ca169cc2 KY |
10296 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
10297 | .type = HDA_FIXUP_FUNC, | |
10298 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
10299 | }, | |
00066e97 SB |
10300 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { |
10301 | .type = HDA_FIXUP_FUNC, | |
10302 | .v.func = alc662_fixup_aspire_ethos_hp, | |
10303 | }, | |
00066e97 SB |
10304 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { |
10305 | .type = HDA_FIXUP_PINS, | |
10306 | .v.pins = (const struct hda_pintbl[]) { | |
10307 | { 0x15, 0x92130110 }, /* front speakers */ | |
10308 | { 0x18, 0x99130111 }, /* center/subwoofer */ | |
10309 | { 0x1b, 0x11130012 }, /* surround plus jack for HP */ | |
10310 | { } | |
10311 | }, | |
10312 | .chained = true, | |
336820c4 | 10313 | .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET |
00066e97 | 10314 | }, |
5af29028 KY |
10315 | [ALC671_FIXUP_HP_HEADSET_MIC2] = { |
10316 | .type = HDA_FIXUP_FUNC, | |
10317 | .v.func = alc671_fixup_hp_headset_mic2, | |
10318 | }, | |
d858c706 JHP |
10319 | [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { |
10320 | .type = HDA_FIXUP_PINS, | |
10321 | .v.pins = (const struct hda_pintbl[]) { | |
10322 | { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ | |
10323 | { } | |
10324 | }, | |
10325 | .chained = true, | |
10326 | .chain_id = ALC662_FIXUP_USI_FUNC | |
10327 | }, | |
a124458a JHP |
10328 | [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { |
10329 | .type = HDA_FIXUP_PINS, | |
10330 | .v.pins = (const struct hda_pintbl[]) { | |
10331 | { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ | |
10332 | { 0x1b, 0x0221144f }, | |
10333 | { } | |
10334 | }, | |
10335 | .chained = true, | |
10336 | .chain_id = ALC662_FIXUP_USI_FUNC | |
10337 | }, | |
6cb3b707 DH |
10338 | }; |
10339 | ||
a9111321 | 10340 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
53c334ad | 10341 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
d3d3835c | 10342 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
02f6ff90 | 10343 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
a6c47a85 | 10344 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
94024cd1 | 10345 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
125821ae | 10346 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
1801928e | 10347 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
2df03514 | 10348 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
9edeb110 | 10349 | SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), |
a124458a | 10350 | SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), |
d858c706 | 10351 | SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), |
73bdd597 DH |
10352 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
10353 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
c5d019c3 | 10354 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
033b0a7c | 10355 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
467e1436 | 10356 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
09d2014f | 10357 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
ad8ff99e | 10358 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
8dc9abb9 KY |
10359 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
10360 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
6a98e34b | 10361 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
e59ea3ed | 10362 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
148ebf54 | 10363 | SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), |
2da2dc9e | 10364 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
83a9efb5 | 10365 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
9d4dc584 | 10366 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
11ba6111 | 10367 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
9edeb110 | 10368 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
8e54b4ac | 10369 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
61a75f13 | 10370 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
3231e205 YP |
10371 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
10372 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), | |
c7efff92 | 10373 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
61a75f13 | 10374 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
8e54b4ac | 10375 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
1565cc35 | 10376 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
53c334ad | 10377 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
a0e90acc | 10378 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
c6790c8e | 10379 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
ca169cc2 | 10380 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
d4118588 | 10381 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
6cb3b707 | 10382 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
1a3f0991 | 10383 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
edfe3bfc | 10384 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
9b51fe3e | 10385 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
f1ec5be1 | 10386 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), |
d2ebd479 | 10387 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
53c334ad TI |
10388 | |
10389 | #if 0 | |
10390 | /* Below is a quirk table taken from the old code. | |
10391 | * Basically the device should work as is without the fixup table. | |
10392 | * If BIOS doesn't give a proper info, enable the corresponding | |
10393 | * fixup entry. | |
7d7eb9ea | 10394 | */ |
53c334ad TI |
10395 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
10396 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), | |
10397 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), | |
10398 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), | |
10399 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10400 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10401 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10402 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), | |
10403 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), | |
10404 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10405 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), | |
10406 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), | |
10407 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), | |
10408 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), | |
10409 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), | |
10410 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10411 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), | |
10412 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), | |
10413 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10414 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
10415 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
10416 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10417 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), | |
10418 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), | |
10419 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), | |
10420 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10421 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), | |
10422 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
10423 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10424 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), | |
10425 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10426 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10427 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), | |
10428 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), | |
10429 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), | |
10430 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), | |
10431 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), | |
10432 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), | |
10433 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), | |
10434 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10435 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), | |
10436 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), | |
10437 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10438 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), | |
10439 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), | |
10440 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), | |
10441 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), | |
10442 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), | |
10443 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10444 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), | |
10445 | #endif | |
6cb3b707 DH |
10446 | {} |
10447 | }; | |
10448 | ||
1727a771 | 10449 | static const struct hda_model_fixup alc662_fixup_models[] = { |
aa3841b5 TI |
10450 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
10451 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, | |
6be7948f | 10452 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
aa3841b5 | 10453 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
53c334ad TI |
10454 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
10455 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, | |
10456 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, | |
10457 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, | |
10458 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, | |
10459 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, | |
10460 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, | |
10461 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, | |
aa3841b5 | 10462 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
6e72aa5f | 10463 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
aa3841b5 | 10464 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
e32aa85a | 10465 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
aa3841b5 TI |
10466 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
10467 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, | |
10468 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, | |
10469 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, | |
10470 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, | |
10471 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, | |
10472 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, | |
10473 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, | |
40c51675 | 10474 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
aa3841b5 TI |
10475 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
10476 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, | |
10477 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, | |
10478 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, | |
10479 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, | |
ba90d6a6 | 10480 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
00066e97 | 10481 | {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, |
6be7948f TB |
10482 | {} |
10483 | }; | |
6cb3b707 | 10484 | |
532895c5 | 10485 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
78f4f7c2 KY |
10486 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
10487 | {0x17, 0x02211010}, | |
10488 | {0x18, 0x01a19030}, | |
10489 | {0x1a, 0x01813040}, | |
10490 | {0x21, 0x01014020}), | |
4b4e0e32 HW |
10491 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
10492 | {0x16, 0x01813030}, | |
10493 | {0x17, 0x02211010}, | |
10494 | {0x18, 0x01a19040}, | |
10495 | {0x21, 0x01014020}), | |
1f8b46cd | 10496 | SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 10497 | {0x14, 0x01014010}, |
1f8b46cd | 10498 | {0x18, 0x01a19020}, |
1f8b46cd | 10499 | {0x1a, 0x0181302f}, |
11580297 | 10500 | {0x1b, 0x0221401f}), |
76c2132e DH |
10501 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
10502 | {0x12, 0x99a30130}, | |
10503 | {0x14, 0x90170110}, | |
10504 | {0x15, 0x0321101f}, | |
11580297 | 10505 | {0x16, 0x03011020}), |
76c2132e DH |
10506 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
10507 | {0x12, 0x99a30140}, | |
10508 | {0x14, 0x90170110}, | |
10509 | {0x15, 0x0321101f}, | |
11580297 | 10510 | {0x16, 0x03011020}), |
76c2132e DH |
10511 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
10512 | {0x12, 0x99a30150}, | |
10513 | {0x14, 0x90170110}, | |
10514 | {0x15, 0x0321101f}, | |
11580297 | 10515 | {0x16, 0x03011020}), |
76c2132e | 10516 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
76c2132e DH |
10517 | {0x14, 0x90170110}, |
10518 | {0x15, 0x0321101f}, | |
11580297 | 10519 | {0x16, 0x03011020}), |
76c2132e DH |
10520 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
10521 | {0x12, 0x90a60130}, | |
10522 | {0x14, 0x90170110}, | |
11580297 | 10523 | {0x15, 0x0321101f}), |
5af29028 KY |
10524 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
10525 | {0x14, 0x01014010}, | |
10526 | {0x17, 0x90170150}, | |
f2adbae0 | 10527 | {0x19, 0x02a11060}, |
5af29028 KY |
10528 | {0x1b, 0x01813030}, |
10529 | {0x21, 0x02211020}), | |
10530 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, | |
10531 | {0x14, 0x01014010}, | |
10532 | {0x18, 0x01a19040}, | |
10533 | {0x1b, 0x01813030}, | |
10534 | {0x21, 0x02211020}), | |
10535 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, | |
10536 | {0x14, 0x01014020}, | |
10537 | {0x17, 0x90170110}, | |
10538 | {0x18, 0x01a19050}, | |
10539 | {0x1b, 0x01813040}, | |
10540 | {0x21, 0x02211030}), | |
532895c5 HW |
10541 | {} |
10542 | }; | |
10543 | ||
1d045db9 TI |
10544 | /* |
10545 | */ | |
bc9f98a9 KY |
10546 | static int patch_alc662(struct hda_codec *codec) |
10547 | { | |
10548 | struct alc_spec *spec; | |
3de95173 | 10549 | int err; |
bc9f98a9 | 10550 | |
3de95173 TI |
10551 | err = alc_alloc_spec(codec, 0x0b); |
10552 | if (err < 0) | |
10553 | return err; | |
bc9f98a9 | 10554 | |
3de95173 | 10555 | spec = codec->spec; |
1f0f4b80 | 10556 | |
225068ab TI |
10557 | spec->shutup = alc_eapd_shutup; |
10558 | ||
53c334ad TI |
10559 | /* handle multiple HPs as is */ |
10560 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
10561 | ||
2c3bf9ab TI |
10562 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
10563 | ||
7639a06c | 10564 | switch (codec->core.vendor_id) { |
f3f9185f KY |
10565 | case 0x10ec0668: |
10566 | spec->init_hook = alc668_restore_default_value; | |
10567 | break; | |
f3f9185f | 10568 | } |
8663ff75 | 10569 | |
c9af753f TI |
10570 | alc_pre_init(codec); |
10571 | ||
1727a771 | 10572 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
8e5a0509 | 10573 | alc662_fixup_tbl, alc662_fixups); |
0fc1e447 | 10574 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); |
1727a771 | 10575 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
8e5a0509 TI |
10576 | |
10577 | alc_auto_parse_customize_define(codec); | |
10578 | ||
7504b6cd TI |
10579 | if (has_cdefine_beep(codec)) |
10580 | spec->gen.beep_nid = 0x01; | |
10581 | ||
1bb7e43e | 10582 | if ((alc_get_coef0(codec) & (1 << 14)) && |
5100cd07 | 10583 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
e16fb6d1 | 10584 | spec->cdefine.platform_type == 1) { |
6134b1a2 WY |
10585 | err = alc_codec_rename(codec, "ALC272X"); |
10586 | if (err < 0) | |
e16fb6d1 | 10587 | goto error; |
20ca0c35 | 10588 | } |
274693f3 | 10589 | |
b9c5106c TI |
10590 | /* automatic parse from the BIOS config */ |
10591 | err = alc662_parse_auto_config(codec); | |
e16fb6d1 TI |
10592 | if (err < 0) |
10593 | goto error; | |
bc9f98a9 | 10594 | |
7504b6cd | 10595 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
7639a06c | 10596 | switch (codec->core.vendor_id) { |
da00c244 | 10597 | case 0x10ec0662: |
fea80fae | 10598 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
da00c244 KY |
10599 | break; |
10600 | case 0x10ec0272: | |
10601 | case 0x10ec0663: | |
10602 | case 0x10ec0665: | |
9ad54547 | 10603 | case 0x10ec0668: |
fea80fae | 10604 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
da00c244 KY |
10605 | break; |
10606 | case 0x10ec0273: | |
fea80fae | 10607 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
da00c244 KY |
10608 | break; |
10609 | } | |
fea80fae TI |
10610 | if (err < 0) |
10611 | goto error; | |
cec27c89 | 10612 | } |
2134ea4f | 10613 | |
1727a771 | 10614 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 10615 | |
bc9f98a9 | 10616 | return 0; |
801f49d3 | 10617 | |
e16fb6d1 TI |
10618 | error: |
10619 | alc_free(codec); | |
10620 | return err; | |
b478b998 KY |
10621 | } |
10622 | ||
d1eb57f4 KY |
10623 | /* |
10624 | * ALC680 support | |
10625 | */ | |
d1eb57f4 | 10626 | |
d1eb57f4 KY |
10627 | static int alc680_parse_auto_config(struct hda_codec *codec) |
10628 | { | |
3e6179b8 | 10629 | return alc_parse_auto_config(codec, NULL, NULL); |
d1eb57f4 KY |
10630 | } |
10631 | ||
d1eb57f4 | 10632 | /* |
d1eb57f4 | 10633 | */ |
d1eb57f4 KY |
10634 | static int patch_alc680(struct hda_codec *codec) |
10635 | { | |
d1eb57f4 KY |
10636 | int err; |
10637 | ||
1f0f4b80 | 10638 | /* ALC680 has no aa-loopback mixer */ |
3de95173 TI |
10639 | err = alc_alloc_spec(codec, 0); |
10640 | if (err < 0) | |
10641 | return err; | |
1f0f4b80 | 10642 | |
1ebec5f2 TI |
10643 | /* automatic parse from the BIOS config */ |
10644 | err = alc680_parse_auto_config(codec); | |
10645 | if (err < 0) { | |
10646 | alc_free(codec); | |
10647 | return err; | |
d1eb57f4 KY |
10648 | } |
10649 | ||
d1eb57f4 KY |
10650 | return 0; |
10651 | } | |
10652 | ||
1da177e4 LT |
10653 | /* |
10654 | * patch entries | |
10655 | */ | |
b9a94a9c | 10656 | static const struct hda_device_id snd_hda_id_realtek[] = { |
0a6f0600 | 10657 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
b9a94a9c | 10658 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
2a36c16e | 10659 | HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), |
4231430d | 10660 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
1948fc06 | 10661 | HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269), |
b9a94a9c TI |
10662 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
10663 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), | |
dcd4f0db | 10664 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
b9a94a9c | 10665 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
736f20a7 | 10666 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
7fbdcd83 | 10667 | HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), |
b9a94a9c TI |
10668 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
10669 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), | |
f429e7e4 | 10670 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
b9a94a9c TI |
10671 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
10672 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), | |
10673 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), | |
10674 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), | |
10675 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), | |
10676 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), | |
10677 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), | |
dcd4f0db | 10678 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
b9a94a9c TI |
10679 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
10680 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), | |
10681 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), | |
10682 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), | |
10683 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), | |
10684 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), | |
0a6f0600 | 10685 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
b9a94a9c | 10686 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
630e3612 | 10687 | HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), |
b9a94a9c | 10688 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
0a6f0600 | 10689 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
b9a94a9c TI |
10690 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
10691 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), | |
10692 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), | |
dcd4f0db | 10693 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
7d727869 | 10694 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
b9a94a9c | 10695 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
28f1f9b2 | 10696 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
1078bef0 | 10697 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
f0778871 | 10698 | HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), |
b9a94a9c TI |
10699 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
10700 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), | |
10701 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), | |
10702 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), | |
10703 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), | |
10704 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), | |
10705 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), | |
10706 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), | |
10707 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), | |
10708 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), | |
10709 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), | |
10710 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), | |
10711 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), | |
10712 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), | |
6fbae35a KY |
10713 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
10714 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), | |
10715 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), | |
83629532 | 10716 | HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), |
78f4f7c2 | 10717 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
b9a94a9c TI |
10718 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
10719 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), | |
10720 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), | |
10721 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), | |
10722 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), | |
10723 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), | |
10724 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), | |
10725 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), | |
10726 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), | |
10727 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), | |
10728 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), | |
e5782a5d | 10729 | HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662), |
b9a94a9c TI |
10730 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
10731 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), | |
6d9ffcff | 10732 | HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), |
65553b12 | 10733 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
a535ad57 | 10734 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
1da177e4 LT |
10735 | {} /* terminator */ |
10736 | }; | |
b9a94a9c | 10737 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
1289e9e8 TI |
10738 | |
10739 | MODULE_LICENSE("GPL"); | |
10740 | MODULE_DESCRIPTION("Realtek HD-audio codec"); | |
10741 | ||
d8a766a1 | 10742 | static struct hda_codec_driver realtek_driver = { |
b9a94a9c | 10743 | .id = snd_hda_id_realtek, |
1289e9e8 TI |
10744 | }; |
10745 | ||
d8a766a1 | 10746 | module_hda_codec_driver(realtek_driver); |