]>
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); |
d922b51d | 112 | |
4a79ba34 | 113 | int init_amp; |
d433a678 | 114 | int codec_variant; /* flag for other variants */ |
97a26570 KY |
115 | unsigned int has_alc5505_dsp:1; |
116 | unsigned int no_depop_delay:1; | |
693abe11 | 117 | unsigned int done_hp_init:1; |
c0ca5ece | 118 | unsigned int no_shutup_pins:1; |
d3ba58bb | 119 | unsigned int ultra_low_power:1; |
476c02e0 | 120 | unsigned int has_hs_key:1; |
92666d45 | 121 | unsigned int no_internal_mic_pin:1; |
e64f14f4 | 122 | |
2c3bf9ab TI |
123 | /* for PLL fix */ |
124 | hda_nid_t pll_nid; | |
125 | unsigned int pll_coef_idx, pll_coef_bit; | |
1bb7e43e | 126 | unsigned int coef0; |
33f4acd3 | 127 | struct input_dev *kb_dev; |
c7b60a89 | 128 | u8 alc_mute_keycode_map[1]; |
df694daa KY |
129 | }; |
130 | ||
f2a227cd TI |
131 | /* |
132 | * COEF access helper functions | |
133 | */ | |
134 | ||
135 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
136 | unsigned int coef_idx) | |
137 | { | |
138 | unsigned int val; | |
139 | ||
140 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
141 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); | |
142 | return val; | |
143 | } | |
144 | ||
145 | #define alc_read_coef_idx(codec, coef_idx) \ | |
146 | alc_read_coefex_idx(codec, 0x20, coef_idx) | |
147 | ||
148 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
149 | unsigned int coef_idx, unsigned int coef_val) | |
150 | { | |
151 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); | |
153 | } | |
154 | ||
155 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ | |
156 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) | |
157 | ||
98b24883 TI |
158 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
159 | unsigned int coef_idx, unsigned int mask, | |
160 | unsigned int bits_set) | |
161 | { | |
162 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); | |
163 | ||
164 | if (val != -1) | |
165 | alc_write_coefex_idx(codec, nid, coef_idx, | |
166 | (val & ~mask) | bits_set); | |
167 | } | |
168 | ||
169 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ | |
170 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) | |
171 | ||
f2a227cd TI |
172 | /* a special bypass for COEF 0; read the cached value at the second time */ |
173 | static unsigned int alc_get_coef0(struct hda_codec *codec) | |
174 | { | |
175 | struct alc_spec *spec = codec->spec; | |
176 | ||
177 | if (!spec->coef0) | |
178 | spec->coef0 = alc_read_coef_idx(codec, 0); | |
179 | return spec->coef0; | |
180 | } | |
181 | ||
54db6c39 TI |
182 | /* coef writes/updates batch */ |
183 | struct coef_fw { | |
184 | unsigned char nid; | |
185 | unsigned char idx; | |
186 | unsigned short mask; | |
187 | unsigned short val; | |
188 | }; | |
189 | ||
190 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ | |
191 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } | |
192 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) | |
193 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) | |
194 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) | |
195 | ||
196 | static void alc_process_coef_fw(struct hda_codec *codec, | |
197 | const struct coef_fw *fw) | |
198 | { | |
199 | for (; fw->nid; fw++) { | |
200 | if (fw->mask == (unsigned short)-1) | |
201 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); | |
202 | else | |
203 | alc_update_coefex_idx(codec, fw->nid, fw->idx, | |
204 | fw->mask, fw->val); | |
205 | } | |
206 | } | |
207 | ||
df694daa | 208 | /* |
1d045db9 | 209 | * GPIO setup tables, used in initialization |
df694daa | 210 | */ |
5579cd6f | 211 | |
bc9f98a9 | 212 | /* Enable GPIO mask and set output */ |
5579cd6f TI |
213 | static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) |
214 | { | |
215 | struct alc_spec *spec = codec->spec; | |
bc9f98a9 | 216 | |
5579cd6f TI |
217 | spec->gpio_mask |= mask; |
218 | spec->gpio_dir |= mask; | |
219 | spec->gpio_data |= mask; | |
220 | } | |
bc9f98a9 | 221 | |
5579cd6f TI |
222 | static void alc_write_gpio_data(struct hda_codec *codec) |
223 | { | |
224 | struct alc_spec *spec = codec->spec; | |
225 | ||
226 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | |
227 | spec->gpio_data); | |
228 | } | |
229 | ||
aaf312de TI |
230 | static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, |
231 | bool on) | |
232 | { | |
233 | struct alc_spec *spec = codec->spec; | |
234 | unsigned int oldval = spec->gpio_data; | |
235 | ||
236 | if (on) | |
237 | spec->gpio_data |= mask; | |
238 | else | |
239 | spec->gpio_data &= ~mask; | |
240 | if (oldval != spec->gpio_data) | |
241 | alc_write_gpio_data(codec); | |
242 | } | |
243 | ||
5579cd6f TI |
244 | static void alc_write_gpio(struct hda_codec *codec) |
245 | { | |
246 | struct alc_spec *spec = codec->spec; | |
247 | ||
248 | if (!spec->gpio_mask) | |
249 | return; | |
250 | ||
251 | snd_hda_codec_write(codec, codec->core.afg, 0, | |
252 | AC_VERB_SET_GPIO_MASK, spec->gpio_mask); | |
253 | snd_hda_codec_write(codec, codec->core.afg, 0, | |
254 | AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); | |
215c850c TI |
255 | if (spec->gpio_write_delay) |
256 | msleep(1); | |
5579cd6f TI |
257 | alc_write_gpio_data(codec); |
258 | } | |
259 | ||
260 | static void alc_fixup_gpio(struct hda_codec *codec, int action, | |
261 | unsigned int mask) | |
262 | { | |
263 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
264 | alc_setup_gpio(codec, mask); | |
265 | } | |
266 | ||
267 | static void alc_fixup_gpio1(struct hda_codec *codec, | |
268 | const struct hda_fixup *fix, int action) | |
269 | { | |
270 | alc_fixup_gpio(codec, action, 0x01); | |
271 | } | |
272 | ||
273 | static void alc_fixup_gpio2(struct hda_codec *codec, | |
274 | const struct hda_fixup *fix, int action) | |
275 | { | |
276 | alc_fixup_gpio(codec, action, 0x02); | |
277 | } | |
278 | ||
279 | static void alc_fixup_gpio3(struct hda_codec *codec, | |
280 | const struct hda_fixup *fix, int action) | |
281 | { | |
282 | alc_fixup_gpio(codec, action, 0x03); | |
283 | } | |
bdd148a3 | 284 | |
ae065f1c TI |
285 | static void alc_fixup_gpio4(struct hda_codec *codec, |
286 | const struct hda_fixup *fix, int action) | |
287 | { | |
288 | alc_fixup_gpio(codec, action, 0x04); | |
289 | } | |
290 | ||
8a503555 TI |
291 | static void alc_fixup_micmute_led(struct hda_codec *codec, |
292 | const struct hda_fixup *fix, int action) | |
293 | { | |
e65bf997 | 294 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
8a503555 TI |
295 | snd_hda_gen_add_micmute_led_cdev(codec, NULL); |
296 | } | |
297 | ||
2c3bf9ab TI |
298 | /* |
299 | * Fix hardware PLL issue | |
300 | * On some codecs, the analog PLL gating control must be off while | |
301 | * the default value is 1. | |
302 | */ | |
303 | static void alc_fix_pll(struct hda_codec *codec) | |
304 | { | |
305 | struct alc_spec *spec = codec->spec; | |
2c3bf9ab | 306 | |
98b24883 TI |
307 | if (spec->pll_nid) |
308 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, | |
309 | 1 << spec->pll_coef_bit, 0); | |
2c3bf9ab TI |
310 | } |
311 | ||
312 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, | |
313 | unsigned int coef_idx, unsigned int coef_bit) | |
314 | { | |
315 | struct alc_spec *spec = codec->spec; | |
316 | spec->pll_nid = nid; | |
317 | spec->pll_coef_idx = coef_idx; | |
318 | spec->pll_coef_bit = coef_bit; | |
319 | alc_fix_pll(codec); | |
320 | } | |
321 | ||
cf5a2279 | 322 | /* update the master volume per volume-knob's unsol event */ |
1a4f69d5 TI |
323 | static void alc_update_knob_master(struct hda_codec *codec, |
324 | struct hda_jack_callback *jack) | |
cf5a2279 TI |
325 | { |
326 | unsigned int val; | |
327 | struct snd_kcontrol *kctl; | |
328 | struct snd_ctl_elem_value *uctl; | |
329 | ||
330 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); | |
331 | if (!kctl) | |
332 | return; | |
333 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | |
334 | if (!uctl) | |
335 | return; | |
2ebab40e | 336 | val = snd_hda_codec_read(codec, jack->nid, 0, |
cf5a2279 TI |
337 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
338 | val &= HDA_AMP_VOLMASK; | |
339 | uctl->value.integer.value[0] = val; | |
340 | uctl->value.integer.value[1] = val; | |
341 | kctl->put(kctl, uctl); | |
342 | kfree(uctl); | |
343 | } | |
344 | ||
29adc4b9 | 345 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
f21d78e2 | 346 | { |
29adc4b9 DH |
347 | /* For some reason, the res given from ALC880 is broken. |
348 | Here we adjust it properly. */ | |
349 | snd_hda_jack_unsol_event(codec, res >> 2); | |
f21d78e2 TI |
350 | } |
351 | ||
394c97f8 KY |
352 | /* Change EAPD to verb control */ |
353 | static void alc_fill_eapd_coef(struct hda_codec *codec) | |
354 | { | |
355 | int coef; | |
356 | ||
357 | coef = alc_get_coef0(codec); | |
358 | ||
7639a06c | 359 | switch (codec->core.vendor_id) { |
394c97f8 KY |
360 | case 0x10ec0262: |
361 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); | |
362 | break; | |
363 | case 0x10ec0267: | |
364 | case 0x10ec0268: | |
365 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); | |
366 | break; | |
367 | case 0x10ec0269: | |
368 | if ((coef & 0x00f0) == 0x0010) | |
369 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); | |
370 | if ((coef & 0x00f0) == 0x0020) | |
371 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
372 | if ((coef & 0x00f0) == 0x0030) | |
373 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); | |
374 | break; | |
375 | case 0x10ec0280: | |
376 | case 0x10ec0284: | |
377 | case 0x10ec0290: | |
378 | case 0x10ec0292: | |
379 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
380 | break; | |
4231430d | 381 | case 0x10ec0225: |
44be77c5 TI |
382 | case 0x10ec0295: |
383 | case 0x10ec0299: | |
384 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
c0dbbdad | 385 | fallthrough; |
44be77c5 | 386 | case 0x10ec0215: |
1948fc06 | 387 | case 0x10ec0230: |
394c97f8 | 388 | case 0x10ec0233: |
ea04a1db | 389 | case 0x10ec0235: |
c4473744 | 390 | case 0x10ec0236: |
7fbdcd83 | 391 | case 0x10ec0245: |
394c97f8 | 392 | case 0x10ec0255: |
c4473744 | 393 | case 0x10ec0256: |
f429e7e4 | 394 | case 0x10ec0257: |
394c97f8 KY |
395 | case 0x10ec0282: |
396 | case 0x10ec0283: | |
397 | case 0x10ec0286: | |
398 | case 0x10ec0288: | |
0a6f0600 | 399 | case 0x10ec0285: |
506b62c3 | 400 | case 0x10ec0298: |
0a6f0600 | 401 | case 0x10ec0289: |
1078bef0 | 402 | case 0x10ec0300: |
394c97f8 KY |
403 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
404 | break; | |
3aabf94c KY |
405 | case 0x10ec0275: |
406 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); | |
407 | break; | |
8822702f HW |
408 | case 0x10ec0287: |
409 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); | |
410 | alc_write_coef_idx(codec, 0x8, 0x4ab7); | |
411 | break; | |
394c97f8 KY |
412 | case 0x10ec0293: |
413 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); | |
414 | break; | |
dcd4f0db KY |
415 | case 0x10ec0234: |
416 | case 0x10ec0274: | |
417 | case 0x10ec0294: | |
6fbae35a KY |
418 | case 0x10ec0700: |
419 | case 0x10ec0701: | |
420 | case 0x10ec0703: | |
83629532 | 421 | case 0x10ec0711: |
dcd4f0db KY |
422 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
423 | break; | |
394c97f8 KY |
424 | case 0x10ec0662: |
425 | if ((coef & 0x00f0) == 0x0030) | |
426 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ | |
427 | break; | |
428 | case 0x10ec0272: | |
429 | case 0x10ec0273: | |
430 | case 0x10ec0663: | |
431 | case 0x10ec0665: | |
432 | case 0x10ec0670: | |
433 | case 0x10ec0671: | |
434 | case 0x10ec0672: | |
435 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ | |
436 | break; | |
9194a1eb | 437 | case 0x10ec0222: |
f0778871 KY |
438 | case 0x10ec0623: |
439 | alc_update_coef_idx(codec, 0x19, 1<<13, 0); | |
440 | break; | |
394c97f8 KY |
441 | case 0x10ec0668: |
442 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); | |
443 | break; | |
444 | case 0x10ec0867: | |
445 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); | |
446 | break; | |
447 | case 0x10ec0888: | |
448 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) | |
449 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); | |
450 | break; | |
451 | case 0x10ec0892: | |
e5782a5d | 452 | case 0x10ec0897: |
394c97f8 KY |
453 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); |
454 | break; | |
455 | case 0x10ec0899: | |
456 | case 0x10ec0900: | |
6d9ffcff | 457 | case 0x10ec0b00: |
65553b12 | 458 | case 0x10ec1168: |
a535ad57 | 459 | case 0x10ec1220: |
394c97f8 KY |
460 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
461 | break; | |
462 | } | |
463 | } | |
464 | ||
f9423e7a KY |
465 | /* additional initialization for ALC888 variants */ |
466 | static void alc888_coef_init(struct hda_codec *codec) | |
467 | { | |
1df8874b KY |
468 | switch (alc_get_coef0(codec) & 0x00f0) { |
469 | /* alc888-VA */ | |
470 | case 0x00: | |
471 | /* alc888-VB */ | |
472 | case 0x10: | |
473 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ | |
474 | break; | |
475 | } | |
87a8c370 JK |
476 | } |
477 | ||
3fb4a508 TI |
478 | /* turn on/off EAPD control (only if available) */ |
479 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) | |
480 | { | |
481 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) | |
482 | return; | |
483 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) | |
484 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, | |
485 | on ? 2 : 0); | |
486 | } | |
487 | ||
691f1fcc TI |
488 | /* turn on/off EAPD controls of the codec */ |
489 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) | |
490 | { | |
491 | /* We currently only handle front, HP */ | |
caf3c043 | 492 | static const hda_nid_t pins[] = { |
af95b414 | 493 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
39fa84e9 | 494 | }; |
caf3c043 | 495 | const hda_nid_t *p; |
39fa84e9 TI |
496 | for (p = pins; *p; p++) |
497 | set_eapd(codec, *p, on); | |
691f1fcc TI |
498 | } |
499 | ||
dad3197d KY |
500 | static int find_ext_mic_pin(struct hda_codec *codec); |
501 | ||
502 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) | |
503 | { | |
504 | const struct hda_pincfg *pin; | |
505 | int mic_pin = find_ext_mic_pin(codec); | |
506 | int i; | |
507 | ||
508 | /* don't shut up pins when unloading the driver; otherwise it breaks | |
509 | * the default pin setup at the next load of the driver | |
510 | */ | |
511 | if (codec->bus->shutdown) | |
512 | return; | |
513 | ||
514 | snd_array_for_each(&codec->init_pins, i, pin) { | |
515 | /* use read here for syncing after issuing each verb */ | |
516 | if (pin->nid != mic_pin) | |
517 | snd_hda_codec_read(codec, pin->nid, 0, | |
518 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | |
519 | } | |
520 | ||
521 | codec->pins_shutup = 1; | |
522 | } | |
523 | ||
c0ca5ece TI |
524 | static void alc_shutup_pins(struct hda_codec *codec) |
525 | { | |
526 | struct alc_spec *spec = codec->spec; | |
527 | ||
dad3197d | 528 | switch (codec->core.vendor_id) { |
5aec9891 KY |
529 | case 0x10ec0236: |
530 | case 0x10ec0256: | |
66c5d718 | 531 | case 0x10ec0283: |
dad3197d KY |
532 | case 0x10ec0286: |
533 | case 0x10ec0288: | |
534 | case 0x10ec0298: | |
535 | alc_headset_mic_no_shutup(codec); | |
536 | break; | |
537 | default: | |
538 | if (!spec->no_shutup_pins) | |
539 | snd_hda_shutup_pins(codec); | |
540 | break; | |
541 | } | |
c0ca5ece TI |
542 | } |
543 | ||
1c716153 | 544 | /* generic shutup callback; |
4ce8e6a5 | 545 | * just turning off EAPD and a little pause for avoiding pop-noise |
1c716153 TI |
546 | */ |
547 | static void alc_eapd_shutup(struct hda_codec *codec) | |
548 | { | |
97a26570 KY |
549 | struct alc_spec *spec = codec->spec; |
550 | ||
1c716153 | 551 | alc_auto_setup_eapd(codec, false); |
97a26570 KY |
552 | if (!spec->no_depop_delay) |
553 | msleep(200); | |
c0ca5ece | 554 | alc_shutup_pins(codec); |
1c716153 TI |
555 | } |
556 | ||
1d045db9 | 557 | /* generic EAPD initialization */ |
4a79ba34 | 558 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
bc9f98a9 | 559 | { |
39fa84e9 | 560 | alc_auto_setup_eapd(codec, true); |
5579cd6f | 561 | alc_write_gpio(codec); |
4a79ba34 | 562 | switch (type) { |
4a79ba34 | 563 | case ALC_INIT_DEFAULT: |
7639a06c | 564 | switch (codec->core.vendor_id) { |
c9b58006 | 565 | case 0x10ec0260: |
98b24883 | 566 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
c9b58006 | 567 | break; |
c9b58006 KY |
568 | case 0x10ec0880: |
569 | case 0x10ec0882: | |
570 | case 0x10ec0883: | |
571 | case 0x10ec0885: | |
1df8874b | 572 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
c9b58006 | 573 | break; |
f9423e7a | 574 | case 0x10ec0888: |
4a79ba34 | 575 | alc888_coef_init(codec); |
f9423e7a | 576 | break; |
bc9f98a9 | 577 | } |
4a79ba34 TI |
578 | break; |
579 | } | |
580 | } | |
581 | ||
35a39f98 TI |
582 | /* get a primary headphone pin if available */ |
583 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) | |
584 | { | |
585 | if (spec->gen.autocfg.hp_pins[0]) | |
586 | return spec->gen.autocfg.hp_pins[0]; | |
587 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
588 | return spec->gen.autocfg.line_out_pins[0]; | |
589 | return 0; | |
590 | } | |
08c189f2 | 591 | |
1d045db9 | 592 | /* |
08c189f2 | 593 | * Realtek SSID verification |
1d045db9 | 594 | */ |
42cf0d01 | 595 | |
08c189f2 TI |
596 | /* Could be any non-zero and even value. When used as fixup, tells |
597 | * the driver to ignore any present sku defines. | |
598 | */ | |
599 | #define ALC_FIXUP_SKU_IGNORE (2) | |
1a1455de | 600 | |
08c189f2 TI |
601 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
602 | const struct hda_fixup *fix, int action) | |
1a1455de | 603 | { |
1a1455de | 604 | struct alc_spec *spec = codec->spec; |
08c189f2 TI |
605 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
606 | spec->cdefine.fixup = 1; | |
607 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; | |
1a1455de | 608 | } |
1a1455de TI |
609 | } |
610 | ||
b5c6611f ML |
611 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
612 | const struct hda_fixup *fix, int action) | |
613 | { | |
614 | struct alc_spec *spec = codec->spec; | |
615 | ||
84d2dc3e | 616 | if (action == HDA_FIXUP_ACT_PROBE) { |
b5c6611f | 617 | spec->no_depop_delay = 1; |
84d2dc3e ML |
618 | codec->depop_delay = 0; |
619 | } | |
b5c6611f ML |
620 | } |
621 | ||
08c189f2 | 622 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
4a79ba34 | 623 | { |
08c189f2 TI |
624 | unsigned int ass, tmp, i; |
625 | unsigned nid = 0; | |
4a79ba34 TI |
626 | struct alc_spec *spec = codec->spec; |
627 | ||
08c189f2 | 628 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
4a79ba34 | 629 | |
08c189f2 TI |
630 | if (spec->cdefine.fixup) { |
631 | ass = spec->cdefine.sku_cfg; | |
632 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
633 | return -1; | |
634 | goto do_sku; | |
bb35febd TI |
635 | } |
636 | ||
5100cd07 TI |
637 | if (!codec->bus->pci) |
638 | return -1; | |
7639a06c | 639 | ass = codec->core.subsystem_id & 0xffff; |
08c189f2 TI |
640 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
641 | goto do_sku; | |
4a79ba34 | 642 | |
08c189f2 | 643 | nid = 0x1d; |
7639a06c | 644 | if (codec->core.vendor_id == 0x10ec0260) |
08c189f2 TI |
645 | nid = 0x17; |
646 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
42cf0d01 | 647 | |
08c189f2 | 648 | if (!(ass & 1)) { |
4e76a883 | 649 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
7639a06c | 650 | codec->core.chip_name, ass); |
08c189f2 | 651 | return -1; |
42cf0d01 DH |
652 | } |
653 | ||
08c189f2 TI |
654 | /* check sum */ |
655 | tmp = 0; | |
656 | for (i = 1; i < 16; i++) { | |
657 | if ((ass >> i) & 1) | |
658 | tmp++; | |
ae8a60a5 | 659 | } |
08c189f2 TI |
660 | if (((ass >> 16) & 0xf) != tmp) |
661 | return -1; | |
ae8a60a5 | 662 | |
da00c244 KY |
663 | spec->cdefine.port_connectivity = ass >> 30; |
664 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; | |
665 | spec->cdefine.check_sum = (ass >> 16) & 0xf; | |
666 | spec->cdefine.customization = ass >> 8; | |
667 | do_sku: | |
668 | spec->cdefine.sku_cfg = ass; | |
669 | spec->cdefine.external_amp = (ass & 0x38) >> 3; | |
670 | spec->cdefine.platform_type = (ass & 0x4) >> 2; | |
671 | spec->cdefine.swap = (ass & 0x2) >> 1; | |
672 | spec->cdefine.override = ass & 0x1; | |
673 | ||
4e76a883 | 674 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
da00c244 | 675 | nid, spec->cdefine.sku_cfg); |
4e76a883 | 676 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
da00c244 | 677 | spec->cdefine.port_connectivity); |
4e76a883 TI |
678 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
679 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); | |
680 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); | |
681 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); | |
682 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); | |
683 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); | |
684 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); | |
da00c244 KY |
685 | |
686 | return 0; | |
687 | } | |
688 | ||
08c189f2 TI |
689 | /* return the position of NID in the list, or -1 if not found */ |
690 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) | |
691 | { | |
692 | int i; | |
693 | for (i = 0; i < nums; i++) | |
694 | if (list[i] == nid) | |
695 | return i; | |
696 | return -1; | |
697 | } | |
1d045db9 | 698 | /* return true if the given NID is found in the list */ |
3af9ee6b TI |
699 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
700 | { | |
21268961 | 701 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
3af9ee6b TI |
702 | } |
703 | ||
4a79ba34 TI |
704 | /* check subsystem ID and set up device-specific initialization; |
705 | * return 1 if initialized, 0 if invalid SSID | |
706 | */ | |
707 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. | |
708 | * 31 ~ 16 : Manufacture ID | |
709 | * 15 ~ 8 : SKU ID | |
710 | * 7 ~ 0 : Assembly ID | |
711 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 | |
712 | */ | |
58c57cfa | 713 | static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) |
4a79ba34 TI |
714 | { |
715 | unsigned int ass, tmp, i; | |
716 | unsigned nid; | |
717 | struct alc_spec *spec = codec->spec; | |
718 | ||
90622917 DH |
719 | if (spec->cdefine.fixup) { |
720 | ass = spec->cdefine.sku_cfg; | |
721 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
722 | return 0; | |
723 | goto do_sku; | |
724 | } | |
725 | ||
7639a06c | 726 | ass = codec->core.subsystem_id & 0xffff; |
5100cd07 TI |
727 | if (codec->bus->pci && |
728 | ass != codec->bus->pci->subsystem_device && (ass & 1)) | |
4a79ba34 TI |
729 | goto do_sku; |
730 | ||
731 | /* invalid SSID, check the special NID pin defcfg instead */ | |
732 | /* | |
def319f9 | 733 | * 31~30 : port connectivity |
4a79ba34 TI |
734 | * 29~21 : reserve |
735 | * 20 : PCBEEP input | |
736 | * 19~16 : Check sum (15:1) | |
737 | * 15~1 : Custom | |
738 | * 0 : override | |
739 | */ | |
740 | nid = 0x1d; | |
7639a06c | 741 | if (codec->core.vendor_id == 0x10ec0260) |
4a79ba34 TI |
742 | nid = 0x17; |
743 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
4e76a883 TI |
744 | codec_dbg(codec, |
745 | "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", | |
cb6605c1 | 746 | ass, nid); |
6227cdce | 747 | if (!(ass & 1)) |
4a79ba34 TI |
748 | return 0; |
749 | if ((ass >> 30) != 1) /* no physical connection */ | |
750 | return 0; | |
751 | ||
752 | /* check sum */ | |
753 | tmp = 0; | |
754 | for (i = 1; i < 16; i++) { | |
755 | if ((ass >> i) & 1) | |
756 | tmp++; | |
757 | } | |
758 | if (((ass >> 16) & 0xf) != tmp) | |
759 | return 0; | |
760 | do_sku: | |
4e76a883 | 761 | codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", |
7639a06c | 762 | ass & 0xffff, codec->core.vendor_id); |
4a79ba34 TI |
763 | /* |
764 | * 0 : override | |
765 | * 1 : Swap Jack | |
766 | * 2 : 0 --> Desktop, 1 --> Laptop | |
767 | * 3~5 : External Amplifier control | |
768 | * 7~6 : Reserved | |
769 | */ | |
770 | tmp = (ass & 0x38) >> 3; /* external Amp control */ | |
1c76aa5f TI |
771 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
772 | switch (tmp) { | |
773 | case 1: | |
5579cd6f | 774 | alc_setup_gpio(codec, 0x01); |
1c76aa5f TI |
775 | break; |
776 | case 3: | |
5579cd6f | 777 | alc_setup_gpio(codec, 0x02); |
1c76aa5f TI |
778 | break; |
779 | case 7: | |
5579cd6f | 780 | alc_setup_gpio(codec, 0x03); |
1c76aa5f TI |
781 | break; |
782 | case 5: | |
783 | default: | |
784 | spec->init_amp = ALC_INIT_DEFAULT; | |
785 | break; | |
786 | } | |
bc9f98a9 | 787 | } |
ea1fb29a | 788 | |
8c427226 | 789 | /* is laptop or Desktop and enable the function "Mute internal speaker |
c9b58006 KY |
790 | * when the external headphone out jack is plugged" |
791 | */ | |
8c427226 | 792 | if (!(ass & 0x8000)) |
4a79ba34 | 793 | return 1; |
c9b58006 KY |
794 | /* |
795 | * 10~8 : Jack location | |
796 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered | |
797 | * 14~13: Resvered | |
798 | * 15 : 1 --> enable the function "Mute internal speaker | |
799 | * when the external headphone out jack is plugged" | |
800 | */ | |
35a39f98 | 801 | if (!alc_get_hp_pin(spec)) { |
01d4825d | 802 | hda_nid_t nid; |
c9b58006 | 803 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
58c57cfa | 804 | nid = ports[tmp]; |
08c189f2 TI |
805 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
806 | spec->gen.autocfg.line_outs)) | |
3af9ee6b | 807 | return 1; |
08c189f2 | 808 | spec->gen.autocfg.hp_pins[0] = nid; |
c9b58006 | 809 | } |
4a79ba34 TI |
810 | return 1; |
811 | } | |
ea1fb29a | 812 | |
3e6179b8 TI |
813 | /* Check the validity of ALC subsystem-id |
814 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ | |
815 | static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) | |
4a79ba34 | 816 | { |
58c57cfa | 817 | if (!alc_subsystem_id(codec, ports)) { |
4a79ba34 | 818 | struct alc_spec *spec = codec->spec; |
67791202 TI |
819 | if (spec->init_amp == ALC_INIT_UNDEFINED) { |
820 | codec_dbg(codec, | |
821 | "realtek: Enable default setup for auto mode as fallback\n"); | |
822 | spec->init_amp = ALC_INIT_DEFAULT; | |
823 | } | |
4a79ba34 | 824 | } |
21268961 | 825 | } |
1a1455de | 826 | |
1d045db9 | 827 | /* |
ef8ef5fb | 828 | */ |
f9e336f6 | 829 | |
9d36a7dc DH |
830 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
831 | const struct hda_fixup *fix, int action) | |
125821ae TI |
832 | { |
833 | struct alc_spec *spec = codec->spec; | |
668d1e96 | 834 | |
9d36a7dc | 835 | spec->gen.inv_dmic_split = 1; |
6e72aa5f TI |
836 | } |
837 | ||
e9edcee0 | 838 | |
08c189f2 | 839 | static int alc_build_controls(struct hda_codec *codec) |
1d045db9 | 840 | { |
a5cb463a | 841 | int err; |
e9427969 | 842 | |
08c189f2 TI |
843 | err = snd_hda_gen_build_controls(codec); |
844 | if (err < 0) | |
845 | return err; | |
1da177e4 | 846 | |
1727a771 | 847 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
1c4a54b4 | 848 | return 0; |
a361d84b KY |
849 | } |
850 | ||
a361d84b | 851 | |
df694daa | 852 | /* |
08c189f2 | 853 | * Common callbacks |
df694daa | 854 | */ |
a361d84b | 855 | |
c9af753f TI |
856 | static void alc_pre_init(struct hda_codec *codec) |
857 | { | |
858 | alc_fill_eapd_coef(codec); | |
859 | } | |
860 | ||
aeac1a0d KY |
861 | #define is_s3_resume(codec) \ |
862 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) | |
c9af753f TI |
863 | #define is_s4_resume(codec) \ |
864 | ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) | |
865 | ||
08c189f2 | 866 | static int alc_init(struct hda_codec *codec) |
1d045db9 TI |
867 | { |
868 | struct alc_spec *spec = codec->spec; | |
a361d84b | 869 | |
c9af753f TI |
870 | /* hibernation resume needs the full chip initialization */ |
871 | if (is_s4_resume(codec)) | |
872 | alc_pre_init(codec); | |
873 | ||
08c189f2 TI |
874 | if (spec->init_hook) |
875 | spec->init_hook(codec); | |
a361d84b | 876 | |
89781d08 | 877 | spec->gen.skip_verbs = 1; /* applied in below */ |
607ca3bd | 878 | snd_hda_gen_init(codec); |
08c189f2 TI |
879 | alc_fix_pll(codec); |
880 | alc_auto_init_amp(codec, spec->init_amp); | |
89781d08 | 881 | snd_hda_apply_verbs(codec); /* apply verbs here after own init */ |
3abf2f36 | 882 | |
1727a771 | 883 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
a361d84b | 884 | |
1d045db9 TI |
885 | return 0; |
886 | } | |
a361d84b | 887 | |
08c189f2 | 888 | static inline void alc_shutup(struct hda_codec *codec) |
1d045db9 TI |
889 | { |
890 | struct alc_spec *spec = codec->spec; | |
a361d84b | 891 | |
c7273bd6 TI |
892 | if (!snd_hda_get_bool_hint(codec, "shutup")) |
893 | return; /* disabled explicitly by hints */ | |
894 | ||
08c189f2 TI |
895 | if (spec && spec->shutup) |
896 | spec->shutup(codec); | |
9bfb2844 | 897 | else |
c0ca5ece | 898 | alc_shutup_pins(codec); |
1d045db9 TI |
899 | } |
900 | ||
8a02c0cc | 901 | #define alc_free snd_hda_gen_free |
2134ea4f | 902 | |
08c189f2 TI |
903 | #ifdef CONFIG_PM |
904 | static void alc_power_eapd(struct hda_codec *codec) | |
1d045db9 | 905 | { |
08c189f2 | 906 | alc_auto_setup_eapd(codec, false); |
1d045db9 | 907 | } |
2134ea4f | 908 | |
08c189f2 | 909 | static int alc_suspend(struct hda_codec *codec) |
1d045db9 TI |
910 | { |
911 | struct alc_spec *spec = codec->spec; | |
08c189f2 TI |
912 | alc_shutup(codec); |
913 | if (spec && spec->power_hook) | |
914 | spec->power_hook(codec); | |
a361d84b KY |
915 | return 0; |
916 | } | |
08c189f2 | 917 | #endif |
a361d84b | 918 | |
08c189f2 TI |
919 | #ifdef CONFIG_PM |
920 | static int alc_resume(struct hda_codec *codec) | |
1d045db9 | 921 | { |
97a26570 KY |
922 | struct alc_spec *spec = codec->spec; |
923 | ||
924 | if (!spec->no_depop_delay) | |
925 | msleep(150); /* to avoid pop noise */ | |
08c189f2 | 926 | codec->patch_ops.init(codec); |
1a462be5 | 927 | snd_hda_regmap_sync(codec); |
08c189f2 TI |
928 | hda_call_check_power_status(codec, 0x01); |
929 | return 0; | |
1d045db9 | 930 | } |
08c189f2 | 931 | #endif |
f6a92248 | 932 | |
1d045db9 | 933 | /* |
1d045db9 | 934 | */ |
08c189f2 TI |
935 | static const struct hda_codec_ops alc_patch_ops = { |
936 | .build_controls = alc_build_controls, | |
937 | .build_pcms = snd_hda_gen_build_pcms, | |
938 | .init = alc_init, | |
939 | .free = alc_free, | |
940 | .unsol_event = snd_hda_jack_unsol_event, | |
941 | #ifdef CONFIG_PM | |
942 | .resume = alc_resume, | |
08c189f2 | 943 | .suspend = alc_suspend, |
fce52a3b | 944 | .check_power_status = snd_hda_gen_check_power_status, |
08c189f2 | 945 | #endif |
08c189f2 | 946 | }; |
f6a92248 | 947 | |
f53281e6 | 948 | |
ded255be | 949 | #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) |
e01bf509 | 950 | |
e4770629 | 951 | /* |
4b016931 | 952 | * Rename codecs appropriately from COEF value or subvendor id |
e4770629 | 953 | */ |
08c189f2 TI |
954 | struct alc_codec_rename_table { |
955 | unsigned int vendor_id; | |
956 | unsigned short coef_mask; | |
957 | unsigned short coef_bits; | |
958 | const char *name; | |
959 | }; | |
84898e87 | 960 | |
4b016931 KY |
961 | struct alc_codec_rename_pci_table { |
962 | unsigned int codec_vendor_id; | |
963 | unsigned short pci_subvendor; | |
964 | unsigned short pci_subdevice; | |
965 | const char *name; | |
966 | }; | |
967 | ||
6b0f95c4 | 968 | static const struct alc_codec_rename_table rename_tbl[] = { |
e6e5f7ad | 969 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
08c189f2 TI |
970 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
971 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, | |
972 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, | |
973 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, | |
974 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, | |
975 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, | |
976 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, | |
977 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, | |
e6e5f7ad | 978 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
08c189f2 TI |
979 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
980 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, | |
981 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, | |
982 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, | |
983 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, | |
984 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, | |
985 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, | |
986 | { } /* terminator */ | |
987 | }; | |
84898e87 | 988 | |
6b0f95c4 | 989 | static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
4b016931 KY |
990 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, |
991 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, | |
992 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, | |
193177de | 993 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
4b016931 | 994 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
193177de | 995 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
4b016931 KY |
996 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
997 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, | |
e6e5f7ad KY |
998 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
999 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, | |
2c674fac | 1000 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
736f20a7 | 1001 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
82324502 | 1002 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
4231430d | 1003 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
7d727869 | 1004 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
28f1f9b2 | 1005 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
e6e5f7ad KY |
1006 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
1007 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, | |
1008 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, | |
1009 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, | |
1010 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, | |
1011 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, | |
1012 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, | |
1013 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, | |
1014 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, | |
1015 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, | |
1016 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, | |
4b016931 KY |
1017 | { } /* terminator */ |
1018 | }; | |
1019 | ||
08c189f2 | 1020 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
1d045db9 | 1021 | { |
08c189f2 | 1022 | const struct alc_codec_rename_table *p; |
4b016931 | 1023 | const struct alc_codec_rename_pci_table *q; |
60db6b53 | 1024 | |
08c189f2 | 1025 | for (p = rename_tbl; p->vendor_id; p++) { |
7639a06c | 1026 | if (p->vendor_id != codec->core.vendor_id) |
08c189f2 TI |
1027 | continue; |
1028 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) | |
1029 | return alc_codec_rename(codec, p->name); | |
1d045db9 | 1030 | } |
4b016931 | 1031 | |
5100cd07 TI |
1032 | if (!codec->bus->pci) |
1033 | return 0; | |
4b016931 | 1034 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
7639a06c | 1035 | if (q->codec_vendor_id != codec->core.vendor_id) |
4b016931 KY |
1036 | continue; |
1037 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) | |
1038 | continue; | |
1039 | if (!q->pci_subdevice || | |
1040 | q->pci_subdevice == codec->bus->pci->subsystem_device) | |
1041 | return alc_codec_rename(codec, q->name); | |
1042 | } | |
1043 | ||
08c189f2 | 1044 | return 0; |
1d045db9 | 1045 | } |
f53281e6 | 1046 | |
e4770629 | 1047 | |
1d045db9 TI |
1048 | /* |
1049 | * Digital-beep handlers | |
1050 | */ | |
1051 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | |
fea80fae TI |
1052 | |
1053 | /* additional beep mixers; private_value will be overwritten */ | |
1054 | static const struct snd_kcontrol_new alc_beep_mixer[] = { | |
1055 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), | |
1056 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), | |
1057 | }; | |
1058 | ||
1059 | /* set up and create beep controls */ | |
1060 | static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, | |
1061 | int idx, int dir) | |
1062 | { | |
1063 | struct snd_kcontrol_new *knew; | |
1064 | unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); | |
1065 | int i; | |
1066 | ||
1067 | for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { | |
1068 | knew = snd_hda_gen_add_kctl(&spec->gen, NULL, | |
1069 | &alc_beep_mixer[i]); | |
1070 | if (!knew) | |
1071 | return -ENOMEM; | |
1072 | knew->private_value = beep_amp; | |
1073 | } | |
1074 | return 0; | |
1075 | } | |
84898e87 | 1076 | |
6317e5eb | 1077 | static const struct snd_pci_quirk beep_allow_list[] = { |
7110005e | 1078 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
a4b7f21d | 1079 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
1d045db9 | 1080 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
8554ee40 | 1081 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
1d045db9 TI |
1082 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
1083 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), | |
1084 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), | |
78f8baf1 | 1085 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
1d045db9 | 1086 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
6317e5eb | 1087 | /* denylist -- no beep available */ |
051c78af TI |
1088 | SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
1089 | SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), | |
1d045db9 | 1090 | {} |
fe3eb0a7 KY |
1091 | }; |
1092 | ||
1d045db9 TI |
1093 | static inline int has_cdefine_beep(struct hda_codec *codec) |
1094 | { | |
1095 | struct alc_spec *spec = codec->spec; | |
1096 | const struct snd_pci_quirk *q; | |
6317e5eb | 1097 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); |
1d045db9 TI |
1098 | if (q) |
1099 | return q->value; | |
1100 | return spec->cdefine.enable_pcbeep; | |
1101 | } | |
1102 | #else | |
fea80fae | 1103 | #define set_beep_amp(spec, nid, idx, dir) 0 |
1d045db9 TI |
1104 | #define has_cdefine_beep(codec) 0 |
1105 | #endif | |
84898e87 | 1106 | |
1d045db9 TI |
1107 | /* parse the BIOS configuration and set up the alc_spec */ |
1108 | /* return 1 if successful, 0 if the proper config is not found, | |
1109 | * or a negative error code | |
1110 | */ | |
3e6179b8 TI |
1111 | static int alc_parse_auto_config(struct hda_codec *codec, |
1112 | const hda_nid_t *ignore_nids, | |
1113 | const hda_nid_t *ssid_nids) | |
1d045db9 TI |
1114 | { |
1115 | struct alc_spec *spec = codec->spec; | |
08c189f2 | 1116 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
1d045db9 | 1117 | int err; |
26f5df26 | 1118 | |
53c334ad TI |
1119 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
1120 | spec->parse_flags); | |
1d045db9 TI |
1121 | if (err < 0) |
1122 | return err; | |
3e6179b8 TI |
1123 | |
1124 | if (ssid_nids) | |
1125 | alc_ssid_check(codec, ssid_nids); | |
64154835 | 1126 | |
08c189f2 TI |
1127 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
1128 | if (err < 0) | |
1129 | return err; | |
070cff4c | 1130 | |
1d045db9 | 1131 | return 1; |
60db6b53 | 1132 | } |
f6a92248 | 1133 | |
3de95173 TI |
1134 | /* common preparation job for alc_spec */ |
1135 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) | |
1136 | { | |
1137 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); | |
1138 | int err; | |
1139 | ||
1140 | if (!spec) | |
1141 | return -ENOMEM; | |
1142 | codec->spec = spec; | |
08c189f2 TI |
1143 | snd_hda_gen_spec_init(&spec->gen); |
1144 | spec->gen.mixer_nid = mixer_nid; | |
1145 | spec->gen.own_eapd_ctl = 1; | |
1098b7c2 | 1146 | codec->single_adc_amp = 1; |
08c189f2 TI |
1147 | /* FIXME: do we need this for all Realtek codec models? */ |
1148 | codec->spdif_status_reset = 1; | |
a6e7d0a4 | 1149 | codec->forced_resume = 1; |
225068ab | 1150 | codec->patch_ops = alc_patch_ops; |
3de95173 TI |
1151 | |
1152 | err = alc_codec_rename_from_preset(codec); | |
1153 | if (err < 0) { | |
1154 | kfree(spec); | |
1155 | return err; | |
1156 | } | |
1157 | return 0; | |
1158 | } | |
1159 | ||
3e6179b8 TI |
1160 | static int alc880_parse_auto_config(struct hda_codec *codec) |
1161 | { | |
1162 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; | |
7d7eb9ea | 1163 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
3e6179b8 TI |
1164 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
1165 | } | |
1166 | ||
ee3b2969 TI |
1167 | /* |
1168 | * ALC880 fix-ups | |
1169 | */ | |
1170 | enum { | |
411225a0 | 1171 | ALC880_FIXUP_GPIO1, |
ee3b2969 TI |
1172 | ALC880_FIXUP_GPIO2, |
1173 | ALC880_FIXUP_MEDION_RIM, | |
dc6af52d | 1174 | ALC880_FIXUP_LG, |
db8a38e5 | 1175 | ALC880_FIXUP_LG_LW25, |
f02aab5d | 1176 | ALC880_FIXUP_W810, |
27e917f8 | 1177 | ALC880_FIXUP_EAPD_COEF, |
b9368f5c | 1178 | ALC880_FIXUP_TCL_S700, |
cf5a2279 TI |
1179 | ALC880_FIXUP_VOL_KNOB, |
1180 | ALC880_FIXUP_FUJITSU, | |
ba533818 | 1181 | ALC880_FIXUP_F1734, |
817de92f | 1182 | ALC880_FIXUP_UNIWILL, |
967b88c4 | 1183 | ALC880_FIXUP_UNIWILL_DIG, |
96e225f6 | 1184 | ALC880_FIXUP_Z71V, |
487a588d | 1185 | ALC880_FIXUP_ASUS_W5A, |
67b6ec31 TI |
1186 | ALC880_FIXUP_3ST_BASE, |
1187 | ALC880_FIXUP_3ST, | |
1188 | ALC880_FIXUP_3ST_DIG, | |
1189 | ALC880_FIXUP_5ST_BASE, | |
1190 | ALC880_FIXUP_5ST, | |
1191 | ALC880_FIXUP_5ST_DIG, | |
1192 | ALC880_FIXUP_6ST_BASE, | |
1193 | ALC880_FIXUP_6ST, | |
1194 | ALC880_FIXUP_6ST_DIG, | |
5397145f | 1195 | ALC880_FIXUP_6ST_AUTOMUTE, |
ee3b2969 TI |
1196 | }; |
1197 | ||
cf5a2279 TI |
1198 | /* enable the volume-knob widget support on NID 0x21 */ |
1199 | static void alc880_fixup_vol_knob(struct hda_codec *codec, | |
1727a771 | 1200 | const struct hda_fixup *fix, int action) |
cf5a2279 | 1201 | { |
1727a771 | 1202 | if (action == HDA_FIXUP_ACT_PROBE) |
62f949bf TI |
1203 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
1204 | alc_update_knob_master); | |
cf5a2279 TI |
1205 | } |
1206 | ||
1727a771 | 1207 | static const struct hda_fixup alc880_fixups[] = { |
411225a0 | 1208 | [ALC880_FIXUP_GPIO1] = { |
5579cd6f TI |
1209 | .type = HDA_FIXUP_FUNC, |
1210 | .v.func = alc_fixup_gpio1, | |
411225a0 | 1211 | }, |
ee3b2969 | 1212 | [ALC880_FIXUP_GPIO2] = { |
5579cd6f TI |
1213 | .type = HDA_FIXUP_FUNC, |
1214 | .v.func = alc_fixup_gpio2, | |
ee3b2969 TI |
1215 | }, |
1216 | [ALC880_FIXUP_MEDION_RIM] = { | |
1727a771 | 1217 | .type = HDA_FIXUP_VERBS, |
ee3b2969 TI |
1218 | .v.verbs = (const struct hda_verb[]) { |
1219 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1220 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1221 | { } | |
1222 | }, | |
1223 | .chained = true, | |
1224 | .chain_id = ALC880_FIXUP_GPIO2, | |
1225 | }, | |
dc6af52d | 1226 | [ALC880_FIXUP_LG] = { |
1727a771 TI |
1227 | .type = HDA_FIXUP_PINS, |
1228 | .v.pins = (const struct hda_pintbl[]) { | |
dc6af52d TI |
1229 | /* disable bogus unused pins */ |
1230 | { 0x16, 0x411111f0 }, | |
1231 | { 0x18, 0x411111f0 }, | |
1232 | { 0x1a, 0x411111f0 }, | |
1233 | { } | |
1234 | } | |
1235 | }, | |
db8a38e5 TI |
1236 | [ALC880_FIXUP_LG_LW25] = { |
1237 | .type = HDA_FIXUP_PINS, | |
1238 | .v.pins = (const struct hda_pintbl[]) { | |
1239 | { 0x1a, 0x0181344f }, /* line-in */ | |
1240 | { 0x1b, 0x0321403f }, /* headphone */ | |
1241 | { } | |
1242 | } | |
1243 | }, | |
f02aab5d | 1244 | [ALC880_FIXUP_W810] = { |
1727a771 TI |
1245 | .type = HDA_FIXUP_PINS, |
1246 | .v.pins = (const struct hda_pintbl[]) { | |
f02aab5d TI |
1247 | /* disable bogus unused pins */ |
1248 | { 0x17, 0x411111f0 }, | |
1249 | { } | |
1250 | }, | |
1251 | .chained = true, | |
1252 | .chain_id = ALC880_FIXUP_GPIO2, | |
1253 | }, | |
27e917f8 | 1254 | [ALC880_FIXUP_EAPD_COEF] = { |
1727a771 | 1255 | .type = HDA_FIXUP_VERBS, |
27e917f8 TI |
1256 | .v.verbs = (const struct hda_verb[]) { |
1257 | /* change to EAPD mode */ | |
1258 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1259 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1260 | {} | |
1261 | }, | |
1262 | }, | |
b9368f5c | 1263 | [ALC880_FIXUP_TCL_S700] = { |
1727a771 | 1264 | .type = HDA_FIXUP_VERBS, |
b9368f5c TI |
1265 | .v.verbs = (const struct hda_verb[]) { |
1266 | /* change to EAPD mode */ | |
1267 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1268 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
1269 | {} | |
1270 | }, | |
1271 | .chained = true, | |
1272 | .chain_id = ALC880_FIXUP_GPIO2, | |
1273 | }, | |
cf5a2279 | 1274 | [ALC880_FIXUP_VOL_KNOB] = { |
1727a771 | 1275 | .type = HDA_FIXUP_FUNC, |
cf5a2279 TI |
1276 | .v.func = alc880_fixup_vol_knob, |
1277 | }, | |
1278 | [ALC880_FIXUP_FUJITSU] = { | |
1279 | /* override all pins as BIOS on old Amilo is broken */ | |
1727a771 TI |
1280 | .type = HDA_FIXUP_PINS, |
1281 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1282 | { 0x14, 0x0121401f }, /* HP */ |
cf5a2279 TI |
1283 | { 0x15, 0x99030120 }, /* speaker */ |
1284 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1285 | { 0x17, 0x411111f0 }, /* N/A */ | |
1286 | { 0x18, 0x411111f0 }, /* N/A */ | |
1287 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1288 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1289 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1290 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1291 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1292 | { 0x1e, 0x01454140 }, /* SPDIF out */ | |
1293 | { } | |
1294 | }, | |
1295 | .chained = true, | |
1296 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1297 | }, | |
ba533818 TI |
1298 | [ALC880_FIXUP_F1734] = { |
1299 | /* almost compatible with FUJITSU, but no bass and SPDIF */ | |
1727a771 TI |
1300 | .type = HDA_FIXUP_PINS, |
1301 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1302 | { 0x14, 0x0121401f }, /* HP */ |
ba533818 TI |
1303 | { 0x15, 0x99030120 }, /* speaker */ |
1304 | { 0x16, 0x411111f0 }, /* N/A */ | |
1305 | { 0x17, 0x411111f0 }, /* N/A */ | |
1306 | { 0x18, 0x411111f0 }, /* N/A */ | |
1307 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1308 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1309 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1310 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1311 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1312 | { 0x1e, 0x411111f0 }, /* N/A */ | |
1313 | { } | |
1314 | }, | |
1315 | .chained = true, | |
1316 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1317 | }, | |
817de92f TI |
1318 | [ALC880_FIXUP_UNIWILL] = { |
1319 | /* need to fix HP and speaker pins to be parsed correctly */ | |
1727a771 TI |
1320 | .type = HDA_FIXUP_PINS, |
1321 | .v.pins = (const struct hda_pintbl[]) { | |
817de92f TI |
1322 | { 0x14, 0x0121411f }, /* HP */ |
1323 | { 0x15, 0x99030120 }, /* speaker */ | |
1324 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1325 | { } | |
1326 | }, | |
1327 | }, | |
967b88c4 | 1328 | [ALC880_FIXUP_UNIWILL_DIG] = { |
1727a771 TI |
1329 | .type = HDA_FIXUP_PINS, |
1330 | .v.pins = (const struct hda_pintbl[]) { | |
967b88c4 TI |
1331 | /* disable bogus unused pins */ |
1332 | { 0x17, 0x411111f0 }, | |
1333 | { 0x19, 0x411111f0 }, | |
1334 | { 0x1b, 0x411111f0 }, | |
1335 | { 0x1f, 0x411111f0 }, | |
1336 | { } | |
1337 | } | |
1338 | }, | |
96e225f6 | 1339 | [ALC880_FIXUP_Z71V] = { |
1727a771 TI |
1340 | .type = HDA_FIXUP_PINS, |
1341 | .v.pins = (const struct hda_pintbl[]) { | |
96e225f6 TI |
1342 | /* set up the whole pins as BIOS is utterly broken */ |
1343 | { 0x14, 0x99030120 }, /* speaker */ | |
1344 | { 0x15, 0x0121411f }, /* HP */ | |
1345 | { 0x16, 0x411111f0 }, /* N/A */ | |
1346 | { 0x17, 0x411111f0 }, /* N/A */ | |
1347 | { 0x18, 0x01a19950 }, /* mic-in */ | |
1348 | { 0x19, 0x411111f0 }, /* N/A */ | |
1349 | { 0x1a, 0x01813031 }, /* line-in */ | |
1350 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1351 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1352 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1353 | { 0x1e, 0x0144111e }, /* SPDIF */ | |
1354 | { } | |
1355 | } | |
1356 | }, | |
487a588d TI |
1357 | [ALC880_FIXUP_ASUS_W5A] = { |
1358 | .type = HDA_FIXUP_PINS, | |
1359 | .v.pins = (const struct hda_pintbl[]) { | |
1360 | /* set up the whole pins as BIOS is utterly broken */ | |
1361 | { 0x14, 0x0121411f }, /* HP */ | |
1362 | { 0x15, 0x411111f0 }, /* N/A */ | |
1363 | { 0x16, 0x411111f0 }, /* N/A */ | |
1364 | { 0x17, 0x411111f0 }, /* N/A */ | |
1365 | { 0x18, 0x90a60160 }, /* mic */ | |
1366 | { 0x19, 0x411111f0 }, /* N/A */ | |
1367 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1368 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1369 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1370 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1371 | { 0x1e, 0xb743111e }, /* SPDIF out */ | |
1372 | { } | |
1373 | }, | |
1374 | .chained = true, | |
1375 | .chain_id = ALC880_FIXUP_GPIO1, | |
1376 | }, | |
67b6ec31 | 1377 | [ALC880_FIXUP_3ST_BASE] = { |
1727a771 TI |
1378 | .type = HDA_FIXUP_PINS, |
1379 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1380 | { 0x14, 0x01014010 }, /* line-out */ |
1381 | { 0x15, 0x411111f0 }, /* N/A */ | |
1382 | { 0x16, 0x411111f0 }, /* N/A */ | |
1383 | { 0x17, 0x411111f0 }, /* N/A */ | |
1384 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1385 | { 0x19, 0x0121411f }, /* HP */ | |
1386 | { 0x1a, 0x01813031 }, /* line-in */ | |
1387 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1388 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1389 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1390 | /* 0x1e is filled in below */ | |
1391 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1392 | { } | |
1393 | } | |
1394 | }, | |
1395 | [ALC880_FIXUP_3ST] = { | |
1727a771 TI |
1396 | .type = HDA_FIXUP_PINS, |
1397 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1398 | { 0x1e, 0x411111f0 }, /* N/A */ |
1399 | { } | |
1400 | }, | |
1401 | .chained = true, | |
1402 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1403 | }, | |
1404 | [ALC880_FIXUP_3ST_DIG] = { | |
1727a771 TI |
1405 | .type = HDA_FIXUP_PINS, |
1406 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1407 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1408 | { } | |
1409 | }, | |
1410 | .chained = true, | |
1411 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1412 | }, | |
1413 | [ALC880_FIXUP_5ST_BASE] = { | |
1727a771 TI |
1414 | .type = HDA_FIXUP_PINS, |
1415 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1416 | { 0x14, 0x01014010 }, /* front */ |
1417 | { 0x15, 0x411111f0 }, /* N/A */ | |
1418 | { 0x16, 0x01011411 }, /* CLFE */ | |
1419 | { 0x17, 0x01016412 }, /* surr */ | |
1420 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1421 | { 0x19, 0x0121411f }, /* HP */ | |
1422 | { 0x1a, 0x01813031 }, /* line-in */ | |
1423 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1424 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1425 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1426 | /* 0x1e is filled in below */ | |
1427 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1428 | { } | |
1429 | } | |
1430 | }, | |
1431 | [ALC880_FIXUP_5ST] = { | |
1727a771 TI |
1432 | .type = HDA_FIXUP_PINS, |
1433 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1434 | { 0x1e, 0x411111f0 }, /* N/A */ |
1435 | { } | |
1436 | }, | |
1437 | .chained = true, | |
1438 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1439 | }, | |
1440 | [ALC880_FIXUP_5ST_DIG] = { | |
1727a771 TI |
1441 | .type = HDA_FIXUP_PINS, |
1442 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1443 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1444 | { } | |
1445 | }, | |
1446 | .chained = true, | |
1447 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1448 | }, | |
1449 | [ALC880_FIXUP_6ST_BASE] = { | |
1727a771 TI |
1450 | .type = HDA_FIXUP_PINS, |
1451 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1452 | { 0x14, 0x01014010 }, /* front */ |
1453 | { 0x15, 0x01016412 }, /* surr */ | |
1454 | { 0x16, 0x01011411 }, /* CLFE */ | |
1455 | { 0x17, 0x01012414 }, /* side */ | |
1456 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1457 | { 0x19, 0x02a19c40 }, /* front-mic */ | |
1458 | { 0x1a, 0x01813031 }, /* line-in */ | |
1459 | { 0x1b, 0x0121411f }, /* HP */ | |
1460 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1461 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1462 | /* 0x1e is filled in below */ | |
1463 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1464 | { } | |
1465 | } | |
1466 | }, | |
1467 | [ALC880_FIXUP_6ST] = { | |
1727a771 TI |
1468 | .type = HDA_FIXUP_PINS, |
1469 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1470 | { 0x1e, 0x411111f0 }, /* N/A */ |
1471 | { } | |
1472 | }, | |
1473 | .chained = true, | |
1474 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1475 | }, | |
1476 | [ALC880_FIXUP_6ST_DIG] = { | |
1727a771 TI |
1477 | .type = HDA_FIXUP_PINS, |
1478 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1479 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1480 | { } | |
1481 | }, | |
1482 | .chained = true, | |
1483 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1484 | }, | |
5397145f TI |
1485 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
1486 | .type = HDA_FIXUP_PINS, | |
1487 | .v.pins = (const struct hda_pintbl[]) { | |
1488 | { 0x1b, 0x0121401f }, /* HP with jack detect */ | |
1489 | { } | |
1490 | }, | |
1491 | .chained_before = true, | |
1492 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1493 | }, | |
ee3b2969 TI |
1494 | }; |
1495 | ||
1496 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { | |
f02aab5d | 1497 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
487a588d | 1498 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
96e225f6 | 1499 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
29e3fdcc | 1500 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
6538de03 | 1501 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
29e3fdcc | 1502 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
27e917f8 | 1503 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
967b88c4 | 1504 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
ba533818 | 1505 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
817de92f | 1506 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
7833c7e8 | 1507 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
f02aab5d | 1508 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
ee3b2969 | 1509 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
5397145f | 1510 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
a161574e | 1511 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
cf5a2279 | 1512 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
ba533818 | 1513 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
cf5a2279 | 1514 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
dc6af52d TI |
1515 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
1516 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), | |
1517 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), | |
db8a38e5 | 1518 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
b9368f5c | 1519 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
67b6ec31 TI |
1520 | |
1521 | /* Below is the copied entries from alc880_quirks.c. | |
1522 | * It's not quite sure whether BIOS sets the correct pin-config table | |
1523 | * on these machines, thus they are kept to be compatible with | |
1524 | * the old static quirks. Once when it's confirmed to work without | |
1525 | * these overrides, it'd be better to remove. | |
1526 | */ | |
1527 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), | |
1528 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), | |
1529 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), | |
1530 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), | |
1531 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), | |
1532 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), | |
1533 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), | |
1534 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), | |
1535 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), | |
1536 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), | |
1537 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), | |
1538 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), | |
1539 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), | |
1540 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), | |
1541 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), | |
1542 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), | |
1543 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), | |
1544 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), | |
1545 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), | |
1546 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), | |
1547 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), | |
1548 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ | |
1549 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), | |
1550 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1551 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1552 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1553 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1554 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1555 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1556 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1557 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1558 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1559 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1560 | /* default Intel */ | |
1561 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), | |
1562 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), | |
1563 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), | |
1564 | {} | |
1565 | }; | |
1566 | ||
1727a771 | 1567 | static const struct hda_model_fixup alc880_fixup_models[] = { |
67b6ec31 TI |
1568 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
1569 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, | |
1570 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, | |
1571 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, | |
1572 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, | |
1573 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, | |
5397145f | 1574 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
ee3b2969 TI |
1575 | {} |
1576 | }; | |
1577 | ||
1578 | ||
1d045db9 TI |
1579 | /* |
1580 | * OK, here we have finally the patch for ALC880 | |
1581 | */ | |
1d045db9 | 1582 | static int patch_alc880(struct hda_codec *codec) |
60db6b53 | 1583 | { |
1d045db9 | 1584 | struct alc_spec *spec; |
1d045db9 | 1585 | int err; |
f6a92248 | 1586 | |
3de95173 TI |
1587 | err = alc_alloc_spec(codec, 0x0b); |
1588 | if (err < 0) | |
1589 | return err; | |
64154835 | 1590 | |
3de95173 | 1591 | spec = codec->spec; |
08c189f2 | 1592 | spec->gen.need_dac_fix = 1; |
7504b6cd | 1593 | spec->gen.beep_nid = 0x01; |
f53281e6 | 1594 | |
225068ab TI |
1595 | codec->patch_ops.unsol_event = alc880_unsol_event; |
1596 | ||
c9af753f TI |
1597 | alc_pre_init(codec); |
1598 | ||
1727a771 | 1599 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
67b6ec31 | 1600 | alc880_fixups); |
1727a771 | 1601 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ee3b2969 | 1602 | |
67b6ec31 TI |
1603 | /* automatic parse from the BIOS config */ |
1604 | err = alc880_parse_auto_config(codec); | |
1605 | if (err < 0) | |
1606 | goto error; | |
fe3eb0a7 | 1607 | |
fea80fae TI |
1608 | if (!spec->gen.no_analog) { |
1609 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
1610 | if (err < 0) | |
1611 | goto error; | |
1612 | } | |
f53281e6 | 1613 | |
1727a771 | 1614 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1615 | |
1d045db9 | 1616 | return 0; |
e16fb6d1 TI |
1617 | |
1618 | error: | |
1619 | alc_free(codec); | |
1620 | return err; | |
226b1ec8 KY |
1621 | } |
1622 | ||
1d045db9 | 1623 | |
60db6b53 | 1624 | /* |
1d045db9 | 1625 | * ALC260 support |
60db6b53 | 1626 | */ |
1d045db9 | 1627 | static int alc260_parse_auto_config(struct hda_codec *codec) |
f6a92248 | 1628 | { |
1d045db9 | 1629 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
3e6179b8 TI |
1630 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
1631 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); | |
f6a92248 KY |
1632 | } |
1633 | ||
1d045db9 TI |
1634 | /* |
1635 | * Pin config fixes | |
1636 | */ | |
1637 | enum { | |
ca8f0424 TI |
1638 | ALC260_FIXUP_HP_DC5750, |
1639 | ALC260_FIXUP_HP_PIN_0F, | |
1640 | ALC260_FIXUP_COEF, | |
15317ab2 | 1641 | ALC260_FIXUP_GPIO1, |
20f7d928 TI |
1642 | ALC260_FIXUP_GPIO1_TOGGLE, |
1643 | ALC260_FIXUP_REPLACER, | |
0a1c4fa2 | 1644 | ALC260_FIXUP_HP_B1900, |
118cb4a4 | 1645 | ALC260_FIXUP_KN1, |
39aedee7 | 1646 | ALC260_FIXUP_FSC_S7020, |
5ebd3bbd | 1647 | ALC260_FIXUP_FSC_S7020_JWSE, |
d08c5ef2 | 1648 | ALC260_FIXUP_VAIO_PINS, |
1d045db9 TI |
1649 | }; |
1650 | ||
20f7d928 TI |
1651 | static void alc260_gpio1_automute(struct hda_codec *codec) |
1652 | { | |
1653 | struct alc_spec *spec = codec->spec; | |
aaf312de TI |
1654 | |
1655 | alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); | |
20f7d928 TI |
1656 | } |
1657 | ||
1658 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, | |
1727a771 | 1659 | const struct hda_fixup *fix, int action) |
20f7d928 TI |
1660 | { |
1661 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1662 | if (action == HDA_FIXUP_ACT_PROBE) { |
20f7d928 TI |
1663 | /* although the machine has only one output pin, we need to |
1664 | * toggle GPIO1 according to the jack state | |
1665 | */ | |
08c189f2 TI |
1666 | spec->gen.automute_hook = alc260_gpio1_automute; |
1667 | spec->gen.detect_hp = 1; | |
1668 | spec->gen.automute_speaker = 1; | |
1669 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ | |
62f949bf | 1670 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
08c189f2 | 1671 | snd_hda_gen_hp_automute); |
5579cd6f | 1672 | alc_setup_gpio(codec, 0x01); |
20f7d928 TI |
1673 | } |
1674 | } | |
1675 | ||
118cb4a4 | 1676 | static void alc260_fixup_kn1(struct hda_codec *codec, |
1727a771 | 1677 | const struct hda_fixup *fix, int action) |
118cb4a4 TI |
1678 | { |
1679 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1680 | static const struct hda_pintbl pincfgs[] = { |
118cb4a4 TI |
1681 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
1682 | { 0x12, 0x90a60160 }, /* int mic */ | |
1683 | { 0x13, 0x02a19000 }, /* ext mic */ | |
1684 | { 0x18, 0x01446000 }, /* SPDIF out */ | |
1685 | /* disable bogus I/O pins */ | |
1686 | { 0x10, 0x411111f0 }, | |
1687 | { 0x11, 0x411111f0 }, | |
1688 | { 0x14, 0x411111f0 }, | |
1689 | { 0x15, 0x411111f0 }, | |
1690 | { 0x16, 0x411111f0 }, | |
1691 | { 0x17, 0x411111f0 }, | |
1692 | { 0x19, 0x411111f0 }, | |
1693 | { } | |
1694 | }; | |
1695 | ||
1696 | switch (action) { | |
1727a771 TI |
1697 | case HDA_FIXUP_ACT_PRE_PROBE: |
1698 | snd_hda_apply_pincfgs(codec, pincfgs); | |
118cb4a4 TI |
1699 | spec->init_amp = ALC_INIT_NONE; |
1700 | break; | |
1701 | } | |
1702 | } | |
1703 | ||
39aedee7 TI |
1704 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
1705 | const struct hda_fixup *fix, int action) | |
1706 | { | |
1707 | struct alc_spec *spec = codec->spec; | |
1c76aa5f | 1708 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
5ebd3bbd TI |
1709 | spec->init_amp = ALC_INIT_NONE; |
1710 | } | |
39aedee7 | 1711 | |
5ebd3bbd TI |
1712 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
1713 | const struct hda_fixup *fix, int action) | |
1714 | { | |
1715 | struct alc_spec *spec = codec->spec; | |
1716 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
f811c3cf | 1717 | spec->gen.add_jack_modes = 1; |
5ebd3bbd | 1718 | spec->gen.hp_mic = 1; |
e6e0ee50 | 1719 | } |
39aedee7 TI |
1720 | } |
1721 | ||
1727a771 | 1722 | static const struct hda_fixup alc260_fixups[] = { |
ca8f0424 | 1723 | [ALC260_FIXUP_HP_DC5750] = { |
1727a771 TI |
1724 | .type = HDA_FIXUP_PINS, |
1725 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
1726 | { 0x11, 0x90130110 }, /* speaker */ |
1727 | { } | |
1728 | } | |
1729 | }, | |
ca8f0424 | 1730 | [ALC260_FIXUP_HP_PIN_0F] = { |
1727a771 TI |
1731 | .type = HDA_FIXUP_PINS, |
1732 | .v.pins = (const struct hda_pintbl[]) { | |
ca8f0424 TI |
1733 | { 0x0f, 0x01214000 }, /* HP */ |
1734 | { } | |
1735 | } | |
1736 | }, | |
1737 | [ALC260_FIXUP_COEF] = { | |
1727a771 | 1738 | .type = HDA_FIXUP_VERBS, |
ca8f0424 | 1739 | .v.verbs = (const struct hda_verb[]) { |
e30cf2d2 RM |
1740 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1741 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, | |
ca8f0424 TI |
1742 | { } |
1743 | }, | |
ca8f0424 | 1744 | }, |
15317ab2 | 1745 | [ALC260_FIXUP_GPIO1] = { |
5579cd6f TI |
1746 | .type = HDA_FIXUP_FUNC, |
1747 | .v.func = alc_fixup_gpio1, | |
15317ab2 | 1748 | }, |
20f7d928 | 1749 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
1727a771 | 1750 | .type = HDA_FIXUP_FUNC, |
20f7d928 TI |
1751 | .v.func = alc260_fixup_gpio1_toggle, |
1752 | .chained = true, | |
1753 | .chain_id = ALC260_FIXUP_HP_PIN_0F, | |
1754 | }, | |
1755 | [ALC260_FIXUP_REPLACER] = { | |
1727a771 | 1756 | .type = HDA_FIXUP_VERBS, |
20f7d928 | 1757 | .v.verbs = (const struct hda_verb[]) { |
192a98e2 TI |
1758 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1759 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
20f7d928 TI |
1760 | { } |
1761 | }, | |
1762 | .chained = true, | |
1763 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, | |
1764 | }, | |
0a1c4fa2 | 1765 | [ALC260_FIXUP_HP_B1900] = { |
1727a771 | 1766 | .type = HDA_FIXUP_FUNC, |
0a1c4fa2 TI |
1767 | .v.func = alc260_fixup_gpio1_toggle, |
1768 | .chained = true, | |
1769 | .chain_id = ALC260_FIXUP_COEF, | |
118cb4a4 TI |
1770 | }, |
1771 | [ALC260_FIXUP_KN1] = { | |
1727a771 | 1772 | .type = HDA_FIXUP_FUNC, |
118cb4a4 TI |
1773 | .v.func = alc260_fixup_kn1, |
1774 | }, | |
39aedee7 TI |
1775 | [ALC260_FIXUP_FSC_S7020] = { |
1776 | .type = HDA_FIXUP_FUNC, | |
1777 | .v.func = alc260_fixup_fsc_s7020, | |
1778 | }, | |
5ebd3bbd TI |
1779 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
1780 | .type = HDA_FIXUP_FUNC, | |
1781 | .v.func = alc260_fixup_fsc_s7020_jwse, | |
1782 | .chained = true, | |
1783 | .chain_id = ALC260_FIXUP_FSC_S7020, | |
1784 | }, | |
d08c5ef2 TI |
1785 | [ALC260_FIXUP_VAIO_PINS] = { |
1786 | .type = HDA_FIXUP_PINS, | |
1787 | .v.pins = (const struct hda_pintbl[]) { | |
1788 | /* Pin configs are missing completely on some VAIOs */ | |
1789 | { 0x0f, 0x01211020 }, | |
1790 | { 0x10, 0x0001003f }, | |
1791 | { 0x11, 0x411111f0 }, | |
1792 | { 0x12, 0x01a15930 }, | |
1793 | { 0x13, 0x411111f0 }, | |
1794 | { 0x14, 0x411111f0 }, | |
1795 | { 0x15, 0x411111f0 }, | |
1796 | { 0x16, 0x411111f0 }, | |
1797 | { 0x17, 0x411111f0 }, | |
1798 | { 0x18, 0x411111f0 }, | |
1799 | { 0x19, 0x411111f0 }, | |
1800 | { } | |
1801 | } | |
1802 | }, | |
1d045db9 TI |
1803 | }; |
1804 | ||
1805 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { | |
15317ab2 | 1806 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1807 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
15317ab2 | 1808 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1809 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
0a1c4fa2 | 1810 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
d08c5ef2 | 1811 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
0f5a5b85 | 1812 | SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), |
39aedee7 | 1813 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
b1f58085 | 1814 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
118cb4a4 | 1815 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
20f7d928 | 1816 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
ca8f0424 | 1817 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
1d045db9 TI |
1818 | {} |
1819 | }; | |
1820 | ||
5ebd3bbd TI |
1821 | static const struct hda_model_fixup alc260_fixup_models[] = { |
1822 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, | |
1823 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, | |
1824 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, | |
1825 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, | |
1826 | {} | |
1827 | }; | |
1828 | ||
1d045db9 TI |
1829 | /* |
1830 | */ | |
1d045db9 | 1831 | static int patch_alc260(struct hda_codec *codec) |
977ddd6b | 1832 | { |
1d045db9 | 1833 | struct alc_spec *spec; |
c3c2c9e7 | 1834 | int err; |
1d045db9 | 1835 | |
3de95173 TI |
1836 | err = alc_alloc_spec(codec, 0x07); |
1837 | if (err < 0) | |
1838 | return err; | |
1d045db9 | 1839 | |
3de95173 | 1840 | spec = codec->spec; |
ea46c3c8 TI |
1841 | /* as quite a few machines require HP amp for speaker outputs, |
1842 | * it's easier to enable it unconditionally; even if it's unneeded, | |
1843 | * it's almost harmless. | |
1844 | */ | |
1845 | spec->gen.prefer_hp_amp = 1; | |
7504b6cd | 1846 | spec->gen.beep_nid = 0x01; |
1d045db9 | 1847 | |
225068ab TI |
1848 | spec->shutup = alc_eapd_shutup; |
1849 | ||
c9af753f TI |
1850 | alc_pre_init(codec); |
1851 | ||
5ebd3bbd TI |
1852 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
1853 | alc260_fixups); | |
1727a771 | 1854 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
977ddd6b | 1855 | |
c3c2c9e7 TI |
1856 | /* automatic parse from the BIOS config */ |
1857 | err = alc260_parse_auto_config(codec); | |
1858 | if (err < 0) | |
1859 | goto error; | |
977ddd6b | 1860 | |
fea80fae TI |
1861 | if (!spec->gen.no_analog) { |
1862 | err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); | |
1863 | if (err < 0) | |
1864 | goto error; | |
1865 | } | |
977ddd6b | 1866 | |
1727a771 | 1867 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1868 | |
1d045db9 | 1869 | return 0; |
e16fb6d1 TI |
1870 | |
1871 | error: | |
1872 | alc_free(codec); | |
1873 | return err; | |
6981d184 TI |
1874 | } |
1875 | ||
1d045db9 TI |
1876 | |
1877 | /* | |
1878 | * ALC882/883/885/888/889 support | |
1879 | * | |
1880 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible | |
1881 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
1882 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
1883 | * 6-channel independent captures. | |
1884 | * | |
1885 | * In addition, an independent DAC for the multi-playback (not used in this | |
1886 | * driver yet). | |
1887 | */ | |
1d045db9 TI |
1888 | |
1889 | /* | |
1890 | * Pin config fixes | |
1891 | */ | |
ff818c24 | 1892 | enum { |
5c0ebfbe TI |
1893 | ALC882_FIXUP_ABIT_AW9D_MAX, |
1894 | ALC882_FIXUP_LENOVO_Y530, | |
1895 | ALC882_FIXUP_PB_M5210, | |
1896 | ALC882_FIXUP_ACER_ASPIRE_7736, | |
1897 | ALC882_FIXUP_ASUS_W90V, | |
8f239214 | 1898 | ALC889_FIXUP_CD, |
b2c53e20 | 1899 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
5c0ebfbe | 1900 | ALC889_FIXUP_VAIO_TT, |
0e7cc2e7 | 1901 | ALC888_FIXUP_EEE1601, |
4841b8e6 | 1902 | ALC886_FIXUP_EAPD, |
177943a3 | 1903 | ALC882_FIXUP_EAPD, |
7a6069bf | 1904 | ALC883_FIXUP_EAPD, |
8812c4f9 | 1905 | ALC883_FIXUP_ACER_EAPD, |
1a97b7f2 TI |
1906 | ALC882_FIXUP_GPIO1, |
1907 | ALC882_FIXUP_GPIO2, | |
eb844d51 | 1908 | ALC882_FIXUP_GPIO3, |
68ef0561 TI |
1909 | ALC889_FIXUP_COEF, |
1910 | ALC882_FIXUP_ASUS_W2JC, | |
c3e837bb TI |
1911 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
1912 | ALC882_FIXUP_ACER_ASPIRE_8930G, | |
1913 | ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
5671087f | 1914 | ALC885_FIXUP_MACPRO_GPIO, |
02a237b2 | 1915 | ALC889_FIXUP_DAC_ROUTE, |
1a97b7f2 TI |
1916 | ALC889_FIXUP_MBP_VREF, |
1917 | ALC889_FIXUP_IMAC91_VREF, | |
e7729a41 | 1918 | ALC889_FIXUP_MBA11_VREF, |
0756f09c | 1919 | ALC889_FIXUP_MBA21_VREF, |
c20f31ec | 1920 | ALC889_FIXUP_MP11_VREF, |
9f660a1c | 1921 | ALC889_FIXUP_MP41_VREF, |
6e72aa5f | 1922 | ALC882_FIXUP_INV_DMIC, |
e427c237 | 1923 | ALC882_FIXUP_NO_PRIMARY_HP, |
1f0bbf03 | 1924 | ALC887_FIXUP_ASUS_BASS, |
eb9ca3ab | 1925 | ALC887_FIXUP_BASS_CHMAP, |
7beb3a6e | 1926 | ALC1220_FIXUP_GB_DUAL_CODECS, |
0202f5cd | 1927 | ALC1220_FIXUP_CLEVO_P950, |
80690a27 RS |
1928 | ALC1220_FIXUP_CLEVO_PB51ED, |
1929 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, | |
ca184355 JHP |
1930 | ALC887_FIXUP_ASUS_AUDIO, |
1931 | ALC887_FIXUP_ASUS_HMIC, | |
ff818c24 TI |
1932 | }; |
1933 | ||
68ef0561 | 1934 | static void alc889_fixup_coef(struct hda_codec *codec, |
1727a771 | 1935 | const struct hda_fixup *fix, int action) |
68ef0561 | 1936 | { |
1727a771 | 1937 | if (action != HDA_FIXUP_ACT_INIT) |
68ef0561 | 1938 | return; |
1df8874b | 1939 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
68ef0561 TI |
1940 | } |
1941 | ||
5671087f TI |
1942 | /* set up GPIO at initialization */ |
1943 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, | |
1727a771 | 1944 | const struct hda_fixup *fix, int action) |
5671087f | 1945 | { |
215c850c TI |
1946 | struct alc_spec *spec = codec->spec; |
1947 | ||
1948 | spec->gpio_write_delay = true; | |
1949 | alc_fixup_gpio3(codec, fix, action); | |
5671087f TI |
1950 | } |
1951 | ||
02a237b2 TI |
1952 | /* Fix the connection of some pins for ALC889: |
1953 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't | |
1954 | * work correctly (bko#42740) | |
1955 | */ | |
1956 | static void alc889_fixup_dac_route(struct hda_codec *codec, | |
1727a771 | 1957 | const struct hda_fixup *fix, int action) |
02a237b2 | 1958 | { |
1727a771 | 1959 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
ef8d60fb | 1960 | /* fake the connections during parsing the tree */ |
caf3c043 MM |
1961 | static const hda_nid_t conn1[] = { 0x0c, 0x0d }; |
1962 | static const hda_nid_t conn2[] = { 0x0e, 0x0f }; | |
1963 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); | |
1964 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); | |
1965 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); | |
1966 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); | |
1727a771 | 1967 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
ef8d60fb | 1968 | /* restore the connections */ |
caf3c043 MM |
1969 | static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; |
1970 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); | |
1971 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); | |
1972 | snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); | |
1973 | snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); | |
02a237b2 TI |
1974 | } |
1975 | } | |
1976 | ||
1a97b7f2 TI |
1977 | /* Set VREF on HP pin */ |
1978 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, | |
1727a771 | 1979 | const struct hda_fixup *fix, int action) |
1a97b7f2 | 1980 | { |
caf3c043 | 1981 | static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; |
1a97b7f2 | 1982 | struct alc_spec *spec = codec->spec; |
1a97b7f2 TI |
1983 | int i; |
1984 | ||
1727a771 | 1985 | if (action != HDA_FIXUP_ACT_INIT) |
1a97b7f2 TI |
1986 | return; |
1987 | for (i = 0; i < ARRAY_SIZE(nids); i++) { | |
1988 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); | |
1989 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) | |
1990 | continue; | |
d3f02d60 | 1991 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 1992 | val |= AC_PINCTL_VREF_80; |
cdd03ced | 1993 | snd_hda_set_pin_ctl(codec, nids[i], val); |
08c189f2 | 1994 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
1995 | break; |
1996 | } | |
1997 | } | |
1998 | ||
0756f09c TI |
1999 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
2000 | const hda_nid_t *nids, int num_nids) | |
1a97b7f2 TI |
2001 | { |
2002 | struct alc_spec *spec = codec->spec; | |
1a97b7f2 TI |
2003 | int i; |
2004 | ||
0756f09c | 2005 | for (i = 0; i < num_nids; i++) { |
1a97b7f2 | 2006 | unsigned int val; |
d3f02d60 | 2007 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 2008 | val |= AC_PINCTL_VREF_50; |
cdd03ced | 2009 | snd_hda_set_pin_ctl(codec, nids[i], val); |
1a97b7f2 | 2010 | } |
08c189f2 | 2011 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
2012 | } |
2013 | ||
0756f09c TI |
2014 | /* Set VREF on speaker pins on imac91 */ |
2015 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, | |
2016 | const struct hda_fixup *fix, int action) | |
2017 | { | |
caf3c043 | 2018 | static const hda_nid_t nids[] = { 0x18, 0x1a }; |
0756f09c TI |
2019 | |
2020 | if (action == HDA_FIXUP_ACT_INIT) | |
2021 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2022 | } | |
2023 | ||
e7729a41 AV |
2024 | /* Set VREF on speaker pins on mba11 */ |
2025 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, | |
2026 | const struct hda_fixup *fix, int action) | |
2027 | { | |
caf3c043 | 2028 | static const hda_nid_t nids[] = { 0x18 }; |
e7729a41 AV |
2029 | |
2030 | if (action == HDA_FIXUP_ACT_INIT) | |
2031 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2032 | } | |
2033 | ||
0756f09c TI |
2034 | /* Set VREF on speaker pins on mba21 */ |
2035 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, | |
2036 | const struct hda_fixup *fix, int action) | |
2037 | { | |
caf3c043 | 2038 | static const hda_nid_t nids[] = { 0x18, 0x19 }; |
0756f09c TI |
2039 | |
2040 | if (action == HDA_FIXUP_ACT_INIT) | |
2041 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2042 | } | |
2043 | ||
e427c237 | 2044 | /* Don't take HP output as primary |
d9111496 FLVC |
2045 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
2046 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 | |
e427c237 TI |
2047 | */ |
2048 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, | |
1727a771 | 2049 | const struct hda_fixup *fix, int action) |
e427c237 TI |
2050 | { |
2051 | struct alc_spec *spec = codec->spec; | |
da96fb5b | 2052 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
08c189f2 | 2053 | spec->gen.no_primary_hp = 1; |
da96fb5b TI |
2054 | spec->gen.no_multi_io = 1; |
2055 | } | |
e427c237 TI |
2056 | } |
2057 | ||
eb9ca3ab TI |
2058 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
2059 | const struct hda_fixup *fix, int action); | |
2060 | ||
7beb3a6e TI |
2061 | /* For dual-codec configuration, we need to disable some features to avoid |
2062 | * conflicts of kctls and PCM streams | |
2063 | */ | |
2064 | static void alc_fixup_dual_codecs(struct hda_codec *codec, | |
2065 | const struct hda_fixup *fix, int action) | |
2066 | { | |
2067 | struct alc_spec *spec = codec->spec; | |
2068 | ||
2069 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2070 | return; | |
2071 | /* disable vmaster */ | |
2072 | spec->gen.suppress_vmaster = 1; | |
2073 | /* auto-mute and auto-mic switch don't work with multiple codecs */ | |
2074 | spec->gen.suppress_auto_mute = 1; | |
2075 | spec->gen.suppress_auto_mic = 1; | |
2076 | /* disable aamix as well */ | |
2077 | spec->gen.mixer_nid = 0; | |
2078 | /* add location prefix to avoid conflicts */ | |
2079 | codec->force_pin_prefix = 1; | |
2080 | } | |
2081 | ||
2082 | static void rename_ctl(struct hda_codec *codec, const char *oldname, | |
2083 | const char *newname) | |
2084 | { | |
2085 | struct snd_kcontrol *kctl; | |
2086 | ||
2087 | kctl = snd_hda_find_mixer_ctl(codec, oldname); | |
2088 | if (kctl) | |
2089 | strcpy(kctl->id.name, newname); | |
2090 | } | |
2091 | ||
2092 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, | |
2093 | const struct hda_fixup *fix, | |
2094 | int action) | |
2095 | { | |
2096 | alc_fixup_dual_codecs(codec, fix, action); | |
2097 | switch (action) { | |
2098 | case HDA_FIXUP_ACT_PRE_PROBE: | |
2099 | /* override card longname to provide a unique UCM profile */ | |
2100 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); | |
2101 | break; | |
2102 | case HDA_FIXUP_ACT_BUILD: | |
2103 | /* rename Capture controls depending on the codec */ | |
2104 | rename_ctl(codec, "Capture Volume", | |
2105 | codec->addr == 0 ? | |
2106 | "Rear-Panel Capture Volume" : | |
2107 | "Front-Panel Capture Volume"); | |
2108 | rename_ctl(codec, "Capture Switch", | |
2109 | codec->addr == 0 ? | |
2110 | "Rear-Panel Capture Switch" : | |
2111 | "Front-Panel Capture Switch"); | |
2112 | break; | |
2113 | } | |
2114 | } | |
2115 | ||
0202f5cd P |
2116 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
2117 | const struct hda_fixup *fix, | |
2118 | int action) | |
2119 | { | |
caf3c043 | 2120 | static const hda_nid_t conn1[] = { 0x0c }; |
0202f5cd P |
2121 | |
2122 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2123 | return; | |
2124 | ||
2125 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); | |
2126 | /* We therefore want to make sure 0x14 (front headphone) and | |
2127 | * 0x1b (speakers) use the stereo DAC 0x02 | |
2128 | */ | |
caf3c043 MM |
2129 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); |
2130 | snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); | |
0202f5cd P |
2131 | } |
2132 | ||
7f665b1c JS |
2133 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
2134 | const struct hda_fixup *fix, int action); | |
2135 | ||
80690a27 | 2136 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
7f665b1c JS |
2137 | const struct hda_fixup *fix, |
2138 | int action) | |
2139 | { | |
2140 | alc1220_fixup_clevo_p950(codec, fix, action); | |
2141 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); | |
2142 | } | |
2143 | ||
ca184355 JHP |
2144 | static void alc887_asus_hp_automute_hook(struct hda_codec *codec, |
2145 | struct hda_jack_callback *jack) | |
2146 | { | |
2147 | struct alc_spec *spec = codec->spec; | |
2148 | unsigned int vref; | |
2149 | ||
2150 | snd_hda_gen_hp_automute(codec, jack); | |
2151 | ||
2152 | if (spec->gen.hp_jack_present) | |
2153 | vref = AC_PINCTL_VREF_80; | |
2154 | else | |
2155 | vref = AC_PINCTL_VREF_HIZ; | |
2156 | snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); | |
2157 | } | |
2158 | ||
2159 | static void alc887_fixup_asus_jack(struct hda_codec *codec, | |
2160 | const struct hda_fixup *fix, int action) | |
2161 | { | |
2162 | struct alc_spec *spec = codec->spec; | |
2163 | if (action != HDA_FIXUP_ACT_PROBE) | |
2164 | return; | |
2165 | snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); | |
2166 | spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; | |
2167 | } | |
2168 | ||
1727a771 | 2169 | static const struct hda_fixup alc882_fixups[] = { |
5c0ebfbe | 2170 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
1727a771 TI |
2171 | .type = HDA_FIXUP_PINS, |
2172 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2173 | { 0x15, 0x01080104 }, /* side */ |
2174 | { 0x16, 0x01011012 }, /* rear */ | |
2175 | { 0x17, 0x01016011 }, /* clfe */ | |
2785591a | 2176 | { } |
145a902b DH |
2177 | } |
2178 | }, | |
5c0ebfbe | 2179 | [ALC882_FIXUP_LENOVO_Y530] = { |
1727a771 TI |
2180 | .type = HDA_FIXUP_PINS, |
2181 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2182 | { 0x15, 0x99130112 }, /* rear int speakers */ |
2183 | { 0x16, 0x99130111 }, /* subwoofer */ | |
ac612407 DH |
2184 | { } |
2185 | } | |
2186 | }, | |
5c0ebfbe | 2187 | [ALC882_FIXUP_PB_M5210] = { |
fd108215 TI |
2188 | .type = HDA_FIXUP_PINCTLS, |
2189 | .v.pins = (const struct hda_pintbl[]) { | |
2190 | { 0x19, PIN_VREF50 }, | |
357f915e KY |
2191 | {} |
2192 | } | |
2193 | }, | |
5c0ebfbe | 2194 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
1727a771 | 2195 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 2196 | .v.func = alc_fixup_sku_ignore, |
6981d184 | 2197 | }, |
5c0ebfbe | 2198 | [ALC882_FIXUP_ASUS_W90V] = { |
1727a771 TI |
2199 | .type = HDA_FIXUP_PINS, |
2200 | .v.pins = (const struct hda_pintbl[]) { | |
5cdf745e TI |
2201 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
2202 | { } | |
2203 | } | |
2204 | }, | |
8f239214 | 2205 | [ALC889_FIXUP_CD] = { |
1727a771 TI |
2206 | .type = HDA_FIXUP_PINS, |
2207 | .v.pins = (const struct hda_pintbl[]) { | |
8f239214 MB |
2208 | { 0x1c, 0x993301f0 }, /* CD */ |
2209 | { } | |
2210 | } | |
2211 | }, | |
b2c53e20 DH |
2212 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
2213 | .type = HDA_FIXUP_PINS, | |
2214 | .v.pins = (const struct hda_pintbl[]) { | |
2215 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ | |
2216 | { } | |
2217 | }, | |
2218 | .chained = true, | |
2219 | .chain_id = ALC889_FIXUP_CD, | |
2220 | }, | |
5c0ebfbe | 2221 | [ALC889_FIXUP_VAIO_TT] = { |
1727a771 TI |
2222 | .type = HDA_FIXUP_PINS, |
2223 | .v.pins = (const struct hda_pintbl[]) { | |
5c0ebfbe TI |
2224 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
2225 | { } | |
2226 | } | |
2227 | }, | |
0e7cc2e7 | 2228 | [ALC888_FIXUP_EEE1601] = { |
1727a771 | 2229 | .type = HDA_FIXUP_VERBS, |
0e7cc2e7 TI |
2230 | .v.verbs = (const struct hda_verb[]) { |
2231 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2232 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, | |
2233 | { } | |
2234 | } | |
177943a3 | 2235 | }, |
4841b8e6 PH |
2236 | [ALC886_FIXUP_EAPD] = { |
2237 | .type = HDA_FIXUP_VERBS, | |
2238 | .v.verbs = (const struct hda_verb[]) { | |
2239 | /* change to EAPD mode */ | |
2240 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2241 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 }, | |
2242 | { } | |
2243 | } | |
2244 | }, | |
177943a3 | 2245 | [ALC882_FIXUP_EAPD] = { |
1727a771 | 2246 | .type = HDA_FIXUP_VERBS, |
177943a3 TI |
2247 | .v.verbs = (const struct hda_verb[]) { |
2248 | /* change to EAPD mode */ | |
2249 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2250 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
2251 | { } | |
2252 | } | |
2253 | }, | |
7a6069bf | 2254 | [ALC883_FIXUP_EAPD] = { |
1727a771 | 2255 | .type = HDA_FIXUP_VERBS, |
7a6069bf TI |
2256 | .v.verbs = (const struct hda_verb[]) { |
2257 | /* change to EAPD mode */ | |
2258 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2259 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2260 | { } | |
2261 | } | |
2262 | }, | |
8812c4f9 | 2263 | [ALC883_FIXUP_ACER_EAPD] = { |
1727a771 | 2264 | .type = HDA_FIXUP_VERBS, |
8812c4f9 TI |
2265 | .v.verbs = (const struct hda_verb[]) { |
2266 | /* eanable EAPD on Acer laptops */ | |
2267 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2268 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2269 | { } | |
2270 | } | |
2271 | }, | |
1a97b7f2 | 2272 | [ALC882_FIXUP_GPIO1] = { |
5579cd6f TI |
2273 | .type = HDA_FIXUP_FUNC, |
2274 | .v.func = alc_fixup_gpio1, | |
1a97b7f2 TI |
2275 | }, |
2276 | [ALC882_FIXUP_GPIO2] = { | |
5579cd6f TI |
2277 | .type = HDA_FIXUP_FUNC, |
2278 | .v.func = alc_fixup_gpio2, | |
1a97b7f2 | 2279 | }, |
eb844d51 | 2280 | [ALC882_FIXUP_GPIO3] = { |
5579cd6f TI |
2281 | .type = HDA_FIXUP_FUNC, |
2282 | .v.func = alc_fixup_gpio3, | |
eb844d51 | 2283 | }, |
68ef0561 | 2284 | [ALC882_FIXUP_ASUS_W2JC] = { |
5579cd6f TI |
2285 | .type = HDA_FIXUP_FUNC, |
2286 | .v.func = alc_fixup_gpio1, | |
68ef0561 TI |
2287 | .chained = true, |
2288 | .chain_id = ALC882_FIXUP_EAPD, | |
2289 | }, | |
2290 | [ALC889_FIXUP_COEF] = { | |
1727a771 | 2291 | .type = HDA_FIXUP_FUNC, |
68ef0561 TI |
2292 | .v.func = alc889_fixup_coef, |
2293 | }, | |
c3e837bb | 2294 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
1727a771 TI |
2295 | .type = HDA_FIXUP_PINS, |
2296 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2297 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2298 | { 0x17, 0x99130112 }, /* surround speaker */ | |
2299 | { } | |
038d4fef TI |
2300 | }, |
2301 | .chained = true, | |
2302 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb TI |
2303 | }, |
2304 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { | |
1727a771 TI |
2305 | .type = HDA_FIXUP_PINS, |
2306 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2307 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2308 | { 0x1b, 0x99130112 }, /* surround speaker */ | |
2309 | { } | |
2310 | }, | |
2311 | .chained = true, | |
2312 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
2313 | }, | |
2314 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { | |
2315 | /* additional init verbs for Acer Aspire 8930G */ | |
1727a771 | 2316 | .type = HDA_FIXUP_VERBS, |
c3e837bb TI |
2317 | .v.verbs = (const struct hda_verb[]) { |
2318 | /* Enable all DACs */ | |
2319 | /* DAC DISABLE/MUTE 1? */ | |
2320 | /* setting bits 1-5 disables DAC nids 0x02-0x06 | |
2321 | * apparently. Init=0x38 */ | |
2322 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, | |
2323 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2324 | /* DAC DISABLE/MUTE 2? */ | |
2325 | /* some bit here disables the other DACs. | |
2326 | * Init=0x4900 */ | |
2327 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, | |
2328 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2329 | /* DMIC fix | |
2330 | * This laptop has a stereo digital microphone. | |
2331 | * The mics are only 1cm apart which makes the stereo | |
2332 | * useless. However, either the mic or the ALC889 | |
2333 | * makes the signal become a difference/sum signal | |
2334 | * instead of standard stereo, which is annoying. | |
2335 | * So instead we flip this bit which makes the | |
2336 | * codec replicate the sum signal to both channels, | |
2337 | * turning it into a normal mono mic. | |
2338 | */ | |
2339 | /* DMIC_CONTROL? Init value = 0x0001 */ | |
2340 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2341 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, | |
2342 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2343 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2344 | { } | |
038d4fef TI |
2345 | }, |
2346 | .chained = true, | |
2347 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb | 2348 | }, |
5671087f | 2349 | [ALC885_FIXUP_MACPRO_GPIO] = { |
1727a771 | 2350 | .type = HDA_FIXUP_FUNC, |
5671087f TI |
2351 | .v.func = alc885_fixup_macpro_gpio, |
2352 | }, | |
02a237b2 | 2353 | [ALC889_FIXUP_DAC_ROUTE] = { |
1727a771 | 2354 | .type = HDA_FIXUP_FUNC, |
02a237b2 TI |
2355 | .v.func = alc889_fixup_dac_route, |
2356 | }, | |
1a97b7f2 | 2357 | [ALC889_FIXUP_MBP_VREF] = { |
1727a771 | 2358 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2359 | .v.func = alc889_fixup_mbp_vref, |
2360 | .chained = true, | |
2361 | .chain_id = ALC882_FIXUP_GPIO1, | |
2362 | }, | |
2363 | [ALC889_FIXUP_IMAC91_VREF] = { | |
1727a771 | 2364 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2365 | .v.func = alc889_fixup_imac91_vref, |
2366 | .chained = true, | |
2367 | .chain_id = ALC882_FIXUP_GPIO1, | |
2368 | }, | |
e7729a41 AV |
2369 | [ALC889_FIXUP_MBA11_VREF] = { |
2370 | .type = HDA_FIXUP_FUNC, | |
2371 | .v.func = alc889_fixup_mba11_vref, | |
2372 | .chained = true, | |
2373 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2374 | }, | |
0756f09c TI |
2375 | [ALC889_FIXUP_MBA21_VREF] = { |
2376 | .type = HDA_FIXUP_FUNC, | |
2377 | .v.func = alc889_fixup_mba21_vref, | |
2378 | .chained = true, | |
2379 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2380 | }, | |
c20f31ec TI |
2381 | [ALC889_FIXUP_MP11_VREF] = { |
2382 | .type = HDA_FIXUP_FUNC, | |
2383 | .v.func = alc889_fixup_mba11_vref, | |
2384 | .chained = true, | |
2385 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2386 | }, | |
9f660a1c MK |
2387 | [ALC889_FIXUP_MP41_VREF] = { |
2388 | .type = HDA_FIXUP_FUNC, | |
2389 | .v.func = alc889_fixup_mbp_vref, | |
2390 | .chained = true, | |
2391 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2392 | }, | |
6e72aa5f | 2393 | [ALC882_FIXUP_INV_DMIC] = { |
1727a771 | 2394 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2395 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2396 | }, |
e427c237 | 2397 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
1727a771 | 2398 | .type = HDA_FIXUP_FUNC, |
e427c237 TI |
2399 | .v.func = alc882_fixup_no_primary_hp, |
2400 | }, | |
1f0bbf03 TI |
2401 | [ALC887_FIXUP_ASUS_BASS] = { |
2402 | .type = HDA_FIXUP_PINS, | |
2403 | .v.pins = (const struct hda_pintbl[]) { | |
2404 | {0x16, 0x99130130}, /* bass speaker */ | |
2405 | {} | |
2406 | }, | |
eb9ca3ab TI |
2407 | .chained = true, |
2408 | .chain_id = ALC887_FIXUP_BASS_CHMAP, | |
2409 | }, | |
2410 | [ALC887_FIXUP_BASS_CHMAP] = { | |
2411 | .type = HDA_FIXUP_FUNC, | |
2412 | .v.func = alc_fixup_bass_chmap, | |
1f0bbf03 | 2413 | }, |
7beb3a6e TI |
2414 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
2415 | .type = HDA_FIXUP_FUNC, | |
2416 | .v.func = alc1220_fixup_gb_dual_codecs, | |
2417 | }, | |
0202f5cd P |
2418 | [ALC1220_FIXUP_CLEVO_P950] = { |
2419 | .type = HDA_FIXUP_FUNC, | |
2420 | .v.func = alc1220_fixup_clevo_p950, | |
2421 | }, | |
80690a27 | 2422 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
7f665b1c | 2423 | .type = HDA_FIXUP_FUNC, |
80690a27 | 2424 | .v.func = alc1220_fixup_clevo_pb51ed, |
7f665b1c | 2425 | }, |
80690a27 | 2426 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
7f665b1c JS |
2427 | .type = HDA_FIXUP_PINS, |
2428 | .v.pins = (const struct hda_pintbl[]) { | |
2429 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
2430 | {} | |
2431 | }, | |
2432 | .chained = true, | |
80690a27 | 2433 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
7f665b1c | 2434 | }, |
ca184355 JHP |
2435 | [ALC887_FIXUP_ASUS_AUDIO] = { |
2436 | .type = HDA_FIXUP_PINS, | |
2437 | .v.pins = (const struct hda_pintbl[]) { | |
2438 | { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ | |
2439 | { 0x19, 0x22219420 }, | |
2440 | {} | |
2441 | }, | |
2442 | }, | |
2443 | [ALC887_FIXUP_ASUS_HMIC] = { | |
2444 | .type = HDA_FIXUP_FUNC, | |
2445 | .v.func = alc887_fixup_asus_jack, | |
2446 | .chained = true, | |
2447 | .chain_id = ALC887_FIXUP_ASUS_AUDIO, | |
2448 | }, | |
ff818c24 TI |
2449 | }; |
2450 | ||
1d045db9 | 2451 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
8812c4f9 TI |
2452 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
2453 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
b5d724b1 | 2454 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
8812c4f9 TI |
2455 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
2456 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
2457 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), | |
2458 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), | |
c3e837bb TI |
2459 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
2460 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2461 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", | |
2462 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2463 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", | |
2464 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
2465 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", | |
2466 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
b265047a TI |
2467 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", |
2468 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2469 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), | |
c3e837bb TI |
2470 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", |
2471 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2472 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", | |
2473 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
f5c53d89 TI |
2474 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
2475 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
02a237b2 | 2476 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
fe97da1f | 2477 | SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), |
ac9b1cdd | 2478 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
177943a3 | 2479 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
5c0ebfbe | 2480 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
68ef0561 | 2481 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
ca184355 | 2482 | SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), |
0e7cc2e7 | 2483 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
1f0bbf03 | 2484 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
85bcf96c | 2485 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
b7529c18 TI |
2486 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
2487 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), | |
ac9b1cdd | 2488 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
e427c237 | 2489 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
3f3c3714 | 2490 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
5671087f TI |
2491 | |
2492 | /* All Apple entries are in codec SSIDs */ | |
1a97b7f2 TI |
2493 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
2494 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), | |
2495 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
c20f31ec | 2496 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
5671087f TI |
2497 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
2498 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), | |
1a97b7f2 TI |
2499 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
2500 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2501 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
e7729a41 | 2502 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
0756f09c | 2503 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
1a97b7f2 TI |
2504 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
2505 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2506 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
1a97b7f2 TI |
2507 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
2508 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), | |
2509 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), | |
9f660a1c | 2510 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), |
05193639 | 2511 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
1a97b7f2 TI |
2512 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
2513 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), | |
649ccd08 | 2514 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
5671087f | 2515 | |
7a6069bf | 2516 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
4841b8e6 | 2517 | SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), |
b2c53e20 | 2518 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
7beb3a6e | 2519 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
0d45e86d | 2520 | SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), |
d9e8fe0c | 2521 | SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), |
a0b03952 | 2522 | SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), |
a655e2b1 | 2523 | SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), |
09926202 | 2524 | SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), |
1d3aa4a5 | 2525 | SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), |
7dafba37 | 2526 | SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), |
cc5049ae | 2527 | SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), |
d2c3b14e | 2528 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
26af1772 | 2529 | SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS), |
63691587 | 2530 | SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
d2c3b14e | 2531 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
5c0ebfbe | 2532 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
13e1a4cd TI |
2533 | SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2534 | SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2535 | SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2536 | SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2537 | SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
aef454b4 | 2538 | SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
13e1a4cd TI |
2539 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2540 | SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2541 | SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
a7182ce8 | 2542 | SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
13e1a4cd | 2543 | SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
1f8d398e | 2544 | SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
cc03069a | 2545 | SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED), |
0202f5cd | 2546 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
b5acfe15 | 2547 | SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), |
13e1a4cd | 2548 | SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), |
f3d737b6 | 2549 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
2f0d520a | 2550 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
b5acfe15 PH |
2551 | SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950), |
2552 | SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950), | |
2553 | SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950), | |
2554 | SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950), | |
503d90b3 RS |
2555 | SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), |
2556 | SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), | |
b5acfe15 | 2557 | SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950), |
7a6069bf TI |
2558 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
2559 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), | |
ac9b1cdd | 2560 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
68ef0561 | 2561 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
ff818c24 TI |
2562 | {} |
2563 | }; | |
2564 | ||
1727a771 | 2565 | static const struct hda_model_fixup alc882_fixup_models[] = { |
772c2917 TI |
2566 | {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, |
2567 | {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, | |
2568 | {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, | |
2569 | {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, | |
2570 | {.id = ALC889_FIXUP_CD, .name = "cd"}, | |
2571 | {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, | |
2572 | {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, | |
2573 | {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, | |
2574 | {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, | |
2575 | {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, | |
2576 | {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, | |
2577 | {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, | |
2578 | {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, | |
2579 | {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, | |
2580 | {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, | |
912093bc TI |
2581 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
2582 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, | |
2583 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, | |
772c2917 TI |
2584 | {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, |
2585 | {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, | |
2586 | {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, | |
2587 | {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, | |
2588 | {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, | |
2589 | {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, | |
2590 | {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, | |
2591 | {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, | |
6e72aa5f | 2592 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e427c237 | 2593 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
772c2917 | 2594 | {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, |
ba90d6a6 | 2595 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
772c2917 | 2596 | {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, |
912093bc TI |
2597 | {} |
2598 | }; | |
2599 | ||
119b75c1 HW |
2600 | static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = { |
2601 | SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950, | |
2602 | {0x14, 0x01014010}, | |
2603 | {0x15, 0x01011012}, | |
2604 | {0x16, 0x01016011}, | |
2605 | {0x18, 0x01a19040}, | |
2606 | {0x19, 0x02a19050}, | |
2607 | {0x1a, 0x0181304f}, | |
2608 | {0x1b, 0x0221401f}, | |
2609 | {0x1e, 0x01456130}), | |
2610 | SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950, | |
2611 | {0x14, 0x01015010}, | |
2612 | {0x15, 0x01011012}, | |
2613 | {0x16, 0x01011011}, | |
2614 | {0x18, 0x01a11040}, | |
2615 | {0x19, 0x02a19050}, | |
2616 | {0x1a, 0x0181104f}, | |
2617 | {0x1b, 0x0221401f}, | |
2618 | {0x1e, 0x01451130}), | |
2619 | {} | |
2620 | }; | |
2621 | ||
f6a92248 | 2622 | /* |
1d045db9 | 2623 | * BIOS auto configuration |
f6a92248 | 2624 | */ |
1d045db9 TI |
2625 | /* almost identical with ALC880 parser... */ |
2626 | static int alc882_parse_auto_config(struct hda_codec *codec) | |
2627 | { | |
1d045db9 | 2628 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2629 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2630 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); | |
1d045db9 | 2631 | } |
b896b4eb | 2632 | |
1d045db9 TI |
2633 | /* |
2634 | */ | |
1d045db9 | 2635 | static int patch_alc882(struct hda_codec *codec) |
f6a92248 KY |
2636 | { |
2637 | struct alc_spec *spec; | |
1a97b7f2 | 2638 | int err; |
f6a92248 | 2639 | |
3de95173 TI |
2640 | err = alc_alloc_spec(codec, 0x0b); |
2641 | if (err < 0) | |
2642 | return err; | |
f6a92248 | 2643 | |
3de95173 | 2644 | spec = codec->spec; |
1f0f4b80 | 2645 | |
7639a06c | 2646 | switch (codec->core.vendor_id) { |
1d045db9 TI |
2647 | case 0x10ec0882: |
2648 | case 0x10ec0885: | |
acf08081 | 2649 | case 0x10ec0900: |
6d9ffcff | 2650 | case 0x10ec0b00: |
a535ad57 | 2651 | case 0x10ec1220: |
1d045db9 TI |
2652 | break; |
2653 | default: | |
2654 | /* ALC883 and variants */ | |
2655 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); | |
2656 | break; | |
c793bec5 | 2657 | } |
977ddd6b | 2658 | |
c9af753f TI |
2659 | alc_pre_init(codec); |
2660 | ||
1727a771 | 2661 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
912093bc | 2662 | alc882_fixups); |
119b75c1 | 2663 | snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true); |
1727a771 | 2664 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ff818c24 | 2665 | |
1d045db9 TI |
2666 | alc_auto_parse_customize_define(codec); |
2667 | ||
7504b6cd TI |
2668 | if (has_cdefine_beep(codec)) |
2669 | spec->gen.beep_nid = 0x01; | |
2670 | ||
1a97b7f2 TI |
2671 | /* automatic parse from the BIOS config */ |
2672 | err = alc882_parse_auto_config(codec); | |
2673 | if (err < 0) | |
2674 | goto error; | |
f6a92248 | 2675 | |
fea80fae TI |
2676 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
2677 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
2678 | if (err < 0) | |
2679 | goto error; | |
2680 | } | |
f6a92248 | 2681 | |
1727a771 | 2682 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2683 | |
f6a92248 | 2684 | return 0; |
e16fb6d1 TI |
2685 | |
2686 | error: | |
2687 | alc_free(codec); | |
2688 | return err; | |
f6a92248 KY |
2689 | } |
2690 | ||
df694daa | 2691 | |
df694daa | 2692 | /* |
1d045db9 | 2693 | * ALC262 support |
df694daa | 2694 | */ |
1d045db9 | 2695 | static int alc262_parse_auto_config(struct hda_codec *codec) |
df694daa | 2696 | { |
1d045db9 | 2697 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2698 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2699 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); | |
df694daa KY |
2700 | } |
2701 | ||
df694daa | 2702 | /* |
1d045db9 | 2703 | * Pin config fixes |
df694daa | 2704 | */ |
cfc9b06f | 2705 | enum { |
ea4e7af1 | 2706 | ALC262_FIXUP_FSC_H270, |
7513e6da | 2707 | ALC262_FIXUP_FSC_S7110, |
ea4e7af1 TI |
2708 | ALC262_FIXUP_HP_Z200, |
2709 | ALC262_FIXUP_TYAN, | |
c470150c | 2710 | ALC262_FIXUP_LENOVO_3000, |
b42590b8 TI |
2711 | ALC262_FIXUP_BENQ, |
2712 | ALC262_FIXUP_BENQ_T31, | |
6e72aa5f | 2713 | ALC262_FIXUP_INV_DMIC, |
b5c6611f | 2714 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
cfc9b06f TI |
2715 | }; |
2716 | ||
1727a771 | 2717 | static const struct hda_fixup alc262_fixups[] = { |
ea4e7af1 | 2718 | [ALC262_FIXUP_FSC_H270] = { |
1727a771 TI |
2719 | .type = HDA_FIXUP_PINS, |
2720 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2721 | { 0x14, 0x99130110 }, /* speaker */ |
2722 | { 0x15, 0x0221142f }, /* front HP */ | |
2723 | { 0x1b, 0x0121141f }, /* rear HP */ | |
2724 | { } | |
2725 | } | |
2726 | }, | |
7513e6da TI |
2727 | [ALC262_FIXUP_FSC_S7110] = { |
2728 | .type = HDA_FIXUP_PINS, | |
2729 | .v.pins = (const struct hda_pintbl[]) { | |
2730 | { 0x15, 0x90170110 }, /* speaker */ | |
2731 | { } | |
2732 | }, | |
2733 | .chained = true, | |
2734 | .chain_id = ALC262_FIXUP_BENQ, | |
2735 | }, | |
ea4e7af1 | 2736 | [ALC262_FIXUP_HP_Z200] = { |
1727a771 TI |
2737 | .type = HDA_FIXUP_PINS, |
2738 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 | 2739 | { 0x16, 0x99130120 }, /* internal speaker */ |
73413b12 TI |
2740 | { } |
2741 | } | |
cfc9b06f | 2742 | }, |
ea4e7af1 | 2743 | [ALC262_FIXUP_TYAN] = { |
1727a771 TI |
2744 | .type = HDA_FIXUP_PINS, |
2745 | .v.pins = (const struct hda_pintbl[]) { | |
ea4e7af1 TI |
2746 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
2747 | { } | |
2748 | } | |
2749 | }, | |
c470150c | 2750 | [ALC262_FIXUP_LENOVO_3000] = { |
fd108215 TI |
2751 | .type = HDA_FIXUP_PINCTLS, |
2752 | .v.pins = (const struct hda_pintbl[]) { | |
2753 | { 0x19, PIN_VREF50 }, | |
b42590b8 TI |
2754 | {} |
2755 | }, | |
2756 | .chained = true, | |
2757 | .chain_id = ALC262_FIXUP_BENQ, | |
2758 | }, | |
2759 | [ALC262_FIXUP_BENQ] = { | |
1727a771 | 2760 | .type = HDA_FIXUP_VERBS, |
b42590b8 | 2761 | .v.verbs = (const struct hda_verb[]) { |
c470150c TI |
2762 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
2763 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2764 | {} | |
2765 | } | |
2766 | }, | |
b42590b8 | 2767 | [ALC262_FIXUP_BENQ_T31] = { |
1727a771 | 2768 | .type = HDA_FIXUP_VERBS, |
b42590b8 TI |
2769 | .v.verbs = (const struct hda_verb[]) { |
2770 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2771 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2772 | {} | |
2773 | } | |
2774 | }, | |
6e72aa5f | 2775 | [ALC262_FIXUP_INV_DMIC] = { |
1727a771 | 2776 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2777 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2778 | }, |
b5c6611f ML |
2779 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
2780 | .type = HDA_FIXUP_FUNC, | |
2781 | .v.func = alc_fixup_no_depop_delay, | |
2782 | }, | |
cfc9b06f TI |
2783 | }; |
2784 | ||
1d045db9 | 2785 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
ea4e7af1 | 2786 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
7513e6da | 2787 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
3dcd3be3 | 2788 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
ea4e7af1 | 2789 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
275ec0cb | 2790 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
ea4e7af1 | 2791 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
c470150c | 2792 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
b42590b8 TI |
2793 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
2794 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), | |
b5c6611f | 2795 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
cfc9b06f TI |
2796 | {} |
2797 | }; | |
df694daa | 2798 | |
1727a771 | 2799 | static const struct hda_model_fixup alc262_fixup_models[] = { |
6e72aa5f | 2800 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e43c44d6 TI |
2801 | {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, |
2802 | {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, | |
2803 | {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, | |
2804 | {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, | |
2805 | {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, | |
2806 | {.id = ALC262_FIXUP_BENQ, .name = "benq"}, | |
2807 | {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, | |
2808 | {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, | |
6e72aa5f TI |
2809 | {} |
2810 | }; | |
1d045db9 | 2811 | |
1d045db9 TI |
2812 | /* |
2813 | */ | |
1d045db9 | 2814 | static int patch_alc262(struct hda_codec *codec) |
df694daa KY |
2815 | { |
2816 | struct alc_spec *spec; | |
df694daa KY |
2817 | int err; |
2818 | ||
3de95173 TI |
2819 | err = alc_alloc_spec(codec, 0x0b); |
2820 | if (err < 0) | |
2821 | return err; | |
df694daa | 2822 | |
3de95173 | 2823 | spec = codec->spec; |
08c189f2 | 2824 | spec->gen.shared_mic_vref_pin = 0x18; |
1d045db9 | 2825 | |
225068ab TI |
2826 | spec->shutup = alc_eapd_shutup; |
2827 | ||
1d045db9 TI |
2828 | #if 0 |
2829 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is | |
2830 | * under-run | |
2831 | */ | |
98b24883 | 2832 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
1d045db9 | 2833 | #endif |
1d045db9 TI |
2834 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
2835 | ||
c9af753f TI |
2836 | alc_pre_init(codec); |
2837 | ||
1727a771 | 2838 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
6e72aa5f | 2839 | alc262_fixups); |
1727a771 | 2840 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
9c7f852e | 2841 | |
af741c15 TI |
2842 | alc_auto_parse_customize_define(codec); |
2843 | ||
7504b6cd TI |
2844 | if (has_cdefine_beep(codec)) |
2845 | spec->gen.beep_nid = 0x01; | |
2846 | ||
42399f7a TI |
2847 | /* automatic parse from the BIOS config */ |
2848 | err = alc262_parse_auto_config(codec); | |
2849 | if (err < 0) | |
2850 | goto error; | |
df694daa | 2851 | |
fea80fae TI |
2852 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
2853 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
2854 | if (err < 0) | |
2855 | goto error; | |
2856 | } | |
2134ea4f | 2857 | |
1727a771 | 2858 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2859 | |
1da177e4 | 2860 | return 0; |
e16fb6d1 TI |
2861 | |
2862 | error: | |
2863 | alc_free(codec); | |
2864 | return err; | |
1da177e4 LT |
2865 | } |
2866 | ||
f32610ed | 2867 | /* |
1d045db9 | 2868 | * ALC268 |
f32610ed | 2869 | */ |
1d045db9 | 2870 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
a717777d TI |
2871 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
2872 | struct snd_ctl_elem_value *ucontrol) | |
2873 | { | |
2874 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | |
2875 | unsigned long pval; | |
2876 | int err; | |
2877 | ||
2878 | mutex_lock(&codec->control_mutex); | |
2879 | pval = kcontrol->private_value; | |
2880 | kcontrol->private_value = (pval & ~0xff) | 0x0f; | |
2881 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2882 | if (err >= 0) { | |
2883 | kcontrol->private_value = (pval & ~0xff) | 0x10; | |
2884 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2885 | } | |
2886 | kcontrol->private_value = pval; | |
2887 | mutex_unlock(&codec->control_mutex); | |
2888 | return err; | |
2889 | } | |
f32610ed | 2890 | |
1d045db9 TI |
2891 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
2892 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), | |
a717777d TI |
2893 | { |
2894 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | |
2895 | .name = "Beep Playback Switch", | |
2896 | .subdevice = HDA_SUBDEV_AMP_FLAG, | |
2897 | .info = snd_hda_mixer_amp_switch_info, | |
2898 | .get = snd_hda_mixer_amp_switch_get, | |
2899 | .put = alc268_beep_switch_put, | |
2900 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) | |
2901 | }, | |
f32610ed JS |
2902 | }; |
2903 | ||
1d045db9 TI |
2904 | /* set PCBEEP vol = 0, mute connections */ |
2905 | static const struct hda_verb alc268_beep_init_verbs[] = { | |
2906 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | |
2907 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2908 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2909 | { } | |
f32610ed JS |
2910 | }; |
2911 | ||
6e72aa5f TI |
2912 | enum { |
2913 | ALC268_FIXUP_INV_DMIC, | |
cb766404 | 2914 | ALC268_FIXUP_HP_EAPD, |
24eff328 | 2915 | ALC268_FIXUP_SPDIF, |
6e72aa5f TI |
2916 | }; |
2917 | ||
1727a771 | 2918 | static const struct hda_fixup alc268_fixups[] = { |
6e72aa5f | 2919 | [ALC268_FIXUP_INV_DMIC] = { |
1727a771 | 2920 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2921 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2922 | }, |
cb766404 | 2923 | [ALC268_FIXUP_HP_EAPD] = { |
1727a771 | 2924 | .type = HDA_FIXUP_VERBS, |
cb766404 TI |
2925 | .v.verbs = (const struct hda_verb[]) { |
2926 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
2927 | {} | |
2928 | } | |
2929 | }, | |
24eff328 TI |
2930 | [ALC268_FIXUP_SPDIF] = { |
2931 | .type = HDA_FIXUP_PINS, | |
2932 | .v.pins = (const struct hda_pintbl[]) { | |
2933 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ | |
2934 | {} | |
2935 | } | |
2936 | }, | |
6e72aa5f TI |
2937 | }; |
2938 | ||
1727a771 | 2939 | static const struct hda_model_fixup alc268_fixup_models[] = { |
6e72aa5f | 2940 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
cb766404 | 2941 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
03bf11c9 | 2942 | {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, |
cb766404 TI |
2943 | {} |
2944 | }; | |
2945 | ||
2946 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { | |
24eff328 | 2947 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
fcd8f3b1 | 2948 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), |
cb766404 TI |
2949 | /* below is codec SSID since multiple Toshiba laptops have the |
2950 | * same PCI SSID 1179:ff00 | |
2951 | */ | |
2952 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), | |
6e72aa5f TI |
2953 | {} |
2954 | }; | |
2955 | ||
f32610ed JS |
2956 | /* |
2957 | * BIOS auto configuration | |
2958 | */ | |
1d045db9 | 2959 | static int alc268_parse_auto_config(struct hda_codec *codec) |
f32610ed | 2960 | { |
3e6179b8 | 2961 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
7504b6cd | 2962 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
f32610ed JS |
2963 | } |
2964 | ||
1d045db9 TI |
2965 | /* |
2966 | */ | |
1d045db9 | 2967 | static int patch_alc268(struct hda_codec *codec) |
f32610ed JS |
2968 | { |
2969 | struct alc_spec *spec; | |
a5cb463a | 2970 | int i, err; |
f32610ed | 2971 | |
1d045db9 | 2972 | /* ALC268 has no aa-loopback mixer */ |
3de95173 TI |
2973 | err = alc_alloc_spec(codec, 0); |
2974 | if (err < 0) | |
2975 | return err; | |
2976 | ||
2977 | spec = codec->spec; | |
2722b535 TI |
2978 | if (has_cdefine_beep(codec)) |
2979 | spec->gen.beep_nid = 0x01; | |
1f0f4b80 | 2980 | |
225068ab TI |
2981 | spec->shutup = alc_eapd_shutup; |
2982 | ||
c9af753f TI |
2983 | alc_pre_init(codec); |
2984 | ||
1727a771 TI |
2985 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
2986 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
6e72aa5f | 2987 | |
6ebb8053 TI |
2988 | /* automatic parse from the BIOS config */ |
2989 | err = alc268_parse_auto_config(codec); | |
e16fb6d1 TI |
2990 | if (err < 0) |
2991 | goto error; | |
f32610ed | 2992 | |
7504b6cd TI |
2993 | if (err > 0 && !spec->gen.no_analog && |
2994 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { | |
a5cb463a TI |
2995 | for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { |
2996 | if (!snd_hda_gen_add_kctl(&spec->gen, NULL, | |
2997 | &alc268_beep_mixer[i])) { | |
2998 | err = -ENOMEM; | |
2999 | goto error; | |
3000 | } | |
3001 | } | |
7504b6cd | 3002 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); |
1d045db9 TI |
3003 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
3004 | /* override the amp caps for beep generator */ | |
3005 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, | |
3006 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | | |
3007 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
3008 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
3009 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
2f893286 KY |
3010 | } |
3011 | ||
1727a771 | 3012 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
6e72aa5f | 3013 | |
f32610ed | 3014 | return 0; |
e16fb6d1 TI |
3015 | |
3016 | error: | |
3017 | alc_free(codec); | |
3018 | return err; | |
f32610ed JS |
3019 | } |
3020 | ||
bc9f98a9 | 3021 | /* |
1d045db9 | 3022 | * ALC269 |
bc9f98a9 | 3023 | */ |
08c189f2 | 3024 | |
1d045db9 | 3025 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
1d045db9 | 3026 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 KY |
3027 | }; |
3028 | ||
1d045db9 | 3029 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
1d045db9 | 3030 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 | 3031 | }; |
291702f0 | 3032 | |
1d045db9 TI |
3033 | /* different alc269-variants */ |
3034 | enum { | |
3035 | ALC269_TYPE_ALC269VA, | |
3036 | ALC269_TYPE_ALC269VB, | |
3037 | ALC269_TYPE_ALC269VC, | |
adcc70b2 | 3038 | ALC269_TYPE_ALC269VD, |
065380f0 KY |
3039 | ALC269_TYPE_ALC280, |
3040 | ALC269_TYPE_ALC282, | |
2af02be7 | 3041 | ALC269_TYPE_ALC283, |
065380f0 | 3042 | ALC269_TYPE_ALC284, |
4731d5de | 3043 | ALC269_TYPE_ALC293, |
7fc7d047 | 3044 | ALC269_TYPE_ALC286, |
506b62c3 | 3045 | ALC269_TYPE_ALC298, |
1d04c9de | 3046 | ALC269_TYPE_ALC255, |
4344aec8 | 3047 | ALC269_TYPE_ALC256, |
f429e7e4 | 3048 | ALC269_TYPE_ALC257, |
0a6f0600 | 3049 | ALC269_TYPE_ALC215, |
4231430d | 3050 | ALC269_TYPE_ALC225, |
99cee034 | 3051 | ALC269_TYPE_ALC287, |
dcd4f0db | 3052 | ALC269_TYPE_ALC294, |
1078bef0 | 3053 | ALC269_TYPE_ALC300, |
f0778871 | 3054 | ALC269_TYPE_ALC623, |
6fbae35a | 3055 | ALC269_TYPE_ALC700, |
bc9f98a9 KY |
3056 | }; |
3057 | ||
3058 | /* | |
1d045db9 | 3059 | * BIOS auto configuration |
bc9f98a9 | 3060 | */ |
1d045db9 TI |
3061 | static int alc269_parse_auto_config(struct hda_codec *codec) |
3062 | { | |
1d045db9 | 3063 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
3064 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
3065 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
3066 | struct alc_spec *spec = codec->spec; | |
adcc70b2 KY |
3067 | const hda_nid_t *ssids; |
3068 | ||
3069 | switch (spec->codec_variant) { | |
3070 | case ALC269_TYPE_ALC269VA: | |
3071 | case ALC269_TYPE_ALC269VC: | |
065380f0 KY |
3072 | case ALC269_TYPE_ALC280: |
3073 | case ALC269_TYPE_ALC284: | |
4731d5de | 3074 | case ALC269_TYPE_ALC293: |
adcc70b2 KY |
3075 | ssids = alc269va_ssids; |
3076 | break; | |
3077 | case ALC269_TYPE_ALC269VB: | |
3078 | case ALC269_TYPE_ALC269VD: | |
065380f0 | 3079 | case ALC269_TYPE_ALC282: |
2af02be7 | 3080 | case ALC269_TYPE_ALC283: |
7fc7d047 | 3081 | case ALC269_TYPE_ALC286: |
506b62c3 | 3082 | case ALC269_TYPE_ALC298: |
1d04c9de | 3083 | case ALC269_TYPE_ALC255: |
4344aec8 | 3084 | case ALC269_TYPE_ALC256: |
f429e7e4 | 3085 | case ALC269_TYPE_ALC257: |
0a6f0600 | 3086 | case ALC269_TYPE_ALC215: |
4231430d | 3087 | case ALC269_TYPE_ALC225: |
99cee034 | 3088 | case ALC269_TYPE_ALC287: |
dcd4f0db | 3089 | case ALC269_TYPE_ALC294: |
1078bef0 | 3090 | case ALC269_TYPE_ALC300: |
f0778871 | 3091 | case ALC269_TYPE_ALC623: |
6fbae35a | 3092 | case ALC269_TYPE_ALC700: |
adcc70b2 KY |
3093 | ssids = alc269_ssids; |
3094 | break; | |
3095 | default: | |
3096 | ssids = alc269_ssids; | |
3097 | break; | |
3098 | } | |
bc9f98a9 | 3099 | |
3e6179b8 | 3100 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
1d045db9 | 3101 | } |
bc9f98a9 | 3102 | |
476c02e0 HW |
3103 | static const struct hda_jack_keymap alc_headset_btn_keymap[] = { |
3104 | { SND_JACK_BTN_0, KEY_PLAYPAUSE }, | |
3105 | { SND_JACK_BTN_1, KEY_VOICECOMMAND }, | |
3106 | { SND_JACK_BTN_2, KEY_VOLUMEUP }, | |
3107 | { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, | |
3108 | {} | |
3109 | }; | |
3110 | ||
3111 | static void alc_headset_btn_callback(struct hda_codec *codec, | |
3112 | struct hda_jack_callback *jack) | |
3113 | { | |
3114 | int report = 0; | |
3115 | ||
3116 | if (jack->unsol_res & (7 << 13)) | |
3117 | report |= SND_JACK_BTN_0; | |
3118 | ||
3119 | if (jack->unsol_res & (1 << 16 | 3 << 8)) | |
3120 | report |= SND_JACK_BTN_1; | |
3121 | ||
3122 | /* Volume up key */ | |
3123 | if (jack->unsol_res & (7 << 23)) | |
3124 | report |= SND_JACK_BTN_2; | |
3125 | ||
3126 | /* Volume down key */ | |
3127 | if (jack->unsol_res & (7 << 10)) | |
3128 | report |= SND_JACK_BTN_3; | |
3129 | ||
04f7791b | 3130 | snd_hda_jack_set_button_state(codec, jack->nid, report); |
476c02e0 HW |
3131 | } |
3132 | ||
3133 | static void alc_disable_headset_jack_key(struct hda_codec *codec) | |
3134 | { | |
3135 | struct alc_spec *spec = codec->spec; | |
3136 | ||
3137 | if (!spec->has_hs_key) | |
3138 | return; | |
3139 | ||
3140 | switch (codec->core.vendor_id) { | |
3141 | case 0x10ec0215: | |
3142 | case 0x10ec0225: | |
3143 | case 0x10ec0285: | |
c72b9bfe | 3144 | case 0x10ec0287: |
476c02e0 HW |
3145 | case 0x10ec0295: |
3146 | case 0x10ec0289: | |
3147 | case 0x10ec0299: | |
3148 | alc_write_coef_idx(codec, 0x48, 0x0); | |
3149 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); | |
3150 | alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); | |
3151 | break; | |
1948fc06 | 3152 | case 0x10ec0230: |
476c02e0 HW |
3153 | case 0x10ec0236: |
3154 | case 0x10ec0256: | |
3155 | alc_write_coef_idx(codec, 0x48, 0x0); | |
3156 | alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); | |
3157 | break; | |
3158 | } | |
3159 | } | |
3160 | ||
3161 | static void alc_enable_headset_jack_key(struct hda_codec *codec) | |
3162 | { | |
3163 | struct alc_spec *spec = codec->spec; | |
3164 | ||
3165 | if (!spec->has_hs_key) | |
3166 | return; | |
3167 | ||
3168 | switch (codec->core.vendor_id) { | |
3169 | case 0x10ec0215: | |
3170 | case 0x10ec0225: | |
3171 | case 0x10ec0285: | |
c72b9bfe | 3172 | case 0x10ec0287: |
476c02e0 HW |
3173 | case 0x10ec0295: |
3174 | case 0x10ec0289: | |
3175 | case 0x10ec0299: | |
3176 | alc_write_coef_idx(codec, 0x48, 0xd011); | |
3177 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); | |
3178 | alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); | |
3179 | break; | |
1948fc06 | 3180 | case 0x10ec0230: |
476c02e0 HW |
3181 | case 0x10ec0236: |
3182 | case 0x10ec0256: | |
3183 | alc_write_coef_idx(codec, 0x48, 0xd011); | |
3184 | alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); | |
3185 | break; | |
3186 | } | |
3187 | } | |
3188 | ||
3189 | static void alc_fixup_headset_jack(struct hda_codec *codec, | |
3190 | const struct hda_fixup *fix, int action) | |
3191 | { | |
3192 | struct alc_spec *spec = codec->spec; | |
04f7791b | 3193 | hda_nid_t hp_pin; |
476c02e0 HW |
3194 | |
3195 | switch (action) { | |
3196 | case HDA_FIXUP_ACT_PRE_PROBE: | |
3197 | spec->has_hs_key = 1; | |
3198 | snd_hda_jack_detect_enable_callback(codec, 0x55, | |
3199 | alc_headset_btn_callback); | |
476c02e0 | 3200 | break; |
04f7791b HW |
3201 | case HDA_FIXUP_ACT_BUILD: |
3202 | hp_pin = alc_get_hp_pin(spec); | |
3203 | if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55, | |
3204 | alc_headset_btn_keymap, | |
3205 | hp_pin)) | |
3206 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", | |
3207 | false, SND_JACK_HEADSET, | |
3208 | alc_headset_btn_keymap); | |
3209 | ||
476c02e0 HW |
3210 | alc_enable_headset_jack_key(codec); |
3211 | break; | |
3212 | } | |
3213 | } | |
3214 | ||
1387e2d1 | 3215 | static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) |
1d045db9 | 3216 | { |
98b24883 | 3217 | alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); |
1d045db9 | 3218 | } |
291702f0 | 3219 | |
1d045db9 TI |
3220 | static void alc269_shutup(struct hda_codec *codec) |
3221 | { | |
adcc70b2 KY |
3222 | struct alc_spec *spec = codec->spec; |
3223 | ||
1387e2d1 KY |
3224 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3225 | alc269vb_toggle_power_output(codec, 0); | |
3226 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
3227 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { | |
1d045db9 TI |
3228 | msleep(150); |
3229 | } | |
c0ca5ece | 3230 | alc_shutup_pins(codec); |
1d045db9 | 3231 | } |
291702f0 | 3232 | |
6b0f95c4 | 3233 | static const struct coef_fw alc282_coefs[] = { |
54db6c39 | 3234 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
32fa7e49 | 3235 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
3236 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
3237 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
3238 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
3239 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
3240 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
3241 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ | |
3242 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
3243 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
3244 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ | |
3245 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ | |
3246 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ | |
3247 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ | |
3248 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
3249 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
3250 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
3251 | WRITE_COEF(0x63, 0x2902), /* PLL */ | |
3252 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ | |
3253 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ | |
3254 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ | |
3255 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ | |
3256 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ | |
3257 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ | |
3258 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ | |
3259 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ | |
3260 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ | |
3261 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ | |
3262 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ | |
3263 | {} | |
3264 | }; | |
3265 | ||
cb149cb3 KY |
3266 | static void alc282_restore_default_value(struct hda_codec *codec) |
3267 | { | |
54db6c39 | 3268 | alc_process_coef_fw(codec, alc282_coefs); |
cb149cb3 KY |
3269 | } |
3270 | ||
7b5c7a02 KY |
3271 | static void alc282_init(struct hda_codec *codec) |
3272 | { | |
3273 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3274 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
3275 | bool hp_pin_sense; |
3276 | int coef78; | |
3277 | ||
cb149cb3 KY |
3278 | alc282_restore_default_value(codec); |
3279 | ||
7b5c7a02 KY |
3280 | if (!hp_pin) |
3281 | return; | |
3282 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3283 | coef78 = alc_read_coef_idx(codec, 0x78); | |
3284 | ||
3285 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ | |
3286 | /* Headphone capless set to high power mode */ | |
3287 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
3288 | ||
3289 | if (hp_pin_sense) | |
3290 | msleep(2); | |
3291 | ||
3292 | snd_hda_codec_write(codec, hp_pin, 0, | |
3293 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3294 | ||
3295 | if (hp_pin_sense) | |
3296 | msleep(85); | |
3297 | ||
3298 | snd_hda_codec_write(codec, hp_pin, 0, | |
3299 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3300 | ||
3301 | if (hp_pin_sense) | |
3302 | msleep(100); | |
3303 | ||
3304 | /* Headphone capless set to normal mode */ | |
3305 | alc_write_coef_idx(codec, 0x78, coef78); | |
3306 | } | |
3307 | ||
3308 | static void alc282_shutup(struct hda_codec *codec) | |
3309 | { | |
3310 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3311 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
3312 | bool hp_pin_sense; |
3313 | int coef78; | |
3314 | ||
3315 | if (!hp_pin) { | |
3316 | alc269_shutup(codec); | |
3317 | return; | |
3318 | } | |
3319 | ||
3320 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3321 | coef78 = alc_read_coef_idx(codec, 0x78); | |
3322 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
3323 | ||
3324 | if (hp_pin_sense) | |
3325 | msleep(2); | |
3326 | ||
3327 | snd_hda_codec_write(codec, hp_pin, 0, | |
3328 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3329 | ||
3330 | if (hp_pin_sense) | |
3331 | msleep(85); | |
3332 | ||
c0ca5ece TI |
3333 | if (!spec->no_shutup_pins) |
3334 | snd_hda_codec_write(codec, hp_pin, 0, | |
3335 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
7b5c7a02 KY |
3336 | |
3337 | if (hp_pin_sense) | |
3338 | msleep(100); | |
3339 | ||
3340 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3341 | alc_shutup_pins(codec); |
7b5c7a02 KY |
3342 | alc_write_coef_idx(codec, 0x78, coef78); |
3343 | } | |
3344 | ||
6b0f95c4 | 3345 | static const struct coef_fw alc283_coefs[] = { |
54db6c39 | 3346 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ |
56779864 | 3347 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
3348 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
3349 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
3350 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
3351 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
3352 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
3353 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ | |
3354 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
3355 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
3356 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ | |
3357 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ | |
3358 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ | |
3359 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ | |
3360 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
3361 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
3362 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
3363 | WRITE_COEF(0x2e, 0x2902), /* PLL */ | |
3364 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ | |
3365 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ | |
3366 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ | |
3367 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ | |
3368 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ | |
3369 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ | |
3370 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ | |
3371 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ | |
3372 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ | |
3373 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ | |
3374 | WRITE_COEF(0x49, 0x0), /* test mode */ | |
3375 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ | |
3376 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ | |
3377 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ | |
56779864 | 3378 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
54db6c39 TI |
3379 | {} |
3380 | }; | |
3381 | ||
6bd55b04 KY |
3382 | static void alc283_restore_default_value(struct hda_codec *codec) |
3383 | { | |
54db6c39 | 3384 | alc_process_coef_fw(codec, alc283_coefs); |
6bd55b04 KY |
3385 | } |
3386 | ||
2af02be7 KY |
3387 | static void alc283_init(struct hda_codec *codec) |
3388 | { | |
3389 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3390 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3391 | bool hp_pin_sense; |
2af02be7 | 3392 | |
6bd55b04 KY |
3393 | alc283_restore_default_value(codec); |
3394 | ||
2af02be7 KY |
3395 | if (!hp_pin) |
3396 | return; | |
a59d7199 KY |
3397 | |
3398 | msleep(30); | |
2af02be7 KY |
3399 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
3400 | ||
3401 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ | |
3402 | /* Headphone capless set to high power mode */ | |
3403 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3404 | ||
3405 | snd_hda_codec_write(codec, hp_pin, 0, | |
3406 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3407 | ||
3408 | if (hp_pin_sense) | |
3409 | msleep(85); | |
3410 | ||
3411 | snd_hda_codec_write(codec, hp_pin, 0, | |
3412 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3413 | ||
3414 | if (hp_pin_sense) | |
3415 | msleep(85); | |
3416 | /* Index 0x46 Combo jack auto switch control 2 */ | |
3417 | /* 3k pull low control for Headset jack. */ | |
98b24883 | 3418 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
2af02be7 KY |
3419 | /* Headphone capless set to normal mode */ |
3420 | alc_write_coef_idx(codec, 0x43, 0x9614); | |
3421 | } | |
3422 | ||
3423 | static void alc283_shutup(struct hda_codec *codec) | |
3424 | { | |
3425 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3426 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3427 | bool hp_pin_sense; |
2af02be7 KY |
3428 | |
3429 | if (!hp_pin) { | |
3430 | alc269_shutup(codec); | |
3431 | return; | |
3432 | } | |
3433 | ||
3434 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3435 | ||
3436 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3437 | ||
b450b17c HP |
3438 | /*depop hp during suspend*/ |
3439 | alc_write_coef_idx(codec, 0x06, 0x2100); | |
3440 | ||
2af02be7 KY |
3441 | snd_hda_codec_write(codec, hp_pin, 0, |
3442 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3443 | ||
3444 | if (hp_pin_sense) | |
88011c09 | 3445 | msleep(100); |
2af02be7 | 3446 | |
c0ca5ece TI |
3447 | if (!spec->no_shutup_pins) |
3448 | snd_hda_codec_write(codec, hp_pin, 0, | |
3449 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
2af02be7 | 3450 | |
98b24883 | 3451 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
2af02be7 KY |
3452 | |
3453 | if (hp_pin_sense) | |
88011c09 | 3454 | msleep(100); |
0435b3ff | 3455 | alc_auto_setup_eapd(codec, false); |
c0ca5ece | 3456 | alc_shutup_pins(codec); |
2af02be7 KY |
3457 | alc_write_coef_idx(codec, 0x43, 0x9614); |
3458 | } | |
3459 | ||
4a219ef8 KY |
3460 | static void alc256_init(struct hda_codec *codec) |
3461 | { | |
3462 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3463 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3464 | bool hp_pin_sense; |
3465 | ||
3466 | if (!hp_pin) | |
6447c962 | 3467 | hp_pin = 0x21; |
4a219ef8 KY |
3468 | |
3469 | msleep(30); | |
3470 | ||
3471 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3472 | ||
3473 | if (hp_pin_sense) | |
3474 | msleep(2); | |
3475 | ||
3476 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
6447c962 KY |
3477 | if (spec->ultra_low_power) { |
3478 | alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); | |
3479 | alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); | |
3480 | alc_update_coef_idx(codec, 0x08, 7<<4, 0); | |
3481 | alc_update_coef_idx(codec, 0x3b, 1<<15, 0); | |
3482 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); | |
3483 | msleep(30); | |
3484 | } | |
4a219ef8 KY |
3485 | |
3486 | snd_hda_codec_write(codec, hp_pin, 0, | |
3487 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3488 | ||
6447c962 | 3489 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3490 | msleep(85); |
3491 | ||
3492 | snd_hda_codec_write(codec, hp_pin, 0, | |
3493 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3494 | ||
6447c962 | 3495 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3496 | msleep(100); |
3497 | ||
3498 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); | |
3499 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
88d42b2b KY |
3500 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
3501 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); | |
c4473744 TH |
3502 | /* |
3503 | * Expose headphone mic (or possibly Line In on some machines) instead | |
3504 | * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See | |
3505 | * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of | |
3506 | * this register. | |
3507 | */ | |
3508 | alc_write_coef_idx(codec, 0x36, 0x5757); | |
4a219ef8 KY |
3509 | } |
3510 | ||
3511 | static void alc256_shutup(struct hda_codec *codec) | |
3512 | { | |
3513 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3514 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3515 | bool hp_pin_sense; |
3516 | ||
6447c962 KY |
3517 | if (!hp_pin) |
3518 | hp_pin = 0x21; | |
4a219ef8 KY |
3519 | |
3520 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3521 | ||
3522 | if (hp_pin_sense) | |
3523 | msleep(2); | |
3524 | ||
3525 | snd_hda_codec_write(codec, hp_pin, 0, | |
3526 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3527 | ||
6447c962 | 3528 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3529 | msleep(85); |
3530 | ||
1c9609e3 TI |
3531 | /* 3k pull low control for Headset jack. */ |
3532 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ | |
3f742490 HW |
3533 | /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly |
3534 | * when booting with headset plugged. So skip setting it for the codec alc257 | |
3535 | */ | |
5aec9891 KY |
3536 | if (spec->codec_variant != ALC269_TYPE_ALC257 && |
3537 | spec->codec_variant != ALC269_TYPE_ALC256) | |
3f742490 | 3538 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
1c9609e3 | 3539 | |
c0ca5ece TI |
3540 | if (!spec->no_shutup_pins) |
3541 | snd_hda_codec_write(codec, hp_pin, 0, | |
3542 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
4a219ef8 | 3543 | |
6447c962 | 3544 | if (hp_pin_sense || spec->ultra_low_power) |
4a219ef8 KY |
3545 | msleep(100); |
3546 | ||
3547 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3548 | alc_shutup_pins(codec); |
6447c962 KY |
3549 | if (spec->ultra_low_power) { |
3550 | msleep(50); | |
3551 | alc_update_coef_idx(codec, 0x03, 1<<1, 0); | |
3552 | alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); | |
3553 | alc_update_coef_idx(codec, 0x08, 3<<2, 0); | |
3554 | alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); | |
3555 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); | |
3556 | msleep(30); | |
3557 | } | |
4a219ef8 KY |
3558 | } |
3559 | ||
3c24e483 KY |
3560 | static void alc285_hp_init(struct hda_codec *codec) |
3561 | { | |
3562 | struct alc_spec *spec = codec->spec; | |
3563 | hda_nid_t hp_pin = alc_get_hp_pin(spec); | |
3564 | int i, val; | |
3565 | int coef38, coef0d, coef36; | |
3566 | ||
3567 | alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */ | |
3568 | coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */ | |
3569 | coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */ | |
3570 | coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */ | |
3571 | alc_update_coef_idx(codec, 0x38, 1<<4, 0x0); | |
3572 | alc_update_coef_idx(codec, 0x0d, 0x110, 0x0); | |
3573 | ||
3574 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
3575 | ||
3576 | if (hp_pin) | |
3577 | snd_hda_codec_write(codec, hp_pin, 0, | |
3578 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3579 | ||
3580 | msleep(130); | |
3581 | alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14); | |
3582 | alc_update_coef_idx(codec, 0x36, 1<<13, 0x0); | |
3583 | ||
3584 | if (hp_pin) | |
3585 | snd_hda_codec_write(codec, hp_pin, 0, | |
3586 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3587 | msleep(10); | |
3588 | alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */ | |
3589 | alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880); | |
3590 | alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049); | |
3591 | alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0); | |
3592 | ||
3593 | alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */ | |
3594 | val = alc_read_coefex_idx(codec, 0x58, 0x00); | |
3595 | for (i = 0; i < 20 && val & 0x8000; i++) { | |
3596 | msleep(50); | |
3597 | val = alc_read_coefex_idx(codec, 0x58, 0x00); | |
3598 | } /* Wait for depop procedure finish */ | |
3599 | ||
3600 | alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */ | |
3601 | alc_update_coef_idx(codec, 0x38, 1<<4, coef38); | |
3602 | alc_update_coef_idx(codec, 0x0d, 0x110, coef0d); | |
3603 | alc_update_coef_idx(codec, 0x36, 3<<13, coef36); | |
3604 | ||
3605 | msleep(50); | |
3606 | alc_update_coef_idx(codec, 0x4a, 1<<15, 0); | |
3607 | } | |
3608 | ||
da911b1f KY |
3609 | static void alc225_init(struct hda_codec *codec) |
3610 | { | |
3611 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3612 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
da911b1f KY |
3613 | bool hp1_pin_sense, hp2_pin_sense; |
3614 | ||
3c24e483 KY |
3615 | if (spec->codec_variant != ALC269_TYPE_ALC287) |
3616 | /* required only at boot or S3 and S4 resume time */ | |
3617 | if (!spec->done_hp_init || | |
3618 | is_s3_resume(codec) || | |
3619 | is_s4_resume(codec)) { | |
3620 | alc285_hp_init(codec); | |
3621 | spec->done_hp_init = true; | |
3622 | } | |
3623 | ||
da911b1f | 3624 | if (!hp_pin) |
d3ba58bb | 3625 | hp_pin = 0x21; |
da911b1f KY |
3626 | msleep(30); |
3627 | ||
3628 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3629 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3630 | ||
3631 | if (hp1_pin_sense || hp2_pin_sense) | |
3632 | msleep(2); | |
3633 | ||
3634 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
d3ba58bb KY |
3635 | if (spec->ultra_low_power) { |
3636 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); | |
3637 | alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); | |
3638 | alc_update_coef_idx(codec, 0x33, 1<<11, 0); | |
3639 | msleep(30); | |
3640 | } | |
da911b1f | 3641 | |
d3ba58bb | 3642 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3643 | snd_hda_codec_write(codec, hp_pin, 0, |
3644 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3645 | if (hp2_pin_sense) | |
3646 | snd_hda_codec_write(codec, 0x16, 0, | |
3647 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3648 | ||
d3ba58bb | 3649 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3650 | msleep(85); |
3651 | ||
d3ba58bb | 3652 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3653 | snd_hda_codec_write(codec, hp_pin, 0, |
3654 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3655 | if (hp2_pin_sense) | |
3656 | snd_hda_codec_write(codec, 0x16, 0, | |
3657 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3658 | ||
d3ba58bb | 3659 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3660 | msleep(100); |
3661 | ||
3662 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); | |
3663 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
3664 | } | |
3665 | ||
3666 | static void alc225_shutup(struct hda_codec *codec) | |
3667 | { | |
3668 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3669 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
da911b1f KY |
3670 | bool hp1_pin_sense, hp2_pin_sense; |
3671 | ||
d3ba58bb KY |
3672 | if (!hp_pin) |
3673 | hp_pin = 0x21; | |
476c02e0 HW |
3674 | |
3675 | alc_disable_headset_jack_key(codec); | |
da911b1f KY |
3676 | /* 3k pull low control for Headset jack. */ |
3677 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); | |
3678 | ||
3679 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3680 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3681 | ||
3682 | if (hp1_pin_sense || hp2_pin_sense) | |
3683 | msleep(2); | |
3684 | ||
d3ba58bb | 3685 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3686 | snd_hda_codec_write(codec, hp_pin, 0, |
3687 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3688 | if (hp2_pin_sense) | |
3689 | snd_hda_codec_write(codec, 0x16, 0, | |
3690 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3691 | ||
d3ba58bb | 3692 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3693 | msleep(85); |
3694 | ||
d3ba58bb | 3695 | if (hp1_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3696 | snd_hda_codec_write(codec, hp_pin, 0, |
3697 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3698 | if (hp2_pin_sense) | |
3699 | snd_hda_codec_write(codec, 0x16, 0, | |
3700 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3701 | ||
d3ba58bb | 3702 | if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) |
da911b1f KY |
3703 | msleep(100); |
3704 | ||
3705 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3706 | alc_shutup_pins(codec); |
d3ba58bb KY |
3707 | if (spec->ultra_low_power) { |
3708 | msleep(50); | |
3709 | alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); | |
3710 | alc_update_coef_idx(codec, 0x0e, 7<<6, 0); | |
3711 | alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); | |
3712 | alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); | |
3713 | msleep(30); | |
3714 | } | |
476c02e0 HW |
3715 | |
3716 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); | |
3717 | alc_enable_headset_jack_key(codec); | |
da911b1f KY |
3718 | } |
3719 | ||
c2d6af53 KY |
3720 | static void alc_default_init(struct hda_codec *codec) |
3721 | { | |
3722 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3723 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3724 | bool hp_pin_sense; |
3725 | ||
3726 | if (!hp_pin) | |
3727 | return; | |
3728 | ||
3729 | msleep(30); | |
3730 | ||
3731 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3732 | ||
3733 | if (hp_pin_sense) | |
3734 | msleep(2); | |
3735 | ||
3736 | snd_hda_codec_write(codec, hp_pin, 0, | |
3737 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3738 | ||
3739 | if (hp_pin_sense) | |
3740 | msleep(85); | |
3741 | ||
3742 | snd_hda_codec_write(codec, hp_pin, 0, | |
3743 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3744 | ||
3745 | if (hp_pin_sense) | |
3746 | msleep(100); | |
3747 | } | |
3748 | ||
3749 | static void alc_default_shutup(struct hda_codec *codec) | |
3750 | { | |
3751 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3752 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3753 | bool hp_pin_sense; |
3754 | ||
3755 | if (!hp_pin) { | |
3756 | alc269_shutup(codec); | |
3757 | return; | |
3758 | } | |
3759 | ||
3760 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3761 | ||
3762 | if (hp_pin_sense) | |
3763 | msleep(2); | |
3764 | ||
3765 | snd_hda_codec_write(codec, hp_pin, 0, | |
3766 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3767 | ||
3768 | if (hp_pin_sense) | |
3769 | msleep(85); | |
3770 | ||
c0ca5ece TI |
3771 | if (!spec->no_shutup_pins) |
3772 | snd_hda_codec_write(codec, hp_pin, 0, | |
3773 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
c2d6af53 KY |
3774 | |
3775 | if (hp_pin_sense) | |
3776 | msleep(100); | |
3777 | ||
3778 | alc_auto_setup_eapd(codec, false); | |
c0ca5ece | 3779 | alc_shutup_pins(codec); |
c2d6af53 KY |
3780 | } |
3781 | ||
693abe11 KY |
3782 | static void alc294_hp_init(struct hda_codec *codec) |
3783 | { | |
3784 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 3785 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
693abe11 KY |
3786 | int i, val; |
3787 | ||
3788 | if (!hp_pin) | |
3789 | return; | |
3790 | ||
3791 | snd_hda_codec_write(codec, hp_pin, 0, | |
3792 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3793 | ||
3794 | msleep(100); | |
3795 | ||
c0ca5ece TI |
3796 | if (!spec->no_shutup_pins) |
3797 | snd_hda_codec_write(codec, hp_pin, 0, | |
3798 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
693abe11 KY |
3799 | |
3800 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ | |
3801 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ | |
3802 | ||
3803 | /* Wait for depop procedure finish */ | |
3804 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3805 | for (i = 0; i < 20 && val & 0x0080; i++) { | |
3806 | msleep(50); | |
3807 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3808 | } | |
3809 | /* Set HP depop to auto mode */ | |
3810 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); | |
3811 | msleep(50); | |
3812 | } | |
3813 | ||
3814 | static void alc294_init(struct hda_codec *codec) | |
3815 | { | |
3816 | struct alc_spec *spec = codec->spec; | |
3817 | ||
f6ef4e0e TI |
3818 | /* required only at boot or S4 resume time */ |
3819 | if (!spec->done_hp_init || | |
3820 | codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { | |
693abe11 KY |
3821 | alc294_hp_init(codec); |
3822 | spec->done_hp_init = true; | |
3823 | } | |
3824 | alc_default_init(codec); | |
3825 | } | |
3826 | ||
ad60d502 KY |
3827 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
3828 | unsigned int val) | |
3829 | { | |
3830 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3831 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ | |
3832 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ | |
3833 | } | |
3834 | ||
3835 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) | |
3836 | { | |
3837 | unsigned int val; | |
3838 | ||
3839 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3840 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3841 | & 0xffff; | |
3842 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3843 | << 16; | |
3844 | return val; | |
3845 | } | |
3846 | ||
3847 | static void alc5505_dsp_halt(struct hda_codec *codec) | |
3848 | { | |
3849 | unsigned int val; | |
3850 | ||
3851 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ | |
3852 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ | |
3853 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ | |
3854 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ | |
3855 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ | |
3856 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ | |
3857 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ | |
3858 | val = alc5505_coef_get(codec, 0x6220); | |
3859 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ | |
3860 | } | |
3861 | ||
3862 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) | |
3863 | { | |
3864 | alc5505_coef_set(codec, 0x61b8, 0x04133302); | |
3865 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); | |
3866 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); | |
3867 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); | |
3868 | alc5505_coef_set(codec, 0x6220, 0x2002010f); | |
3869 | alc5505_coef_set(codec, 0x880c, 0x00000004); | |
3870 | } | |
3871 | ||
3872 | static void alc5505_dsp_init(struct hda_codec *codec) | |
3873 | { | |
3874 | unsigned int val; | |
3875 | ||
3876 | alc5505_dsp_halt(codec); | |
3877 | alc5505_dsp_back_from_halt(codec); | |
3878 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ | |
3879 | alc5505_coef_set(codec, 0x61b0, 0x5b16); | |
3880 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ | |
3881 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); | |
3882 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ | |
3883 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); | |
3884 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ | |
3885 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); | |
3886 | alc5505_coef_set(codec, 0x61b8, 0x04173302); | |
3887 | alc5505_coef_set(codec, 0x61b8, 0x04163302); | |
3888 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ | |
3889 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ | |
3890 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ | |
3891 | ||
3892 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ | |
3893 | if (val <= 3) | |
3894 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ | |
3895 | else | |
3896 | alc5505_coef_set(codec, 0x6220, 0x6002018f); | |
3897 | ||
3898 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ | |
3899 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ | |
3900 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ | |
3901 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ | |
3902 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ | |
3903 | alc5505_coef_set(codec, 0x880c, 0x00000003); | |
3904 | alc5505_coef_set(codec, 0x880c, 0x00000010); | |
cd63a5ff TI |
3905 | |
3906 | #ifdef HALT_REALTEK_ALC5505 | |
3907 | alc5505_dsp_halt(codec); | |
3908 | #endif | |
ad60d502 KY |
3909 | } |
3910 | ||
cd63a5ff | 3911 | #ifdef HALT_REALTEK_ALC5505 |
8a71821f PLB |
3912 | #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ |
3913 | #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ | |
cd63a5ff TI |
3914 | #else |
3915 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) | |
3916 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) | |
3917 | #endif | |
3918 | ||
2a43952a | 3919 | #ifdef CONFIG_PM |
ad60d502 KY |
3920 | static int alc269_suspend(struct hda_codec *codec) |
3921 | { | |
3922 | struct alc_spec *spec = codec->spec; | |
3923 | ||
3924 | if (spec->has_alc5505_dsp) | |
cd63a5ff | 3925 | alc5505_dsp_suspend(codec); |
ad60d502 KY |
3926 | return alc_suspend(codec); |
3927 | } | |
3928 | ||
1d045db9 TI |
3929 | static int alc269_resume(struct hda_codec *codec) |
3930 | { | |
adcc70b2 KY |
3931 | struct alc_spec *spec = codec->spec; |
3932 | ||
1387e2d1 KY |
3933 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3934 | alc269vb_toggle_power_output(codec, 0); | |
3935 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3936 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 TI |
3937 | msleep(150); |
3938 | } | |
8c427226 | 3939 | |
1d045db9 | 3940 | codec->patch_ops.init(codec); |
f1d4e28b | 3941 | |
1387e2d1 KY |
3942 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3943 | alc269vb_toggle_power_output(codec, 1); | |
3944 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3945 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 TI |
3946 | msleep(200); |
3947 | } | |
f1d4e28b | 3948 | |
1a462be5 | 3949 | snd_hda_regmap_sync(codec); |
1d045db9 | 3950 | hda_call_check_power_status(codec, 0x01); |
f475371a HW |
3951 | |
3952 | /* on some machine, the BIOS will clear the codec gpio data when enter | |
3953 | * suspend, and won't restore the data after resume, so we restore it | |
3954 | * in the driver. | |
3955 | */ | |
d261eec8 TI |
3956 | if (spec->gpio_data) |
3957 | alc_write_gpio_data(codec); | |
f475371a | 3958 | |
ad60d502 | 3959 | if (spec->has_alc5505_dsp) |
cd63a5ff | 3960 | alc5505_dsp_resume(codec); |
c5177c86 | 3961 | |
1d045db9 TI |
3962 | return 0; |
3963 | } | |
2a43952a | 3964 | #endif /* CONFIG_PM */ |
f1d4e28b | 3965 | |
108cc108 | 3966 | static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, |
1727a771 | 3967 | const struct hda_fixup *fix, int action) |
108cc108 DH |
3968 | { |
3969 | struct alc_spec *spec = codec->spec; | |
3970 | ||
1727a771 | 3971 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
108cc108 DH |
3972 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
3973 | } | |
3974 | ||
fdcc968a JMG |
3975 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
3976 | const struct hda_fixup *fix, | |
3977 | int action) | |
3978 | { | |
3979 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); | |
3980 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); | |
3981 | ||
3982 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) | |
3983 | snd_hda_codec_set_pincfg(codec, 0x19, | |
3984 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | | |
3985 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); | |
3986 | } | |
3987 | ||
1d045db9 | 3988 | static void alc269_fixup_hweq(struct hda_codec *codec, |
1727a771 | 3989 | const struct hda_fixup *fix, int action) |
1d045db9 | 3990 | { |
98b24883 TI |
3991 | if (action == HDA_FIXUP_ACT_INIT) |
3992 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); | |
1d045db9 | 3993 | } |
f1d4e28b | 3994 | |
7c478f03 DH |
3995 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
3996 | const struct hda_fixup *fix, int action) | |
3997 | { | |
3998 | struct alc_spec *spec = codec->spec; | |
3999 | ||
4000 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
4001 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
4002 | } | |
4003 | ||
1d045db9 | 4004 | static void alc271_fixup_dmic(struct hda_codec *codec, |
1727a771 | 4005 | const struct hda_fixup *fix, int action) |
1d045db9 TI |
4006 | { |
4007 | static const struct hda_verb verbs[] = { | |
4008 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, | |
4009 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, | |
4010 | {} | |
4011 | }; | |
4012 | unsigned int cfg; | |
f1d4e28b | 4013 | |
7639a06c TI |
4014 | if (strcmp(codec->core.chip_name, "ALC271X") && |
4015 | strcmp(codec->core.chip_name, "ALC269VB")) | |
1d045db9 TI |
4016 | return; |
4017 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); | |
4018 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) | |
4019 | snd_hda_sequence_write(codec, verbs); | |
4020 | } | |
f1d4e28b | 4021 | |
c8426b27 TI |
4022 | /* Fix the speaker amp after resume, etc */ |
4023 | static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec, | |
4024 | const struct hda_fixup *fix, | |
4025 | int action) | |
4026 | { | |
4027 | if (action == HDA_FIXUP_ACT_INIT) | |
4028 | alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000); | |
4029 | } | |
4030 | ||
017f2a10 | 4031 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
1727a771 | 4032 | const struct hda_fixup *fix, int action) |
017f2a10 TI |
4033 | { |
4034 | struct alc_spec *spec = codec->spec; | |
4035 | ||
1727a771 | 4036 | if (action != HDA_FIXUP_ACT_PROBE) |
017f2a10 TI |
4037 | return; |
4038 | ||
4039 | /* Due to a hardware problem on Lenovo Ideadpad, we need to | |
4040 | * fix the sample rate of analog I/O to 44.1kHz | |
4041 | */ | |
08c189f2 TI |
4042 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
4043 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; | |
017f2a10 TI |
4044 | } |
4045 | ||
adabb3ec | 4046 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
1727a771 | 4047 | const struct hda_fixup *fix, int action) |
adabb3ec | 4048 | { |
adabb3ec TI |
4049 | /* The digital-mic unit sends PDM (differential signal) instead of |
4050 | * the standard PCM, thus you can't record a valid mono stream as is. | |
4051 | * Below is a workaround specific to ALC269 to control the dmic | |
4052 | * signal source as mono. | |
4053 | */ | |
98b24883 TI |
4054 | if (action == HDA_FIXUP_ACT_INIT) |
4055 | alc_update_coef_idx(codec, 0x07, 0, 0x80); | |
adabb3ec TI |
4056 | } |
4057 | ||
24519911 TI |
4058 | static void alc269_quanta_automute(struct hda_codec *codec) |
4059 | { | |
08c189f2 | 4060 | snd_hda_gen_update_outputs(codec); |
24519911 | 4061 | |
1687ccc8 TI |
4062 | alc_write_coef_idx(codec, 0x0c, 0x680); |
4063 | alc_write_coef_idx(codec, 0x0c, 0x480); | |
24519911 TI |
4064 | } |
4065 | ||
4066 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, | |
1727a771 | 4067 | const struct hda_fixup *fix, int action) |
24519911 TI |
4068 | { |
4069 | struct alc_spec *spec = codec->spec; | |
1727a771 | 4070 | if (action != HDA_FIXUP_ACT_PROBE) |
24519911 | 4071 | return; |
08c189f2 | 4072 | spec->gen.automute_hook = alc269_quanta_automute; |
24519911 TI |
4073 | } |
4074 | ||
d240d1dc | 4075 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 4076 | struct hda_jack_callback *jack) |
d240d1dc DH |
4077 | { |
4078 | struct alc_spec *spec = codec->spec; | |
4079 | int vref; | |
4080 | msleep(200); | |
4081 | snd_hda_gen_hp_automute(codec, jack); | |
4082 | ||
4083 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
4084 | msleep(100); | |
4085 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
4086 | vref); | |
4087 | msleep(500); | |
4088 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
4089 | vref); | |
4090 | } | |
4091 | ||
a2ef03fe TE |
4092 | /* |
4093 | * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) | |
4094 | */ | |
4095 | struct hda_alc298_mbxinit { | |
4096 | unsigned char value_0x23; | |
4097 | unsigned char value_0x25; | |
4098 | }; | |
4099 | ||
4100 | static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, | |
4101 | const struct hda_alc298_mbxinit *initval, | |
4102 | bool first) | |
4103 | { | |
4104 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); | |
4105 | alc_write_coef_idx(codec, 0x26, 0xb000); | |
4106 | ||
4107 | if (first) | |
4108 | snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); | |
4109 | ||
4110 | snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); | |
4111 | alc_write_coef_idx(codec, 0x26, 0xf000); | |
4112 | alc_write_coef_idx(codec, 0x23, initval->value_0x23); | |
4113 | ||
4114 | if (initval->value_0x23 != 0x1e) | |
4115 | alc_write_coef_idx(codec, 0x25, initval->value_0x25); | |
4116 | ||
4117 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); | |
4118 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); | |
4119 | } | |
4120 | ||
4121 | static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, | |
4122 | const struct hda_fixup *fix, | |
4123 | int action) | |
4124 | { | |
4125 | /* Initialization magic */ | |
4126 | static const struct hda_alc298_mbxinit dac_init[] = { | |
4127 | {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, | |
4128 | {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, | |
4129 | {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, | |
4130 | {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, | |
4131 | {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, | |
4132 | {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, | |
4133 | {0x2f, 0x00}, | |
4134 | {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, | |
4135 | {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, | |
4136 | {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, | |
4137 | {} | |
4138 | }; | |
4139 | const struct hda_alc298_mbxinit *seq; | |
4140 | ||
4141 | if (action != HDA_FIXUP_ACT_INIT) | |
4142 | return; | |
4143 | ||
4144 | /* Start */ | |
4145 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); | |
4146 | snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); | |
4147 | alc_write_coef_idx(codec, 0x26, 0xf000); | |
4148 | alc_write_coef_idx(codec, 0x22, 0x31); | |
4149 | alc_write_coef_idx(codec, 0x23, 0x0b); | |
4150 | alc_write_coef_idx(codec, 0x25, 0x00); | |
4151 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); | |
4152 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); | |
4153 | ||
4154 | for (seq = dac_init; seq->value_0x23; seq++) | |
4155 | alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); | |
4156 | } | |
4157 | ||
d240d1dc DH |
4158 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, |
4159 | const struct hda_fixup *fix, int action) | |
4160 | { | |
4161 | struct alc_spec *spec = codec->spec; | |
4162 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4163 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
4164 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; | |
4165 | } | |
4166 | } | |
4167 | ||
766538ac TI |
4168 | static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, |
4169 | bool polarity, bool on) | |
4170 | { | |
4171 | unsigned int pinval; | |
4172 | ||
4173 | if (!pin) | |
4174 | return; | |
4175 | if (polarity) | |
4176 | on = !on; | |
4177 | pinval = snd_hda_codec_get_pin_target(codec, pin); | |
4178 | pinval &= ~AC_PINCTL_VREFEN; | |
4179 | pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; | |
4180 | /* temporarily power up/down for setting VREF */ | |
4181 | snd_hda_power_up_pm(codec); | |
4182 | snd_hda_set_pin_ctl_cache(codec, pin, pinval); | |
4183 | snd_hda_power_down_pm(codec); | |
4184 | } | |
d240d1dc | 4185 | |
08fb0d0e | 4186 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
8d3d1ece TI |
4187 | static int vref_mute_led_set(struct led_classdev *led_cdev, |
4188 | enum led_brightness brightness) | |
6d3cd5d4 | 4189 | { |
8d3d1ece | 4190 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
08fb0d0e | 4191 | struct alc_spec *spec = codec->spec; |
08fb0d0e | 4192 | |
766538ac TI |
4193 | alc_update_vref_led(codec, spec->mute_led_nid, |
4194 | spec->mute_led_polarity, brightness); | |
8d3d1ece | 4195 | return 0; |
6d3cd5d4 DH |
4196 | } |
4197 | ||
d5b6b65e DH |
4198 | /* Make sure the led works even in runtime suspend */ |
4199 | static unsigned int led_power_filter(struct hda_codec *codec, | |
4200 | hda_nid_t nid, | |
4201 | unsigned int power_state) | |
4202 | { | |
4203 | struct alc_spec *spec = codec->spec; | |
4204 | ||
50dd9050 HW |
4205 | if (power_state != AC_PWRST_D3 || nid == 0 || |
4206 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) | |
d5b6b65e DH |
4207 | return power_state; |
4208 | ||
4209 | /* Set pin ctl again, it might have just been set to 0 */ | |
4210 | snd_hda_set_pin_ctl(codec, nid, | |
4211 | snd_hda_codec_get_pin_target(codec, nid)); | |
4212 | ||
cffd3966 | 4213 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
d5b6b65e DH |
4214 | } |
4215 | ||
08fb0d0e TI |
4216 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
4217 | const struct hda_fixup *fix, int action) | |
6d3cd5d4 DH |
4218 | { |
4219 | struct alc_spec *spec = codec->spec; | |
08fb0d0e TI |
4220 | const struct dmi_device *dev = NULL; |
4221 | ||
4222 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
4223 | return; | |
4224 | ||
4225 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { | |
4226 | int pol, pin; | |
4227 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) | |
4228 | continue; | |
4229 | if (pin < 0x0a || pin >= 0x10) | |
4230 | break; | |
4231 | spec->mute_led_polarity = pol; | |
4232 | spec->mute_led_nid = pin - 0x0a + 0x18; | |
8d3d1ece | 4233 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
d5b6b65e | 4234 | codec->power_filter = led_power_filter; |
4e76a883 TI |
4235 | codec_dbg(codec, |
4236 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, | |
08fb0d0e | 4237 | spec->mute_led_polarity); |
6d3cd5d4 DH |
4238 | break; |
4239 | } | |
4240 | } | |
4241 | ||
85c467dc TI |
4242 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
4243 | const struct hda_fixup *fix, | |
4244 | int action, hda_nid_t pin) | |
d06ac143 DH |
4245 | { |
4246 | struct alc_spec *spec = codec->spec; | |
85c467dc | 4247 | |
d06ac143 DH |
4248 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
4249 | spec->mute_led_polarity = 0; | |
85c467dc | 4250 | spec->mute_led_nid = pin; |
8d3d1ece | 4251 | snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); |
d5b6b65e | 4252 | codec->power_filter = led_power_filter; |
d06ac143 DH |
4253 | } |
4254 | } | |
4255 | ||
85c467dc TI |
4256 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
4257 | const struct hda_fixup *fix, int action) | |
4258 | { | |
4259 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); | |
4260 | } | |
4261 | ||
08fb0d0e TI |
4262 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
4263 | const struct hda_fixup *fix, int action) | |
420b0feb | 4264 | { |
85c467dc | 4265 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
420b0feb TI |
4266 | } |
4267 | ||
7f783bd5 TB |
4268 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
4269 | const struct hda_fixup *fix, int action) | |
4270 | { | |
85c467dc | 4271 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
7f783bd5 TB |
4272 | } |
4273 | ||
0f32fd19 TI |
4274 | /* update LED status via GPIO */ |
4275 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, | |
dbd13179 | 4276 | int polarity, bool enabled) |
9f5c6faf | 4277 | { |
dbd13179 | 4278 | if (polarity) |
0f32fd19 | 4279 | enabled = !enabled; |
d261eec8 | 4280 | alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ |
9f5c6faf TI |
4281 | } |
4282 | ||
0f32fd19 | 4283 | /* turn on/off mute LED via GPIO per vmaster hook */ |
8d3d1ece TI |
4284 | static int gpio_mute_led_set(struct led_classdev *led_cdev, |
4285 | enum led_brightness brightness) | |
9f5c6faf | 4286 | { |
8d3d1ece | 4287 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
9f5c6faf | 4288 | struct alc_spec *spec = codec->spec; |
9f5c6faf | 4289 | |
dbd13179 | 4290 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, |
8d3d1ece TI |
4291 | spec->mute_led_polarity, !brightness); |
4292 | return 0; | |
0f32fd19 | 4293 | } |
9f5c6faf | 4294 | |
0f32fd19 | 4295 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
87dc3648 KHF |
4296 | static int micmute_led_set(struct led_classdev *led_cdev, |
4297 | enum led_brightness brightness) | |
4298 | { | |
4299 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); | |
4300 | struct alc_spec *spec = codec->spec; | |
4301 | ||
4302 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, | |
40469064 | 4303 | spec->micmute_led_polarity, !brightness); |
87dc3648 KHF |
4304 | return 0; |
4305 | } | |
4306 | ||
01e4a275 TI |
4307 | /* setup mute and mic-mute GPIO bits, add hooks appropriately */ |
4308 | static void alc_fixup_hp_gpio_led(struct hda_codec *codec, | |
4309 | int action, | |
4310 | unsigned int mute_mask, | |
4311 | unsigned int micmute_mask) | |
9f5c6faf TI |
4312 | { |
4313 | struct alc_spec *spec = codec->spec; | |
9f5c6faf | 4314 | |
01e4a275 TI |
4315 | alc_fixup_gpio(codec, action, mute_mask | micmute_mask); |
4316 | ||
4317 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
4318 | return; | |
4319 | if (mute_mask) { | |
4320 | spec->gpio_mute_led_mask = mute_mask; | |
8d3d1ece | 4321 | snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); |
01e4a275 TI |
4322 | } |
4323 | if (micmute_mask) { | |
4324 | spec->gpio_mic_led_mask = micmute_mask; | |
7cdf8c49 | 4325 | snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); |
9f5c6faf TI |
4326 | } |
4327 | } | |
4328 | ||
e7d66cf7 JS |
4329 | static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, |
4330 | const struct hda_fixup *fix, int action) | |
4331 | { | |
4332 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); | |
4333 | } | |
4334 | ||
01e4a275 | 4335 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, |
eaa8e5ef KY |
4336 | const struct hda_fixup *fix, int action) |
4337 | { | |
01e4a275 TI |
4338 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
4339 | } | |
eaa8e5ef | 4340 | |
f5a88b0a KHF |
4341 | static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, |
4342 | const struct hda_fixup *fix, int action) | |
4343 | { | |
3e0650ab | 4344 | alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); |
f5a88b0a KHF |
4345 | } |
4346 | ||
01e4a275 TI |
4347 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
4348 | const struct hda_fixup *fix, int action) | |
4349 | { | |
4350 | alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); | |
9f5c6faf TI |
4351 | } |
4352 | ||
a0ccbc53 KY |
4353 | static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, |
4354 | const struct hda_fixup *fix, int action) | |
4355 | { | |
4356 | alc_fixup_hp_gpio_led(codec, action, 0x10, 0); | |
4357 | } | |
4358 | ||
c47b3112 JC |
4359 | static void alc245_fixup_hp_gpio_led(struct hda_codec *codec, |
4360 | const struct hda_fixup *fix, int action) | |
4361 | { | |
4362 | struct alc_spec *spec = codec->spec; | |
4363 | ||
4364 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
4365 | spec->micmute_led_polarity = 1; | |
4366 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); | |
4367 | } | |
4368 | ||
8a503555 TI |
4369 | /* turn on/off mic-mute LED per capture hook via VREF change */ |
4370 | static int vref_micmute_led_set(struct led_classdev *led_cdev, | |
4371 | enum led_brightness brightness) | |
9c5dc3bf | 4372 | { |
8a503555 | 4373 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
9c5dc3bf | 4374 | struct alc_spec *spec = codec->spec; |
9c5dc3bf | 4375 | |
766538ac TI |
4376 | alc_update_vref_led(codec, spec->cap_mute_led_nid, |
4377 | spec->micmute_led_polarity, brightness); | |
8a503555 | 4378 | return 0; |
9c5dc3bf KY |
4379 | } |
4380 | ||
4381 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, | |
4382 | const struct hda_fixup *fix, int action) | |
4383 | { | |
4384 | struct alc_spec *spec = codec->spec; | |
9c5dc3bf | 4385 | |
01e4a275 | 4386 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
9c5dc3bf | 4387 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
01e4a275 TI |
4388 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to |
4389 | * enable headphone amp | |
4390 | */ | |
4391 | spec->gpio_mask |= 0x10; | |
4392 | spec->gpio_dir |= 0x10; | |
9c5dc3bf | 4393 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4394 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
50dd9050 | 4395 | codec->power_filter = led_power_filter; |
9c5dc3bf KY |
4396 | } |
4397 | } | |
4398 | ||
7a5255f1 DH |
4399 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
4400 | const struct hda_fixup *fix, int action) | |
4401 | { | |
7a5255f1 | 4402 | struct alc_spec *spec = codec->spec; |
7a5255f1 | 4403 | |
01e4a275 | 4404 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
7a5255f1 | 4405 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
7a5255f1 | 4406 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4407 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
7a5255f1 DH |
4408 | codec->power_filter = led_power_filter; |
4409 | } | |
4410 | } | |
4411 | ||
c3bb2b52 TI |
4412 | /* HP Spectre x360 14 model needs a unique workaround for enabling the amp; |
4413 | * it needs to toggle the GPIO0 once on and off at each time (bko#210633) | |
4414 | */ | |
4415 | static void alc245_fixup_hp_x360_amp(struct hda_codec *codec, | |
4416 | const struct hda_fixup *fix, int action) | |
4417 | { | |
4418 | struct alc_spec *spec = codec->spec; | |
4419 | ||
4420 | switch (action) { | |
4421 | case HDA_FIXUP_ACT_PRE_PROBE: | |
4422 | spec->gpio_mask |= 0x01; | |
4423 | spec->gpio_dir |= 0x01; | |
4424 | break; | |
4425 | case HDA_FIXUP_ACT_INIT: | |
4426 | /* need to toggle GPIO to enable the amp */ | |
4427 | alc_update_gpio_data(codec, 0x01, true); | |
4428 | msleep(100); | |
4429 | alc_update_gpio_data(codec, 0x01, false); | |
4430 | break; | |
4431 | } | |
4432 | } | |
4433 | ||
622464c8 TI |
4434 | /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */ |
4435 | static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo, | |
4436 | struct hda_codec *codec, | |
4437 | struct snd_pcm_substream *substream, | |
4438 | int action) | |
4439 | { | |
4440 | switch (action) { | |
4441 | case HDA_GEN_PCM_ACT_PREPARE: | |
4442 | alc_update_gpio_data(codec, 0x04, true); | |
4443 | break; | |
4444 | case HDA_GEN_PCM_ACT_CLEANUP: | |
4445 | alc_update_gpio_data(codec, 0x04, false); | |
4446 | break; | |
4447 | } | |
4448 | } | |
4449 | ||
4450 | static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec, | |
4451 | const struct hda_fixup *fix, | |
4452 | int action) | |
4453 | { | |
4454 | struct alc_spec *spec = codec->spec; | |
4455 | ||
4456 | if (action == HDA_FIXUP_ACT_PROBE) { | |
4457 | spec->gpio_mask |= 0x04; | |
4458 | spec->gpio_dir |= 0x04; | |
4459 | spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook; | |
4460 | } | |
4461 | } | |
4462 | ||
766538ac TI |
4463 | static void alc_update_coef_led(struct hda_codec *codec, |
4464 | struct alc_coef_led *led, | |
4465 | bool polarity, bool on) | |
4466 | { | |
4467 | if (polarity) | |
4468 | on = !on; | |
4469 | /* temporarily power up/down for setting COEF bit */ | |
4470 | alc_update_coef_idx(codec, led->idx, led->mask, | |
4471 | on ? led->on : led->off); | |
4472 | } | |
4473 | ||
431e76c3 | 4474 | /* update mute-LED according to the speaker mute state via COEF bit */ |
8d3d1ece TI |
4475 | static int coef_mute_led_set(struct led_classdev *led_cdev, |
4476 | enum led_brightness brightness) | |
431e76c3 | 4477 | { |
8d3d1ece | 4478 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
431e76c3 KY |
4479 | struct alc_spec *spec = codec->spec; |
4480 | ||
766538ac TI |
4481 | alc_update_coef_led(codec, &spec->mute_led_coef, |
4482 | spec->mute_led_polarity, brightness); | |
8d3d1ece | 4483 | return 0; |
431e76c3 KY |
4484 | } |
4485 | ||
4486 | static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, | |
4487 | const struct hda_fixup *fix, | |
4488 | int action) | |
4489 | { | |
4490 | struct alc_spec *spec = codec->spec; | |
4491 | ||
4492 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4493 | spec->mute_led_polarity = 0; | |
766538ac TI |
4494 | spec->mute_led_coef.idx = 0x0b; |
4495 | spec->mute_led_coef.mask = 1 << 3; | |
4496 | spec->mute_led_coef.on = 1 << 3; | |
4497 | spec->mute_led_coef.off = 0; | |
8d3d1ece | 4498 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
431e76c3 KY |
4499 | } |
4500 | } | |
4501 | ||
24164f43 KY |
4502 | static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, |
4503 | const struct hda_fixup *fix, | |
4504 | int action) | |
4505 | { | |
4506 | struct alc_spec *spec = codec->spec; | |
4507 | ||
4508 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4509 | spec->mute_led_polarity = 0; | |
766538ac TI |
4510 | spec->mute_led_coef.idx = 0x34; |
4511 | spec->mute_led_coef.mask = 1 << 5; | |
4512 | spec->mute_led_coef.on = 0; | |
4513 | spec->mute_led_coef.off = 1 << 5; | |
8d3d1ece | 4514 | snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); |
24164f43 KY |
4515 | } |
4516 | } | |
4517 | ||
431e76c3 | 4518 | /* turn on/off mic-mute LED per capture hook by coef bit */ |
8a503555 TI |
4519 | static int coef_micmute_led_set(struct led_classdev *led_cdev, |
4520 | enum led_brightness brightness) | |
431e76c3 | 4521 | { |
8a503555 | 4522 | struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); |
431e76c3 KY |
4523 | struct alc_spec *spec = codec->spec; |
4524 | ||
766538ac TI |
4525 | alc_update_coef_led(codec, &spec->mic_led_coef, |
4526 | spec->micmute_led_polarity, brightness); | |
8a503555 | 4527 | return 0; |
431e76c3 KY |
4528 | } |
4529 | ||
4530 | static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, | |
4531 | const struct hda_fixup *fix, int action) | |
4532 | { | |
4533 | struct alc_spec *spec = codec->spec; | |
4534 | ||
4535 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
766538ac TI |
4536 | spec->mic_led_coef.idx = 0x19; |
4537 | spec->mic_led_coef.mask = 1 << 13; | |
4538 | spec->mic_led_coef.on = 1 << 13; | |
4539 | spec->mic_led_coef.off = 0; | |
8a503555 | 4540 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
431e76c3 KY |
4541 | } |
4542 | } | |
4543 | ||
24164f43 KY |
4544 | static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, |
4545 | const struct hda_fixup *fix, int action) | |
4546 | { | |
4547 | struct alc_spec *spec = codec->spec; | |
4548 | ||
4549 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
766538ac TI |
4550 | spec->mic_led_coef.idx = 0x35; |
4551 | spec->mic_led_coef.mask = 3 << 2; | |
4552 | spec->mic_led_coef.on = 2 << 2; | |
4553 | spec->mic_led_coef.off = 1 << 2; | |
8a503555 | 4554 | snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); |
24164f43 KY |
4555 | } |
4556 | } | |
4557 | ||
431e76c3 KY |
4558 | static void alc285_fixup_hp_mute_led(struct hda_codec *codec, |
4559 | const struct hda_fixup *fix, int action) | |
4560 | { | |
4561 | alc285_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4562 | alc285_fixup_hp_coef_micmute_led(codec, fix, action); | |
4563 | } | |
4564 | ||
24164f43 KY |
4565 | static void alc236_fixup_hp_mute_led(struct hda_codec *codec, |
4566 | const struct hda_fixup *fix, int action) | |
4567 | { | |
4568 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4569 | alc236_fixup_hp_coef_micmute_led(codec, fix, action); | |
4570 | } | |
4571 | ||
75b62ab6 JW |
4572 | static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec, |
4573 | const struct hda_fixup *fix, int action) | |
4574 | { | |
4575 | struct alc_spec *spec = codec->spec; | |
4576 | ||
4577 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4578 | spec->cap_mute_led_nid = 0x1a; | |
4579 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); | |
4580 | codec->power_filter = led_power_filter; | |
4581 | } | |
4582 | } | |
4583 | ||
4584 | static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec, | |
4585 | const struct hda_fixup *fix, int action) | |
4586 | { | |
4587 | alc236_fixup_hp_mute_led_coefbit(codec, fix, action); | |
4588 | alc236_fixup_hp_micmute_led_vref(codec, fix, action); | |
4589 | } | |
4590 | ||
6a30abaa | 4591 | #if IS_REACHABLE(CONFIG_INPUT) |
33f4acd3 DH |
4592 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
4593 | struct hda_jack_callback *event) | |
4594 | { | |
4595 | struct alc_spec *spec = codec->spec; | |
4596 | ||
4597 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore | |
4598 | send both key on and key off event for every interrupt. */ | |
c7b60a89 | 4599 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); |
33f4acd3 | 4600 | input_sync(spec->kb_dev); |
c7b60a89 | 4601 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); |
33f4acd3 DH |
4602 | input_sync(spec->kb_dev); |
4603 | } | |
33f4acd3 | 4604 | |
3694cb29 K |
4605 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
4606 | { | |
4607 | struct alc_spec *spec = codec->spec; | |
c7b60a89 | 4608 | int i; |
3694cb29 K |
4609 | |
4610 | spec->kb_dev = input_allocate_device(); | |
4611 | if (!spec->kb_dev) { | |
4612 | codec_err(codec, "Out of memory (input_allocate_device)\n"); | |
4613 | return -ENOMEM; | |
4614 | } | |
c7b60a89 HW |
4615 | |
4616 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; | |
4617 | ||
3694cb29 K |
4618 | spec->kb_dev->name = "Microphone Mute Button"; |
4619 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); | |
c7b60a89 HW |
4620 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
4621 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); | |
4622 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; | |
4623 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) | |
4624 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); | |
3694cb29 K |
4625 | |
4626 | if (input_register_device(spec->kb_dev)) { | |
4627 | codec_err(codec, "input_register_device failed\n"); | |
4628 | input_free_device(spec->kb_dev); | |
4629 | spec->kb_dev = NULL; | |
4630 | return -ENOMEM; | |
4631 | } | |
4632 | ||
4633 | return 0; | |
4634 | } | |
4635 | ||
01e4a275 TI |
4636 | /* GPIO1 = set according to SKU external amp |
4637 | * GPIO2 = mic mute hotkey | |
4638 | * GPIO3 = mute LED | |
4639 | * GPIO4 = mic mute LED | |
4640 | */ | |
33f4acd3 DH |
4641 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
4642 | const struct hda_fixup *fix, int action) | |
4643 | { | |
33f4acd3 DH |
4644 | struct alc_spec *spec = codec->spec; |
4645 | ||
01e4a275 | 4646 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); |
33f4acd3 | 4647 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
1c76aa5f | 4648 | spec->init_amp = ALC_INIT_DEFAULT; |
3694cb29 | 4649 | if (alc_register_micmute_input_device(codec) != 0) |
33f4acd3 | 4650 | return; |
33f4acd3 | 4651 | |
01e4a275 TI |
4652 | spec->gpio_mask |= 0x06; |
4653 | spec->gpio_dir |= 0x02; | |
4654 | spec->gpio_data |= 0x02; | |
7639a06c | 4655 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
33f4acd3 | 4656 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
7639a06c | 4657 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
33f4acd3 | 4658 | gpio2_mic_hotkey_event); |
33f4acd3 DH |
4659 | return; |
4660 | } | |
4661 | ||
4662 | if (!spec->kb_dev) | |
4663 | return; | |
4664 | ||
4665 | switch (action) { | |
33f4acd3 DH |
4666 | case HDA_FIXUP_ACT_FREE: |
4667 | input_unregister_device(spec->kb_dev); | |
33f4acd3 DH |
4668 | spec->kb_dev = NULL; |
4669 | } | |
33f4acd3 DH |
4670 | } |
4671 | ||
01e4a275 TI |
4672 | /* Line2 = mic mute hotkey |
4673 | * GPIO2 = mic mute LED | |
4674 | */ | |
3694cb29 K |
4675 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
4676 | const struct hda_fixup *fix, int action) | |
4677 | { | |
3694cb29 K |
4678 | struct alc_spec *spec = codec->spec; |
4679 | ||
01e4a275 | 4680 | alc_fixup_hp_gpio_led(codec, action, 0, 0x04); |
3694cb29 | 4681 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
1c76aa5f | 4682 | spec->init_amp = ALC_INIT_DEFAULT; |
3694cb29 K |
4683 | if (alc_register_micmute_input_device(codec) != 0) |
4684 | return; | |
4685 | ||
3694cb29 K |
4686 | snd_hda_jack_detect_enable_callback(codec, 0x1b, |
4687 | gpio2_mic_hotkey_event); | |
3694cb29 K |
4688 | return; |
4689 | } | |
4690 | ||
4691 | if (!spec->kb_dev) | |
4692 | return; | |
4693 | ||
4694 | switch (action) { | |
3694cb29 K |
4695 | case HDA_FIXUP_ACT_FREE: |
4696 | input_unregister_device(spec->kb_dev); | |
4697 | spec->kb_dev = NULL; | |
4698 | } | |
4699 | } | |
c469652b TI |
4700 | #else /* INPUT */ |
4701 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL | |
4702 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL | |
4703 | #endif /* INPUT */ | |
3694cb29 | 4704 | |
9c5dc3bf KY |
4705 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
4706 | const struct hda_fixup *fix, int action) | |
4707 | { | |
4708 | struct alc_spec *spec = codec->spec; | |
4709 | ||
1bce62a6 | 4710 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); |
9c5dc3bf | 4711 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
9c5dc3bf | 4712 | spec->cap_mute_led_nid = 0x18; |
8a503555 | 4713 | snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); |
9c5dc3bf KY |
4714 | } |
4715 | } | |
4716 | ||
6b0f95c4 | 4717 | static const struct coef_fw alc225_pre_hsmode[] = { |
5a36767a KY |
4718 | UPDATE_COEF(0x4a, 1<<8, 0), |
4719 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), | |
4720 | UPDATE_COEF(0x63, 3<<14, 3<<14), | |
4721 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4722 | UPDATE_COEF(0x4a, 3<<10, 3<<10), | |
4723 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | |
4724 | UPDATE_COEF(0x4a, 3<<10, 0), | |
4725 | {} | |
4726 | }; | |
4727 | ||
73bdd597 DH |
4728 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
4729 | { | |
92666d45 | 4730 | struct alc_spec *spec = codec->spec; |
6b0f95c4 | 4731 | static const struct coef_fw coef0255[] = { |
717f43d8 | 4732 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ |
54db6c39 TI |
4733 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
4734 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
4735 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ | |
4736 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ | |
4737 | {} | |
4738 | }; | |
6b0f95c4 | 4739 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 4740 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ |
717f43d8 KY |
4741 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
4742 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ | |
4743 | WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ | |
4744 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
e69e7e03 KY |
4745 | {} |
4746 | }; | |
6b0f95c4 | 4747 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4748 | WRITE_COEF(0x1b, 0x0c0b), |
4749 | WRITE_COEF(0x45, 0xc429), | |
4750 | UPDATE_COEF(0x35, 0x4000, 0), | |
4751 | WRITE_COEF(0x06, 0x2104), | |
4752 | WRITE_COEF(0x1a, 0x0001), | |
4753 | WRITE_COEF(0x26, 0x0004), | |
4754 | WRITE_COEF(0x32, 0x42a3), | |
4755 | {} | |
4756 | }; | |
6b0f95c4 | 4757 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
4758 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
4759 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4760 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4761 | UPDATE_COEF(0x66, 0x0008, 0), | |
4762 | UPDATE_COEF(0x67, 0x2000, 0), | |
4763 | {} | |
4764 | }; | |
6b0f95c4 | 4765 | static const struct coef_fw coef0298[] = { |
89542936 KY |
4766 | UPDATE_COEF(0x19, 0x1300, 0x0300), |
4767 | {} | |
4768 | }; | |
6b0f95c4 | 4769 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4770 | WRITE_COEF(0x76, 0x000e), |
4771 | WRITE_COEF(0x6c, 0x2400), | |
4772 | WRITE_COEF(0x18, 0x7308), | |
4773 | WRITE_COEF(0x6b, 0xc429), | |
4774 | {} | |
4775 | }; | |
6b0f95c4 | 4776 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4777 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ |
4778 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ | |
4779 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ | |
4780 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ | |
4781 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ | |
4782 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ | |
4783 | {} | |
4784 | }; | |
6b0f95c4 | 4785 | static const struct coef_fw coef0668[] = { |
54db6c39 TI |
4786 | WRITE_COEF(0x15, 0x0d40), |
4787 | WRITE_COEF(0xb7, 0x802b), | |
4788 | {} | |
4789 | }; | |
6b0f95c4 | 4790 | static const struct coef_fw coef0225[] = { |
5a36767a | 4791 | UPDATE_COEF(0x63, 3<<14, 0), |
4cc9b9d6 KY |
4792 | {} |
4793 | }; | |
6b0f95c4 | 4794 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4795 | UPDATE_COEF(0x4a, 0x0100, 0), |
4796 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), | |
4797 | UPDATE_COEF(0x6b, 0xf000, 0x5000), | |
4798 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4799 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), | |
4800 | WRITE_COEF(0x45, 0x5289), | |
4801 | UPDATE_COEF(0x4a, 0x0c00, 0), | |
4802 | {} | |
4803 | }; | |
54db6c39 | 4804 | |
92666d45 KY |
4805 | if (spec->no_internal_mic_pin) { |
4806 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); | |
4807 | return; | |
4808 | } | |
4809 | ||
7639a06c | 4810 | switch (codec->core.vendor_id) { |
9a22a8f5 | 4811 | case 0x10ec0255: |
e69e7e03 KY |
4812 | alc_process_coef_fw(codec, coef0255); |
4813 | break; | |
1948fc06 | 4814 | case 0x10ec0230: |
736f20a7 | 4815 | case 0x10ec0236: |
7081adf3 | 4816 | case 0x10ec0256: |
e69e7e03 | 4817 | alc_process_coef_fw(codec, coef0256); |
9a22a8f5 | 4818 | break; |
71683c32 KY |
4819 | case 0x10ec0234: |
4820 | case 0x10ec0274: | |
4821 | case 0x10ec0294: | |
4822 | alc_process_coef_fw(codec, coef0274); | |
4823 | break; | |
13fd08a3 | 4824 | case 0x10ec0233: |
73bdd597 | 4825 | case 0x10ec0283: |
54db6c39 | 4826 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4827 | break; |
f3b70332 KY |
4828 | case 0x10ec0286: |
4829 | case 0x10ec0288: | |
89542936 KY |
4830 | alc_process_coef_fw(codec, coef0288); |
4831 | break; | |
1a5bc8d9 | 4832 | case 0x10ec0298: |
89542936 | 4833 | alc_process_coef_fw(codec, coef0298); |
f3b70332 KY |
4834 | alc_process_coef_fw(codec, coef0288); |
4835 | break; | |
73bdd597 | 4836 | case 0x10ec0292: |
54db6c39 | 4837 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4838 | break; |
a22aa26f | 4839 | case 0x10ec0293: |
54db6c39 | 4840 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4841 | break; |
73bdd597 | 4842 | case 0x10ec0668: |
54db6c39 | 4843 | alc_process_coef_fw(codec, coef0668); |
73bdd597 | 4844 | break; |
c2b691ee | 4845 | case 0x10ec0215: |
4cc9b9d6 | 4846 | case 0x10ec0225: |
c2b691ee | 4847 | case 0x10ec0285: |
7d727869 | 4848 | case 0x10ec0295: |
c2b691ee | 4849 | case 0x10ec0289: |
28f1f9b2 | 4850 | case 0x10ec0299: |
4d4b0c52 | 4851 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4852 | alc_process_coef_fw(codec, coef0225); |
4853 | break; | |
78f4f7c2 KY |
4854 | case 0x10ec0867: |
4855 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
4856 | break; | |
73bdd597 | 4857 | } |
4e76a883 | 4858 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
73bdd597 DH |
4859 | } |
4860 | ||
4861 | ||
4862 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |
4863 | hda_nid_t mic_pin) | |
4864 | { | |
6b0f95c4 | 4865 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
4866 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), |
4867 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ | |
4868 | {} | |
4869 | }; | |
6b0f95c4 | 4870 | static const struct coef_fw coef0256[] = { |
717f43d8 KY |
4871 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ |
4872 | WRITE_COEFEX(0x57, 0x03, 0x09a3), | |
4873 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ | |
4874 | {} | |
4875 | }; | |
6b0f95c4 | 4876 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
4877 | UPDATE_COEF(0x35, 0, 1<<14), |
4878 | WRITE_COEF(0x06, 0x2100), | |
4879 | WRITE_COEF(0x1a, 0x0021), | |
4880 | WRITE_COEF(0x26, 0x008c), | |
4881 | {} | |
4882 | }; | |
6b0f95c4 | 4883 | static const struct coef_fw coef0288[] = { |
89542936 | 4884 | UPDATE_COEF(0x4f, 0x00c0, 0), |
f3b70332 KY |
4885 | UPDATE_COEF(0x50, 0x2000, 0), |
4886 | UPDATE_COEF(0x56, 0x0006, 0), | |
4887 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | |
4888 | UPDATE_COEF(0x66, 0x0008, 0x0008), | |
4889 | UPDATE_COEF(0x67, 0x2000, 0x2000), | |
4890 | {} | |
4891 | }; | |
6b0f95c4 | 4892 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
4893 | WRITE_COEF(0x19, 0xa208), |
4894 | WRITE_COEF(0x2e, 0xacf0), | |
4895 | {} | |
4896 | }; | |
6b0f95c4 | 4897 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
4898 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ |
4899 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ | |
4900 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
4901 | {} | |
4902 | }; | |
6b0f95c4 | 4903 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
4904 | WRITE_COEF(0xb7, 0x802b), |
4905 | WRITE_COEF(0xb5, 0x1040), | |
4906 | UPDATE_COEF(0xc3, 0, 1<<12), | |
4907 | {} | |
4908 | }; | |
6b0f95c4 | 4909 | static const struct coef_fw coef0225[] = { |
4cc9b9d6 KY |
4910 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), |
4911 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4912 | UPDATE_COEF(0x63, 3<<14, 0), | |
4913 | {} | |
4914 | }; | |
6b0f95c4 | 4915 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
4916 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), |
4917 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4918 | UPDATE_COEF(0x6b, 0xf000, 0), | |
4919 | {} | |
4920 | }; | |
54db6c39 | 4921 | |
7639a06c | 4922 | switch (codec->core.vendor_id) { |
9a22a8f5 KY |
4923 | case 0x10ec0255: |
4924 | alc_write_coef_idx(codec, 0x45, 0xc489); | |
4925 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4926 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
4927 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4928 | break; | |
1948fc06 | 4929 | case 0x10ec0230: |
717f43d8 KY |
4930 | case 0x10ec0236: |
4931 | case 0x10ec0256: | |
4932 | alc_write_coef_idx(codec, 0x45, 0xc489); | |
4933 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4934 | alc_process_coef_fw(codec, coef0256); | |
4935 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4936 | break; | |
71683c32 KY |
4937 | case 0x10ec0234: |
4938 | case 0x10ec0274: | |
4939 | case 0x10ec0294: | |
4940 | alc_write_coef_idx(codec, 0x45, 0x4689); | |
4941 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4942 | alc_process_coef_fw(codec, coef0274); | |
4943 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4944 | break; | |
13fd08a3 | 4945 | case 0x10ec0233: |
73bdd597 DH |
4946 | case 0x10ec0283: |
4947 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4948 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4949 | alc_process_coef_fw(codec, coef0233); |
73bdd597 DH |
4950 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4951 | break; | |
f3b70332 KY |
4952 | case 0x10ec0286: |
4953 | case 0x10ec0288: | |
1a5bc8d9 | 4954 | case 0x10ec0298: |
f3b70332 KY |
4955 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
4956 | alc_process_coef_fw(codec, coef0288); | |
4957 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4958 | break; | |
73bdd597 DH |
4959 | case 0x10ec0292: |
4960 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4961 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4962 | break; |
a22aa26f KY |
4963 | case 0x10ec0293: |
4964 | /* Set to TRS mode */ | |
4965 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4966 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4967 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
4968 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4969 | break; | |
78f4f7c2 KY |
4970 | case 0x10ec0867: |
4971 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); | |
c0dbbdad | 4972 | fallthrough; |
9eb5d0e6 | 4973 | case 0x10ec0221: |
1f8b46cd DH |
4974 | case 0x10ec0662: |
4975 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4976 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4977 | break; | |
73bdd597 DH |
4978 | case 0x10ec0668: |
4979 | alc_write_coef_idx(codec, 0x11, 0x0001); | |
4980 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4981 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
4982 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4983 | break; | |
c2b691ee | 4984 | case 0x10ec0215: |
4cc9b9d6 | 4985 | case 0x10ec0225: |
c2b691ee | 4986 | case 0x10ec0285: |
7d727869 | 4987 | case 0x10ec0295: |
c2b691ee | 4988 | case 0x10ec0289: |
28f1f9b2 | 4989 | case 0x10ec0299: |
5a36767a | 4990 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4991 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
4992 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4993 | alc_process_coef_fw(codec, coef0225); | |
4994 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4995 | break; | |
73bdd597 | 4996 | } |
4e76a883 | 4997 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
73bdd597 DH |
4998 | } |
4999 | ||
5000 | static void alc_headset_mode_default(struct hda_codec *codec) | |
5001 | { | |
6b0f95c4 | 5002 | static const struct coef_fw coef0225[] = { |
5a36767a KY |
5003 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
5004 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), | |
5005 | UPDATE_COEF(0x49, 3<<8, 0<<8), | |
5006 | UPDATE_COEF(0x4a, 3<<4, 3<<4), | |
5007 | UPDATE_COEF(0x63, 3<<14, 0), | |
5008 | UPDATE_COEF(0x67, 0xf000, 0x3000), | |
2ae95577 DH |
5009 | {} |
5010 | }; | |
6b0f95c4 | 5011 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5012 | WRITE_COEF(0x45, 0xc089), |
5013 | WRITE_COEF(0x45, 0xc489), | |
5014 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
5015 | WRITE_COEF(0x49, 0x0049), | |
5016 | {} | |
5017 | }; | |
6b0f95c4 | 5018 | static const struct coef_fw coef0256[] = { |
717f43d8 KY |
5019 | WRITE_COEF(0x45, 0xc489), |
5020 | WRITE_COEFEX(0x57, 0x03, 0x0da3), | |
5021 | WRITE_COEF(0x49, 0x0049), | |
5022 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
5023 | WRITE_COEF(0x06, 0x6100), | |
5024 | {} | |
5025 | }; | |
6b0f95c4 | 5026 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
5027 | WRITE_COEF(0x06, 0x2100), |
5028 | WRITE_COEF(0x32, 0x4ea3), | |
5029 | {} | |
5030 | }; | |
6b0f95c4 | 5031 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5032 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ |
5033 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
5034 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5035 | UPDATE_COEF(0x66, 0x0008, 0), | |
5036 | UPDATE_COEF(0x67, 0x2000, 0), | |
5037 | {} | |
5038 | }; | |
6b0f95c4 | 5039 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
5040 | WRITE_COEF(0x76, 0x000e), |
5041 | WRITE_COEF(0x6c, 0x2400), | |
5042 | WRITE_COEF(0x6b, 0xc429), | |
5043 | WRITE_COEF(0x18, 0x7308), | |
5044 | {} | |
5045 | }; | |
6b0f95c4 | 5046 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5047 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ |
5048 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ | |
5049 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
5050 | {} | |
5051 | }; | |
6b0f95c4 | 5052 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5053 | WRITE_COEF(0x11, 0x0041), |
5054 | WRITE_COEF(0x15, 0x0d40), | |
5055 | WRITE_COEF(0xb7, 0x802b), | |
5056 | {} | |
5057 | }; | |
6b0f95c4 | 5058 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
5059 | WRITE_COEF(0x45, 0x4289), |
5060 | UPDATE_COEF(0x4a, 0x0010, 0x0010), | |
5061 | UPDATE_COEF(0x6b, 0x0f00, 0), | |
5062 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
5063 | {} | |
5064 | }; | |
54db6c39 | 5065 | |
7639a06c | 5066 | switch (codec->core.vendor_id) { |
c2b691ee | 5067 | case 0x10ec0215: |
2ae95577 | 5068 | case 0x10ec0225: |
c2b691ee | 5069 | case 0x10ec0285: |
7d727869 | 5070 | case 0x10ec0295: |
c2b691ee | 5071 | case 0x10ec0289: |
28f1f9b2 | 5072 | case 0x10ec0299: |
5a36767a | 5073 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
2ae95577 DH |
5074 | alc_process_coef_fw(codec, coef0225); |
5075 | break; | |
9a22a8f5 | 5076 | case 0x10ec0255: |
54db6c39 | 5077 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 5078 | break; |
1948fc06 | 5079 | case 0x10ec0230: |
717f43d8 KY |
5080 | case 0x10ec0236: |
5081 | case 0x10ec0256: | |
5082 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); | |
5083 | alc_write_coef_idx(codec, 0x45, 0xc089); | |
5084 | msleep(50); | |
5085 | alc_process_coef_fw(codec, coef0256); | |
5086 | break; | |
71683c32 KY |
5087 | case 0x10ec0234: |
5088 | case 0x10ec0274: | |
5089 | case 0x10ec0294: | |
5090 | alc_process_coef_fw(codec, coef0274); | |
5091 | break; | |
13fd08a3 | 5092 | case 0x10ec0233: |
73bdd597 | 5093 | case 0x10ec0283: |
54db6c39 | 5094 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 5095 | break; |
f3b70332 KY |
5096 | case 0x10ec0286: |
5097 | case 0x10ec0288: | |
1a5bc8d9 | 5098 | case 0x10ec0298: |
f3b70332 KY |
5099 | alc_process_coef_fw(codec, coef0288); |
5100 | break; | |
73bdd597 | 5101 | case 0x10ec0292: |
54db6c39 | 5102 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 5103 | break; |
a22aa26f | 5104 | case 0x10ec0293: |
54db6c39 | 5105 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5106 | break; |
73bdd597 | 5107 | case 0x10ec0668: |
54db6c39 | 5108 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5109 | break; |
78f4f7c2 KY |
5110 | case 0x10ec0867: |
5111 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5112 | break; | |
73bdd597 | 5113 | } |
4e76a883 | 5114 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
73bdd597 DH |
5115 | } |
5116 | ||
5117 | /* Iphone type */ | |
5118 | static void alc_headset_mode_ctia(struct hda_codec *codec) | |
5119 | { | |
89542936 KY |
5120 | int val; |
5121 | ||
6b0f95c4 | 5122 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5123 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
5124 | WRITE_COEF(0x1b, 0x0c2b), | |
5125 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
5126 | {} | |
5127 | }; | |
6b0f95c4 | 5128 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 5129 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
717f43d8 | 5130 | WRITE_COEF(0x1b, 0x0e6b), |
e69e7e03 KY |
5131 | {} |
5132 | }; | |
6b0f95c4 | 5133 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
5134 | WRITE_COEF(0x45, 0xd429), |
5135 | WRITE_COEF(0x1b, 0x0c2b), | |
5136 | WRITE_COEF(0x32, 0x4ea3), | |
5137 | {} | |
5138 | }; | |
6b0f95c4 | 5139 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5140 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5141 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5142 | UPDATE_COEF(0x66, 0x0008, 0), | |
5143 | UPDATE_COEF(0x67, 0x2000, 0), | |
5144 | {} | |
5145 | }; | |
6b0f95c4 | 5146 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
5147 | WRITE_COEF(0x6b, 0xd429), |
5148 | WRITE_COEF(0x76, 0x0008), | |
5149 | WRITE_COEF(0x18, 0x7388), | |
5150 | {} | |
5151 | }; | |
6b0f95c4 | 5152 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5153 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ |
5154 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
5155 | {} | |
5156 | }; | |
6b0f95c4 | 5157 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5158 | WRITE_COEF(0x11, 0x0001), |
5159 | WRITE_COEF(0x15, 0x0d60), | |
5160 | WRITE_COEF(0xc3, 0x0000), | |
5161 | {} | |
5162 | }; | |
6b0f95c4 | 5163 | static const struct coef_fw coef0225_1[] = { |
4cc9b9d6 | 5164 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
5a36767a KY |
5165 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
5166 | {} | |
5167 | }; | |
6b0f95c4 | 5168 | static const struct coef_fw coef0225_2[] = { |
5a36767a KY |
5169 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
5170 | UPDATE_COEF(0x63, 3<<14, 1<<14), | |
4cc9b9d6 KY |
5171 | {} |
5172 | }; | |
54db6c39 | 5173 | |
7639a06c | 5174 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5175 | case 0x10ec0255: |
54db6c39 | 5176 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 5177 | break; |
1948fc06 | 5178 | case 0x10ec0230: |
736f20a7 | 5179 | case 0x10ec0236: |
e69e7e03 KY |
5180 | case 0x10ec0256: |
5181 | alc_process_coef_fw(codec, coef0256); | |
5182 | break; | |
71683c32 KY |
5183 | case 0x10ec0234: |
5184 | case 0x10ec0274: | |
5185 | case 0x10ec0294: | |
5186 | alc_write_coef_idx(codec, 0x45, 0xd689); | |
5187 | break; | |
13fd08a3 | 5188 | case 0x10ec0233: |
73bdd597 | 5189 | case 0x10ec0283: |
54db6c39 | 5190 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 5191 | break; |
1a5bc8d9 | 5192 | case 0x10ec0298: |
89542936 KY |
5193 | val = alc_read_coef_idx(codec, 0x50); |
5194 | if (val & (1 << 12)) { | |
5195 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
5196 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
5197 | msleep(300); | |
5198 | } else { | |
5199 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
5200 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
5201 | msleep(300); | |
5202 | } | |
5203 | break; | |
f3b70332 KY |
5204 | case 0x10ec0286: |
5205 | case 0x10ec0288: | |
5206 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
5207 | msleep(300); | |
5208 | alc_process_coef_fw(codec, coef0288); | |
5209 | break; | |
73bdd597 | 5210 | case 0x10ec0292: |
54db6c39 | 5211 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 5212 | break; |
a22aa26f | 5213 | case 0x10ec0293: |
54db6c39 | 5214 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5215 | break; |
73bdd597 | 5216 | case 0x10ec0668: |
54db6c39 | 5217 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5218 | break; |
c2b691ee | 5219 | case 0x10ec0215: |
4cc9b9d6 | 5220 | case 0x10ec0225: |
c2b691ee | 5221 | case 0x10ec0285: |
7d727869 | 5222 | case 0x10ec0295: |
c2b691ee | 5223 | case 0x10ec0289: |
28f1f9b2 | 5224 | case 0x10ec0299: |
5a36767a KY |
5225 | val = alc_read_coef_idx(codec, 0x45); |
5226 | if (val & (1 << 9)) | |
5227 | alc_process_coef_fw(codec, coef0225_2); | |
5228 | else | |
5229 | alc_process_coef_fw(codec, coef0225_1); | |
4cc9b9d6 | 5230 | break; |
78f4f7c2 KY |
5231 | case 0x10ec0867: |
5232 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5233 | break; | |
73bdd597 | 5234 | } |
4e76a883 | 5235 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
73bdd597 DH |
5236 | } |
5237 | ||
5238 | /* Nokia type */ | |
5239 | static void alc_headset_mode_omtp(struct hda_codec *codec) | |
5240 | { | |
6b0f95c4 | 5241 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5242 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
5243 | WRITE_COEF(0x1b, 0x0c2b), | |
5244 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
5245 | {} | |
5246 | }; | |
6b0f95c4 | 5247 | static const struct coef_fw coef0256[] = { |
e69e7e03 | 5248 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ |
717f43d8 | 5249 | WRITE_COEF(0x1b, 0x0e6b), |
e69e7e03 KY |
5250 | {} |
5251 | }; | |
6b0f95c4 | 5252 | static const struct coef_fw coef0233[] = { |
54db6c39 TI |
5253 | WRITE_COEF(0x45, 0xe429), |
5254 | WRITE_COEF(0x1b, 0x0c2b), | |
5255 | WRITE_COEF(0x32, 0x4ea3), | |
5256 | {} | |
5257 | }; | |
6b0f95c4 | 5258 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5259 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5260 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5261 | UPDATE_COEF(0x66, 0x0008, 0), | |
5262 | UPDATE_COEF(0x67, 0x2000, 0), | |
5263 | {} | |
5264 | }; | |
6b0f95c4 | 5265 | static const struct coef_fw coef0292[] = { |
54db6c39 TI |
5266 | WRITE_COEF(0x6b, 0xe429), |
5267 | WRITE_COEF(0x76, 0x0008), | |
5268 | WRITE_COEF(0x18, 0x7388), | |
5269 | {} | |
5270 | }; | |
6b0f95c4 | 5271 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5272 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ |
5273 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
5274 | {} | |
5275 | }; | |
6b0f95c4 | 5276 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5277 | WRITE_COEF(0x11, 0x0001), |
5278 | WRITE_COEF(0x15, 0x0d50), | |
5279 | WRITE_COEF(0xc3, 0x0000), | |
5280 | {} | |
5281 | }; | |
6b0f95c4 | 5282 | static const struct coef_fw coef0225[] = { |
4cc9b9d6 | 5283 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
5a36767a | 5284 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4cc9b9d6 KY |
5285 | {} |
5286 | }; | |
54db6c39 | 5287 | |
7639a06c | 5288 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5289 | case 0x10ec0255: |
54db6c39 | 5290 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 5291 | break; |
1948fc06 | 5292 | case 0x10ec0230: |
736f20a7 | 5293 | case 0x10ec0236: |
e69e7e03 KY |
5294 | case 0x10ec0256: |
5295 | alc_process_coef_fw(codec, coef0256); | |
5296 | break; | |
71683c32 KY |
5297 | case 0x10ec0234: |
5298 | case 0x10ec0274: | |
5299 | case 0x10ec0294: | |
5300 | alc_write_coef_idx(codec, 0x45, 0xe689); | |
5301 | break; | |
13fd08a3 | 5302 | case 0x10ec0233: |
73bdd597 | 5303 | case 0x10ec0283: |
54db6c39 | 5304 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 5305 | break; |
1a5bc8d9 KY |
5306 | case 0x10ec0298: |
5307 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ | |
89542936 KY |
5308 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
5309 | msleep(300); | |
5310 | break; | |
f3b70332 KY |
5311 | case 0x10ec0286: |
5312 | case 0x10ec0288: | |
5313 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); | |
5314 | msleep(300); | |
5315 | alc_process_coef_fw(codec, coef0288); | |
5316 | break; | |
73bdd597 | 5317 | case 0x10ec0292: |
54db6c39 | 5318 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 5319 | break; |
a22aa26f | 5320 | case 0x10ec0293: |
54db6c39 | 5321 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 5322 | break; |
73bdd597 | 5323 | case 0x10ec0668: |
54db6c39 | 5324 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 5325 | break; |
c2b691ee | 5326 | case 0x10ec0215: |
4cc9b9d6 | 5327 | case 0x10ec0225: |
c2b691ee | 5328 | case 0x10ec0285: |
7d727869 | 5329 | case 0x10ec0295: |
c2b691ee | 5330 | case 0x10ec0289: |
28f1f9b2 | 5331 | case 0x10ec0299: |
4cc9b9d6 KY |
5332 | alc_process_coef_fw(codec, coef0225); |
5333 | break; | |
73bdd597 | 5334 | } |
4e76a883 | 5335 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
73bdd597 DH |
5336 | } |
5337 | ||
5338 | static void alc_determine_headset_type(struct hda_codec *codec) | |
5339 | { | |
5340 | int val; | |
5341 | bool is_ctia = false; | |
5342 | struct alc_spec *spec = codec->spec; | |
6b0f95c4 | 5343 | static const struct coef_fw coef0255[] = { |
54db6c39 TI |
5344 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ |
5345 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref | |
5346 | conteol) */ | |
5347 | {} | |
5348 | }; | |
6b0f95c4 | 5349 | static const struct coef_fw coef0288[] = { |
f3b70332 KY |
5350 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
5351 | {} | |
5352 | }; | |
6b0f95c4 | 5353 | static const struct coef_fw coef0298[] = { |
89542936 KY |
5354 | UPDATE_COEF(0x50, 0x2000, 0x2000), |
5355 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
5356 | UPDATE_COEF(0x66, 0x0008, 0), | |
5357 | UPDATE_COEF(0x67, 0x2000, 0), | |
5358 | UPDATE_COEF(0x19, 0x1300, 0x1300), | |
5359 | {} | |
5360 | }; | |
6b0f95c4 | 5361 | static const struct coef_fw coef0293[] = { |
54db6c39 TI |
5362 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
5363 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ | |
5364 | {} | |
5365 | }; | |
6b0f95c4 | 5366 | static const struct coef_fw coef0688[] = { |
54db6c39 TI |
5367 | WRITE_COEF(0x11, 0x0001), |
5368 | WRITE_COEF(0xb7, 0x802b), | |
5369 | WRITE_COEF(0x15, 0x0d60), | |
5370 | WRITE_COEF(0xc3, 0x0c00), | |
5371 | {} | |
5372 | }; | |
6b0f95c4 | 5373 | static const struct coef_fw coef0274[] = { |
71683c32 KY |
5374 | UPDATE_COEF(0x4a, 0x0010, 0), |
5375 | UPDATE_COEF(0x4a, 0x8000, 0), | |
5376 | WRITE_COEF(0x45, 0xd289), | |
5377 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
5378 | {} | |
5379 | }; | |
73bdd597 | 5380 | |
92666d45 KY |
5381 | if (spec->no_internal_mic_pin) { |
5382 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); | |
5383 | return; | |
5384 | } | |
5385 | ||
7639a06c | 5386 | switch (codec->core.vendor_id) { |
9a22a8f5 | 5387 | case 0x10ec0255: |
717f43d8 KY |
5388 | alc_process_coef_fw(codec, coef0255); |
5389 | msleep(300); | |
5390 | val = alc_read_coef_idx(codec, 0x46); | |
5391 | is_ctia = (val & 0x0070) == 0x0070; | |
5392 | break; | |
1948fc06 | 5393 | case 0x10ec0230: |
717f43d8 | 5394 | case 0x10ec0236: |
7081adf3 | 5395 | case 0x10ec0256: |
717f43d8 KY |
5396 | alc_write_coef_idx(codec, 0x1b, 0x0e4b); |
5397 | alc_write_coef_idx(codec, 0x06, 0x6104); | |
5398 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); | |
5399 | ||
5400 | snd_hda_codec_write(codec, 0x21, 0, | |
5401 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5402 | msleep(80); | |
5403 | snd_hda_codec_write(codec, 0x21, 0, | |
5404 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5405 | ||
54db6c39 | 5406 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
5407 | msleep(300); |
5408 | val = alc_read_coef_idx(codec, 0x46); | |
5409 | is_ctia = (val & 0x0070) == 0x0070; | |
717f43d8 KY |
5410 | |
5411 | alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); | |
5412 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
5413 | ||
5414 | snd_hda_codec_write(codec, 0x21, 0, | |
5415 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
5416 | msleep(80); | |
5417 | snd_hda_codec_write(codec, 0x21, 0, | |
5418 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
9a22a8f5 | 5419 | break; |
71683c32 KY |
5420 | case 0x10ec0234: |
5421 | case 0x10ec0274: | |
5422 | case 0x10ec0294: | |
5423 | alc_process_coef_fw(codec, coef0274); | |
febf2256 | 5424 | msleep(850); |
71683c32 KY |
5425 | val = alc_read_coef_idx(codec, 0x46); |
5426 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5427 | break; | |
13fd08a3 | 5428 | case 0x10ec0233: |
73bdd597 DH |
5429 | case 0x10ec0283: |
5430 | alc_write_coef_idx(codec, 0x45, 0xd029); | |
5431 | msleep(300); | |
5432 | val = alc_read_coef_idx(codec, 0x46); | |
5433 | is_ctia = (val & 0x0070) == 0x0070; | |
5434 | break; | |
1a5bc8d9 | 5435 | case 0x10ec0298: |
89542936 KY |
5436 | snd_hda_codec_write(codec, 0x21, 0, |
5437 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5438 | msleep(100); | |
5439 | snd_hda_codec_write(codec, 0x21, 0, | |
5440 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5441 | msleep(200); | |
5442 | ||
5443 | val = alc_read_coef_idx(codec, 0x50); | |
5444 | if (val & (1 << 12)) { | |
5445 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
5446 | alc_process_coef_fw(codec, coef0288); | |
5447 | msleep(350); | |
5448 | val = alc_read_coef_idx(codec, 0x50); | |
5449 | is_ctia = (val & 0x0070) == 0x0070; | |
5450 | } else { | |
5451 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
5452 | alc_process_coef_fw(codec, coef0288); | |
5453 | msleep(350); | |
5454 | val = alc_read_coef_idx(codec, 0x50); | |
5455 | is_ctia = (val & 0x0070) == 0x0070; | |
5456 | } | |
5457 | alc_process_coef_fw(codec, coef0298); | |
5458 | snd_hda_codec_write(codec, 0x21, 0, | |
5459 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); | |
5460 | msleep(75); | |
5461 | snd_hda_codec_write(codec, 0x21, 0, | |
5462 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
5463 | break; | |
f3b70332 KY |
5464 | case 0x10ec0286: |
5465 | case 0x10ec0288: | |
5466 | alc_process_coef_fw(codec, coef0288); | |
5467 | msleep(350); | |
5468 | val = alc_read_coef_idx(codec, 0x50); | |
5469 | is_ctia = (val & 0x0070) == 0x0070; | |
5470 | break; | |
73bdd597 DH |
5471 | case 0x10ec0292: |
5472 | alc_write_coef_idx(codec, 0x6b, 0xd429); | |
5473 | msleep(300); | |
5474 | val = alc_read_coef_idx(codec, 0x6c); | |
5475 | is_ctia = (val & 0x001c) == 0x001c; | |
5476 | break; | |
a22aa26f | 5477 | case 0x10ec0293: |
54db6c39 | 5478 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
5479 | msleep(300); |
5480 | val = alc_read_coef_idx(codec, 0x46); | |
5481 | is_ctia = (val & 0x0070) == 0x0070; | |
5482 | break; | |
73bdd597 | 5483 | case 0x10ec0668: |
54db6c39 | 5484 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
5485 | msleep(300); |
5486 | val = alc_read_coef_idx(codec, 0xbe); | |
5487 | is_ctia = (val & 0x1c02) == 0x1c02; | |
5488 | break; | |
c2b691ee | 5489 | case 0x10ec0215: |
4cc9b9d6 | 5490 | case 0x10ec0225: |
c2b691ee | 5491 | case 0x10ec0285: |
7d727869 | 5492 | case 0x10ec0295: |
c2b691ee | 5493 | case 0x10ec0289: |
28f1f9b2 | 5494 | case 0x10ec0299: |
da911b1f KY |
5495 | snd_hda_codec_write(codec, 0x21, 0, |
5496 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5497 | msleep(80); | |
5498 | snd_hda_codec_write(codec, 0x21, 0, | |
5499 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
5500 | ||
5a36767a KY |
5501 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
5502 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); | |
5503 | val = alc_read_coef_idx(codec, 0x45); | |
5504 | if (val & (1 << 9)) { | |
5505 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
5506 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); | |
5507 | msleep(800); | |
5508 | val = alc_read_coef_idx(codec, 0x46); | |
5509 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5510 | } else { | |
5511 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
5512 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); | |
5513 | msleep(800); | |
5514 | val = alc_read_coef_idx(codec, 0x46); | |
5515 | is_ctia = (val & 0x00f0) == 0x00f0; | |
5516 | } | |
5517 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); | |
5518 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); | |
5519 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
da911b1f KY |
5520 | |
5521 | snd_hda_codec_write(codec, 0x21, 0, | |
5522 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
5523 | msleep(80); | |
5524 | snd_hda_codec_write(codec, 0x21, 0, | |
5525 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
4cc9b9d6 | 5526 | break; |
78f4f7c2 KY |
5527 | case 0x10ec0867: |
5528 | is_ctia = true; | |
5529 | break; | |
73bdd597 DH |
5530 | } |
5531 | ||
4e76a883 | 5532 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
73bdd597 DH |
5533 | is_ctia ? "yes" : "no"); |
5534 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; | |
5535 | } | |
5536 | ||
5537 | static void alc_update_headset_mode(struct hda_codec *codec) | |
5538 | { | |
5539 | struct alc_spec *spec = codec->spec; | |
5540 | ||
5541 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; | |
35a39f98 | 5542 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
73bdd597 DH |
5543 | |
5544 | int new_headset_mode; | |
5545 | ||
5546 | if (!snd_hda_jack_detect(codec, hp_pin)) | |
5547 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; | |
5548 | else if (mux_pin == spec->headset_mic_pin) | |
5549 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; | |
5550 | else if (mux_pin == spec->headphone_mic_pin) | |
5551 | new_headset_mode = ALC_HEADSET_MODE_MIC; | |
5552 | else | |
5553 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; | |
5554 | ||
5959a6bc DH |
5555 | if (new_headset_mode == spec->current_headset_mode) { |
5556 | snd_hda_gen_update_outputs(codec); | |
73bdd597 | 5557 | return; |
5959a6bc | 5558 | } |
73bdd597 DH |
5559 | |
5560 | switch (new_headset_mode) { | |
5561 | case ALC_HEADSET_MODE_UNPLUGGED: | |
5562 | alc_headset_mode_unplugged(codec); | |
aeac1a0d KY |
5563 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; |
5564 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; | |
73bdd597 DH |
5565 | spec->gen.hp_jack_present = false; |
5566 | break; | |
5567 | case ALC_HEADSET_MODE_HEADSET: | |
5568 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) | |
5569 | alc_determine_headset_type(codec); | |
5570 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) | |
5571 | alc_headset_mode_ctia(codec); | |
5572 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) | |
5573 | alc_headset_mode_omtp(codec); | |
5574 | spec->gen.hp_jack_present = true; | |
5575 | break; | |
5576 | case ALC_HEADSET_MODE_MIC: | |
5577 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); | |
5578 | spec->gen.hp_jack_present = false; | |
5579 | break; | |
5580 | case ALC_HEADSET_MODE_HEADPHONE: | |
5581 | alc_headset_mode_default(codec); | |
5582 | spec->gen.hp_jack_present = true; | |
5583 | break; | |
5584 | } | |
5585 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { | |
5586 | snd_hda_set_pin_ctl_cache(codec, hp_pin, | |
5587 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); | |
1f8b46cd | 5588 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
73bdd597 DH |
5589 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
5590 | PIN_VREFHIZ); | |
5591 | } | |
5592 | spec->current_headset_mode = new_headset_mode; | |
5593 | ||
5594 | snd_hda_gen_update_outputs(codec); | |
5595 | } | |
5596 | ||
5597 | static void alc_update_headset_mode_hook(struct hda_codec *codec, | |
7fe30711 TI |
5598 | struct snd_kcontrol *kcontrol, |
5599 | struct snd_ctl_elem_value *ucontrol) | |
73bdd597 DH |
5600 | { |
5601 | alc_update_headset_mode(codec); | |
5602 | } | |
5603 | ||
1a4f69d5 TI |
5604 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
5605 | struct hda_jack_callback *jack) | |
73bdd597 | 5606 | { |
73bdd597 | 5607 | snd_hda_gen_hp_automute(codec, jack); |
e54f30be | 5608 | alc_update_headset_mode(codec); |
73bdd597 DH |
5609 | } |
5610 | ||
5611 | static void alc_probe_headset_mode(struct hda_codec *codec) | |
5612 | { | |
5613 | int i; | |
5614 | struct alc_spec *spec = codec->spec; | |
5615 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5616 | ||
5617 | /* Find mic pins */ | |
5618 | for (i = 0; i < cfg->num_inputs; i++) { | |
5619 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) | |
5620 | spec->headset_mic_pin = cfg->inputs[i].pin; | |
5621 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) | |
5622 | spec->headphone_mic_pin = cfg->inputs[i].pin; | |
5623 | } | |
5624 | ||
0bed2aa3 | 5625 | WARN_ON(spec->gen.cap_sync_hook); |
73bdd597 DH |
5626 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; |
5627 | spec->gen.automute_hook = alc_update_headset_mode; | |
5628 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; | |
5629 | } | |
5630 | ||
5631 | static void alc_fixup_headset_mode(struct hda_codec *codec, | |
5632 | const struct hda_fixup *fix, int action) | |
5633 | { | |
5634 | struct alc_spec *spec = codec->spec; | |
5635 | ||
5636 | switch (action) { | |
5637 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5638 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; | |
5639 | break; | |
5640 | case HDA_FIXUP_ACT_PROBE: | |
5641 | alc_probe_headset_mode(codec); | |
5642 | break; | |
5643 | case HDA_FIXUP_ACT_INIT: | |
aeac1a0d KY |
5644 | if (is_s3_resume(codec) || is_s4_resume(codec)) { |
5645 | spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; | |
5646 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; | |
5647 | } | |
73bdd597 DH |
5648 | alc_update_headset_mode(codec); |
5649 | break; | |
5650 | } | |
5651 | } | |
5652 | ||
5653 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, | |
5654 | const struct hda_fixup *fix, int action) | |
5655 | { | |
5656 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5657 | struct alc_spec *spec = codec->spec; | |
5658 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5659 | } | |
5660 | else | |
5661 | alc_fixup_headset_mode(codec, fix, action); | |
5662 | } | |
5663 | ||
31278997 KY |
5664 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
5665 | { | |
5666 | /* Set to iphone type */ | |
6b0f95c4 | 5667 | static const struct coef_fw alc255fw[] = { |
54db6c39 TI |
5668 | WRITE_COEF(0x1b, 0x880b), |
5669 | WRITE_COEF(0x45, 0xd089), | |
5670 | WRITE_COEF(0x1b, 0x080b), | |
5671 | WRITE_COEF(0x46, 0x0004), | |
5672 | WRITE_COEF(0x1b, 0x0c0b), | |
5673 | {} | |
5674 | }; | |
6b0f95c4 | 5675 | static const struct coef_fw alc256fw[] = { |
e69e7e03 KY |
5676 | WRITE_COEF(0x1b, 0x884b), |
5677 | WRITE_COEF(0x45, 0xd089), | |
5678 | WRITE_COEF(0x1b, 0x084b), | |
5679 | WRITE_COEF(0x46, 0x0004), | |
5680 | WRITE_COEF(0x1b, 0x0c4b), | |
5681 | {} | |
5682 | }; | |
5683 | switch (codec->core.vendor_id) { | |
5684 | case 0x10ec0255: | |
5685 | alc_process_coef_fw(codec, alc255fw); | |
5686 | break; | |
1948fc06 | 5687 | case 0x10ec0230: |
736f20a7 | 5688 | case 0x10ec0236: |
e69e7e03 KY |
5689 | case 0x10ec0256: |
5690 | alc_process_coef_fw(codec, alc256fw); | |
5691 | break; | |
5692 | } | |
31278997 KY |
5693 | msleep(30); |
5694 | } | |
5695 | ||
9a22a8f5 KY |
5696 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
5697 | const struct hda_fixup *fix, int action) | |
5698 | { | |
5699 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
31278997 | 5700 | alc255_set_default_jack_type(codec); |
9a22a8f5 KY |
5701 | } |
5702 | alc_fixup_headset_mode(codec, fix, action); | |
5703 | } | |
5704 | ||
31278997 KY |
5705 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
5706 | const struct hda_fixup *fix, int action) | |
5707 | { | |
5708 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5709 | struct alc_spec *spec = codec->spec; | |
5710 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5711 | alc255_set_default_jack_type(codec); | |
5712 | } | |
5713 | else | |
5714 | alc_fixup_headset_mode(codec, fix, action); | |
5715 | } | |
5716 | ||
e1e62b98 KY |
5717 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
5718 | struct hda_jack_callback *jack) | |
5719 | { | |
5720 | struct alc_spec *spec = codec->spec; | |
e1e62b98 KY |
5721 | |
5722 | alc_update_headset_jack_cb(codec, jack); | |
5723 | /* Headset Mic enable or disable, only for Dell Dino */ | |
d44a6864 | 5724 | alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); |
e1e62b98 KY |
5725 | } |
5726 | ||
5727 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, | |
5728 | const struct hda_fixup *fix, int action) | |
5729 | { | |
5730 | alc_fixup_headset_mode(codec, fix, action); | |
5731 | if (action == HDA_FIXUP_ACT_PROBE) { | |
5732 | struct alc_spec *spec = codec->spec; | |
d44a6864 TI |
5733 | /* toggled via hp_automute_hook */ |
5734 | spec->gpio_mask |= 0x40; | |
5735 | spec->gpio_dir |= 0x40; | |
e1e62b98 KY |
5736 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; |
5737 | } | |
5738 | } | |
5739 | ||
493a52a9 HW |
5740 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
5741 | const struct hda_fixup *fix, int action) | |
5742 | { | |
5743 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5744 | struct alc_spec *spec = codec->spec; | |
5745 | spec->gen.auto_mute_via_amp = 1; | |
5746 | } | |
5747 | } | |
5748 | ||
9b745ab8 TI |
5749 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
5750 | const struct hda_fixup *fix, int action) | |
5751 | { | |
efe55732 | 5752 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
9b745ab8 | 5753 | struct alc_spec *spec = codec->spec; |
c0ca5ece | 5754 | spec->no_shutup_pins = 1; |
9b745ab8 TI |
5755 | } |
5756 | } | |
5757 | ||
5e6db669 GM |
5758 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
5759 | const struct hda_fixup *fix, int action) | |
5760 | { | |
5761 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5762 | struct alc_spec *spec = codec->spec; | |
5763 | /* Disable AA-loopback as it causes white noise */ | |
5764 | spec->gen.mixer_nid = 0; | |
5765 | } | |
5766 | } | |
5767 | ||
7f57d803 TI |
5768 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
5769 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, | |
5770 | const struct hda_fixup *fix, int action) | |
5771 | { | |
5772 | static const struct hda_pintbl pincfgs[] = { | |
5773 | { 0x16, 0x21211010 }, /* dock headphone */ | |
5774 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5775 | { } | |
5776 | }; | |
5777 | struct alc_spec *spec = codec->spec; | |
5778 | ||
5779 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5780 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
5781 | codec->power_save_node = 0; /* avoid click noises */ | |
5782 | snd_hda_apply_pincfgs(codec, pincfgs); | |
5783 | } | |
5784 | } | |
5785 | ||
61fcf8ec KY |
5786 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
5787 | const struct hda_fixup *fix, int action) | |
5788 | { | |
5789 | static const struct hda_pintbl pincfgs[] = { | |
5790 | { 0x17, 0x21211010 }, /* dock headphone */ | |
5791 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5792 | { } | |
5793 | }; | |
5794 | struct alc_spec *spec = codec->spec; | |
5795 | ||
5796 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5797 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
71db96dd TI |
5798 | snd_hda_apply_pincfgs(codec, pincfgs); |
5799 | } else if (action == HDA_FIXUP_ACT_INIT) { | |
61fcf8ec KY |
5800 | /* Enable DOCK device */ |
5801 | snd_hda_codec_write(codec, 0x17, 0, | |
5802 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
5803 | /* Enable DOCK device */ | |
5804 | snd_hda_codec_write(codec, 0x19, 0, | |
5805 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
61fcf8ec KY |
5806 | } |
5807 | } | |
5808 | ||
399c01aa TI |
5809 | static void alc_fixup_tpt470_dacs(struct hda_codec *codec, |
5810 | const struct hda_fixup *fix, int action) | |
5811 | { | |
5812 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise | |
5813 | * the speaker output becomes too low by some reason on Thinkpads with | |
5814 | * ALC298 codec | |
5815 | */ | |
5816 | static const hda_nid_t preferred_pairs[] = { | |
5817 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, | |
5818 | 0 | |
5819 | }; | |
5820 | struct alc_spec *spec = codec->spec; | |
5821 | ||
5822 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
5823 | spec->gen.preferred_dacs = preferred_pairs; | |
5824 | } | |
5825 | ||
8eedd3a7 TI |
5826 | static void alc295_fixup_asus_dacs(struct hda_codec *codec, |
5827 | const struct hda_fixup *fix, int action) | |
5828 | { | |
5829 | static const hda_nid_t preferred_pairs[] = { | |
5830 | 0x17, 0x02, 0x21, 0x03, 0 | |
5831 | }; | |
5832 | struct alc_spec *spec = codec->spec; | |
5833 | ||
5834 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
5835 | spec->gen.preferred_dacs = preferred_pairs; | |
5836 | } | |
5837 | ||
9476d369 | 5838 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
033b0a7c GM |
5839 | { |
5840 | struct alc_spec *spec = codec->spec; | |
35a39f98 | 5841 | int hp_pin = alc_get_hp_pin(spec); |
033b0a7c | 5842 | |
9476d369 GM |
5843 | /* Prevent pop noises when headphones are plugged in */ |
5844 | snd_hda_codec_write(codec, hp_pin, 0, | |
5845 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5846 | msleep(20); | |
033b0a7c GM |
5847 | } |
5848 | ||
5849 | static void alc_fixup_dell_xps13(struct hda_codec *codec, | |
5850 | const struct hda_fixup *fix, int action) | |
5851 | { | |
3e1b0c4a TI |
5852 | struct alc_spec *spec = codec->spec; |
5853 | struct hda_input_mux *imux = &spec->gen.input_mux; | |
5854 | int i; | |
f38663ab | 5855 | |
3e1b0c4a TI |
5856 | switch (action) { |
5857 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5858 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise | |
5859 | * it causes a click noise at start up | |
5860 | */ | |
5861 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
efe55732 | 5862 | spec->shutup = alc_shutup_dell_xps13; |
3e1b0c4a TI |
5863 | break; |
5864 | case HDA_FIXUP_ACT_PROBE: | |
f38663ab GM |
5865 | /* Make the internal mic the default input source. */ |
5866 | for (i = 0; i < imux->num_items; i++) { | |
5867 | if (spec->gen.imux_pins[i] == 0x12) { | |
5868 | spec->gen.cur_mux[0] = i; | |
5869 | break; | |
5870 | } | |
5871 | } | |
3e1b0c4a | 5872 | break; |
033b0a7c GM |
5873 | } |
5874 | } | |
5875 | ||
1f8b46cd DH |
5876 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
5877 | const struct hda_fixup *fix, int action) | |
5878 | { | |
5879 | struct alc_spec *spec = codec->spec; | |
5880 | ||
5881 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5882 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5883 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ | |
b40eda64 DH |
5884 | |
5885 | /* Disable boost for mic-in permanently. (This code is only called | |
5886 | from quirks that guarantee that the headphone is at NID 0x1b.) */ | |
5887 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); | |
5888 | snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); | |
1f8b46cd DH |
5889 | } else |
5890 | alc_fixup_headset_mode(codec, fix, action); | |
5891 | } | |
5892 | ||
73bdd597 DH |
5893 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
5894 | const struct hda_fixup *fix, int action) | |
5895 | { | |
5896 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
73bdd597 | 5897 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
98b24883 | 5898 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
73bdd597 DH |
5899 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
5900 | } | |
5901 | alc_fixup_headset_mode(codec, fix, action); | |
5902 | } | |
5903 | ||
bde7bc60 CCC |
5904 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
5905 | static int find_ext_mic_pin(struct hda_codec *codec) | |
5906 | { | |
5907 | struct alc_spec *spec = codec->spec; | |
5908 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5909 | hda_nid_t nid; | |
5910 | unsigned int defcfg; | |
5911 | int i; | |
5912 | ||
5913 | for (i = 0; i < cfg->num_inputs; i++) { | |
5914 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5915 | continue; | |
5916 | nid = cfg->inputs[i].pin; | |
5917 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5918 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) | |
5919 | continue; | |
5920 | return nid; | |
5921 | } | |
5922 | ||
5923 | return 0; | |
5924 | } | |
5925 | ||
08a978db | 5926 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
1727a771 | 5927 | const struct hda_fixup *fix, |
08a978db DR |
5928 | int action) |
5929 | { | |
5930 | struct alc_spec *spec = codec->spec; | |
5931 | ||
0db75790 | 5932 | if (action == HDA_FIXUP_ACT_PROBE) { |
bde7bc60 | 5933 | int mic_pin = find_ext_mic_pin(codec); |
35a39f98 | 5934 | int hp_pin = alc_get_hp_pin(spec); |
bde7bc60 CCC |
5935 | |
5936 | if (snd_BUG_ON(!mic_pin || !hp_pin)) | |
0db75790 | 5937 | return; |
bde7bc60 | 5938 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
0db75790 | 5939 | } |
08a978db | 5940 | } |
693b613d | 5941 | |
3e0d611b DH |
5942 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
5943 | const struct hda_fixup *fix, | |
5944 | int action) | |
5945 | { | |
5946 | struct alc_spec *spec = codec->spec; | |
5947 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5948 | int i; | |
5949 | ||
5950 | /* The mic boosts on level 2 and 3 are too noisy | |
5951 | on the internal mic input. | |
5952 | Therefore limit the boost to 0 or 1. */ | |
5953 | ||
5954 | if (action != HDA_FIXUP_ACT_PROBE) | |
5955 | return; | |
5956 | ||
5957 | for (i = 0; i < cfg->num_inputs; i++) { | |
5958 | hda_nid_t nid = cfg->inputs[i].pin; | |
5959 | unsigned int defcfg; | |
5960 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5961 | continue; | |
5962 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5963 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) | |
5964 | continue; | |
5965 | ||
5966 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, | |
5967 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | | |
5968 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
5969 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
5970 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
5971 | } | |
5972 | } | |
5973 | ||
cd217a63 | 5974 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 5975 | struct hda_jack_callback *jack) |
cd217a63 KY |
5976 | { |
5977 | struct alc_spec *spec = codec->spec; | |
5978 | int vref; | |
5979 | ||
5980 | msleep(200); | |
5981 | snd_hda_gen_hp_automute(codec, jack); | |
5982 | ||
5983 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
5984 | ||
5985 | msleep(600); | |
5986 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
5987 | vref); | |
5988 | } | |
5989 | ||
cd217a63 KY |
5990 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
5991 | const struct hda_fixup *fix, int action) | |
5992 | { | |
5993 | struct alc_spec *spec = codec->spec; | |
cd217a63 KY |
5994 | |
5995 | switch (action) { | |
5996 | case HDA_FIXUP_ACT_PRE_PROBE: | |
0202e99c | 5997 | snd_hda_override_wcaps(codec, 0x03, 0); |
d2e92709 TI |
5998 | /* Disable AA-loopback as it causes white noise */ |
5999 | spec->gen.mixer_nid = 0; | |
38070219 | 6000 | break; |
0202e99c | 6001 | case HDA_FIXUP_ACT_INIT: |
de9481cb KY |
6002 | /* MIC2-VREF control */ |
6003 | /* Set to manual mode */ | |
98b24883 | 6004 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
0202e99c | 6005 | /* Enable Line1 input control by verb */ |
98b24883 | 6006 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
0202e99c KY |
6007 | break; |
6008 | } | |
6009 | } | |
6010 | ||
6011 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, | |
6012 | const struct hda_fixup *fix, int action) | |
6013 | { | |
6014 | struct alc_spec *spec = codec->spec; | |
0202e99c KY |
6015 | |
6016 | switch (action) { | |
6017 | case HDA_FIXUP_ACT_PRE_PROBE: | |
cd217a63 | 6018 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
38070219 KY |
6019 | break; |
6020 | case HDA_FIXUP_ACT_INIT: | |
cd217a63 KY |
6021 | /* MIC2-VREF control */ |
6022 | /* Set to manual mode */ | |
98b24883 | 6023 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
cd217a63 KY |
6024 | break; |
6025 | } | |
6026 | } | |
6027 | ||
7bba2157 TI |
6028 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
6029 | static void asus_tx300_automute(struct hda_codec *codec) | |
6030 | { | |
6031 | struct alc_spec *spec = codec->spec; | |
6032 | snd_hda_gen_update_outputs(codec); | |
6033 | if (snd_hda_jack_detect(codec, 0x1b)) | |
6034 | spec->gen.mute_bits |= (1ULL << 0x14); | |
6035 | } | |
6036 | ||
6037 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, | |
6038 | const struct hda_fixup *fix, int action) | |
6039 | { | |
6040 | struct alc_spec *spec = codec->spec; | |
7bba2157 TI |
6041 | static const struct hda_pintbl dock_pins[] = { |
6042 | { 0x1b, 0x21114000 }, /* dock speaker pin */ | |
6043 | {} | |
6044 | }; | |
7bba2157 TI |
6045 | |
6046 | switch (action) { | |
6047 | case HDA_FIXUP_ACT_PRE_PROBE: | |
1c76aa5f | 6048 | spec->init_amp = ALC_INIT_DEFAULT; |
ae065f1c TI |
6049 | /* TX300 needs to set up GPIO2 for the speaker amp */ |
6050 | alc_setup_gpio(codec, 0x04); | |
7bba2157 TI |
6051 | snd_hda_apply_pincfgs(codec, dock_pins); |
6052 | spec->gen.auto_mute_via_amp = 1; | |
6053 | spec->gen.automute_hook = asus_tx300_automute; | |
6054 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
7bba2157 TI |
6055 | snd_hda_gen_hp_automute); |
6056 | break; | |
5579cd6f TI |
6057 | case HDA_FIXUP_ACT_PROBE: |
6058 | spec->init_amp = ALC_INIT_DEFAULT; | |
6059 | break; | |
7bba2157 TI |
6060 | case HDA_FIXUP_ACT_BUILD: |
6061 | /* this is a bit tricky; give more sane names for the main | |
6062 | * (tablet) speaker and the dock speaker, respectively | |
6063 | */ | |
56798e6b TI |
6064 | rename_ctl(codec, "Speaker Playback Switch", |
6065 | "Dock Speaker Playback Switch"); | |
6066 | rename_ctl(codec, "Bass Speaker Playback Switch", | |
6067 | "Speaker Playback Switch"); | |
7bba2157 TI |
6068 | break; |
6069 | } | |
6070 | } | |
6071 | ||
338cae56 DH |
6072 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
6073 | const struct hda_fixup *fix, int action) | |
6074 | { | |
0f4881dc DH |
6075 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
6076 | /* DAC node 0x03 is giving mono output. We therefore want to | |
6077 | make sure 0x14 (front speaker) and 0x15 (headphones) use the | |
6078 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ | |
caf3c043 MM |
6079 | static const hda_nid_t conn1[] = { 0x0c }; |
6080 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); | |
6081 | snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); | |
0f4881dc | 6082 | } |
338cae56 DH |
6083 | } |
6084 | ||
dd9aa335 HW |
6085 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
6086 | const struct hda_fixup *fix, int action) | |
6087 | { | |
6088 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
6089 | /* The speaker is routed to the Node 0x06 by a mistake, as a result | |
6090 | we can't adjust the speaker's volume since this node does not has | |
6091 | Amp-out capability. we change the speaker's route to: | |
6092 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( | |
6093 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust | |
6094 | speaker's volume now. */ | |
6095 | ||
caf3c043 MM |
6096 | static const hda_nid_t conn1[] = { 0x0c }; |
6097 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); | |
dd9aa335 HW |
6098 | } |
6099 | } | |
6100 | ||
e312a869 TI |
6101 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
6102 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, | |
6103 | const struct hda_fixup *fix, int action) | |
6104 | { | |
6105 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
caf3c043 MM |
6106 | static const hda_nid_t conn[] = { 0x02, 0x03 }; |
6107 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
e312a869 TI |
6108 | } |
6109 | } | |
6110 | ||
d2cd795c JK |
6111 | /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ |
6112 | static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, | |
6113 | const struct hda_fixup *fix, int action) | |
6114 | { | |
6115 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
caf3c043 MM |
6116 | static const hda_nid_t conn[] = { 0x02 }; |
6117 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
d2cd795c JK |
6118 | } |
6119 | } | |
6120 | ||
98973f2f KP |
6121 | /* Hook to update amp GPIO4 for automute */ |
6122 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, | |
6123 | struct hda_jack_callback *jack) | |
6124 | { | |
6125 | struct alc_spec *spec = codec->spec; | |
6126 | ||
6127 | snd_hda_gen_hp_automute(codec, jack); | |
6128 | /* mute_led_polarity is set to 0, so we pass inverted value here */ | |
dbd13179 KHF |
6129 | alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, |
6130 | !spec->gen.hp_jack_present); | |
98973f2f KP |
6131 | } |
6132 | ||
6133 | /* Manage GPIOs for HP EliteBook Folio 9480m. | |
6134 | * | |
6135 | * GPIO4 is the headphone amplifier power control | |
6136 | * GPIO3 is the audio output mute indicator LED | |
6137 | */ | |
6138 | ||
6139 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, | |
6140 | const struct hda_fixup *fix, | |
6141 | int action) | |
6142 | { | |
6143 | struct alc_spec *spec = codec->spec; | |
98973f2f | 6144 | |
01e4a275 | 6145 | alc_fixup_hp_gpio_led(codec, action, 0x08, 0); |
98973f2f | 6146 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
01e4a275 TI |
6147 | /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ |
6148 | spec->gpio_mask |= 0x10; | |
6149 | spec->gpio_dir |= 0x10; | |
98973f2f | 6150 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; |
98973f2f KP |
6151 | } |
6152 | } | |
6153 | ||
ae065f1c TI |
6154 | static void alc275_fixup_gpio4_off(struct hda_codec *codec, |
6155 | const struct hda_fixup *fix, | |
6156 | int action) | |
6157 | { | |
6158 | struct alc_spec *spec = codec->spec; | |
6159 | ||
6160 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
6161 | spec->gpio_mask |= 0x04; | |
6162 | spec->gpio_dir |= 0x04; | |
6163 | /* set data bit low */ | |
6164 | } | |
6165 | } | |
6166 | ||
6a6660d0 TI |
6167 | /* Quirk for Thinkpad X1 7th and 8th Gen |
6168 | * The following fixed routing needed | |
6169 | * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly | |
6170 | * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC | |
6171 | * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp | |
6172 | */ | |
6173 | static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, | |
6174 | const struct hda_fixup *fix, int action) | |
6175 | { | |
6176 | static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ | |
6177 | static const hda_nid_t preferred_pairs[] = { | |
6178 | 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 | |
6179 | }; | |
6180 | struct alc_spec *spec = codec->spec; | |
6181 | ||
6182 | switch (action) { | |
6183 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6184 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
6185 | spec->gen.preferred_dacs = preferred_pairs; | |
6186 | break; | |
6187 | case HDA_FIXUP_ACT_BUILD: | |
6188 | /* The generic parser creates somewhat unintuitive volume ctls | |
6189 | * with the fixed routing above, and the shared DAC2 may be | |
6190 | * confusing for PA. | |
6191 | * Rename those to unique names so that PA doesn't touch them | |
6192 | * and use only Master volume. | |
6193 | */ | |
6194 | rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); | |
6195 | rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); | |
6196 | break; | |
6197 | } | |
6198 | } | |
6199 | ||
ca169cc2 KY |
6200 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
6201 | const struct hda_fixup *fix, | |
6202 | int action) | |
6203 | { | |
6204 | alc_fixup_dual_codecs(codec, fix, action); | |
6205 | switch (action) { | |
6206 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6207 | /* override card longname to provide a unique UCM profile */ | |
6208 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); | |
6209 | break; | |
6210 | case HDA_FIXUP_ACT_BUILD: | |
6211 | /* rename Capture controls depending on the codec */ | |
6212 | rename_ctl(codec, "Capture Volume", | |
6213 | codec->addr == 0 ? | |
6214 | "Rear-Panel Capture Volume" : | |
6215 | "Front-Panel Capture Volume"); | |
6216 | rename_ctl(codec, "Capture Switch", | |
6217 | codec->addr == 0 ? | |
6218 | "Rear-Panel Capture Switch" : | |
6219 | "Front-Panel Capture Switch"); | |
6220 | break; | |
6221 | } | |
6222 | } | |
6223 | ||
52e4e368 KHF |
6224 | static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, |
6225 | const struct hda_fixup *fix, int action) | |
6226 | { | |
6227 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6228 | return; | |
6229 | ||
6230 | codec->power_save_node = 1; | |
6231 | } | |
6232 | ||
92266651 KY |
6233 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
6234 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, | |
6235 | const struct hda_fixup *fix, int action) | |
6236 | { | |
6237 | struct alc_spec *spec = codec->spec; | |
caf3c043 | 6238 | static const hda_nid_t preferred_pairs[] = { |
92266651 KY |
6239 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, |
6240 | 0 | |
6241 | }; | |
6242 | ||
6243 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6244 | return; | |
6245 | ||
6246 | spec->gen.preferred_dacs = preferred_pairs; | |
0700d3d1 KY |
6247 | spec->gen.auto_mute_via_amp = 1; |
6248 | codec->power_save_node = 0; | |
92266651 KY |
6249 | } |
6250 | ||
c84bfedc TI |
6251 | /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */ |
6252 | static void alc289_fixup_asus_ga401(struct hda_codec *codec, | |
6253 | const struct hda_fixup *fix, int action) | |
6254 | { | |
6255 | static const hda_nid_t preferred_pairs[] = { | |
6256 | 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0 | |
6257 | }; | |
6258 | struct alc_spec *spec = codec->spec; | |
6259 | ||
6260 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
6261 | spec->gen.preferred_dacs = preferred_pairs; | |
6262 | spec->gen.obey_preferred_dacs = 1; | |
6263 | } | |
6264 | } | |
6265 | ||
c4cfcf6f HW |
6266 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
6267 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, | |
6268 | const struct hda_fixup *fix, int action) | |
6269 | { | |
6270 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
6271 | return; | |
6272 | ||
6273 | snd_hda_override_wcaps(codec, 0x03, 0); | |
6274 | } | |
6275 | ||
8a8de09c KY |
6276 | static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) |
6277 | { | |
6278 | switch (codec->core.vendor_id) { | |
6279 | case 0x10ec0274: | |
6280 | case 0x10ec0294: | |
6281 | case 0x10ec0225: | |
6282 | case 0x10ec0295: | |
6283 | case 0x10ec0299: | |
6284 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ | |
6285 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); | |
6286 | break; | |
1948fc06 | 6287 | case 0x10ec0230: |
8a8de09c KY |
6288 | case 0x10ec0235: |
6289 | case 0x10ec0236: | |
6290 | case 0x10ec0255: | |
6291 | case 0x10ec0256: | |
6292 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ | |
6293 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); | |
6294 | break; | |
6295 | } | |
6296 | } | |
6297 | ||
8983eb60 KY |
6298 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
6299 | const struct hda_fixup *fix, int action) | |
6300 | { | |
d3ba58bb KY |
6301 | struct alc_spec *spec = codec->spec; |
6302 | ||
8983eb60 | 6303 | switch (action) { |
d3ba58bb KY |
6304 | case HDA_FIXUP_ACT_PRE_PROBE: |
6305 | spec->ultra_low_power = true; | |
6306 | break; | |
8983eb60 | 6307 | case HDA_FIXUP_ACT_INIT: |
8a8de09c | 6308 | alc_combo_jack_hp_jd_restart(codec); |
8983eb60 KY |
6309 | break; |
6310 | } | |
6311 | } | |
6312 | ||
d1dd4211 KY |
6313 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
6314 | const struct hda_fixup *fix, int action) | |
6315 | { | |
6316 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
6317 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
6318 | } | |
6319 | ||
c3cdf189 LJ |
6320 | |
6321 | static void alc294_gx502_toggle_output(struct hda_codec *codec, | |
6322 | struct hda_jack_callback *cb) | |
6323 | { | |
6324 | /* The Windows driver sets the codec up in a very different way where | |
6325 | * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it | |
6326 | */ | |
6327 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) | |
6328 | alc_write_coef_idx(codec, 0x10, 0x8a20); | |
6329 | else | |
6330 | alc_write_coef_idx(codec, 0x10, 0x0a20); | |
6331 | } | |
6332 | ||
6333 | static void alc294_fixup_gx502_hp(struct hda_codec *codec, | |
6334 | const struct hda_fixup *fix, int action) | |
6335 | { | |
6336 | /* Pin 0x21: headphones/headset mic */ | |
6337 | if (!is_jack_detectable(codec, 0x21)) | |
6338 | return; | |
6339 | ||
6340 | switch (action) { | |
6341 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6342 | snd_hda_jack_detect_enable_callback(codec, 0x21, | |
6343 | alc294_gx502_toggle_output); | |
6344 | break; | |
6345 | case HDA_FIXUP_ACT_INIT: | |
6346 | /* Make sure to start in a correct state, i.e. if | |
6347 | * headphones have been plugged in before powering up the system | |
6348 | */ | |
6349 | alc294_gx502_toggle_output(codec, NULL); | |
6350 | break; | |
6351 | } | |
6352 | } | |
6353 | ||
c1b55029 DC |
6354 | static void alc294_gu502_toggle_output(struct hda_codec *codec, |
6355 | struct hda_jack_callback *cb) | |
6356 | { | |
6357 | /* Windows sets 0x10 to 0x8420 for Node 0x20 which is | |
6358 | * responsible from changes between speakers and headphones | |
6359 | */ | |
6360 | if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) | |
6361 | alc_write_coef_idx(codec, 0x10, 0x8420); | |
6362 | else | |
6363 | alc_write_coef_idx(codec, 0x10, 0x0a20); | |
6364 | } | |
6365 | ||
6366 | static void alc294_fixup_gu502_hp(struct hda_codec *codec, | |
6367 | const struct hda_fixup *fix, int action) | |
6368 | { | |
6369 | if (!is_jack_detectable(codec, 0x21)) | |
6370 | return; | |
6371 | ||
6372 | switch (action) { | |
6373 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6374 | snd_hda_jack_detect_enable_callback(codec, 0x21, | |
6375 | alc294_gu502_toggle_output); | |
6376 | break; | |
6377 | case HDA_FIXUP_ACT_INIT: | |
6378 | alc294_gu502_toggle_output(codec, NULL); | |
6379 | break; | |
6380 | } | |
6381 | } | |
6382 | ||
56496253 KY |
6383 | static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, |
6384 | const struct hda_fixup *fix, int action) | |
6385 | { | |
6386 | if (action != HDA_FIXUP_ACT_INIT) | |
6387 | return; | |
6388 | ||
6389 | msleep(100); | |
6390 | alc_write_coef_idx(codec, 0x65, 0x0); | |
6391 | } | |
6392 | ||
8a8de09c KY |
6393 | static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, |
6394 | const struct hda_fixup *fix, int action) | |
6395 | { | |
6396 | switch (action) { | |
6397 | case HDA_FIXUP_ACT_INIT: | |
6398 | alc_combo_jack_hp_jd_restart(codec); | |
6399 | break; | |
6400 | } | |
6401 | } | |
6402 | ||
92666d45 KY |
6403 | static void alc_fixup_no_int_mic(struct hda_codec *codec, |
6404 | const struct hda_fixup *fix, int action) | |
6405 | { | |
6406 | struct alc_spec *spec = codec->spec; | |
6407 | ||
6408 | switch (action) { | |
6409 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6410 | /* Mic RING SLEEVE swap for combo jack */ | |
6411 | alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); | |
6412 | spec->no_internal_mic_pin = true; | |
6413 | break; | |
6414 | case HDA_FIXUP_ACT_INIT: | |
6415 | alc_combo_jack_hp_jd_restart(codec); | |
6416 | break; | |
6417 | } | |
6418 | } | |
6419 | ||
d94befbb DB |
6420 | /* GPIO1 = amplifier on/off |
6421 | * GPIO3 = mic mute LED | |
6422 | */ | |
6423 | static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, | |
6424 | const struct hda_fixup *fix, int action) | |
6425 | { | |
6426 | static const hda_nid_t conn[] = { 0x02 }; | |
6427 | ||
6428 | struct alc_spec *spec = codec->spec; | |
6429 | static const struct hda_pintbl pincfgs[] = { | |
6430 | { 0x14, 0x90170110 }, /* front/high speakers */ | |
6431 | { 0x17, 0x90170130 }, /* back/bass speakers */ | |
6432 | { } | |
6433 | }; | |
6434 | ||
6435 | //enable micmute led | |
6436 | alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04); | |
6437 | ||
6438 | switch (action) { | |
6439 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6440 | spec->micmute_led_polarity = 1; | |
6441 | /* needed for amp of back speakers */ | |
6442 | spec->gpio_mask |= 0x01; | |
6443 | spec->gpio_dir |= 0x01; | |
6444 | snd_hda_apply_pincfgs(codec, pincfgs); | |
6445 | /* share DAC to have unified volume control */ | |
6446 | snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); | |
6447 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
6448 | break; | |
6449 | case HDA_FIXUP_ACT_INIT: | |
6450 | /* need to toggle GPIO to enable the amp of back speakers */ | |
6451 | alc_update_gpio_data(codec, 0x01, true); | |
6452 | msleep(100); | |
6453 | alc_update_gpio_data(codec, 0x01, false); | |
6454 | break; | |
6455 | } | |
6456 | } | |
6457 | ||
434591b2 ED |
6458 | static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, |
6459 | const struct hda_fixup *fix, int action) | |
6460 | { | |
6461 | static const hda_nid_t conn[] = { 0x02 }; | |
6462 | static const struct hda_pintbl pincfgs[] = { | |
6463 | { 0x14, 0x90170110 }, /* rear speaker */ | |
6464 | { } | |
6465 | }; | |
6466 | ||
6467 | switch (action) { | |
6468 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6469 | snd_hda_apply_pincfgs(codec, pincfgs); | |
6470 | /* force front speaker to DAC1 */ | |
6471 | snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); | |
6472 | break; | |
6473 | } | |
6474 | } | |
6475 | ||
b317b032 TI |
6476 | /* for hda_fixup_thinkpad_acpi() */ |
6477 | #include "thinkpad_helper.c" | |
b67ae3f1 | 6478 | |
d5a6cabf TI |
6479 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
6480 | const struct hda_fixup *fix, int action) | |
6481 | { | |
6482 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ | |
6483 | hda_fixup_thinkpad_acpi(codec, fix, action); | |
6484 | } | |
6485 | ||
ad7cc2d4 CB |
6486 | /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */ |
6487 | static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec, | |
6488 | const struct hda_fixup *fix, | |
6489 | int action) | |
6490 | { | |
6491 | struct alc_spec *spec = codec->spec; | |
6492 | ||
6493 | switch (action) { | |
6494 | case HDA_FIXUP_ACT_PRE_PROBE: | |
6495 | spec->gen.suppress_auto_mute = 1; | |
6496 | break; | |
6497 | } | |
6498 | } | |
6499 | ||
bbf8ff6b TB |
6500 | /* for alc295_fixup_hp_top_speakers */ |
6501 | #include "hp_x360_helper.c" | |
6502 | ||
26928ca1 TI |
6503 | /* for alc285_fixup_ideapad_s740_coef() */ |
6504 | #include "ideapad_s740_helper.c" | |
6505 | ||
dd6dd6e3 WS |
6506 | static void alc256_fixup_tongfang_reset_persistent_settings(struct hda_codec *codec, |
6507 | const struct hda_fixup *fix, | |
6508 | int action) | |
6509 | { | |
6510 | /* | |
6511 | * A certain other OS sets these coeffs to different values. On at least one TongFang | |
6512 | * barebone these settings might survive even a cold reboot. So to restore a clean slate the | |
6513 | * values are explicitly reset to default here. Without this, the external microphone is | |
6514 | * always in a plugged-in state, while the internal microphone is always in an unplugged | |
6515 | * state, breaking the ability to use the internal microphone. | |
6516 | */ | |
6517 | alc_write_coef_idx(codec, 0x24, 0x0000); | |
6518 | alc_write_coef_idx(codec, 0x26, 0x0000); | |
6519 | alc_write_coef_idx(codec, 0x29, 0x3000); | |
6520 | alc_write_coef_idx(codec, 0x37, 0xfe05); | |
6521 | alc_write_coef_idx(codec, 0x45, 0x5089); | |
6522 | } | |
6523 | ||
e1abacd3 WS |
6524 | static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = { |
6525 | WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06), | |
6526 | WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074), | |
6527 | WRITE_COEF(0x49, 0x0149), | |
6528 | {} | |
6529 | }; | |
6530 | ||
6531 | static void alc233_fixup_no_audio_jack(struct hda_codec *codec, | |
6532 | const struct hda_fixup *fix, | |
6533 | int action) | |
6534 | { | |
6535 | /* | |
6536 | * The audio jack input and output is not detected on the ASRock NUC Box | |
6537 | * 1100 series when cold booting without this fix. Warm rebooting from a | |
6538 | * certain other OS makes the audio functional, as COEF settings are | |
6539 | * preserved in this case. This fix sets these altered COEF values as | |
6540 | * the default. | |
6541 | */ | |
6542 | alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs); | |
6543 | } | |
6544 | ||
1d045db9 | 6545 | enum { |
f73bbf63 | 6546 | ALC269_FIXUP_GPIO2, |
1d045db9 TI |
6547 | ALC269_FIXUP_SONY_VAIO, |
6548 | ALC275_FIXUP_SONY_VAIO_GPIO2, | |
6549 | ALC269_FIXUP_DELL_M101Z, | |
6550 | ALC269_FIXUP_SKU_IGNORE, | |
6551 | ALC269_FIXUP_ASUS_G73JW, | |
6552 | ALC269_FIXUP_LENOVO_EAPD, | |
6553 | ALC275_FIXUP_SONY_HWEQ, | |
e9bd7d5c | 6554 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
1d045db9 | 6555 | ALC271_FIXUP_DMIC, |
017f2a10 | 6556 | ALC269_FIXUP_PCM_44K, |
adabb3ec | 6557 | ALC269_FIXUP_STEREO_DMIC, |
7c478f03 | 6558 | ALC269_FIXUP_HEADSET_MIC, |
24519911 TI |
6559 | ALC269_FIXUP_QUANTA_MUTE, |
6560 | ALC269_FIXUP_LIFEBOOK, | |
2041d564 | 6561 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
cc7016ab | 6562 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
4df3fd17 | 6563 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
fdcc968a | 6564 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
a4297b5d TI |
6565 | ALC269_FIXUP_AMIC, |
6566 | ALC269_FIXUP_DMIC, | |
6567 | ALC269VB_FIXUP_AMIC, | |
6568 | ALC269VB_FIXUP_DMIC, | |
08fb0d0e | 6569 | ALC269_FIXUP_HP_MUTE_LED, |
d06ac143 | 6570 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
08fb0d0e | 6571 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
7f783bd5 | 6572 | ALC269_FIXUP_HP_MUTE_LED_MIC3, |
9f5c6faf | 6573 | ALC269_FIXUP_HP_GPIO_LED, |
9c5dc3bf KY |
6574 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
6575 | ALC269_FIXUP_HP_LINE1_MIC1_LED, | |
693b613d | 6576 | ALC269_FIXUP_INV_DMIC, |
108cc108 | 6577 | ALC269_FIXUP_LENOVO_DOCK, |
b590b38c | 6578 | ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, |
9b745ab8 | 6579 | ALC269_FIXUP_NO_SHUTUP, |
88cfcf86 | 6580 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
108cc108 | 6581 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
73bdd597 DH |
6582 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
6583 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, | |
338cae56 | 6584 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
fcc6c877 | 6585 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
73bdd597 DH |
6586 | ALC269_FIXUP_HEADSET_MODE, |
6587 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, | |
7819717b | 6588 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
d240d1dc DH |
6589 | ALC269_FIXUP_ASUS_X101_FUNC, |
6590 | ALC269_FIXUP_ASUS_X101_VERB, | |
6591 | ALC269_FIXUP_ASUS_X101, | |
08a978db DR |
6592 | ALC271_FIXUP_AMIC_MIC2, |
6593 | ALC271_FIXUP_HP_GATE_MIC_JACK, | |
b1e8972e | 6594 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
42397004 | 6595 | ALC269_FIXUP_ACER_AC700, |
3e0d611b | 6596 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
2cede303 | 6597 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
23870831 | 6598 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
8e35cd4a | 6599 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
02b504d9 | 6600 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
cd217a63 | 6601 | ALC283_FIXUP_CHROME_BOOK, |
0202e99c | 6602 | ALC283_FIXUP_SENSE_COMBO_JACK, |
7bba2157 | 6603 | ALC282_FIXUP_ASUS_TX300, |
1bb3e062 | 6604 | ALC283_FIXUP_INT_MIC, |
338cae56 | 6605 | ALC290_FIXUP_MONO_SPEAKERS, |
0f4881dc DH |
6606 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
6607 | ALC290_FIXUP_SUBWOOFER, | |
6608 | ALC290_FIXUP_SUBWOOFER_HSJACK, | |
b67ae3f1 | 6609 | ALC269_FIXUP_THINKPAD_ACPI, |
56f27013 | 6610 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
5824ce8d | 6611 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
615966ad | 6612 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
9a22a8f5 | 6613 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
31278997 | 6614 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
9a22a8f5 | 6615 | ALC255_FIXUP_HEADSET_MODE, |
31278997 | 6616 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
a22aa26f | 6617 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
1c37c223 | 6618 | ALC292_FIXUP_TPT440_DOCK, |
9a811230 | 6619 | ALC292_FIXUP_TPT440, |
abaa2274 | 6620 | ALC283_FIXUP_HEADSET_MIC, |
b3802783 | 6621 | ALC255_FIXUP_MIC_MUTE_LED, |
1a22e775 | 6622 | ALC282_FIXUP_ASPIRE_V5_PINS, |
c8426b27 | 6623 | ALC269VB_FIXUP_ASPIRE_E1_COEF, |
7a5255f1 | 6624 | ALC280_FIXUP_HP_GPIO4, |
eaa8e5ef | 6625 | ALC286_FIXUP_HP_GPIO_LED, |
33f4acd3 | 6626 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
b4b33f9d | 6627 | ALC280_FIXUP_HP_DOCK_PINS, |
04d5466a | 6628 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
98973f2f | 6629 | ALC280_FIXUP_HP_9480M, |
c3bb2b52 | 6630 | ALC245_FIXUP_HP_X360_AMP, |
d94befbb | 6631 | ALC285_FIXUP_HP_SPECTRE_X360_EB1, |
e1e62b98 KY |
6632 | ALC288_FIXUP_DELL_HEADSET_MODE, |
6633 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, | |
831bfdf9 HW |
6634 | ALC288_FIXUP_DELL_XPS_13, |
6635 | ALC288_FIXUP_DISABLE_AAMIX, | |
5fab5829 | 6636 | ALC292_FIXUP_DELL_E7X_AAMIX, |
8b99aba7 TI |
6637 | ALC292_FIXUP_DELL_E7X, |
6638 | ALC292_FIXUP_DISABLE_AAMIX, | |
c04017ea | 6639 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
54324221 | 6640 | ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
977e6276 | 6641 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
2f726aec | 6642 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
6ed1131f | 6643 | ALC275_FIXUP_DELL_XPS, |
23adc192 | 6644 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
3694cb29 | 6645 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
3b43b71f | 6646 | ALC255_FIXUP_DELL_SPK_NOISE, |
d1dd4211 | 6647 | ALC225_FIXUP_DISABLE_MIC_VREF, |
2ae95577 | 6648 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
e312a869 | 6649 | ALC295_FIXUP_DISABLE_DAC3, |
d2cd795c | 6650 | ALC285_FIXUP_SPEAKER2_TO_DAC1, |
f883982d | 6651 | ALC280_FIXUP_HP_HEADSET_MIC, |
e549d190 | 6652 | ALC221_FIXUP_HP_FRONT_MIC, |
c636b95e | 6653 | ALC292_FIXUP_TPT460, |
dd9aa335 | 6654 | ALC298_FIXUP_SPK_VOLUME, |
f86de9b1 | 6655 | ALC298_FIXUP_LENOVO_SPK_VOLUME, |
fd06c77e | 6656 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
823ff161 | 6657 | ALC269_FIXUP_ATIV_BOOK_8, |
9eb5d0e6 | 6658 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
c1732ede CC |
6659 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
6660 | ALC256_FIXUP_ASUS_MIC, | |
eeed4cd1 | 6661 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
216d7aeb CC |
6662 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
6663 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, | |
ca169cc2 | 6664 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
ea5c7eba | 6665 | ALC233_FIXUP_ACER_HEADSET_MIC, |
f33f79f3 | 6666 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
5f364135 | 6667 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
52e4e368 | 6668 | ALC225_FIXUP_S3_POP_NOISE, |
b84e8436 | 6669 | ALC700_FIXUP_INTEL_REFERENCE, |
92266651 KY |
6670 | ALC274_FIXUP_DELL_BIND_DACS, |
6671 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, | |
399c01aa | 6672 | ALC298_FIXUP_TPT470_DOCK_FIX, |
61fcf8ec | 6673 | ALC298_FIXUP_TPT470_DOCK, |
ae104a21 | 6674 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
f0ba9d69 | 6675 | ALC255_FIXUP_DELL_HEADSET_MIC, |
0fbf21c3 | 6676 | ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, |
a2ef03fe | 6677 | ALC298_FIXUP_HUAWEI_MBX_STEREO, |
bbf8ff6b | 6678 | ALC295_FIXUP_HP_X360, |
8a328ac1 | 6679 | ALC221_FIXUP_HP_HEADSET_MIC, |
c4cfcf6f | 6680 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
e8ed64b0 | 6681 | ALC295_FIXUP_HP_AUTO_MUTE, |
33aaebd4 | 6682 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
d8ae458e | 6683 | ALC294_FIXUP_ASUS_MIC, |
4e051106 JHP |
6684 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
6685 | ALC294_FIXUP_ASUS_SPK, | |
89e3a568 | 6686 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
c8c6ee61 | 6687 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
cbc05fd6 | 6688 | ALC255_FIXUP_ACER_HEADSET_MIC, |
10f5b1b8 | 6689 | ALC295_FIXUP_CHROME_BOOK, |
8983eb60 | 6690 | ALC225_FIXUP_HEADSET_JACK, |
136824ef KY |
6691 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
6692 | ALC225_FIXUP_WYSE_AUTO_MUTE, | |
6693 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, | |
667a8f73 | 6694 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
8c8967a7 | 6695 | ALC256_FIXUP_ASUS_HEADSET_MIC, |
e1037354 | 6696 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
e2a829b3 | 6697 | ALC299_FIXUP_PREDATOR_SPK, |
bd9c10bc | 6698 | ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, |
e79c2269 KY |
6699 | ALC289_FIXUP_DELL_SPK2, |
6700 | ALC289_FIXUP_DUAL_SPK, | |
48e01504 CC |
6701 | ALC294_FIXUP_SPK2_TO_DAC1, |
6702 | ALC294_FIXUP_ASUS_DUAL_SPK, | |
6a6660d0 | 6703 | ALC285_FIXUP_THINKPAD_X1_GEN7, |
76f7dec0 | 6704 | ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
8b33a134 | 6705 | ALC294_FIXUP_ASUS_HPE, |
1b94e59d | 6706 | ALC294_FIXUP_ASUS_COEF_1B, |
c3cdf189 LJ |
6707 | ALC294_FIXUP_ASUS_GX502_HP, |
6708 | ALC294_FIXUP_ASUS_GX502_PINS, | |
6709 | ALC294_FIXUP_ASUS_GX502_VERBS, | |
c1b55029 DC |
6710 | ALC294_FIXUP_ASUS_GU502_HP, |
6711 | ALC294_FIXUP_ASUS_GU502_PINS, | |
6712 | ALC294_FIXUP_ASUS_GU502_VERBS, | |
f5a88b0a | 6713 | ALC285_FIXUP_HP_GPIO_LED, |
431e76c3 | 6714 | ALC285_FIXUP_HP_MUTE_LED, |
e7d66cf7 | 6715 | ALC236_FIXUP_HP_GPIO_LED, |
24164f43 | 6716 | ALC236_FIXUP_HP_MUTE_LED, |
75b62ab6 | 6717 | ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, |
14425f1f | 6718 | ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, |
9e43342b | 6719 | ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
8eae7e9b | 6720 | ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, |
6e15d126 | 6721 | ALC269VC_FIXUP_ACER_HEADSET_MIC, |
781c90c0 | 6722 | ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, |
293a92c1 | 6723 | ALC289_FIXUP_ASUS_GA401, |
4b43d05a | 6724 | ALC289_FIXUP_ASUS_GA502, |
f50a121d | 6725 | ALC256_FIXUP_ACER_MIC_NO_PRESENCE, |
56496253 | 6726 | ALC285_FIXUP_HP_GPIO_AMP_INIT, |
f1ec5be1 HC |
6727 | ALC269_FIXUP_CZC_B20, |
6728 | ALC269_FIXUP_CZC_TMI, | |
6729 | ALC269_FIXUP_CZC_L101, | |
6730 | ALC269_FIXUP_LEMOTE_A1802, | |
6731 | ALC269_FIXUP_LEMOTE_A190X, | |
e2d2fded | 6732 | ALC256_FIXUP_INTEL_NUC8_RUGGED, |
d1ee66c5 PC |
6733 | ALC233_FIXUP_INTEL_NUC8_DMIC, |
6734 | ALC233_FIXUP_INTEL_NUC8_BOOST, | |
73e7161e | 6735 | ALC256_FIXUP_INTEL_NUC10, |
fc19d559 | 6736 | ALC255_FIXUP_XIAOMI_HEADSET_MIC, |
13468bfa | 6737 | ALC274_FIXUP_HP_MIC, |
8a8de09c | 6738 | ALC274_FIXUP_HP_HEADSET_MIC, |
622464c8 | 6739 | ALC274_FIXUP_HP_ENVY_GPIO, |
ef9ce66f | 6740 | ALC256_FIXUP_ASUS_HPE, |
446b8185 | 6741 | ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, |
a0ccbc53 | 6742 | ALC287_FIXUP_HP_GPIO_LED, |
9e885770 | 6743 | ALC256_FIXUP_HP_HEADSET_MIC, |
c47b3112 | 6744 | ALC245_FIXUP_HP_GPIO_LED, |
92666d45 | 6745 | ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
34cdf405 | 6746 | ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
495dc763 | 6747 | ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST, |
d0e18561 | 6748 | ALC256_FIXUP_ACER_HEADSET_MIC, |
26928ca1 | 6749 | ALC285_FIXUP_IDEAPAD_S740_COEF, |
bd15b155 | 6750 | ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST, |
8eedd3a7 | 6751 | ALC295_FIXUP_ASUS_DACS, |
5d84b531 | 6752 | ALC295_FIXUP_HP_OMEN, |
f2be77fe | 6753 | ALC285_FIXUP_HP_SPECTRE_X360, |
9ebaef05 | 6754 | ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, |
29c8f40b | 6755 | ALC623_FIXUP_LENOVO_THINKSTATION_P340, |
57c9e21a | 6756 | ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, |
8903376d | 6757 | ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST, |
ad7cc2d4 CB |
6758 | ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS, |
6759 | ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, | |
6760 | ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, | |
dd6dd6e3 WS |
6761 | ALC287_FIXUP_13S_GEN2_SPEAKERS, |
6762 | ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS, | |
4803b99a | 6763 | ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
e1abacd3 | 6764 | ALC233_FIXUP_NO_AUDIO_JACK, |
f1d4e28b KY |
6765 | }; |
6766 | ||
1727a771 | 6767 | static const struct hda_fixup alc269_fixups[] = { |
f73bbf63 KHF |
6768 | [ALC269_FIXUP_GPIO2] = { |
6769 | .type = HDA_FIXUP_FUNC, | |
6770 | .v.func = alc_fixup_gpio2, | |
6771 | }, | |
1d045db9 | 6772 | [ALC269_FIXUP_SONY_VAIO] = { |
fd108215 TI |
6773 | .type = HDA_FIXUP_PINCTLS, |
6774 | .v.pins = (const struct hda_pintbl[]) { | |
6775 | {0x19, PIN_VREFGRD}, | |
1d045db9 TI |
6776 | {} |
6777 | } | |
f1d4e28b | 6778 | }, |
1d045db9 | 6779 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
ae065f1c TI |
6780 | .type = HDA_FIXUP_FUNC, |
6781 | .v.func = alc275_fixup_gpio4_off, | |
1d045db9 TI |
6782 | .chained = true, |
6783 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
6784 | }, | |
6785 | [ALC269_FIXUP_DELL_M101Z] = { | |
1727a771 | 6786 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
6787 | .v.verbs = (const struct hda_verb[]) { |
6788 | /* Enables internal speaker */ | |
6789 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, | |
6790 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, | |
6791 | {} | |
6792 | } | |
6793 | }, | |
6794 | [ALC269_FIXUP_SKU_IGNORE] = { | |
1727a771 | 6795 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 6796 | .v.func = alc_fixup_sku_ignore, |
1d045db9 TI |
6797 | }, |
6798 | [ALC269_FIXUP_ASUS_G73JW] = { | |
1727a771 TI |
6799 | .type = HDA_FIXUP_PINS, |
6800 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
6801 | { 0x17, 0x99130111 }, /* subwoofer */ |
6802 | { } | |
6803 | } | |
6804 | }, | |
6805 | [ALC269_FIXUP_LENOVO_EAPD] = { | |
1727a771 | 6806 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
6807 | .v.verbs = (const struct hda_verb[]) { |
6808 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
6809 | {} | |
6810 | } | |
6811 | }, | |
6812 | [ALC275_FIXUP_SONY_HWEQ] = { | |
1727a771 | 6813 | .type = HDA_FIXUP_FUNC, |
1d045db9 TI |
6814 | .v.func = alc269_fixup_hweq, |
6815 | .chained = true, | |
6816 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 | |
6817 | }, | |
e9bd7d5c TI |
6818 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
6819 | .type = HDA_FIXUP_FUNC, | |
6820 | .v.func = alc_fixup_disable_aamix, | |
6821 | .chained = true, | |
6822 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
6823 | }, | |
1d045db9 | 6824 | [ALC271_FIXUP_DMIC] = { |
1727a771 | 6825 | .type = HDA_FIXUP_FUNC, |
1d045db9 | 6826 | .v.func = alc271_fixup_dmic, |
f1d4e28b | 6827 | }, |
017f2a10 | 6828 | [ALC269_FIXUP_PCM_44K] = { |
1727a771 | 6829 | .type = HDA_FIXUP_FUNC, |
017f2a10 | 6830 | .v.func = alc269_fixup_pcm_44k, |
012e7eb1 DH |
6831 | .chained = true, |
6832 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
017f2a10 | 6833 | }, |
adabb3ec | 6834 | [ALC269_FIXUP_STEREO_DMIC] = { |
1727a771 | 6835 | .type = HDA_FIXUP_FUNC, |
adabb3ec TI |
6836 | .v.func = alc269_fixup_stereo_dmic, |
6837 | }, | |
7c478f03 DH |
6838 | [ALC269_FIXUP_HEADSET_MIC] = { |
6839 | .type = HDA_FIXUP_FUNC, | |
6840 | .v.func = alc269_fixup_headset_mic, | |
6841 | }, | |
24519911 | 6842 | [ALC269_FIXUP_QUANTA_MUTE] = { |
1727a771 | 6843 | .type = HDA_FIXUP_FUNC, |
24519911 TI |
6844 | .v.func = alc269_fixup_quanta_mute, |
6845 | }, | |
6846 | [ALC269_FIXUP_LIFEBOOK] = { | |
1727a771 TI |
6847 | .type = HDA_FIXUP_PINS, |
6848 | .v.pins = (const struct hda_pintbl[]) { | |
24519911 TI |
6849 | { 0x1a, 0x2101103f }, /* dock line-out */ |
6850 | { 0x1b, 0x23a11040 }, /* dock mic-in */ | |
6851 | { } | |
6852 | }, | |
6853 | .chained = true, | |
6854 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
6855 | }, | |
2041d564 DH |
6856 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
6857 | .type = HDA_FIXUP_PINS, | |
6858 | .v.pins = (const struct hda_pintbl[]) { | |
6859 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ | |
6860 | { } | |
6861 | }, | |
6862 | }, | |
cc7016ab TI |
6863 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
6864 | .type = HDA_FIXUP_PINS, | |
6865 | .v.pins = (const struct hda_pintbl[]) { | |
6866 | { 0x21, 0x0221102f }, /* HP out */ | |
6867 | { } | |
6868 | }, | |
6869 | }, | |
4df3fd17 TI |
6870 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
6871 | .type = HDA_FIXUP_FUNC, | |
6872 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, | |
6873 | }, | |
fdcc968a JMG |
6874 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
6875 | .type = HDA_FIXUP_FUNC, | |
6876 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, | |
6877 | }, | |
a4297b5d | 6878 | [ALC269_FIXUP_AMIC] = { |
1727a771 TI |
6879 | .type = HDA_FIXUP_PINS, |
6880 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6881 | { 0x14, 0x99130110 }, /* speaker */ |
6882 | { 0x15, 0x0121401f }, /* HP out */ | |
6883 | { 0x18, 0x01a19c20 }, /* mic */ | |
6884 | { 0x19, 0x99a3092f }, /* int-mic */ | |
6885 | { } | |
6886 | }, | |
6887 | }, | |
6888 | [ALC269_FIXUP_DMIC] = { | |
1727a771 TI |
6889 | .type = HDA_FIXUP_PINS, |
6890 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6891 | { 0x12, 0x99a3092f }, /* int-mic */ |
6892 | { 0x14, 0x99130110 }, /* speaker */ | |
6893 | { 0x15, 0x0121401f }, /* HP out */ | |
6894 | { 0x18, 0x01a19c20 }, /* mic */ | |
6895 | { } | |
6896 | }, | |
6897 | }, | |
6898 | [ALC269VB_FIXUP_AMIC] = { | |
1727a771 TI |
6899 | .type = HDA_FIXUP_PINS, |
6900 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6901 | { 0x14, 0x99130110 }, /* speaker */ |
6902 | { 0x18, 0x01a19c20 }, /* mic */ | |
6903 | { 0x19, 0x99a3092f }, /* int-mic */ | |
6904 | { 0x21, 0x0121401f }, /* HP out */ | |
6905 | { } | |
6906 | }, | |
6907 | }, | |
2267ea97 | 6908 | [ALC269VB_FIXUP_DMIC] = { |
1727a771 TI |
6909 | .type = HDA_FIXUP_PINS, |
6910 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
6911 | { 0x12, 0x99a3092f }, /* int-mic */ |
6912 | { 0x14, 0x99130110 }, /* speaker */ | |
6913 | { 0x18, 0x01a19c20 }, /* mic */ | |
6914 | { 0x21, 0x0121401f }, /* HP out */ | |
6915 | { } | |
6916 | }, | |
6917 | }, | |
08fb0d0e | 6918 | [ALC269_FIXUP_HP_MUTE_LED] = { |
1727a771 | 6919 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 6920 | .v.func = alc269_fixup_hp_mute_led, |
6d3cd5d4 | 6921 | }, |
d06ac143 DH |
6922 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
6923 | .type = HDA_FIXUP_FUNC, | |
6924 | .v.func = alc269_fixup_hp_mute_led_mic1, | |
6925 | }, | |
08fb0d0e | 6926 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
1727a771 | 6927 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 6928 | .v.func = alc269_fixup_hp_mute_led_mic2, |
420b0feb | 6929 | }, |
7f783bd5 TB |
6930 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
6931 | .type = HDA_FIXUP_FUNC, | |
6932 | .v.func = alc269_fixup_hp_mute_led_mic3, | |
e8ed64b0 GKK |
6933 | .chained = true, |
6934 | .chain_id = ALC295_FIXUP_HP_AUTO_MUTE | |
7f783bd5 | 6935 | }, |
9f5c6faf TI |
6936 | [ALC269_FIXUP_HP_GPIO_LED] = { |
6937 | .type = HDA_FIXUP_FUNC, | |
6938 | .v.func = alc269_fixup_hp_gpio_led, | |
6939 | }, | |
9c5dc3bf KY |
6940 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
6941 | .type = HDA_FIXUP_FUNC, | |
6942 | .v.func = alc269_fixup_hp_gpio_mic1_led, | |
6943 | }, | |
6944 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { | |
6945 | .type = HDA_FIXUP_FUNC, | |
6946 | .v.func = alc269_fixup_hp_line1_mic1_led, | |
6947 | }, | |
693b613d | 6948 | [ALC269_FIXUP_INV_DMIC] = { |
1727a771 | 6949 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 6950 | .v.func = alc_fixup_inv_dmic, |
693b613d | 6951 | }, |
9b745ab8 TI |
6952 | [ALC269_FIXUP_NO_SHUTUP] = { |
6953 | .type = HDA_FIXUP_FUNC, | |
6954 | .v.func = alc_fixup_no_shutup, | |
6955 | }, | |
108cc108 | 6956 | [ALC269_FIXUP_LENOVO_DOCK] = { |
1727a771 TI |
6957 | .type = HDA_FIXUP_PINS, |
6958 | .v.pins = (const struct hda_pintbl[]) { | |
108cc108 DH |
6959 | { 0x19, 0x23a11040 }, /* dock mic */ |
6960 | { 0x1b, 0x2121103f }, /* dock headphone */ | |
6961 | { } | |
6962 | }, | |
6963 | .chained = true, | |
6964 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT | |
6965 | }, | |
b590b38c TI |
6966 | [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { |
6967 | .type = HDA_FIXUP_FUNC, | |
6968 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6969 | .chained = true, | |
6970 | .chain_id = ALC269_FIXUP_LENOVO_DOCK, | |
6971 | }, | |
108cc108 | 6972 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { |
1727a771 | 6973 | .type = HDA_FIXUP_FUNC, |
108cc108 | 6974 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
52129000 DH |
6975 | .chained = true, |
6976 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
108cc108 | 6977 | }, |
73bdd597 DH |
6978 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6979 | .type = HDA_FIXUP_PINS, | |
6980 | .v.pins = (const struct hda_pintbl[]) { | |
6981 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6982 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6983 | { } | |
6984 | }, | |
6985 | .chained = true, | |
6986 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6987 | }, | |
6988 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { | |
6989 | .type = HDA_FIXUP_PINS, | |
6990 | .v.pins = (const struct hda_pintbl[]) { | |
6991 | { 0x16, 0x21014020 }, /* dock line out */ | |
6992 | { 0x19, 0x21a19030 }, /* dock mic */ | |
6993 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6994 | { } | |
6995 | }, | |
6996 | .chained = true, | |
6997 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6998 | }, | |
338cae56 DH |
6999 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
7000 | .type = HDA_FIXUP_PINS, | |
7001 | .v.pins = (const struct hda_pintbl[]) { | |
7002 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7003 | { } | |
7004 | }, | |
7005 | .chained = true, | |
7006 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7007 | }, | |
fcc6c877 KY |
7008 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
7009 | .type = HDA_FIXUP_PINS, | |
7010 | .v.pins = (const struct hda_pintbl[]) { | |
7011 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7012 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7013 | { } | |
7014 | }, | |
7015 | .chained = true, | |
7016 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7017 | }, | |
73bdd597 DH |
7018 | [ALC269_FIXUP_HEADSET_MODE] = { |
7019 | .type = HDA_FIXUP_FUNC, | |
7020 | .v.func = alc_fixup_headset_mode, | |
6676f308 | 7021 | .chained = true, |
b3802783 | 7022 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
73bdd597 DH |
7023 | }, |
7024 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { | |
7025 | .type = HDA_FIXUP_FUNC, | |
7026 | .v.func = alc_fixup_headset_mode_no_hp_mic, | |
7027 | }, | |
7819717b TI |
7028 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
7029 | .type = HDA_FIXUP_PINS, | |
7030 | .v.pins = (const struct hda_pintbl[]) { | |
7031 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ | |
7032 | { } | |
7033 | }, | |
7034 | .chained = true, | |
7035 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
7036 | }, | |
88cfcf86 DH |
7037 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
7038 | .type = HDA_FIXUP_PINS, | |
7039 | .v.pins = (const struct hda_pintbl[]) { | |
7040 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7041 | { } | |
7042 | }, | |
fbc78ad6 DH |
7043 | .chained = true, |
7044 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
88cfcf86 | 7045 | }, |
0fbf21c3 | 7046 | [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { |
8ac51bbc AB |
7047 | .type = HDA_FIXUP_PINS, |
7048 | .v.pins = (const struct hda_pintbl[]) { | |
7049 | {0x12, 0x90a60130}, | |
7050 | {0x13, 0x40000000}, | |
7051 | {0x14, 0x90170110}, | |
7052 | {0x18, 0x411111f0}, | |
7053 | {0x19, 0x04a11040}, | |
7054 | {0x1a, 0x411111f0}, | |
7055 | {0x1b, 0x90170112}, | |
7056 | {0x1d, 0x40759a05}, | |
7057 | {0x1e, 0x411111f0}, | |
7058 | {0x21, 0x04211020}, | |
7059 | { } | |
7060 | }, | |
e2744fd7 AB |
7061 | .chained = true, |
7062 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED | |
8ac51bbc | 7063 | }, |
a2ef03fe TE |
7064 | [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { |
7065 | .type = HDA_FIXUP_FUNC, | |
7066 | .v.func = alc298_fixup_huawei_mbx_stereo, | |
7067 | .chained = true, | |
7068 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED | |
7069 | }, | |
d240d1dc DH |
7070 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
7071 | .type = HDA_FIXUP_FUNC, | |
7072 | .v.func = alc269_fixup_x101_headset_mic, | |
7073 | }, | |
7074 | [ALC269_FIXUP_ASUS_X101_VERB] = { | |
7075 | .type = HDA_FIXUP_VERBS, | |
7076 | .v.verbs = (const struct hda_verb[]) { | |
7077 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, | |
7078 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, | |
7079 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, | |
7080 | { } | |
7081 | }, | |
7082 | .chained = true, | |
7083 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC | |
7084 | }, | |
7085 | [ALC269_FIXUP_ASUS_X101] = { | |
7086 | .type = HDA_FIXUP_PINS, | |
7087 | .v.pins = (const struct hda_pintbl[]) { | |
7088 | { 0x18, 0x04a1182c }, /* Headset mic */ | |
7089 | { } | |
7090 | }, | |
7091 | .chained = true, | |
7092 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB | |
7093 | }, | |
08a978db | 7094 | [ALC271_FIXUP_AMIC_MIC2] = { |
1727a771 TI |
7095 | .type = HDA_FIXUP_PINS, |
7096 | .v.pins = (const struct hda_pintbl[]) { | |
08a978db DR |
7097 | { 0x14, 0x99130110 }, /* speaker */ |
7098 | { 0x19, 0x01a19c20 }, /* mic */ | |
7099 | { 0x1b, 0x99a7012f }, /* int-mic */ | |
7100 | { 0x21, 0x0121401f }, /* HP out */ | |
7101 | { } | |
7102 | }, | |
7103 | }, | |
7104 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { | |
1727a771 | 7105 | .type = HDA_FIXUP_FUNC, |
08a978db DR |
7106 | .v.func = alc271_hp_gate_mic_jack, |
7107 | .chained = true, | |
7108 | .chain_id = ALC271_FIXUP_AMIC_MIC2, | |
7109 | }, | |
b1e8972e OR |
7110 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
7111 | .type = HDA_FIXUP_FUNC, | |
7112 | .v.func = alc269_fixup_limit_int_mic_boost, | |
7113 | .chained = true, | |
7114 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, | |
7115 | }, | |
42397004 DR |
7116 | [ALC269_FIXUP_ACER_AC700] = { |
7117 | .type = HDA_FIXUP_PINS, | |
7118 | .v.pins = (const struct hda_pintbl[]) { | |
7119 | { 0x12, 0x99a3092f }, /* int-mic */ | |
7120 | { 0x14, 0x99130110 }, /* speaker */ | |
7121 | { 0x18, 0x03a11c20 }, /* mic */ | |
7122 | { 0x1e, 0x0346101e }, /* SPDIF1 */ | |
7123 | { 0x21, 0x0321101f }, /* HP out */ | |
7124 | { } | |
7125 | }, | |
7126 | .chained = true, | |
7127 | .chain_id = ALC271_FIXUP_DMIC, | |
7128 | }, | |
3e0d611b DH |
7129 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
7130 | .type = HDA_FIXUP_FUNC, | |
7131 | .v.func = alc269_fixup_limit_int_mic_boost, | |
2793769f DH |
7132 | .chained = true, |
7133 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
3e0d611b | 7134 | }, |
2cede303 OR |
7135 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
7136 | .type = HDA_FIXUP_FUNC, | |
7137 | .v.func = alc269_fixup_limit_int_mic_boost, | |
7138 | .chained = true, | |
7139 | .chain_id = ALC269VB_FIXUP_DMIC, | |
7140 | }, | |
23870831 TI |
7141 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
7142 | .type = HDA_FIXUP_VERBS, | |
7143 | .v.verbs = (const struct hda_verb[]) { | |
7144 | /* class-D output amp +5dB */ | |
7145 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, | |
7146 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, | |
7147 | {} | |
7148 | }, | |
7149 | .chained = true, | |
7150 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, | |
7151 | }, | |
8e35cd4a DH |
7152 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
7153 | .type = HDA_FIXUP_FUNC, | |
7154 | .v.func = alc269_fixup_limit_int_mic_boost, | |
7155 | .chained = true, | |
7156 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
7157 | }, | |
02b504d9 AA |
7158 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
7159 | .type = HDA_FIXUP_PINS, | |
7160 | .v.pins = (const struct hda_pintbl[]) { | |
7161 | { 0x12, 0x99a3092f }, /* int-mic */ | |
7162 | { 0x18, 0x03a11d20 }, /* mic */ | |
7163 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ | |
7164 | { } | |
7165 | }, | |
7166 | }, | |
cd217a63 KY |
7167 | [ALC283_FIXUP_CHROME_BOOK] = { |
7168 | .type = HDA_FIXUP_FUNC, | |
7169 | .v.func = alc283_fixup_chromebook, | |
7170 | }, | |
0202e99c KY |
7171 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
7172 | .type = HDA_FIXUP_FUNC, | |
7173 | .v.func = alc283_fixup_sense_combo_jack, | |
7174 | .chained = true, | |
7175 | .chain_id = ALC283_FIXUP_CHROME_BOOK, | |
7176 | }, | |
7bba2157 TI |
7177 | [ALC282_FIXUP_ASUS_TX300] = { |
7178 | .type = HDA_FIXUP_FUNC, | |
7179 | .v.func = alc282_fixup_asus_tx300, | |
7180 | }, | |
1bb3e062 KY |
7181 | [ALC283_FIXUP_INT_MIC] = { |
7182 | .type = HDA_FIXUP_VERBS, | |
7183 | .v.verbs = (const struct hda_verb[]) { | |
7184 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, | |
7185 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, | |
7186 | { } | |
7187 | }, | |
7188 | .chained = true, | |
7189 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
7190 | }, | |
0f4881dc DH |
7191 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
7192 | .type = HDA_FIXUP_PINS, | |
7193 | .v.pins = (const struct hda_pintbl[]) { | |
7194 | { 0x17, 0x90170112 }, /* subwoofer */ | |
7195 | { } | |
7196 | }, | |
7197 | .chained = true, | |
7198 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, | |
7199 | }, | |
7200 | [ALC290_FIXUP_SUBWOOFER] = { | |
7201 | .type = HDA_FIXUP_PINS, | |
7202 | .v.pins = (const struct hda_pintbl[]) { | |
7203 | { 0x17, 0x90170112 }, /* subwoofer */ | |
7204 | { } | |
7205 | }, | |
7206 | .chained = true, | |
7207 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, | |
7208 | }, | |
338cae56 DH |
7209 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
7210 | .type = HDA_FIXUP_FUNC, | |
7211 | .v.func = alc290_fixup_mono_speakers, | |
0f4881dc DH |
7212 | }, |
7213 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { | |
7214 | .type = HDA_FIXUP_FUNC, | |
7215 | .v.func = alc290_fixup_mono_speakers, | |
338cae56 DH |
7216 | .chained = true, |
7217 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, | |
7218 | }, | |
b67ae3f1 DH |
7219 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
7220 | .type = HDA_FIXUP_FUNC, | |
d5a6cabf | 7221 | .v.func = alc_fixup_thinkpad_acpi, |
09da111a TI |
7222 | .chained = true, |
7223 | .chain_id = ALC269_FIXUP_SKU_IGNORE, | |
b67ae3f1 | 7224 | }, |
56f27013 DH |
7225 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
7226 | .type = HDA_FIXUP_FUNC, | |
7227 | .v.func = alc_fixup_inv_dmic, | |
7228 | .chained = true, | |
7229 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
7230 | }, | |
5824ce8d | 7231 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
17d30460 HW |
7232 | .type = HDA_FIXUP_PINS, |
7233 | .v.pins = (const struct hda_pintbl[]) { | |
7234 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7235 | { } | |
5824ce8d CC |
7236 | }, |
7237 | .chained = true, | |
17d30460 | 7238 | .chain_id = ALC255_FIXUP_HEADSET_MODE |
5824ce8d | 7239 | }, |
615966ad CC |
7240 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7241 | .type = HDA_FIXUP_PINS, | |
7242 | .v.pins = (const struct hda_pintbl[]) { | |
7243 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7244 | { } | |
7245 | }, | |
7246 | .chained = true, | |
7247 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
7248 | }, | |
9a22a8f5 KY |
7249 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7250 | .type = HDA_FIXUP_PINS, | |
7251 | .v.pins = (const struct hda_pintbl[]) { | |
7252 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7253 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7254 | { } | |
7255 | }, | |
7256 | .chained = true, | |
7257 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
7258 | }, | |
31278997 KY |
7259 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
7260 | .type = HDA_FIXUP_PINS, | |
7261 | .v.pins = (const struct hda_pintbl[]) { | |
7262 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7263 | { } | |
7264 | }, | |
7265 | .chained = true, | |
7266 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7267 | }, | |
9a22a8f5 KY |
7268 | [ALC255_FIXUP_HEADSET_MODE] = { |
7269 | .type = HDA_FIXUP_FUNC, | |
7270 | .v.func = alc_fixup_headset_mode_alc255, | |
4a83d42a | 7271 | .chained = true, |
b3802783 | 7272 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
9a22a8f5 | 7273 | }, |
31278997 KY |
7274 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
7275 | .type = HDA_FIXUP_FUNC, | |
7276 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, | |
7277 | }, | |
a22aa26f KY |
7278 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7279 | .type = HDA_FIXUP_PINS, | |
7280 | .v.pins = (const struct hda_pintbl[]) { | |
7281 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7282 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7283 | { } | |
7284 | }, | |
7285 | .chained = true, | |
7286 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7287 | }, | |
1c37c223 | 7288 | [ALC292_FIXUP_TPT440_DOCK] = { |
ec56af67 | 7289 | .type = HDA_FIXUP_FUNC, |
7f57d803 | 7290 | .v.func = alc_fixup_tpt440_dock, |
1c37c223 TI |
7291 | .chained = true, |
7292 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
7293 | }, | |
9a811230 TI |
7294 | [ALC292_FIXUP_TPT440] = { |
7295 | .type = HDA_FIXUP_FUNC, | |
157f0b7f | 7296 | .v.func = alc_fixup_disable_aamix, |
9a811230 TI |
7297 | .chained = true, |
7298 | .chain_id = ALC292_FIXUP_TPT440_DOCK, | |
7299 | }, | |
abaa2274 | 7300 | [ALC283_FIXUP_HEADSET_MIC] = { |
9dc12862 DD |
7301 | .type = HDA_FIXUP_PINS, |
7302 | .v.pins = (const struct hda_pintbl[]) { | |
7303 | { 0x19, 0x04a110f0 }, | |
7304 | { }, | |
7305 | }, | |
7306 | }, | |
b3802783 | 7307 | [ALC255_FIXUP_MIC_MUTE_LED] = { |
00ef9940 | 7308 | .type = HDA_FIXUP_FUNC, |
8a503555 | 7309 | .v.func = alc_fixup_micmute_led, |
00ef9940 | 7310 | }, |
1a22e775 TI |
7311 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
7312 | .type = HDA_FIXUP_PINS, | |
7313 | .v.pins = (const struct hda_pintbl[]) { | |
7314 | { 0x12, 0x90a60130 }, | |
7315 | { 0x14, 0x90170110 }, | |
7316 | { 0x17, 0x40000008 }, | |
7317 | { 0x18, 0x411111f0 }, | |
0420694d | 7318 | { 0x19, 0x01a1913c }, |
1a22e775 TI |
7319 | { 0x1a, 0x411111f0 }, |
7320 | { 0x1b, 0x411111f0 }, | |
7321 | { 0x1d, 0x40f89b2d }, | |
7322 | { 0x1e, 0x411111f0 }, | |
7323 | { 0x21, 0x0321101f }, | |
7324 | { }, | |
7325 | }, | |
7326 | }, | |
c8426b27 TI |
7327 | [ALC269VB_FIXUP_ASPIRE_E1_COEF] = { |
7328 | .type = HDA_FIXUP_FUNC, | |
7329 | .v.func = alc269vb_fixup_aspire_e1_coef, | |
7330 | }, | |
7a5255f1 DH |
7331 | [ALC280_FIXUP_HP_GPIO4] = { |
7332 | .type = HDA_FIXUP_FUNC, | |
7333 | .v.func = alc280_fixup_hp_gpio4, | |
7334 | }, | |
eaa8e5ef KY |
7335 | [ALC286_FIXUP_HP_GPIO_LED] = { |
7336 | .type = HDA_FIXUP_FUNC, | |
7337 | .v.func = alc286_fixup_hp_gpio_led, | |
7338 | }, | |
33f4acd3 DH |
7339 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
7340 | .type = HDA_FIXUP_FUNC, | |
7341 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, | |
7342 | }, | |
b4b33f9d TC |
7343 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
7344 | .type = HDA_FIXUP_PINS, | |
7345 | .v.pins = (const struct hda_pintbl[]) { | |
7346 | { 0x1b, 0x21011020 }, /* line-out */ | |
7347 | { 0x1a, 0x01a1903c }, /* headset mic */ | |
7348 | { 0x18, 0x2181103f }, /* line-in */ | |
7349 | { }, | |
7350 | }, | |
7351 | .chained = true, | |
7352 | .chain_id = ALC280_FIXUP_HP_GPIO4 | |
7353 | }, | |
04d5466a JK |
7354 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
7355 | .type = HDA_FIXUP_PINS, | |
7356 | .v.pins = (const struct hda_pintbl[]) { | |
7357 | { 0x1b, 0x21011020 }, /* line-out */ | |
7358 | { 0x18, 0x2181103f }, /* line-in */ | |
7359 | { }, | |
7360 | }, | |
7361 | .chained = true, | |
7362 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED | |
7363 | }, | |
98973f2f KP |
7364 | [ALC280_FIXUP_HP_9480M] = { |
7365 | .type = HDA_FIXUP_FUNC, | |
7366 | .v.func = alc280_fixup_hp_9480m, | |
7367 | }, | |
c3bb2b52 TI |
7368 | [ALC245_FIXUP_HP_X360_AMP] = { |
7369 | .type = HDA_FIXUP_FUNC, | |
7370 | .v.func = alc245_fixup_hp_x360_amp, | |
c47b3112 JC |
7371 | .chained = true, |
7372 | .chain_id = ALC245_FIXUP_HP_GPIO_LED | |
c3bb2b52 | 7373 | }, |
e1e62b98 KY |
7374 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
7375 | .type = HDA_FIXUP_FUNC, | |
7376 | .v.func = alc_fixup_headset_mode_dell_alc288, | |
7377 | .chained = true, | |
b3802783 | 7378 | .chain_id = ALC255_FIXUP_MIC_MUTE_LED |
e1e62b98 KY |
7379 | }, |
7380 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { | |
7381 | .type = HDA_FIXUP_PINS, | |
7382 | .v.pins = (const struct hda_pintbl[]) { | |
7383 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7384 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7385 | { } | |
7386 | }, | |
7387 | .chained = true, | |
7388 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE | |
7389 | }, | |
831bfdf9 HW |
7390 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
7391 | .type = HDA_FIXUP_FUNC, | |
7392 | .v.func = alc_fixup_disable_aamix, | |
7393 | .chained = true, | |
d44a6864 | 7394 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE |
831bfdf9 HW |
7395 | }, |
7396 | [ALC288_FIXUP_DELL_XPS_13] = { | |
7397 | .type = HDA_FIXUP_FUNC, | |
7398 | .v.func = alc_fixup_dell_xps13, | |
7399 | .chained = true, | |
7400 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX | |
7401 | }, | |
8b99aba7 TI |
7402 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
7403 | .type = HDA_FIXUP_FUNC, | |
7404 | .v.func = alc_fixup_disable_aamix, | |
831bfdf9 HW |
7405 | .chained = true, |
7406 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE | |
8b99aba7 | 7407 | }, |
c04017ea DH |
7408 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
7409 | .type = HDA_FIXUP_FUNC, | |
7410 | .v.func = alc_fixup_disable_aamix, | |
7411 | .chained = true, | |
7412 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE | |
7413 | }, | |
5fab5829 | 7414 | [ALC292_FIXUP_DELL_E7X_AAMIX] = { |
8b99aba7 TI |
7415 | .type = HDA_FIXUP_FUNC, |
7416 | .v.func = alc_fixup_dell_xps13, | |
7417 | .chained = true, | |
7418 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX | |
7419 | }, | |
5fab5829 TI |
7420 | [ALC292_FIXUP_DELL_E7X] = { |
7421 | .type = HDA_FIXUP_FUNC, | |
8a503555 | 7422 | .v.func = alc_fixup_micmute_led, |
5fab5829 TI |
7423 | /* micmute fixup must be applied at last */ |
7424 | .chained_before = true, | |
7425 | .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, | |
7426 | }, | |
54324221 JM |
7427 | [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { |
7428 | .type = HDA_FIXUP_PINS, | |
7429 | .v.pins = (const struct hda_pintbl[]) { | |
7430 | { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ | |
7431 | { } | |
7432 | }, | |
7433 | .chained_before = true, | |
7434 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
7435 | }, | |
977e6276 KY |
7436 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7437 | .type = HDA_FIXUP_PINS, | |
7438 | .v.pins = (const struct hda_pintbl[]) { | |
7439 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7440 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7441 | { } | |
7442 | }, | |
7443 | .chained = true, | |
7444 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7445 | }, | |
2f726aec HW |
7446 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
7447 | .type = HDA_FIXUP_PINS, | |
7448 | .v.pins = (const struct hda_pintbl[]) { | |
7449 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7450 | { } | |
7451 | }, | |
7452 | .chained = true, | |
7453 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7454 | }, | |
6ed1131f KY |
7455 | [ALC275_FIXUP_DELL_XPS] = { |
7456 | .type = HDA_FIXUP_VERBS, | |
7457 | .v.verbs = (const struct hda_verb[]) { | |
7458 | /* Enables internal speaker */ | |
7459 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, | |
7460 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, | |
7461 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, | |
7462 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, | |
7463 | {} | |
7464 | } | |
7465 | }, | |
23adc192 HW |
7466 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
7467 | .type = HDA_FIXUP_FUNC, | |
7468 | .v.func = alc_fixup_disable_aamix, | |
7469 | .chained = true, | |
7470 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
7471 | }, | |
3694cb29 K |
7472 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
7473 | .type = HDA_FIXUP_FUNC, | |
7474 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, | |
7475 | }, | |
d1ee66c5 PC |
7476 | [ALC233_FIXUP_INTEL_NUC8_DMIC] = { |
7477 | .type = HDA_FIXUP_FUNC, | |
7478 | .v.func = alc_fixup_inv_dmic, | |
7479 | .chained = true, | |
7480 | .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST, | |
7481 | }, | |
7482 | [ALC233_FIXUP_INTEL_NUC8_BOOST] = { | |
7483 | .type = HDA_FIXUP_FUNC, | |
7484 | .v.func = alc269_fixup_limit_int_mic_boost | |
7485 | }, | |
3b43b71f KHF |
7486 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
7487 | .type = HDA_FIXUP_FUNC, | |
7488 | .v.func = alc_fixup_disable_aamix, | |
7489 | .chained = true, | |
7490 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7491 | }, | |
d1dd4211 KY |
7492 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
7493 | .type = HDA_FIXUP_FUNC, | |
7494 | .v.func = alc_fixup_disable_mic_vref, | |
7495 | .chained = true, | |
7496 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
7497 | }, | |
2ae95577 DH |
7498 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
7499 | .type = HDA_FIXUP_VERBS, | |
7500 | .v.verbs = (const struct hda_verb[]) { | |
7501 | /* Disable pass-through path for FRONT 14h */ | |
7502 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
7503 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
7504 | {} | |
7505 | }, | |
7506 | .chained = true, | |
d1dd4211 | 7507 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
2ae95577 | 7508 | }, |
f883982d TI |
7509 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
7510 | .type = HDA_FIXUP_FUNC, | |
7511 | .v.func = alc_fixup_disable_aamix, | |
7512 | .chained = true, | |
7513 | .chain_id = ALC269_FIXUP_HEADSET_MIC, | |
7514 | }, | |
e549d190 HW |
7515 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
7516 | .type = HDA_FIXUP_PINS, | |
7517 | .v.pins = (const struct hda_pintbl[]) { | |
7518 | { 0x19, 0x02a19020 }, /* Front Mic */ | |
7519 | { } | |
7520 | }, | |
7521 | }, | |
c636b95e SE |
7522 | [ALC292_FIXUP_TPT460] = { |
7523 | .type = HDA_FIXUP_FUNC, | |
7524 | .v.func = alc_fixup_tpt440_dock, | |
7525 | .chained = true, | |
7526 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, | |
7527 | }, | |
dd9aa335 HW |
7528 | [ALC298_FIXUP_SPK_VOLUME] = { |
7529 | .type = HDA_FIXUP_FUNC, | |
7530 | .v.func = alc298_fixup_speaker_volume, | |
59ec4b57 | 7531 | .chained = true, |
2f726aec | 7532 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
dd9aa335 | 7533 | }, |
f86de9b1 KY |
7534 | [ALC298_FIXUP_LENOVO_SPK_VOLUME] = { |
7535 | .type = HDA_FIXUP_FUNC, | |
7536 | .v.func = alc298_fixup_speaker_volume, | |
7537 | }, | |
e312a869 TI |
7538 | [ALC295_FIXUP_DISABLE_DAC3] = { |
7539 | .type = HDA_FIXUP_FUNC, | |
7540 | .v.func = alc295_fixup_disable_dac3, | |
7541 | }, | |
d2cd795c JK |
7542 | [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { |
7543 | .type = HDA_FIXUP_FUNC, | |
7544 | .v.func = alc285_fixup_speaker2_to_dac1, | |
c37c0ab0 HW |
7545 | .chained = true, |
7546 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
d2cd795c | 7547 | }, |
fd06c77e KHF |
7548 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
7549 | .type = HDA_FIXUP_PINS, | |
7550 | .v.pins = (const struct hda_pintbl[]) { | |
7551 | { 0x1b, 0x90170151 }, | |
7552 | { } | |
7553 | }, | |
7554 | .chained = true, | |
7555 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7556 | }, | |
823ff161 GM |
7557 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
7558 | .type = HDA_FIXUP_FUNC, | |
7559 | .v.func = alc_fixup_auto_mute_via_amp, | |
7560 | .chained = true, | |
7561 | .chain_id = ALC269_FIXUP_NO_SHUTUP | |
7562 | }, | |
9eb5d0e6 KY |
7563 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
7564 | .type = HDA_FIXUP_PINS, | |
7565 | .v.pins = (const struct hda_pintbl[]) { | |
7566 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7567 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
7568 | { } | |
7569 | }, | |
7570 | .chained = true, | |
7571 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
7572 | }, | |
c1732ede CC |
7573 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
7574 | .type = HDA_FIXUP_FUNC, | |
7575 | .v.func = alc_fixup_headset_mode, | |
7576 | }, | |
7577 | [ALC256_FIXUP_ASUS_MIC] = { | |
7578 | .type = HDA_FIXUP_PINS, | |
7579 | .v.pins = (const struct hda_pintbl[]) { | |
7580 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
7581 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7582 | { } | |
7583 | }, | |
7584 | .chained = true, | |
7585 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7586 | }, | |
eeed4cd1 | 7587 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
ae065f1c TI |
7588 | .type = HDA_FIXUP_FUNC, |
7589 | /* Set up GPIO2 for the speaker amp */ | |
7590 | .v.func = alc_fixup_gpio4, | |
eeed4cd1 | 7591 | }, |
216d7aeb CC |
7592 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7593 | .type = HDA_FIXUP_PINS, | |
7594 | .v.pins = (const struct hda_pintbl[]) { | |
7595 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7596 | { } | |
7597 | }, | |
7598 | .chained = true, | |
7599 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7600 | }, | |
7601 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { | |
7602 | .type = HDA_FIXUP_VERBS, | |
7603 | .v.verbs = (const struct hda_verb[]) { | |
7604 | /* Enables internal speaker */ | |
7605 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, | |
7606 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, | |
7607 | {} | |
7608 | }, | |
7609 | .chained = true, | |
7610 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | |
7611 | }, | |
ca169cc2 KY |
7612 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
7613 | .type = HDA_FIXUP_FUNC, | |
7614 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
f73bbf63 KHF |
7615 | .chained = true, |
7616 | .chain_id = ALC269_FIXUP_GPIO2 | |
ca169cc2 | 7617 | }, |
ea5c7eba JHP |
7618 | [ALC233_FIXUP_ACER_HEADSET_MIC] = { |
7619 | .type = HDA_FIXUP_VERBS, | |
7620 | .v.verbs = (const struct hda_verb[]) { | |
7621 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
7622 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
7623 | { } | |
7624 | }, | |
7625 | .chained = true, | |
7626 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | |
7627 | }, | |
f33f79f3 HW |
7628 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
7629 | .type = HDA_FIXUP_PINS, | |
7630 | .v.pins = (const struct hda_pintbl[]) { | |
7631 | /* Change the mic location from front to right, otherwise there are | |
7632 | two front mics with the same name, pulseaudio can't handle them. | |
7633 | This is just a temporary workaround, after applying this fixup, | |
7634 | there will be one "Front Mic" and one "Mic" in this machine. | |
7635 | */ | |
7636 | { 0x1a, 0x04a19040 }, | |
7637 | { } | |
7638 | }, | |
7639 | }, | |
5f364135 KY |
7640 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
7641 | .type = HDA_FIXUP_PINS, | |
7642 | .v.pins = (const struct hda_pintbl[]) { | |
7643 | { 0x16, 0x0101102f }, /* Rear Headset HP */ | |
7644 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ | |
7645 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ | |
7646 | { 0x1b, 0x02011020 }, | |
7647 | { } | |
7648 | }, | |
7649 | .chained = true, | |
52e4e368 KHF |
7650 | .chain_id = ALC225_FIXUP_S3_POP_NOISE |
7651 | }, | |
7652 | [ALC225_FIXUP_S3_POP_NOISE] = { | |
7653 | .type = HDA_FIXUP_FUNC, | |
7654 | .v.func = alc225_fixup_s3_pop_noise, | |
7655 | .chained = true, | |
5f364135 KY |
7656 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC |
7657 | }, | |
b84e8436 PH |
7658 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
7659 | .type = HDA_FIXUP_VERBS, | |
7660 | .v.verbs = (const struct hda_verb[]) { | |
7661 | /* Enables internal speaker */ | |
7662 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, | |
7663 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, | |
7664 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, | |
7665 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, | |
7666 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, | |
7667 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, | |
7668 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, | |
7669 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, | |
7670 | {} | |
7671 | } | |
7672 | }, | |
92266651 KY |
7673 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
7674 | .type = HDA_FIXUP_FUNC, | |
7675 | .v.func = alc274_fixup_bind_dacs, | |
7676 | .chained = true, | |
7677 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
7678 | }, | |
7679 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { | |
7680 | .type = HDA_FIXUP_PINS, | |
7681 | .v.pins = (const struct hda_pintbl[]) { | |
7682 | { 0x1b, 0x0401102f }, | |
7683 | { } | |
7684 | }, | |
7685 | .chained = true, | |
7686 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS | |
7687 | }, | |
399c01aa | 7688 | [ALC298_FIXUP_TPT470_DOCK_FIX] = { |
61fcf8ec KY |
7689 | .type = HDA_FIXUP_FUNC, |
7690 | .v.func = alc_fixup_tpt470_dock, | |
7691 | .chained = true, | |
7692 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE | |
7693 | }, | |
399c01aa TI |
7694 | [ALC298_FIXUP_TPT470_DOCK] = { |
7695 | .type = HDA_FIXUP_FUNC, | |
7696 | .v.func = alc_fixup_tpt470_dacs, | |
7697 | .chained = true, | |
7698 | .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX | |
7699 | }, | |
ae104a21 KY |
7700 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
7701 | .type = HDA_FIXUP_PINS, | |
7702 | .v.pins = (const struct hda_pintbl[]) { | |
7703 | { 0x14, 0x0201101f }, | |
7704 | { } | |
7705 | }, | |
7706 | .chained = true, | |
7707 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
7708 | }, | |
f0ba9d69 KY |
7709 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
7710 | .type = HDA_FIXUP_PINS, | |
7711 | .v.pins = (const struct hda_pintbl[]) { | |
7712 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7713 | { } | |
7714 | }, | |
3ce0d5aa HW |
7715 | .chained = true, |
7716 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
f0ba9d69 | 7717 | }, |
bbf8ff6b TB |
7718 | [ALC295_FIXUP_HP_X360] = { |
7719 | .type = HDA_FIXUP_FUNC, | |
7720 | .v.func = alc295_fixup_hp_top_speakers, | |
7721 | .chained = true, | |
7722 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 | |
8a328ac1 KY |
7723 | }, |
7724 | [ALC221_FIXUP_HP_HEADSET_MIC] = { | |
7725 | .type = HDA_FIXUP_PINS, | |
7726 | .v.pins = (const struct hda_pintbl[]) { | |
7727 | { 0x19, 0x0181313f}, | |
7728 | { } | |
7729 | }, | |
7730 | .chained = true, | |
7731 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7732 | }, | |
c4cfcf6f HW |
7733 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
7734 | .type = HDA_FIXUP_FUNC, | |
7735 | .v.func = alc285_fixup_invalidate_dacs, | |
6ba189c5 HW |
7736 | .chained = true, |
7737 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
c4cfcf6f | 7738 | }, |
e8ed64b0 GKK |
7739 | [ALC295_FIXUP_HP_AUTO_MUTE] = { |
7740 | .type = HDA_FIXUP_FUNC, | |
7741 | .v.func = alc_fixup_auto_mute_via_amp, | |
7742 | }, | |
33aaebd4 CC |
7743 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
7744 | .type = HDA_FIXUP_PINS, | |
7745 | .v.pins = (const struct hda_pintbl[]) { | |
7746 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7747 | { } | |
7748 | }, | |
7749 | .chained = true, | |
7750 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
7751 | }, | |
d8ae458e CC |
7752 | [ALC294_FIXUP_ASUS_MIC] = { |
7753 | .type = HDA_FIXUP_PINS, | |
7754 | .v.pins = (const struct hda_pintbl[]) { | |
7755 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
7756 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7757 | { } | |
7758 | }, | |
7759 | .chained = true, | |
ef9ddb9d | 7760 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
d8ae458e | 7761 | }, |
4e051106 JHP |
7762 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
7763 | .type = HDA_FIXUP_PINS, | |
7764 | .v.pins = (const struct hda_pintbl[]) { | |
82b01149 | 7765 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
4e051106 JHP |
7766 | { } |
7767 | }, | |
7768 | .chained = true, | |
ef9ddb9d | 7769 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
4e051106 JHP |
7770 | }, |
7771 | [ALC294_FIXUP_ASUS_SPK] = { | |
7772 | .type = HDA_FIXUP_VERBS, | |
7773 | .v.verbs = (const struct hda_verb[]) { | |
7774 | /* Set EAPD high */ | |
7775 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, | |
7776 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, | |
473fbe13 KY |
7777 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, |
7778 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, | |
4e051106 JHP |
7779 | { } |
7780 | }, | |
7781 | .chained = true, | |
7782 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7783 | }, | |
c8a9afa6 | 7784 | [ALC295_FIXUP_CHROME_BOOK] = { |
e854747d | 7785 | .type = HDA_FIXUP_FUNC, |
c8a9afa6 | 7786 | .v.func = alc295_fixup_chromebook, |
8983eb60 KY |
7787 | .chained = true, |
7788 | .chain_id = ALC225_FIXUP_HEADSET_JACK | |
7789 | }, | |
7790 | [ALC225_FIXUP_HEADSET_JACK] = { | |
7791 | .type = HDA_FIXUP_FUNC, | |
7792 | .v.func = alc_fixup_headset_jack, | |
e854747d | 7793 | }, |
89e3a568 JS |
7794 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
7795 | .type = HDA_FIXUP_PINS, | |
7796 | .v.pins = (const struct hda_pintbl[]) { | |
7797 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
7798 | { } | |
7799 | }, | |
7800 | .chained = true, | |
7801 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7802 | }, | |
c8c6ee61 HW |
7803 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
7804 | .type = HDA_FIXUP_VERBS, | |
7805 | .v.verbs = (const struct hda_verb[]) { | |
7806 | /* Disable PCBEEP-IN passthrough */ | |
7807 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
7808 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
7809 | { } | |
7810 | }, | |
7811 | .chained = true, | |
7812 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE | |
7813 | }, | |
cbc05fd6 JHP |
7814 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { |
7815 | .type = HDA_FIXUP_PINS, | |
7816 | .v.pins = (const struct hda_pintbl[]) { | |
7817 | { 0x19, 0x03a11130 }, | |
7818 | { 0x1a, 0x90a60140 }, /* use as internal mic */ | |
7819 | { } | |
7820 | }, | |
7821 | .chained = true, | |
7822 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7823 | }, | |
136824ef KY |
7824 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
7825 | .type = HDA_FIXUP_PINS, | |
7826 | .v.pins = (const struct hda_pintbl[]) { | |
7827 | { 0x16, 0x01011020 }, /* Rear Line out */ | |
7828 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ | |
7829 | { } | |
7830 | }, | |
7831 | .chained = true, | |
7832 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE | |
7833 | }, | |
7834 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { | |
7835 | .type = HDA_FIXUP_FUNC, | |
7836 | .v.func = alc_fixup_auto_mute_via_amp, | |
7837 | .chained = true, | |
7838 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF | |
7839 | }, | |
7840 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { | |
7841 | .type = HDA_FIXUP_FUNC, | |
7842 | .v.func = alc_fixup_disable_mic_vref, | |
7843 | .chained = true, | |
7844 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
7845 | }, | |
667a8f73 JHP |
7846 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
7847 | .type = HDA_FIXUP_VERBS, | |
7848 | .v.verbs = (const struct hda_verb[]) { | |
7849 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, | |
7850 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, | |
7851 | { } | |
7852 | }, | |
7853 | .chained = true, | |
7854 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE | |
7855 | }, | |
8c8967a7 DD |
7856 | [ALC256_FIXUP_ASUS_HEADSET_MIC] = { |
7857 | .type = HDA_FIXUP_PINS, | |
7858 | .v.pins = (const struct hda_pintbl[]) { | |
7859 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | |
7860 | { } | |
7861 | }, | |
7862 | .chained = true, | |
7863 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7864 | }, | |
e1037354 JHP |
7865 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
7866 | .type = HDA_FIXUP_PINS, | |
7867 | .v.pins = (const struct hda_pintbl[]) { | |
7868 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
7869 | { } | |
7870 | }, | |
7871 | .chained = true, | |
7872 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
7873 | }, | |
e2a829b3 BR |
7874 | [ALC299_FIXUP_PREDATOR_SPK] = { |
7875 | .type = HDA_FIXUP_PINS, | |
7876 | .v.pins = (const struct hda_pintbl[]) { | |
7877 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ | |
7878 | { } | |
7879 | } | |
7880 | }, | |
bd9c10bc | 7881 | [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { |
60083f9e JHP |
7882 | .type = HDA_FIXUP_PINS, |
7883 | .v.pins = (const struct hda_pintbl[]) { | |
bd9c10bc JMG |
7884 | { 0x19, 0x04a11040 }, |
7885 | { 0x21, 0x04211020 }, | |
60083f9e JHP |
7886 | { } |
7887 | }, | |
7888 | .chained = true, | |
bd9c10bc | 7889 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE |
60083f9e | 7890 | }, |
e79c2269 | 7891 | [ALC289_FIXUP_DELL_SPK2] = { |
bd9c10bc JMG |
7892 | .type = HDA_FIXUP_PINS, |
7893 | .v.pins = (const struct hda_pintbl[]) { | |
e79c2269 | 7894 | { 0x17, 0x90170130 }, /* bass spk */ |
bd9c10bc JMG |
7895 | { } |
7896 | }, | |
7897 | .chained = true, | |
e79c2269 | 7898 | .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE |
bd9c10bc | 7899 | }, |
e79c2269 KY |
7900 | [ALC289_FIXUP_DUAL_SPK] = { |
7901 | .type = HDA_FIXUP_FUNC, | |
7902 | .v.func = alc285_fixup_speaker2_to_dac1, | |
7903 | .chained = true, | |
7904 | .chain_id = ALC289_FIXUP_DELL_SPK2 | |
7905 | }, | |
48e01504 CC |
7906 | [ALC294_FIXUP_SPK2_TO_DAC1] = { |
7907 | .type = HDA_FIXUP_FUNC, | |
7908 | .v.func = alc285_fixup_speaker2_to_dac1, | |
7909 | .chained = true, | |
7910 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7911 | }, | |
7912 | [ALC294_FIXUP_ASUS_DUAL_SPK] = { | |
436e2550 JHP |
7913 | .type = HDA_FIXUP_FUNC, |
7914 | /* The GPIO must be pulled to initialize the AMP */ | |
7915 | .v.func = alc_fixup_gpio4, | |
7916 | .chained = true, | |
48e01504 | 7917 | .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 |
436e2550 | 7918 | }, |
6a6660d0 TI |
7919 | [ALC285_FIXUP_THINKPAD_X1_GEN7] = { |
7920 | .type = HDA_FIXUP_FUNC, | |
7921 | .v.func = alc285_fixup_thinkpad_x1_gen7, | |
7922 | .chained = true, | |
7923 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
7924 | }, | |
76f7dec0 KY |
7925 | [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { |
7926 | .type = HDA_FIXUP_FUNC, | |
7927 | .v.func = alc_fixup_headset_jack, | |
7928 | .chained = true, | |
6a6660d0 | 7929 | .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 |
76f7dec0 | 7930 | }, |
8b33a134 JHP |
7931 | [ALC294_FIXUP_ASUS_HPE] = { |
7932 | .type = HDA_FIXUP_VERBS, | |
7933 | .v.verbs = (const struct hda_verb[]) { | |
7934 | /* Set EAPD high */ | |
7935 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, | |
7936 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, | |
7937 | { } | |
7938 | }, | |
7939 | .chained = true, | |
7940 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
7941 | }, | |
c3cdf189 LJ |
7942 | [ALC294_FIXUP_ASUS_GX502_PINS] = { |
7943 | .type = HDA_FIXUP_PINS, | |
7944 | .v.pins = (const struct hda_pintbl[]) { | |
7945 | { 0x19, 0x03a11050 }, /* front HP mic */ | |
7946 | { 0x1a, 0x01a11830 }, /* rear external mic */ | |
7947 | { 0x21, 0x03211020 }, /* front HP out */ | |
7948 | { } | |
7949 | }, | |
7950 | .chained = true, | |
7951 | .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS | |
7952 | }, | |
7953 | [ALC294_FIXUP_ASUS_GX502_VERBS] = { | |
7954 | .type = HDA_FIXUP_VERBS, | |
7955 | .v.verbs = (const struct hda_verb[]) { | |
7956 | /* set 0x15 to HP-OUT ctrl */ | |
7957 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, | |
7958 | /* unmute the 0x15 amp */ | |
7959 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, | |
7960 | { } | |
7961 | }, | |
7962 | .chained = true, | |
7963 | .chain_id = ALC294_FIXUP_ASUS_GX502_HP | |
7964 | }, | |
7965 | [ALC294_FIXUP_ASUS_GX502_HP] = { | |
7966 | .type = HDA_FIXUP_FUNC, | |
7967 | .v.func = alc294_fixup_gx502_hp, | |
7968 | }, | |
c1b55029 DC |
7969 | [ALC294_FIXUP_ASUS_GU502_PINS] = { |
7970 | .type = HDA_FIXUP_PINS, | |
7971 | .v.pins = (const struct hda_pintbl[]) { | |
7972 | { 0x19, 0x01a11050 }, /* rear HP mic */ | |
7973 | { 0x1a, 0x01a11830 }, /* rear external mic */ | |
7974 | { 0x21, 0x012110f0 }, /* rear HP out */ | |
7975 | { } | |
7976 | }, | |
7977 | .chained = true, | |
7978 | .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS | |
7979 | }, | |
7980 | [ALC294_FIXUP_ASUS_GU502_VERBS] = { | |
7981 | .type = HDA_FIXUP_VERBS, | |
7982 | .v.verbs = (const struct hda_verb[]) { | |
7983 | /* set 0x15 to HP-OUT ctrl */ | |
7984 | { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, | |
7985 | /* unmute the 0x15 amp */ | |
7986 | { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, | |
7987 | /* set 0x1b to HP-OUT */ | |
7988 | { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, | |
7989 | { } | |
7990 | }, | |
7991 | .chained = true, | |
7992 | .chain_id = ALC294_FIXUP_ASUS_GU502_HP | |
7993 | }, | |
7994 | [ALC294_FIXUP_ASUS_GU502_HP] = { | |
7995 | .type = HDA_FIXUP_FUNC, | |
7996 | .v.func = alc294_fixup_gu502_hp, | |
7997 | }, | |
1b94e59d TI |
7998 | [ALC294_FIXUP_ASUS_COEF_1B] = { |
7999 | .type = HDA_FIXUP_VERBS, | |
8000 | .v.verbs = (const struct hda_verb[]) { | |
8001 | /* Set bit 10 to correct noisy output after reboot from | |
8002 | * Windows 10 (due to pop noise reduction?) | |
8003 | */ | |
8004 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, | |
8005 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, | |
8006 | { } | |
8007 | }, | |
f8fbcdfb TI |
8008 | .chained = true, |
8009 | .chain_id = ALC289_FIXUP_ASUS_GA401, | |
1b94e59d | 8010 | }, |
f5a88b0a KHF |
8011 | [ALC285_FIXUP_HP_GPIO_LED] = { |
8012 | .type = HDA_FIXUP_FUNC, | |
8013 | .v.func = alc285_fixup_hp_gpio_led, | |
8014 | }, | |
431e76c3 KY |
8015 | [ALC285_FIXUP_HP_MUTE_LED] = { |
8016 | .type = HDA_FIXUP_FUNC, | |
8017 | .v.func = alc285_fixup_hp_mute_led, | |
8018 | }, | |
e7d66cf7 JS |
8019 | [ALC236_FIXUP_HP_GPIO_LED] = { |
8020 | .type = HDA_FIXUP_FUNC, | |
8021 | .v.func = alc236_fixup_hp_gpio_led, | |
8022 | }, | |
24164f43 KY |
8023 | [ALC236_FIXUP_HP_MUTE_LED] = { |
8024 | .type = HDA_FIXUP_FUNC, | |
8025 | .v.func = alc236_fixup_hp_mute_led, | |
8026 | }, | |
75b62ab6 JW |
8027 | [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = { |
8028 | .type = HDA_FIXUP_FUNC, | |
8029 | .v.func = alc236_fixup_hp_mute_led_micmute_vref, | |
8030 | }, | |
14425f1f MP |
8031 | [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { |
8032 | .type = HDA_FIXUP_VERBS, | |
8033 | .v.verbs = (const struct hda_verb[]) { | |
8034 | { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, | |
8035 | { } | |
8036 | }, | |
8037 | }, | |
9e43342b CC |
8038 | [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
8039 | .type = HDA_FIXUP_PINS, | |
8040 | .v.pins = (const struct hda_pintbl[]) { | |
8041 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
8042 | { } | |
8043 | }, | |
8044 | .chained = true, | |
8045 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
8046 | }, | |
8eae7e9b JHP |
8047 | [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { |
8048 | .type = HDA_FIXUP_PINS, | |
8049 | .v.pins = (const struct hda_pintbl[]) { | |
8050 | { 0x14, 0x90100120 }, /* use as internal speaker */ | |
8051 | { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ | |
8052 | { 0x1a, 0x01011020 }, /* use as line out */ | |
8053 | { }, | |
8054 | }, | |
8055 | .chained = true, | |
8056 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
8057 | }, | |
6e15d126 JHP |
8058 | [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { |
8059 | .type = HDA_FIXUP_PINS, | |
8060 | .v.pins = (const struct hda_pintbl[]) { | |
8061 | { 0x18, 0x02a11030 }, /* use as headset mic */ | |
8062 | { } | |
8063 | }, | |
8064 | .chained = true, | |
8065 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
8066 | }, | |
781c90c0 JHP |
8067 | [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { |
8068 | .type = HDA_FIXUP_PINS, | |
8069 | .v.pins = (const struct hda_pintbl[]) { | |
8070 | { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ | |
8071 | { } | |
8072 | }, | |
8073 | .chained = true, | |
8074 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
8075 | }, | |
293a92c1 | 8076 | [ALC289_FIXUP_ASUS_GA401] = { |
c84bfedc TI |
8077 | .type = HDA_FIXUP_FUNC, |
8078 | .v.func = alc289_fixup_asus_ga401, | |
8079 | .chained = true, | |
8080 | .chain_id = ALC289_FIXUP_ASUS_GA502, | |
ff53664d | 8081 | }, |
4b43d05a AS |
8082 | [ALC289_FIXUP_ASUS_GA502] = { |
8083 | .type = HDA_FIXUP_PINS, | |
8084 | .v.pins = (const struct hda_pintbl[]) { | |
8085 | { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | |
8086 | { } | |
8087 | }, | |
8088 | }, | |
f50a121d JHP |
8089 | [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { |
8090 | .type = HDA_FIXUP_PINS, | |
8091 | .v.pins = (const struct hda_pintbl[]) { | |
8092 | { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ | |
8093 | { } | |
8094 | }, | |
8095 | .chained = true, | |
8096 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
8097 | }, | |
56496253 KY |
8098 | [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { |
8099 | .type = HDA_FIXUP_FUNC, | |
8100 | .v.func = alc285_fixup_hp_gpio_amp_init, | |
8101 | .chained = true, | |
8102 | .chain_id = ALC285_FIXUP_HP_GPIO_LED | |
8103 | }, | |
f1ec5be1 HC |
8104 | [ALC269_FIXUP_CZC_B20] = { |
8105 | .type = HDA_FIXUP_PINS, | |
8106 | .v.pins = (const struct hda_pintbl[]) { | |
8107 | { 0x12, 0x411111f0 }, | |
8108 | { 0x14, 0x90170110 }, /* speaker */ | |
8109 | { 0x15, 0x032f1020 }, /* HP out */ | |
8110 | { 0x17, 0x411111f0 }, | |
8111 | { 0x18, 0x03ab1040 }, /* mic */ | |
8112 | { 0x19, 0xb7a7013f }, | |
8113 | { 0x1a, 0x0181305f }, | |
8114 | { 0x1b, 0x411111f0 }, | |
8115 | { 0x1d, 0x411111f0 }, | |
8116 | { 0x1e, 0x411111f0 }, | |
8117 | { } | |
8118 | }, | |
8119 | .chain_id = ALC269_FIXUP_DMIC, | |
8120 | }, | |
8121 | [ALC269_FIXUP_CZC_TMI] = { | |
8122 | .type = HDA_FIXUP_PINS, | |
8123 | .v.pins = (const struct hda_pintbl[]) { | |
8124 | { 0x12, 0x4000c000 }, | |
8125 | { 0x14, 0x90170110 }, /* speaker */ | |
8126 | { 0x15, 0x0421401f }, /* HP out */ | |
8127 | { 0x17, 0x411111f0 }, | |
8128 | { 0x18, 0x04a19020 }, /* mic */ | |
8129 | { 0x19, 0x411111f0 }, | |
8130 | { 0x1a, 0x411111f0 }, | |
8131 | { 0x1b, 0x411111f0 }, | |
8132 | { 0x1d, 0x40448505 }, | |
8133 | { 0x1e, 0x411111f0 }, | |
8134 | { 0x20, 0x8000ffff }, | |
8135 | { } | |
8136 | }, | |
8137 | .chain_id = ALC269_FIXUP_DMIC, | |
8138 | }, | |
8139 | [ALC269_FIXUP_CZC_L101] = { | |
8140 | .type = HDA_FIXUP_PINS, | |
8141 | .v.pins = (const struct hda_pintbl[]) { | |
8142 | { 0x12, 0x40000000 }, | |
8143 | { 0x14, 0x01014010 }, /* speaker */ | |
8144 | { 0x15, 0x411111f0 }, /* HP out */ | |
8145 | { 0x16, 0x411111f0 }, | |
8146 | { 0x18, 0x01a19020 }, /* mic */ | |
8147 | { 0x19, 0x02a19021 }, | |
8148 | { 0x1a, 0x0181302f }, | |
8149 | { 0x1b, 0x0221401f }, | |
8150 | { 0x1c, 0x411111f0 }, | |
8151 | { 0x1d, 0x4044c601 }, | |
8152 | { 0x1e, 0x411111f0 }, | |
8153 | { } | |
8154 | }, | |
8155 | .chain_id = ALC269_FIXUP_DMIC, | |
8156 | }, | |
8157 | [ALC269_FIXUP_LEMOTE_A1802] = { | |
8158 | .type = HDA_FIXUP_PINS, | |
8159 | .v.pins = (const struct hda_pintbl[]) { | |
8160 | { 0x12, 0x40000000 }, | |
8161 | { 0x14, 0x90170110 }, /* speaker */ | |
8162 | { 0x17, 0x411111f0 }, | |
8163 | { 0x18, 0x03a19040 }, /* mic1 */ | |
8164 | { 0x19, 0x90a70130 }, /* mic2 */ | |
8165 | { 0x1a, 0x411111f0 }, | |
8166 | { 0x1b, 0x411111f0 }, | |
8167 | { 0x1d, 0x40489d2d }, | |
8168 | { 0x1e, 0x411111f0 }, | |
8169 | { 0x20, 0x0003ffff }, | |
8170 | { 0x21, 0x03214020 }, | |
8171 | { } | |
8172 | }, | |
8173 | .chain_id = ALC269_FIXUP_DMIC, | |
8174 | }, | |
8175 | [ALC269_FIXUP_LEMOTE_A190X] = { | |
8176 | .type = HDA_FIXUP_PINS, | |
8177 | .v.pins = (const struct hda_pintbl[]) { | |
8178 | { 0x14, 0x99130110 }, /* speaker */ | |
8179 | { 0x15, 0x0121401f }, /* HP out */ | |
8180 | { 0x18, 0x01a19c20 }, /* rear mic */ | |
8181 | { 0x19, 0x99a3092f }, /* front mic */ | |
8182 | { 0x1b, 0x0201401f }, /* front lineout */ | |
8183 | { } | |
8184 | }, | |
8185 | .chain_id = ALC269_FIXUP_DMIC, | |
8186 | }, | |
e2d2fded KHF |
8187 | [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { |
8188 | .type = HDA_FIXUP_PINS, | |
8189 | .v.pins = (const struct hda_pintbl[]) { | |
8190 | { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
8191 | { } | |
8192 | }, | |
8193 | .chained = true, | |
8194 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
8195 | }, | |
73e7161e WS |
8196 | [ALC256_FIXUP_INTEL_NUC10] = { |
8197 | .type = HDA_FIXUP_PINS, | |
8198 | .v.pins = (const struct hda_pintbl[]) { | |
8199 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
8200 | { } | |
8201 | }, | |
8202 | .chained = true, | |
8203 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
8204 | }, | |
fc19d559 HW |
8205 | [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { |
8206 | .type = HDA_FIXUP_VERBS, | |
8207 | .v.verbs = (const struct hda_verb[]) { | |
8208 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
8209 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
8210 | { } | |
8211 | }, | |
8212 | .chained = true, | |
c84bfedc | 8213 | .chain_id = ALC289_FIXUP_ASUS_GA502 |
fc19d559 | 8214 | }, |
13468bfa HW |
8215 | [ALC274_FIXUP_HP_MIC] = { |
8216 | .type = HDA_FIXUP_VERBS, | |
8217 | .v.verbs = (const struct hda_verb[]) { | |
8218 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, | |
8219 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, | |
8220 | { } | |
8221 | }, | |
8222 | }, | |
8a8de09c KY |
8223 | [ALC274_FIXUP_HP_HEADSET_MIC] = { |
8224 | .type = HDA_FIXUP_FUNC, | |
8225 | .v.func = alc274_fixup_hp_headset_mic, | |
8226 | .chained = true, | |
8227 | .chain_id = ALC274_FIXUP_HP_MIC | |
8228 | }, | |
622464c8 TI |
8229 | [ALC274_FIXUP_HP_ENVY_GPIO] = { |
8230 | .type = HDA_FIXUP_FUNC, | |
8231 | .v.func = alc274_fixup_hp_envy_gpio, | |
8232 | }, | |
ef9ce66f KY |
8233 | [ALC256_FIXUP_ASUS_HPE] = { |
8234 | .type = HDA_FIXUP_VERBS, | |
8235 | .v.verbs = (const struct hda_verb[]) { | |
8236 | /* Set EAPD high */ | |
8237 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, | |
8238 | { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, | |
8239 | { } | |
8240 | }, | |
8241 | .chained = true, | |
8242 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
8243 | }, | |
446b8185 KY |
8244 | [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = { |
8245 | .type = HDA_FIXUP_FUNC, | |
8246 | .v.func = alc_fixup_headset_jack, | |
8247 | .chained = true, | |
8248 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
8249 | }, | |
a0ccbc53 KY |
8250 | [ALC287_FIXUP_HP_GPIO_LED] = { |
8251 | .type = HDA_FIXUP_FUNC, | |
8252 | .v.func = alc287_fixup_hp_gpio_led, | |
8253 | }, | |
9e885770 KY |
8254 | [ALC256_FIXUP_HP_HEADSET_MIC] = { |
8255 | .type = HDA_FIXUP_FUNC, | |
8256 | .v.func = alc274_fixup_hp_headset_mic, | |
8257 | }, | |
92666d45 KY |
8258 | [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = { |
8259 | .type = HDA_FIXUP_FUNC, | |
8260 | .v.func = alc_fixup_no_int_mic, | |
8261 | .chained = true, | |
8262 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
8263 | }, | |
34cdf405 CC |
8264 | [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = { |
8265 | .type = HDA_FIXUP_PINS, | |
8266 | .v.pins = (const struct hda_pintbl[]) { | |
8267 | { 0x1b, 0x411111f0 }, | |
8268 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
8269 | { }, | |
8270 | }, | |
8271 | .chained = true, | |
8272 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
8273 | }, | |
495dc763 CC |
8274 | [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = { |
8275 | .type = HDA_FIXUP_FUNC, | |
8276 | .v.func = alc269_fixup_limit_int_mic_boost, | |
8277 | .chained = true, | |
8278 | .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, | |
8279 | }, | |
d0e18561 CC |
8280 | [ALC256_FIXUP_ACER_HEADSET_MIC] = { |
8281 | .type = HDA_FIXUP_PINS, | |
8282 | .v.pins = (const struct hda_pintbl[]) { | |
8283 | { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */ | |
8284 | { 0x1a, 0x90a1092f }, /* use as internal mic */ | |
8285 | { } | |
8286 | }, | |
8287 | .chained = true, | |
8288 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
8289 | }, | |
26928ca1 TI |
8290 | [ALC285_FIXUP_IDEAPAD_S740_COEF] = { |
8291 | .type = HDA_FIXUP_FUNC, | |
8292 | .v.func = alc285_fixup_ideapad_s740_coef, | |
8293 | .chained = true, | |
8294 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
8295 | }, | |
bd15b155 KHF |
8296 | [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { |
8297 | .type = HDA_FIXUP_FUNC, | |
8298 | .v.func = alc269_fixup_limit_int_mic_boost, | |
8299 | .chained = true, | |
8300 | .chain_id = ALC285_FIXUP_HP_MUTE_LED, | |
8301 | }, | |
8eedd3a7 TI |
8302 | [ALC295_FIXUP_ASUS_DACS] = { |
8303 | .type = HDA_FIXUP_FUNC, | |
8304 | .v.func = alc295_fixup_asus_dacs, | |
8305 | }, | |
5d84b531 TI |
8306 | [ALC295_FIXUP_HP_OMEN] = { |
8307 | .type = HDA_FIXUP_PINS, | |
8308 | .v.pins = (const struct hda_pintbl[]) { | |
8309 | { 0x12, 0xb7a60130 }, | |
8310 | { 0x13, 0x40000000 }, | |
8311 | { 0x14, 0x411111f0 }, | |
8312 | { 0x16, 0x411111f0 }, | |
8313 | { 0x17, 0x90170110 }, | |
8314 | { 0x18, 0x411111f0 }, | |
8315 | { 0x19, 0x02a11030 }, | |
8316 | { 0x1a, 0x411111f0 }, | |
8317 | { 0x1b, 0x04a19030 }, | |
8318 | { 0x1d, 0x40600001 }, | |
8319 | { 0x1e, 0x411111f0 }, | |
8320 | { 0x21, 0x03211020 }, | |
8321 | {} | |
8322 | }, | |
8323 | .chained = true, | |
8324 | .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED, | |
8325 | }, | |
f2be77fe | 8326 | [ALC285_FIXUP_HP_SPECTRE_X360] = { |
434591b2 ED |
8327 | .type = HDA_FIXUP_FUNC, |
8328 | .v.func = alc285_fixup_hp_spectre_x360, | |
f2be77fe | 8329 | }, |
d94befbb DB |
8330 | [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = { |
8331 | .type = HDA_FIXUP_FUNC, | |
8332 | .v.func = alc285_fixup_hp_spectre_x360_eb1 | |
8333 | }, | |
9ebaef05 HW |
8334 | [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { |
8335 | .type = HDA_FIXUP_FUNC, | |
8336 | .v.func = alc285_fixup_ideapad_s740_coef, | |
8337 | .chained = true, | |
8338 | .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, | |
8339 | }, | |
29c8f40b PU |
8340 | [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = { |
8341 | .type = HDA_FIXUP_FUNC, | |
8342 | .v.func = alc_fixup_no_shutup, | |
8343 | .chained = true, | |
8344 | .chain_id = ALC283_FIXUP_HEADSET_MIC, | |
8345 | }, | |
57c9e21a HW |
8346 | [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = { |
8347 | .type = HDA_FIXUP_PINS, | |
8348 | .v.pins = (const struct hda_pintbl[]) { | |
8349 | { 0x21, 0x03211030 }, /* Change the Headphone location to Left */ | |
8350 | { } | |
8351 | }, | |
8352 | .chained = true, | |
8353 | .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC | |
8354 | }, | |
8903376d KHF |
8355 | [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { |
8356 | .type = HDA_FIXUP_FUNC, | |
8357 | .v.func = alc269_fixup_limit_int_mic_boost, | |
8358 | .chained = true, | |
8359 | .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, | |
8360 | }, | |
ad7cc2d4 CB |
8361 | [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = { |
8362 | .type = HDA_FIXUP_VERBS, | |
8363 | //.v.verbs = legion_15imhg05_coefs, | |
8364 | .v.verbs = (const struct hda_verb[]) { | |
8365 | // set left speaker Legion 7i. | |
8366 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, | |
8367 | { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, | |
8368 | ||
8369 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8370 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, | |
8371 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8372 | { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, | |
8373 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8374 | ||
8375 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8376 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, | |
8377 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8378 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8379 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8380 | ||
8381 | // set right speaker Legion 7i. | |
8382 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, | |
8383 | { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, | |
8384 | ||
8385 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8386 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, | |
8387 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8388 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, | |
8389 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8390 | ||
8391 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8392 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, | |
8393 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8394 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8395 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8396 | {} | |
8397 | }, | |
8398 | .chained = true, | |
8399 | .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, | |
8400 | }, | |
8401 | [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = { | |
8402 | .type = HDA_FIXUP_FUNC, | |
8403 | .v.func = alc287_fixup_legion_15imhg05_speakers, | |
8404 | .chained = true, | |
8405 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
8406 | }, | |
8407 | [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = { | |
8408 | .type = HDA_FIXUP_VERBS, | |
8409 | .v.verbs = (const struct hda_verb[]) { | |
8410 | // set left speaker Yoga 7i. | |
8411 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, | |
8412 | { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, | |
8413 | ||
8414 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8415 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, | |
8416 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8417 | { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, | |
8418 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8419 | ||
8420 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8421 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, | |
8422 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8423 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8424 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8425 | ||
8426 | // set right speaker Yoga 7i. | |
8427 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, | |
8428 | { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, | |
8429 | ||
8430 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8431 | { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, | |
8432 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8433 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, | |
8434 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8435 | ||
8436 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8437 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, | |
8438 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8439 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8440 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8441 | {} | |
8442 | }, | |
8443 | .chained = true, | |
8444 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
8445 | }, | |
8446 | [ALC287_FIXUP_13S_GEN2_SPEAKERS] = { | |
8447 | .type = HDA_FIXUP_VERBS, | |
8448 | .v.verbs = (const struct hda_verb[]) { | |
8449 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, | |
8450 | { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, | |
023a062f | 8451 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
ad7cc2d4 CB |
8452 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
8453 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8454 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8455 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8456 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, | |
8457 | { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, | |
8458 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, | |
8459 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, | |
8460 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8461 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, | |
8462 | { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, | |
8463 | {} | |
8464 | }, | |
8465 | .chained = true, | |
8466 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
8467 | }, | |
dd6dd6e3 WS |
8468 | [ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS] = { |
8469 | .type = HDA_FIXUP_FUNC, | |
8470 | .v.func = alc256_fixup_tongfang_reset_persistent_settings, | |
8471 | }, | |
c47b3112 JC |
8472 | [ALC245_FIXUP_HP_GPIO_LED] = { |
8473 | .type = HDA_FIXUP_FUNC, | |
8474 | .v.func = alc245_fixup_hp_gpio_led, | |
8475 | }, | |
4803b99a JS |
8476 | [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
8477 | .type = HDA_FIXUP_PINS, | |
8478 | .v.pins = (const struct hda_pintbl[]) { | |
8479 | { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */ | |
8480 | { } | |
8481 | }, | |
8482 | .chained = true, | |
8483 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, | |
8484 | }, | |
e1abacd3 WS |
8485 | [ALC233_FIXUP_NO_AUDIO_JACK] = { |
8486 | .type = HDA_FIXUP_FUNC, | |
8487 | .v.func = alc233_fixup_no_audio_jack, | |
8488 | }, | |
f1d4e28b KY |
8489 | }; |
8490 | ||
1d045db9 | 8491 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
a6b92b66 | 8492 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
693b613d DH |
8493 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
8494 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), | |
aaedfb47 | 8495 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
7819717b | 8496 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
aaedfb47 DH |
8497 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
8498 | SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), | |
02322ac9 | 8499 | SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
b1e8972e | 8500 | SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
1a22e775 | 8501 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
433f894e | 8502 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
c8426b27 | 8503 | SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF), |
13be30f1 | 8504 | SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK), |
705b65f1 | 8505 | SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6e15d126 | 8506 | SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), |
b9c2fa52 | 8507 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
495dc763 | 8508 | SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), |
c7531e31 CC |
8509 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
8510 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), | |
13be30f1 CC |
8511 | SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK), |
8512 | SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK), | |
e2a829b3 | 8513 | SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), |
8eae7e9b | 8514 | SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), |
781c90c0 | 8515 | SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), |
d0e18561 | 8516 | SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC), |
667a8f73 JHP |
8517 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
8518 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
8519 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
d0e18561 | 8520 | SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC), |
35171fbf | 8521 | SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), |
2733cceb | 8522 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
ea5c7eba | 8523 | SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), |
cbc05fd6 | 8524 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), |
204a71b0 | 8525 | SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
0d4867a1 | 8526 | SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
f50a121d | 8527 | SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), |
57c9e21a | 8528 | SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), |
aaedfb47 | 8529 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
6ed1131f | 8530 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
86f799b8 | 8531 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
cf52103a | 8532 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
8b99aba7 TI |
8533 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
8534 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), | |
0f4881dc | 8535 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
73bdd597 DH |
8536 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
8537 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
8538 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
0f4881dc DH |
8539 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
8540 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), | |
98070576 | 8541 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
4275554d | 8542 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
0f4881dc | 8543 | SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), |
a22aa26f KY |
8544 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
8545 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
831bfdf9 | 8546 | SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), |
afecb146 | 8547 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
3a05d12f | 8548 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
8b72415d | 8549 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
b734304f KY |
8550 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
8551 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
c04017ea DH |
8552 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
8553 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
8554 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
8555 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
8556 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
fd06c77e | 8557 | SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
3b43b71f | 8558 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), |
c0ca5ece | 8559 | SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), |
709ae62e | 8560 | SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), |
dd9aa335 | 8561 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
493de342 | 8562 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
aa143ad3 | 8563 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
5f364135 | 8564 | SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), |
40e2c4e5 KY |
8565 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
8566 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), | |
f0ba9d69 KY |
8567 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
8568 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | |
ae104a21 | 8569 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
136824ef | 8570 | SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), |
da484d00 | 8571 | SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), |
c2a7c55a | 8572 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
e79c2269 | 8573 | SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
aa143ad3 | 8574 | SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), |
78def224 KY |
8575 | SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), |
8576 | SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), | |
92666d45 KY |
8577 | SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), |
8578 | SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), | |
c1e89523 | 8579 | SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), |
da946920 | 8580 | SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK), |
eb676622 | 8581 | SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK), |
2b987fe8 CC |
8582 | SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), |
8583 | SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), | |
a22aa26f KY |
8584 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
8585 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
08fb0d0e | 8586 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
9f5c6faf | 8587 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
8e35cd4a | 8588 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
7976eb49 | 8589 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 8590 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 8591 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
45461e3b TI |
8592 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
8593 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), | |
8594 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8595 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf KY |
8596 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
8597 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
8598 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
8599 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
9c5dc3bf | 8600 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
9c5dc3bf KY |
8601 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
8602 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8603 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8604 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8605 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf | 8606 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
04d5466a | 8607 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
45461e3b | 8608 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
c60666bd | 8609 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
8610 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8611 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8612 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
45461e3b TI |
8613 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8614 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8615 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8616 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8617 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), | |
9c5dc3bf | 8618 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
45461e3b | 8619 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
9c5dc3bf | 8620 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
45461e3b | 8621 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
9c5dc3bf | 8622 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
c60666bd | 8623 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 8624 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 8625 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 8626 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
45461e3b TI |
8627 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8628 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8629 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8630 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8631 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd | 8632 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
8633 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8634 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
45461e3b TI |
8635 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8636 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), | |
8637 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8638 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
8a02b164 KY |
8639 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8640 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8641 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8642 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
167897f4 JK |
8643 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
8644 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
1c9d9dfd KY |
8645 | SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC), |
8646 | SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC), | |
563785ed | 8647 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
e549d190 | 8648 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
bbf8ff6b | 8649 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
aeedad25 | 8650 | SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
167897f4 JK |
8651 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
8652 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
56e40eb6 | 8653 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
901be145 | 8654 | SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
190d0381 | 8655 | SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
5d84b531 | 8656 | SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), |
d33cd42d | 8657 | SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
f2be77fe | 8658 | SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), |
0ac05b25 | 8659 | SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
b2c22910 | 8660 | SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
622464c8 | 8661 | SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), |
15d295b5 | 8662 | SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
61d3e874 | 8663 | SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
a598098c | 8664 | SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), |
afbac2a3 | 8665 | SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED), |
b2c22910 | 8666 | SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), |
75b62ab6 | 8667 | SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), |
de1c4c2b | 8668 | SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), |
56496253 | 8669 | SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
08befca4 | 8670 | SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), |
431e76c3 | 8671 | SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), |
24164f43 | 8672 | SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), |
91bc1568 JS |
8673 | SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation", |
8674 | ALC285_FIXUP_HP_GPIO_AMP_INIT), | |
8675 | SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", | |
8676 | ALC285_FIXUP_HP_GPIO_AMP_INIT), | |
ba28051e | 8677 | SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), |
48422958 | 8678 | SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), |
e7d66cf7 | 8679 | SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
2b70b264 | 8680 | SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
fb3acdb2 | 8681 | SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
417eadfd | 8682 | SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
a0ccbc53 KY |
8683 | SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), |
8684 | SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), | |
93ab3eaf | 8685 | SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), |
c3bb2b52 | 8686 | SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), |
d07149ab | 8687 | SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), |
dfc2e8ae | 8688 | SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
d94befbb DB |
8689 | SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), |
8690 | SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), | |
53b861be | 8691 | SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
c3d2c882 | 8692 | SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
dfb06401 | 8693 | SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
ca688339 | 8694 | SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), |
8903376d KHF |
8695 | SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), |
8696 | SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), | |
50dbfae9 | 8697 | SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
e650c1a9 | 8698 | SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
bbe183e0 | 8699 | SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), |
600dd2a7 | 8700 | SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), |
0e68c4b1 | 8701 | SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), |
bd15b155 | 8702 | SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), |
42334fbc | 8703 | SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), |
c1732ede | 8704 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
7bba2157 | 8705 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
3e0d611b | 8706 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
9cf6533e | 8707 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
c1732ede | 8708 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
4eab0ea1 | 8709 | SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
3e0d611b | 8710 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4eab0ea1 | 8711 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
3cd0ed63 | 8712 | SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
5cfca596 | 8713 | SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), |
4eab0ea1 TI |
8714 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
8715 | SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), | |
c1732ede | 8716 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
3cd0ed63 | 8717 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
c1732ede | 8718 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), |
2cede303 | 8719 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
23870831 | 8720 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), |
3e0d611b | 8721 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
8eedd3a7 | 8722 | SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), |
48e01504 | 8723 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), |
739d0959 | 8724 | SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), |
3cd0ed63 | 8725 | SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), |
8c8967a7 | 8726 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), |
4963d66b | 8727 | SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), |
158ae2f5 | 8728 | SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), |
d3a9b1ce | 8729 | SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401), |
5de3b943 | 8730 | SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), |
8b33a134 | 8731 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), |
7900e817 | 8732 | SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), |
017f2a10 | 8733 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
28e8af8a | 8734 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
1b94e59d | 8735 | SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), |
693b613d | 8736 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
615966ad | 8737 | SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
4eab0ea1 | 8738 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
c1732ede | 8739 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
ef9ce66f | 8740 | SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), |
4b43d05a | 8741 | SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), |
c1b55029 | 8742 | SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), |
76fae618 | 8743 | SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), |
293a92c1 | 8744 | SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), |
eeed4cd1 | 8745 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
adabb3ec TI |
8746 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
8747 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), | |
8748 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
8749 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
d240d1dc | 8750 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
1d045db9 TI |
8751 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
8752 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
8753 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
e9bd7d5c | 8754 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
cab561f8 TI |
8755 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
8756 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), | |
24519911 | 8757 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
4df3fd17 | 8758 | SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), |
cc7016ab | 8759 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
fdcc968a | 8760 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
c656f747 | 8761 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
2041d564 | 8762 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
b84e8436 | 8763 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
c656f747 | 8764 | SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), |
6fa38ef1 | 8765 | SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
ce2e79b2 PH |
8766 | SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), |
8767 | SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), | |
0fca97a2 | 8768 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
a33cc48d | 8769 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
14425f1f MP |
8770 | SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
8771 | SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), | |
f70fff83 | 8772 | SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
8bcea6cb | 8773 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
823ff161 | 8774 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
568e4e82 | 8775 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
c656f747 | 8776 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), |
abaa2274 AA |
8777 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
8778 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), | |
8cd65271 | 8779 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
6ca653e3 | 8780 | SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), |
b5acfe15 | 8781 | SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
745f260b | 8782 | SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
b5acfe15 PH |
8783 | SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8784 | SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8785 | SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8786 | SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8787 | SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8788 | SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8789 | SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8790 | SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8791 | SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8792 | SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
4803b99a JS |
8793 | SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8794 | SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
b5acfe15 PH |
8795 | SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8796 | SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8797 | SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8798 | SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8799 | SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
4803b99a JS |
8800 | SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8801 | SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
b5acfe15 | 8802 | SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
1d5cfca2 | 8803 | SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
b5acfe15 | 8804 | SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
1d5cfca2 PH |
8805 | SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8806 | SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
b5acfe15 PH |
8807 | SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8808 | SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8809 | SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8810 | SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8811 | SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
1d5cfca2 PH |
8812 | SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8813 | SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8814 | SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8815 | SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
b5acfe15 PH |
8816 | SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8817 | SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8818 | SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8819 | SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8820 | SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
745f260b WS |
8821 | SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8822 | SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8823 | SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), | |
8824 | SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), | |
8825 | SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), | |
b5acfe15 PH |
8826 | SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8827 | SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8828 | SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8829 | SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8830 | SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8831 | SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8832 | SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
1d5cfca2 | 8833 | SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
b5acfe15 PH |
8834 | SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8835 | SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
745f260b WS |
8836 | SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8837 | SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
1d5cfca2 PH |
8838 | SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8839 | SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8840 | SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8841 | SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8842 | SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
8843 | SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), | |
ca169cc2 | 8844 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
29c8f40b | 8845 | SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), |
1d045db9 TI |
8846 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
8847 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), | |
8848 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | |
8849 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), | |
8850 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), | |
f552ff54 | 8851 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
b590b38c | 8852 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), |
c8415a48 | 8853 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
4407be6b | 8854 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
108cc108 | 8855 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
aaedfb47 | 8856 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
9a811230 | 8857 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
1c37c223 | 8858 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
a12137e7 | 8859 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
59a51a6b | 8860 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
6d16941a | 8861 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
7c21539c | 8862 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
a4a9e082 | 8863 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
b6903c0e | 8864 | SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), |
d05ea7da | 8865 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
c0278669 | 8866 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
61fcf8ec KY |
8867 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8868 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
dab38e43 | 8869 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
c636b95e | 8870 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8871 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
8872 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8873 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
e4c07b3b | 8874 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8875 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8876 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8877 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
85981dfd | 8878 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
9774dc21 | 8879 | SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
ca707b3f | 8880 | SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), |
446b8185 KY |
8881 | SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), |
8882 | SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), | |
3694cb29 | 8883 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
6ef2f68f | 8884 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
f33f79f3 | 8885 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
bef33e19 | 8886 | SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
e41fc8c5 | 8887 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
65811834 | 8888 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
8da5bbfc | 8889 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
2a36c16e | 8890 | SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
8a6c55d0 AM |
8891 | SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), |
8892 | SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), | |
e4efa826 | 8893 | SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), |
f86de9b1 | 8894 | SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), |
26928ca1 | 8895 | SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), |
9ebaef05 | 8896 | SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), |
ad7cc2d4 CB |
8897 | SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), |
8898 | SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), | |
8899 | SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), | |
8900 | SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), | |
56f27013 | 8901 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
fedb2245 | 8902 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
56df90b6 | 8903 | SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
f552ff54 | 8904 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
a4a9e082 | 8905 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
1bb3e062 | 8906 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
c497d9f9 | 8907 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
cd5302c0 | 8908 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
f2aa1110 | 8909 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
80b311d3 | 8910 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
09ea9976 | 8911 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
037e1197 | 8912 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
23adc192 | 8913 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
0f087ee3 | 8914 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
9cd25743 | 8915 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
0f087ee3 | 8916 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
61fcf8ec KY |
8917 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8918 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8919 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
cd5302c0 | 8920 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
61fcf8ec KY |
8921 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
8922 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
1d045db9 | 8923 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
e1abacd3 | 8924 | SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), |
0fbf21c3 | 8925 | SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), |
f1ec5be1 HC |
8926 | SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), |
8927 | SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), | |
8928 | SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), | |
02b504d9 | 8929 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
c656f747 TI |
8930 | SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
8931 | SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), | |
dd6dd6e3 | 8932 | SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS), |
fc19d559 | 8933 | SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
b95bc12e | 8934 | SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), |
695d1ec3 | 8935 | SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
e1c86210 | 8936 | SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
d1ee66c5 | 8937 | SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), |
e2d2fded | 8938 | SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), |
73e7161e | 8939 | SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), |
a4297b5d | 8940 | |
a7f3eedc | 8941 | #if 0 |
a4297b5d TI |
8942 | /* Below is a quirk table taken from the old code. |
8943 | * Basically the device should work as is without the fixup table. | |
8944 | * If BIOS doesn't give a proper info, enable the corresponding | |
8945 | * fixup entry. | |
7d7eb9ea | 8946 | */ |
a4297b5d TI |
8947 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
8948 | ALC269_FIXUP_AMIC), | |
8949 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), | |
a4297b5d TI |
8950 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
8951 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), | |
8952 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), | |
8953 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), | |
8954 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), | |
8955 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), | |
8956 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), | |
8957 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), | |
8958 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), | |
8959 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), | |
8960 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), | |
8961 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), | |
8962 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), | |
8963 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), | |
8964 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), | |
8965 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), | |
8966 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), | |
8967 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), | |
8968 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), | |
8969 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), | |
8970 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), | |
8971 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), | |
8972 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), | |
8973 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), | |
8974 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), | |
8975 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), | |
8976 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), | |
8977 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), | |
8978 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), | |
8979 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), | |
8980 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), | |
8981 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), | |
8982 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), | |
8983 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), | |
8984 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), | |
8985 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), | |
8986 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), | |
8987 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), | |
8988 | #endif | |
8989 | {} | |
8990 | }; | |
8991 | ||
214eef76 DH |
8992 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
8993 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), | |
8994 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), | |
8995 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | |
8996 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), | |
0fbf21c3 | 8997 | SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), |
214eef76 DH |
8998 | {} |
8999 | }; | |
9000 | ||
1727a771 | 9001 | static const struct hda_model_fixup alc269_fixup_models[] = { |
a4297b5d TI |
9002 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
9003 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, | |
6e72aa5f TI |
9004 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
9005 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, | |
9006 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, | |
7c478f03 | 9007 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
b016951e TI |
9008 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
9009 | {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, | |
108cc108 | 9010 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
b590b38c | 9011 | {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, |
9f5c6faf | 9012 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
04d5466a | 9013 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, |
e32aa85a DH |
9014 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
9015 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, | |
a26d96c7 TI |
9016 | {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, |
9017 | {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, | |
be8ef16a | 9018 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
0202e99c | 9019 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
1c37c223 | 9020 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
9a811230 | 9021 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
c636b95e | 9022 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
399c01aa | 9023 | {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, |
a26d96c7 | 9024 | {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, |
ba90d6a6 | 9025 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
28d1d6d2 | 9026 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
a26d96c7 TI |
9027 | {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, |
9028 | {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, | |
9029 | {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, | |
9030 | {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, | |
9031 | {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, | |
9032 | {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, | |
9033 | {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, | |
9034 | {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, | |
9035 | {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, | |
9036 | {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, | |
9037 | {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, | |
9038 | {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, | |
9039 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, | |
9040 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, | |
9041 | {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, | |
9042 | {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, | |
9043 | {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, | |
9044 | {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, | |
9045 | {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, | |
9046 | {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, | |
9047 | {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, | |
9048 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, | |
9049 | {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, | |
9050 | {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, | |
9051 | {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, | |
9052 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, | |
9053 | {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, | |
9054 | {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, | |
9055 | {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, | |
9056 | {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, | |
9057 | {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, | |
9058 | {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, | |
9059 | {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, | |
9060 | {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, | |
9061 | {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, | |
9062 | {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, | |
9063 | {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, | |
9064 | {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, | |
9065 | {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, | |
9066 | {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, | |
b3802783 | 9067 | {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, |
a26d96c7 | 9068 | {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, |
c8426b27 | 9069 | {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"}, |
a26d96c7 TI |
9070 | {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, |
9071 | {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, | |
9072 | {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, | |
9073 | {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, | |
9074 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, | |
9075 | {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, | |
9076 | {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, | |
9077 | {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, | |
9078 | {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, | |
9079 | {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, | |
9080 | {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, | |
9081 | {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, | |
9082 | {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, | |
9083 | {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, | |
a26d96c7 TI |
9084 | {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, |
9085 | {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, | |
9086 | {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, | |
82aa0d7e | 9087 | {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, |
a26d96c7 | 9088 | {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, |
d2cd795c | 9089 | {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, |
a26d96c7 TI |
9090 | {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, |
9091 | {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, | |
9092 | {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, | |
9093 | {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, | |
9094 | {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, | |
9095 | {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, | |
9096 | {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, | |
9097 | {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, | |
9098 | {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, | |
9099 | {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, | |
9100 | {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, | |
9101 | {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, | |
9102 | {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, | |
9103 | {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, | |
9104 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, | |
9105 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, | |
9106 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, | |
8983eb60 KY |
9107 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, |
9108 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, | |
e2a829b3 | 9109 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
a2ef03fe | 9110 | {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, |
bd9c10bc | 9111 | {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, |
23dc9586 | 9112 | {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, |
fc19d559 | 9113 | {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, |
13468bfa | 9114 | {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, |
c3bb2b52 | 9115 | {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, |
5d84b531 | 9116 | {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, |
f2be77fe | 9117 | {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, |
d94befbb | 9118 | {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, |
9ebaef05 | 9119 | {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, |
29c8f40b | 9120 | {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, |
57c9e21a | 9121 | {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, |
1d045db9 | 9122 | {} |
6dda9f4a | 9123 | }; |
cfc5a845 | 9124 | #define ALC225_STANDARD_PINS \ |
cfc5a845 | 9125 | {0x21, 0x04211020} |
6dda9f4a | 9126 | |
e8191a8e HW |
9127 | #define ALC256_STANDARD_PINS \ |
9128 | {0x12, 0x90a60140}, \ | |
9129 | {0x14, 0x90170110}, \ | |
e8191a8e HW |
9130 | {0x21, 0x02211020} |
9131 | ||
fea185e2 | 9132 | #define ALC282_STANDARD_PINS \ |
11580297 | 9133 | {0x14, 0x90170110} |
e1e62b98 | 9134 | |
fea185e2 | 9135 | #define ALC290_STANDARD_PINS \ |
11580297 | 9136 | {0x12, 0x99a30130} |
fea185e2 DH |
9137 | |
9138 | #define ALC292_STANDARD_PINS \ | |
9139 | {0x14, 0x90170110}, \ | |
11580297 | 9140 | {0x15, 0x0221401f} |
977e6276 | 9141 | |
3f640970 HW |
9142 | #define ALC295_STANDARD_PINS \ |
9143 | {0x12, 0xb7a60130}, \ | |
9144 | {0x14, 0x90170110}, \ | |
3f640970 HW |
9145 | {0x21, 0x04211020} |
9146 | ||
703867e2 WS |
9147 | #define ALC298_STANDARD_PINS \ |
9148 | {0x12, 0x90a60130}, \ | |
9149 | {0x21, 0x03211020} | |
9150 | ||
e1918938 | 9151 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
8a328ac1 KY |
9152 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
9153 | {0x14, 0x01014020}, | |
9154 | {0x17, 0x90170110}, | |
9155 | {0x18, 0x02a11030}, | |
9156 | {0x19, 0x0181303F}, | |
9157 | {0x21, 0x0221102f}), | |
5824ce8d CC |
9158 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
9159 | {0x12, 0x90a601c0}, | |
9160 | {0x14, 0x90171120}, | |
9161 | {0x21, 0x02211030}), | |
615966ad CC |
9162 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
9163 | {0x14, 0x90170110}, | |
9164 | {0x1b, 0x90a70130}, | |
9165 | {0x21, 0x03211020}), | |
9166 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, | |
9167 | {0x1a, 0x90a70130}, | |
9168 | {0x1b, 0x90170110}, | |
9169 | {0x21, 0x03211020}), | |
2ae95577 | 9170 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 9171 | ALC225_STANDARD_PINS, |
8a132099 | 9172 | {0x12, 0xb7a60130}, |
cfc5a845 | 9173 | {0x14, 0x901701a0}), |
2ae95577 | 9174 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 9175 | ALC225_STANDARD_PINS, |
8a132099 | 9176 | {0x12, 0xb7a60130}, |
cfc5a845 | 9177 | {0x14, 0x901701b0}), |
8a132099 HW |
9178 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
9179 | ALC225_STANDARD_PINS, | |
9180 | {0x12, 0xb7a60150}, | |
9181 | {0x14, 0x901701a0}), | |
9182 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9183 | ALC225_STANDARD_PINS, | |
9184 | {0x12, 0xb7a60150}, | |
9185 | {0x14, 0x901701b0}), | |
9186 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9187 | ALC225_STANDARD_PINS, | |
9188 | {0x12, 0xb7a60130}, | |
9189 | {0x1b, 0x90170110}), | |
0ce48e17 KHF |
9190 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
9191 | {0x1b, 0x01111010}, | |
9192 | {0x1e, 0x01451130}, | |
9193 | {0x21, 0x02211020}), | |
986376b6 HW |
9194 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
9195 | {0x12, 0x90a60140}, | |
9196 | {0x14, 0x90170110}, | |
9197 | {0x19, 0x02a11030}, | |
9198 | {0x21, 0x02211020}), | |
e41fc8c5 HW |
9199 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
9200 | {0x14, 0x90170110}, | |
9201 | {0x19, 0x02a11030}, | |
9202 | {0x1a, 0x02a11040}, | |
9203 | {0x1b, 0x01014020}, | |
9204 | {0x21, 0x0221101f}), | |
d06fb562 HW |
9205 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
9206 | {0x14, 0x90170110}, | |
9207 | {0x19, 0x02a11030}, | |
9208 | {0x1a, 0x02a11040}, | |
9209 | {0x1b, 0x01011020}, | |
9210 | {0x21, 0x0221101f}), | |
c6b17f10 HW |
9211 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
9212 | {0x14, 0x90170110}, | |
9213 | {0x19, 0x02a11020}, | |
9214 | {0x1a, 0x02a11030}, | |
9215 | {0x21, 0x0221101f}), | |
92666d45 KY |
9216 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC, |
9217 | {0x21, 0x02211010}), | |
9e885770 KY |
9218 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
9219 | {0x14, 0x90170110}, | |
9220 | {0x19, 0x02a11020}, | |
9221 | {0x21, 0x02211030}), | |
c77900e6 | 9222 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
c77900e6 | 9223 | {0x14, 0x90170110}, |
c77900e6 | 9224 | {0x21, 0x02211020}), |
86c72d1c HW |
9225 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9226 | {0x14, 0x90170130}, | |
9227 | {0x21, 0x02211040}), | |
76c2132e DH |
9228 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9229 | {0x12, 0x90a60140}, | |
9230 | {0x14, 0x90170110}, | |
76c2132e DH |
9231 | {0x21, 0x02211020}), |
9232 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9233 | {0x12, 0x90a60160}, | |
9234 | {0x14, 0x90170120}, | |
76c2132e | 9235 | {0x21, 0x02211030}), |
392c9da2 HW |
9236 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9237 | {0x14, 0x90170110}, | |
9238 | {0x1b, 0x02011020}, | |
9239 | {0x21, 0x0221101f}), | |
6aecd871 HW |
9240 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9241 | {0x14, 0x90170110}, | |
9242 | {0x1b, 0x01011020}, | |
9243 | {0x21, 0x0221101f}), | |
cba59972 | 9244 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
cba59972 | 9245 | {0x14, 0x90170130}, |
cba59972 | 9246 | {0x1b, 0x01014020}, |
cba59972 | 9247 | {0x21, 0x0221103f}), |
6aecd871 HW |
9248 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9249 | {0x14, 0x90170130}, | |
9250 | {0x1b, 0x01011020}, | |
9251 | {0x21, 0x0221103f}), | |
59ec4b57 HW |
9252 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9253 | {0x14, 0x90170130}, | |
9254 | {0x1b, 0x02011020}, | |
9255 | {0x21, 0x0221103f}), | |
e9c28e16 | 9256 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
e9c28e16 | 9257 | {0x14, 0x90170150}, |
e9c28e16 | 9258 | {0x1b, 0x02011020}, |
e9c28e16 WS |
9259 | {0x21, 0x0221105f}), |
9260 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
e9c28e16 | 9261 | {0x14, 0x90170110}, |
e9c28e16 | 9262 | {0x1b, 0x01014020}, |
e9c28e16 | 9263 | {0x21, 0x0221101f}), |
76c2132e DH |
9264 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9265 | {0x12, 0x90a60160}, | |
9266 | {0x14, 0x90170120}, | |
9267 | {0x17, 0x90170140}, | |
76c2132e DH |
9268 | {0x21, 0x0321102f}), |
9269 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9270 | {0x12, 0x90a60160}, | |
9271 | {0x14, 0x90170130}, | |
76c2132e DH |
9272 | {0x21, 0x02211040}), |
9273 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9274 | {0x12, 0x90a60160}, | |
9275 | {0x14, 0x90170140}, | |
76c2132e DH |
9276 | {0x21, 0x02211050}), |
9277 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9278 | {0x12, 0x90a60170}, | |
9279 | {0x14, 0x90170120}, | |
76c2132e DH |
9280 | {0x21, 0x02211030}), |
9281 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9282 | {0x12, 0x90a60170}, | |
9283 | {0x14, 0x90170130}, | |
76c2132e | 9284 | {0x21, 0x02211040}), |
0a1f90a9 HW |
9285 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9286 | {0x12, 0x90a60170}, | |
9287 | {0x14, 0x90171130}, | |
9288 | {0x21, 0x02211040}), | |
70658b99 | 9289 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
70658b99 HW |
9290 | {0x12, 0x90a60170}, |
9291 | {0x14, 0x90170140}, | |
70658b99 | 9292 | {0x21, 0x02211050}), |
9b5a4e39 | 9293 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9b5a4e39 DH |
9294 | {0x12, 0x90a60180}, |
9295 | {0x14, 0x90170130}, | |
9b5a4e39 | 9296 | {0x21, 0x02211040}), |
f90d83b3 AK |
9297 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9298 | {0x12, 0x90a60180}, | |
9299 | {0x14, 0x90170120}, | |
9300 | {0x21, 0x02211030}), | |
989dbe4a HW |
9301 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9302 | {0x1b, 0x01011020}, | |
9303 | {0x21, 0x02211010}), | |
c1732ede CC |
9304 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
9305 | {0x14, 0x90170110}, | |
9306 | {0x1b, 0x90a70130}, | |
9307 | {0x21, 0x04211020}), | |
9308 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, | |
9309 | {0x14, 0x90170110}, | |
9310 | {0x1b, 0x90a70130}, | |
9311 | {0x21, 0x03211020}), | |
a806ef1c CC |
9312 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
9313 | {0x12, 0x90a60130}, | |
9314 | {0x14, 0x90170110}, | |
9315 | {0x21, 0x03211020}), | |
6ac371aa JHP |
9316 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
9317 | {0x12, 0x90a60130}, | |
9318 | {0x14, 0x90170110}, | |
9319 | {0x21, 0x04211020}), | |
e1037354 JHP |
9320 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
9321 | {0x1a, 0x90a70130}, | |
9322 | {0x1b, 0x90170110}, | |
9323 | {0x21, 0x03211020}), | |
9e885770 KY |
9324 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, |
9325 | {0x14, 0x90170110}, | |
9326 | {0x19, 0x02a11020}, | |
9327 | {0x21, 0x0221101f}), | |
8a8de09c KY |
9328 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, |
9329 | {0x17, 0x90170110}, | |
9330 | {0x19, 0x03a11030}, | |
9331 | {0x21, 0x03211020}), | |
cf51eb9d DH |
9332 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
9333 | {0x12, 0x90a60130}, | |
cf51eb9d DH |
9334 | {0x14, 0x90170110}, |
9335 | {0x15, 0x0421101f}, | |
11580297 | 9336 | {0x1a, 0x04a11020}), |
0279661b HW |
9337 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
9338 | {0x12, 0x90a60140}, | |
0279661b HW |
9339 | {0x14, 0x90170110}, |
9340 | {0x15, 0x0421101f}, | |
0279661b | 9341 | {0x18, 0x02811030}, |
0279661b | 9342 | {0x1a, 0x04a1103f}, |
11580297 | 9343 | {0x1b, 0x02011020}), |
42304474 | 9344 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9345 | ALC282_STANDARD_PINS, |
42304474 | 9346 | {0x12, 0x99a30130}, |
42304474 | 9347 | {0x19, 0x03a11020}, |
42304474 | 9348 | {0x21, 0x0321101f}), |
2c609999 | 9349 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9350 | ALC282_STANDARD_PINS, |
2c609999 | 9351 | {0x12, 0x99a30130}, |
2c609999 | 9352 | {0x19, 0x03a11020}, |
2c609999 HW |
9353 | {0x21, 0x03211040}), |
9354 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 9355 | ALC282_STANDARD_PINS, |
2c609999 | 9356 | {0x12, 0x99a30130}, |
2c609999 | 9357 | {0x19, 0x03a11030}, |
2c609999 HW |
9358 | {0x21, 0x03211020}), |
9359 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 9360 | ALC282_STANDARD_PINS, |
2c609999 | 9361 | {0x12, 0x99a30130}, |
2c609999 | 9362 | {0x19, 0x04a11020}, |
2c609999 | 9363 | {0x21, 0x0421101f}), |
200afc09 | 9364 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, |
aec856d0 | 9365 | ALC282_STANDARD_PINS, |
200afc09 | 9366 | {0x12, 0x90a60140}, |
200afc09 | 9367 | {0x19, 0x04a11030}, |
200afc09 | 9368 | {0x21, 0x04211020}), |
34cdf405 CC |
9369 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, |
9370 | ALC282_STANDARD_PINS, | |
9371 | {0x12, 0x90a609c0}, | |
9372 | {0x18, 0x03a11830}, | |
9373 | {0x19, 0x04a19831}, | |
9374 | {0x1a, 0x0481303f}, | |
9375 | {0x1b, 0x04211020}, | |
9376 | {0x21, 0x0321101f}), | |
9377 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, | |
9378 | ALC282_STANDARD_PINS, | |
9379 | {0x12, 0x90a60940}, | |
9380 | {0x18, 0x03a11830}, | |
9381 | {0x19, 0x04a19831}, | |
9382 | {0x1a, 0x0481303f}, | |
9383 | {0x1b, 0x04211020}, | |
9384 | {0x21, 0x0321101f}), | |
76c2132e | 9385 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9386 | ALC282_STANDARD_PINS, |
76c2132e | 9387 | {0x12, 0x90a60130}, |
76c2132e DH |
9388 | {0x21, 0x0321101f}), |
9389 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9390 | {0x12, 0x90a60160}, | |
9391 | {0x14, 0x90170120}, | |
76c2132e | 9392 | {0x21, 0x02211030}), |
bc262179 | 9393 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9394 | ALC282_STANDARD_PINS, |
bc262179 | 9395 | {0x12, 0x90a60130}, |
bc262179 | 9396 | {0x19, 0x03a11020}, |
bc262179 | 9397 | {0x21, 0x0321101f}), |
c8c6ee61 | 9398 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
266fd994 SL |
9399 | {0x12, 0x90a60130}, |
9400 | {0x14, 0x90170110}, | |
9401 | {0x19, 0x04a11040}, | |
9402 | {0x21, 0x04211020}), | |
9403 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, | |
9404 | {0x14, 0x90170110}, | |
9405 | {0x19, 0x04a11040}, | |
9406 | {0x1d, 0x40600001}, | |
9407 | {0x21, 0x04211020}), | |
9408 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, | |
c4cfcf6f HW |
9409 | {0x14, 0x90170110}, |
9410 | {0x19, 0x04a11040}, | |
9411 | {0x21, 0x04211020}), | |
c72b9bfe HW |
9412 | SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK, |
9413 | {0x14, 0x90170110}, | |
9414 | {0x17, 0x90170111}, | |
9415 | {0x19, 0x03a11030}, | |
9416 | {0x21, 0x03211020}), | |
33aaebd4 CC |
9417 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
9418 | {0x12, 0x90a60130}, | |
9419 | {0x17, 0x90170110}, | |
9420 | {0x21, 0x02211020}), | |
d44a6864 | 9421 | SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, |
e1e62b98 | 9422 | {0x12, 0x90a60120}, |
e1e62b98 | 9423 | {0x14, 0x90170110}, |
e1e62b98 | 9424 | {0x21, 0x0321101f}), |
e4442bcf | 9425 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9426 | ALC290_STANDARD_PINS, |
e4442bcf | 9427 | {0x15, 0x04211040}, |
e4442bcf | 9428 | {0x18, 0x90170112}, |
11580297 | 9429 | {0x1a, 0x04a11020}), |
e4442bcf | 9430 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9431 | ALC290_STANDARD_PINS, |
e4442bcf | 9432 | {0x15, 0x04211040}, |
e4442bcf | 9433 | {0x18, 0x90170110}, |
11580297 | 9434 | {0x1a, 0x04a11020}), |
e4442bcf | 9435 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9436 | ALC290_STANDARD_PINS, |
e4442bcf | 9437 | {0x15, 0x0421101f}, |
11580297 | 9438 | {0x1a, 0x04a11020}), |
e4442bcf | 9439 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9440 | ALC290_STANDARD_PINS, |
e4442bcf | 9441 | {0x15, 0x04211020}, |
11580297 | 9442 | {0x1a, 0x04a11040}), |
e4442bcf | 9443 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9444 | ALC290_STANDARD_PINS, |
e4442bcf HW |
9445 | {0x14, 0x90170110}, |
9446 | {0x15, 0x04211020}, | |
11580297 | 9447 | {0x1a, 0x04a11040}), |
e4442bcf | 9448 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9449 | ALC290_STANDARD_PINS, |
e4442bcf HW |
9450 | {0x14, 0x90170110}, |
9451 | {0x15, 0x04211020}, | |
11580297 | 9452 | {0x1a, 0x04a11020}), |
e4442bcf | 9453 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 9454 | ALC290_STANDARD_PINS, |
e4442bcf HW |
9455 | {0x14, 0x90170110}, |
9456 | {0x15, 0x0421101f}, | |
11580297 | 9457 | {0x1a, 0x04a11020}), |
e8818fa8 | 9458 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 9459 | ALC292_STANDARD_PINS, |
e8818fa8 | 9460 | {0x12, 0x90a60140}, |
e8818fa8 | 9461 | {0x16, 0x01014020}, |
11580297 | 9462 | {0x19, 0x01a19030}), |
e8818fa8 | 9463 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 9464 | ALC292_STANDARD_PINS, |
e8818fa8 | 9465 | {0x12, 0x90a60140}, |
e8818fa8 HW |
9466 | {0x16, 0x01014020}, |
9467 | {0x18, 0x02a19031}, | |
11580297 | 9468 | {0x19, 0x01a1903e}), |
76c2132e | 9469 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
aec856d0 | 9470 | ALC292_STANDARD_PINS, |
11580297 | 9471 | {0x12, 0x90a60140}), |
76c2132e | 9472 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9473 | ALC292_STANDARD_PINS, |
76c2132e | 9474 | {0x13, 0x90a60140}, |
76c2132e | 9475 | {0x16, 0x21014020}, |
11580297 | 9476 | {0x19, 0x21a19030}), |
e03fdbde | 9477 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 9478 | ALC292_STANDARD_PINS, |
11580297 | 9479 | {0x13, 0x90a60140}), |
eeacd80f JHP |
9480 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE, |
9481 | {0x17, 0x90170110}, | |
9482 | {0x21, 0x04211020}), | |
d8ae458e CC |
9483 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
9484 | {0x14, 0x90170110}, | |
9485 | {0x1b, 0x90a70130}, | |
9486 | {0x21, 0x04211020}), | |
8bb37a2a JHP |
9487 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
9488 | {0x12, 0x90a60130}, | |
9489 | {0x17, 0x90170110}, | |
9490 | {0x21, 0x03211020}), | |
0bea4cc8 JHP |
9491 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
9492 | {0x12, 0x90a60130}, | |
9493 | {0x17, 0x90170110}, | |
9494 | {0x21, 0x04211020}), | |
3887c26c TI |
9495 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
9496 | {0x12, 0x90a60130}, | |
9497 | {0x17, 0x90170110}, | |
9498 | {0x21, 0x03211020}), | |
9e43342b | 9499 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, |
ad97d667 JHP |
9500 | {0x12, 0x90a60120}, |
9501 | {0x17, 0x90170110}, | |
9502 | {0x21, 0x04211030}), | |
9503 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, | |
9e43342b CC |
9504 | {0x12, 0x90a60130}, |
9505 | {0x17, 0x90170110}, | |
9506 | {0x21, 0x03211020}), | |
9507 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, | |
9508 | {0x12, 0x90a60130}, | |
9509 | {0x17, 0x90170110}, | |
9510 | {0x21, 0x03211020}), | |
fbc57129 | 9511 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
0a29c57b KY |
9512 | {0x14, 0x90170110}, |
9513 | {0x21, 0x04211020}), | |
fbc57129 KY |
9514 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
9515 | {0x14, 0x90170110}, | |
9516 | {0x21, 0x04211030}), | |
3f640970 | 9517 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
f771d5bb HW |
9518 | ALC295_STANDARD_PINS, |
9519 | {0x17, 0x21014020}, | |
9520 | {0x18, 0x21a19030}), | |
9521 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9522 | ALC295_STANDARD_PINS, | |
9523 | {0x17, 0x21014040}, | |
9524 | {0x18, 0x21a19050}), | |
3f307834 HW |
9525 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
9526 | ALC295_STANDARD_PINS), | |
9f502ff5 TI |
9527 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
9528 | ALC298_STANDARD_PINS, | |
9529 | {0x17, 0x90170110}), | |
977e6276 | 9530 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
703867e2 WS |
9531 | ALC298_STANDARD_PINS, |
9532 | {0x17, 0x90170140}), | |
9533 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, | |
9534 | ALC298_STANDARD_PINS, | |
9f502ff5 | 9535 | {0x17, 0x90170150}), |
9f1bc2c4 KHF |
9536 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
9537 | {0x12, 0xb7a60140}, | |
9538 | {0x13, 0xb7a60150}, | |
9539 | {0x17, 0x90170110}, | |
9540 | {0x1a, 0x03011020}, | |
9541 | {0x21, 0x03211030}), | |
54324221 JM |
9542 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, |
9543 | {0x12, 0xb7a60140}, | |
9544 | {0x17, 0x90170110}, | |
9545 | {0x1a, 0x03a11030}, | |
9546 | {0x21, 0x03211020}), | |
fcc6c877 KY |
9547 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
9548 | ALC225_STANDARD_PINS, | |
9549 | {0x12, 0xb7a60130}, | |
fcc6c877 | 9550 | {0x17, 0x90170110}), |
573fcbfd HW |
9551 | SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, |
9552 | {0x14, 0x01014010}, | |
9553 | {0x17, 0x90170120}, | |
9554 | {0x18, 0x02a11030}, | |
9555 | {0x19, 0x02a1103f}, | |
9556 | {0x21, 0x0221101f}), | |
e1918938 HW |
9557 | {} |
9558 | }; | |
6dda9f4a | 9559 | |
7c0a6939 HW |
9560 | /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match |
9561 | * more machines, don't need to match all valid pins, just need to match | |
9562 | * all the pins defined in the tbl. Just because of this reason, it is possible | |
9563 | * that a single machine matches multiple tbls, so there is one limitation: | |
9564 | * at most one tbl is allowed to define for the same vendor and same codec | |
9565 | */ | |
9566 | static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { | |
9567 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, | |
9568 | {0x19, 0x40000000}, | |
9569 | {0x1b, 0x40000000}), | |
aed8c7f4 HW |
9570 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9571 | {0x19, 0x40000000}, | |
9572 | {0x1a, 0x40000000}), | |
d64ebdbf HW |
9573 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9574 | {0x19, 0x40000000}, | |
9575 | {0x1a, 0x40000000}), | |
5815bdfd HW |
9576 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
9577 | {0x19, 0x40000000}, | |
9578 | {0x1a, 0x40000000}), | |
7c0a6939 HW |
9579 | {} |
9580 | }; | |
9581 | ||
546bb678 | 9582 | static void alc269_fill_coef(struct hda_codec *codec) |
1d045db9 | 9583 | { |
526af6eb | 9584 | struct alc_spec *spec = codec->spec; |
1d045db9 | 9585 | int val; |
ebb83eeb | 9586 | |
526af6eb | 9587 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
546bb678 | 9588 | return; |
526af6eb | 9589 | |
1bb7e43e | 9590 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
1d045db9 TI |
9591 | alc_write_coef_idx(codec, 0xf, 0x960b); |
9592 | alc_write_coef_idx(codec, 0xe, 0x8817); | |
9593 | } | |
ebb83eeb | 9594 | |
1bb7e43e | 9595 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
1d045db9 TI |
9596 | alc_write_coef_idx(codec, 0xf, 0x960b); |
9597 | alc_write_coef_idx(codec, 0xe, 0x8814); | |
9598 | } | |
ebb83eeb | 9599 | |
1bb7e43e | 9600 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 | 9601 | /* Power up output pin */ |
98b24883 | 9602 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
1d045db9 | 9603 | } |
ebb83eeb | 9604 | |
1bb7e43e | 9605 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 | 9606 | val = alc_read_coef_idx(codec, 0xd); |
f3ee07d8 | 9607 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
1d045db9 TI |
9608 | /* Capless ramp up clock control */ |
9609 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); | |
9610 | } | |
9611 | val = alc_read_coef_idx(codec, 0x17); | |
f3ee07d8 | 9612 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
1d045db9 TI |
9613 | /* Class D power on reset */ |
9614 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); | |
9615 | } | |
9616 | } | |
ebb83eeb | 9617 | |
98b24883 TI |
9618 | /* HP */ |
9619 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); | |
1d045db9 | 9620 | } |
a7f2371f | 9621 | |
1d045db9 TI |
9622 | /* |
9623 | */ | |
1d045db9 TI |
9624 | static int patch_alc269(struct hda_codec *codec) |
9625 | { | |
9626 | struct alc_spec *spec; | |
3de95173 | 9627 | int err; |
f1d4e28b | 9628 | |
3de95173 | 9629 | err = alc_alloc_spec(codec, 0x0b); |
e16fb6d1 | 9630 | if (err < 0) |
3de95173 TI |
9631 | return err; |
9632 | ||
9633 | spec = codec->spec; | |
08c189f2 | 9634 | spec->gen.shared_mic_vref_pin = 0x18; |
317d9313 | 9635 | codec->power_save_node = 0; |
e16fb6d1 | 9636 | |
225068ab TI |
9637 | #ifdef CONFIG_PM |
9638 | codec->patch_ops.suspend = alc269_suspend; | |
9639 | codec->patch_ops.resume = alc269_resume; | |
9640 | #endif | |
c2d6af53 KY |
9641 | spec->shutup = alc_default_shutup; |
9642 | spec->init_hook = alc_default_init; | |
225068ab | 9643 | |
7639a06c | 9644 | switch (codec->core.vendor_id) { |
065380f0 | 9645 | case 0x10ec0269: |
1d045db9 | 9646 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
1bb7e43e TI |
9647 | switch (alc_get_coef0(codec) & 0x00f0) { |
9648 | case 0x0010: | |
5100cd07 TI |
9649 | if (codec->bus->pci && |
9650 | codec->bus->pci->subsystem_vendor == 0x1025 && | |
e16fb6d1 | 9651 | spec->cdefine.platform_type == 1) |
20ca0c35 | 9652 | err = alc_codec_rename(codec, "ALC271X"); |
1d045db9 | 9653 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
1bb7e43e TI |
9654 | break; |
9655 | case 0x0020: | |
5100cd07 TI |
9656 | if (codec->bus->pci && |
9657 | codec->bus->pci->subsystem_vendor == 0x17aa && | |
e16fb6d1 | 9658 | codec->bus->pci->subsystem_device == 0x21f3) |
20ca0c35 | 9659 | err = alc_codec_rename(codec, "ALC3202"); |
1d045db9 | 9660 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
1bb7e43e | 9661 | break; |
adcc70b2 KY |
9662 | case 0x0030: |
9663 | spec->codec_variant = ALC269_TYPE_ALC269VD; | |
9664 | break; | |
1bb7e43e | 9665 | default: |
1d045db9 | 9666 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
1bb7e43e | 9667 | } |
e16fb6d1 TI |
9668 | if (err < 0) |
9669 | goto error; | |
c2d6af53 | 9670 | spec->shutup = alc269_shutup; |
546bb678 | 9671 | spec->init_hook = alc269_fill_coef; |
1d045db9 | 9672 | alc269_fill_coef(codec); |
065380f0 KY |
9673 | break; |
9674 | ||
9675 | case 0x10ec0280: | |
9676 | case 0x10ec0290: | |
9677 | spec->codec_variant = ALC269_TYPE_ALC280; | |
9678 | break; | |
9679 | case 0x10ec0282: | |
065380f0 | 9680 | spec->codec_variant = ALC269_TYPE_ALC282; |
7b5c7a02 KY |
9681 | spec->shutup = alc282_shutup; |
9682 | spec->init_hook = alc282_init; | |
065380f0 | 9683 | break; |
2af02be7 KY |
9684 | case 0x10ec0233: |
9685 | case 0x10ec0283: | |
9686 | spec->codec_variant = ALC269_TYPE_ALC283; | |
9687 | spec->shutup = alc283_shutup; | |
9688 | spec->init_hook = alc283_init; | |
9689 | break; | |
065380f0 KY |
9690 | case 0x10ec0284: |
9691 | case 0x10ec0292: | |
9692 | spec->codec_variant = ALC269_TYPE_ALC284; | |
9693 | break; | |
161ebf29 | 9694 | case 0x10ec0293: |
4731d5de | 9695 | spec->codec_variant = ALC269_TYPE_ALC293; |
161ebf29 | 9696 | break; |
7fc7d047 | 9697 | case 0x10ec0286: |
7c665932 | 9698 | case 0x10ec0288: |
7fc7d047 KY |
9699 | spec->codec_variant = ALC269_TYPE_ALC286; |
9700 | break; | |
506b62c3 KY |
9701 | case 0x10ec0298: |
9702 | spec->codec_variant = ALC269_TYPE_ALC298; | |
9703 | break; | |
ea04a1db | 9704 | case 0x10ec0235: |
1d04c9de KY |
9705 | case 0x10ec0255: |
9706 | spec->codec_variant = ALC269_TYPE_ALC255; | |
ab3b8e51 KY |
9707 | spec->shutup = alc256_shutup; |
9708 | spec->init_hook = alc256_init; | |
1d04c9de | 9709 | break; |
1948fc06 | 9710 | case 0x10ec0230: |
736f20a7 | 9711 | case 0x10ec0236: |
4344aec8 KY |
9712 | case 0x10ec0256: |
9713 | spec->codec_variant = ALC269_TYPE_ALC256; | |
4a219ef8 KY |
9714 | spec->shutup = alc256_shutup; |
9715 | spec->init_hook = alc256_init; | |
7d1b6e29 | 9716 | spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ |
4344aec8 | 9717 | break; |
f429e7e4 KY |
9718 | case 0x10ec0257: |
9719 | spec->codec_variant = ALC269_TYPE_ALC257; | |
88d42b2b KY |
9720 | spec->shutup = alc256_shutup; |
9721 | spec->init_hook = alc256_init; | |
f429e7e4 KY |
9722 | spec->gen.mixer_nid = 0; |
9723 | break; | |
0a6f0600 | 9724 | case 0x10ec0215: |
7fbdcd83 | 9725 | case 0x10ec0245: |
0a6f0600 KY |
9726 | case 0x10ec0285: |
9727 | case 0x10ec0289: | |
9728 | spec->codec_variant = ALC269_TYPE_ALC215; | |
1b6832be KY |
9729 | spec->shutup = alc225_shutup; |
9730 | spec->init_hook = alc225_init; | |
0a6f0600 KY |
9731 | spec->gen.mixer_nid = 0; |
9732 | break; | |
4231430d | 9733 | case 0x10ec0225: |
7d727869 | 9734 | case 0x10ec0295: |
28f1f9b2 | 9735 | case 0x10ec0299: |
4231430d | 9736 | spec->codec_variant = ALC269_TYPE_ALC225; |
da911b1f KY |
9737 | spec->shutup = alc225_shutup; |
9738 | spec->init_hook = alc225_init; | |
c1350bff | 9739 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ |
4231430d | 9740 | break; |
99cee034 KY |
9741 | case 0x10ec0287: |
9742 | spec->codec_variant = ALC269_TYPE_ALC287; | |
9743 | spec->shutup = alc225_shutup; | |
9744 | spec->init_hook = alc225_init; | |
9745 | spec->gen.mixer_nid = 0; /* no loopback on ALC287 */ | |
9746 | break; | |
dcd4f0db KY |
9747 | case 0x10ec0234: |
9748 | case 0x10ec0274: | |
9749 | case 0x10ec0294: | |
9750 | spec->codec_variant = ALC269_TYPE_ALC294; | |
532a7784 | 9751 | spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ |
71683c32 | 9752 | alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ |
693abe11 | 9753 | spec->init_hook = alc294_init; |
dcd4f0db | 9754 | break; |
1078bef0 KY |
9755 | case 0x10ec0300: |
9756 | spec->codec_variant = ALC269_TYPE_ALC300; | |
9757 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ | |
dcd4f0db | 9758 | break; |
f0778871 KY |
9759 | case 0x10ec0623: |
9760 | spec->codec_variant = ALC269_TYPE_ALC623; | |
9761 | break; | |
6fbae35a KY |
9762 | case 0x10ec0700: |
9763 | case 0x10ec0701: | |
9764 | case 0x10ec0703: | |
83629532 | 9765 | case 0x10ec0711: |
6fbae35a KY |
9766 | spec->codec_variant = ALC269_TYPE_ALC700; |
9767 | spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ | |
2d7fe618 | 9768 | alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ |
693abe11 | 9769 | spec->init_hook = alc294_init; |
6fbae35a KY |
9770 | break; |
9771 | ||
1d045db9 | 9772 | } |
6dda9f4a | 9773 | |
ad60d502 | 9774 | if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { |
97a26570 | 9775 | spec->has_alc5505_dsp = 1; |
ad60d502 KY |
9776 | spec->init_hook = alc5505_dsp_init; |
9777 | } | |
9778 | ||
c9af753f TI |
9779 | alc_pre_init(codec); |
9780 | ||
efe55732 TI |
9781 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
9782 | alc269_fixup_tbl, alc269_fixups); | |
13d9c6b9 TI |
9783 | /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and |
9784 | * the quirk breaks the latter (bko#214101). | |
9785 | * Clear the wrong entry. | |
9786 | */ | |
9787 | if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 && | |
9788 | codec->core.vendor_id == 0x10ec0294) { | |
9789 | codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n"); | |
9790 | codec->fixup_id = HDA_FIXUP_ID_NOT_SET; | |
9791 | } | |
9792 | ||
0fc1e447 | 9793 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); |
7c0a6939 | 9794 | snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); |
efe55732 TI |
9795 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
9796 | alc269_fixups); | |
9797 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
9798 | ||
9799 | alc_auto_parse_customize_define(codec); | |
9800 | ||
9801 | if (has_cdefine_beep(codec)) | |
9802 | spec->gen.beep_nid = 0x01; | |
9803 | ||
a4297b5d TI |
9804 | /* automatic parse from the BIOS config */ |
9805 | err = alc269_parse_auto_config(codec); | |
e16fb6d1 TI |
9806 | if (err < 0) |
9807 | goto error; | |
6dda9f4a | 9808 | |
fea80fae TI |
9809 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { |
9810 | err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); | |
9811 | if (err < 0) | |
9812 | goto error; | |
9813 | } | |
f1d4e28b | 9814 | |
1727a771 | 9815 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 9816 | |
1d045db9 | 9817 | return 0; |
e16fb6d1 TI |
9818 | |
9819 | error: | |
9820 | alc_free(codec); | |
9821 | return err; | |
1d045db9 | 9822 | } |
f1d4e28b | 9823 | |
1d045db9 TI |
9824 | /* |
9825 | * ALC861 | |
9826 | */ | |
622e84cd | 9827 | |
1d045db9 | 9828 | static int alc861_parse_auto_config(struct hda_codec *codec) |
6dda9f4a | 9829 | { |
1d045db9 | 9830 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
9831 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
9832 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); | |
604401a9 TI |
9833 | } |
9834 | ||
1d045db9 TI |
9835 | /* Pin config fixes */ |
9836 | enum { | |
e652f4c8 TI |
9837 | ALC861_FIXUP_FSC_AMILO_PI1505, |
9838 | ALC861_FIXUP_AMP_VREF_0F, | |
9839 | ALC861_FIXUP_NO_JACK_DETECT, | |
9840 | ALC861_FIXUP_ASUS_A6RP, | |
6ddf0fd1 | 9841 | ALC660_FIXUP_ASUS_W7J, |
1d045db9 | 9842 | }; |
7085ec12 | 9843 | |
31150f23 TI |
9844 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
9845 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, | |
1727a771 | 9846 | const struct hda_fixup *fix, int action) |
31150f23 TI |
9847 | { |
9848 | struct alc_spec *spec = codec->spec; | |
9849 | unsigned int val; | |
9850 | ||
1727a771 | 9851 | if (action != HDA_FIXUP_ACT_INIT) |
31150f23 | 9852 | return; |
d3f02d60 | 9853 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
31150f23 TI |
9854 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
9855 | val |= AC_PINCTL_IN_EN; | |
9856 | val |= AC_PINCTL_VREF_50; | |
cdd03ced | 9857 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
08c189f2 | 9858 | spec->gen.keep_vref_in_automute = 1; |
31150f23 TI |
9859 | } |
9860 | ||
e652f4c8 TI |
9861 | /* suppress the jack-detection */ |
9862 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, | |
1727a771 | 9863 | const struct hda_fixup *fix, int action) |
e652f4c8 | 9864 | { |
1727a771 | 9865 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
e652f4c8 | 9866 | codec->no_jack_detect = 1; |
7d7eb9ea | 9867 | } |
e652f4c8 | 9868 | |
1727a771 | 9869 | static const struct hda_fixup alc861_fixups[] = { |
e652f4c8 | 9870 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
1727a771 TI |
9871 | .type = HDA_FIXUP_PINS, |
9872 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
9873 | { 0x0b, 0x0221101f }, /* HP */ |
9874 | { 0x0f, 0x90170310 }, /* speaker */ | |
9875 | { } | |
9876 | } | |
9877 | }, | |
e652f4c8 | 9878 | [ALC861_FIXUP_AMP_VREF_0F] = { |
1727a771 | 9879 | .type = HDA_FIXUP_FUNC, |
31150f23 | 9880 | .v.func = alc861_fixup_asus_amp_vref_0f, |
3b25eb69 | 9881 | }, |
e652f4c8 | 9882 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 9883 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
9884 | .v.func = alc_fixup_no_jack_detect, |
9885 | }, | |
9886 | [ALC861_FIXUP_ASUS_A6RP] = { | |
1727a771 | 9887 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
9888 | .v.func = alc861_fixup_asus_amp_vref_0f, |
9889 | .chained = true, | |
9890 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, | |
6ddf0fd1 TI |
9891 | }, |
9892 | [ALC660_FIXUP_ASUS_W7J] = { | |
9893 | .type = HDA_FIXUP_VERBS, | |
9894 | .v.verbs = (const struct hda_verb[]) { | |
9895 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 | |
9896 | * for enabling outputs | |
9897 | */ | |
9898 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, | |
9899 | { } | |
9900 | }, | |
e652f4c8 | 9901 | } |
1d045db9 | 9902 | }; |
7085ec12 | 9903 | |
1d045db9 | 9904 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
6ddf0fd1 | 9905 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
e7ca237b | 9906 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
e652f4c8 TI |
9907 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
9908 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), | |
9909 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), | |
defce244 | 9910 | SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F), |
e652f4c8 | 9911 | SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), |
1d045db9 TI |
9912 | {} |
9913 | }; | |
3af9ee6b | 9914 | |
1d045db9 TI |
9915 | /* |
9916 | */ | |
1d045db9 | 9917 | static int patch_alc861(struct hda_codec *codec) |
7085ec12 | 9918 | { |
1d045db9 | 9919 | struct alc_spec *spec; |
1d045db9 | 9920 | int err; |
7085ec12 | 9921 | |
3de95173 TI |
9922 | err = alc_alloc_spec(codec, 0x15); |
9923 | if (err < 0) | |
9924 | return err; | |
1d045db9 | 9925 | |
3de95173 | 9926 | spec = codec->spec; |
2722b535 TI |
9927 | if (has_cdefine_beep(codec)) |
9928 | spec->gen.beep_nid = 0x23; | |
1d045db9 | 9929 | |
225068ab TI |
9930 | #ifdef CONFIG_PM |
9931 | spec->power_hook = alc_power_eapd; | |
9932 | #endif | |
9933 | ||
c9af753f TI |
9934 | alc_pre_init(codec); |
9935 | ||
1727a771 TI |
9936 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
9937 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
3af9ee6b | 9938 | |
cb4e4824 TI |
9939 | /* automatic parse from the BIOS config */ |
9940 | err = alc861_parse_auto_config(codec); | |
e16fb6d1 TI |
9941 | if (err < 0) |
9942 | goto error; | |
3af9ee6b | 9943 | |
fea80fae TI |
9944 | if (!spec->gen.no_analog) { |
9945 | err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); | |
9946 | if (err < 0) | |
9947 | goto error; | |
9948 | } | |
7085ec12 | 9949 | |
1727a771 | 9950 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 9951 | |
1d045db9 | 9952 | return 0; |
e16fb6d1 TI |
9953 | |
9954 | error: | |
9955 | alc_free(codec); | |
9956 | return err; | |
7085ec12 TI |
9957 | } |
9958 | ||
1d045db9 TI |
9959 | /* |
9960 | * ALC861-VD support | |
9961 | * | |
9962 | * Based on ALC882 | |
9963 | * | |
9964 | * In addition, an independent DAC | |
9965 | */ | |
1d045db9 | 9966 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
bc9f98a9 | 9967 | { |
1d045db9 | 9968 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
9969 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
9970 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); | |
ce764ab2 TI |
9971 | } |
9972 | ||
1d045db9 | 9973 | enum { |
8fdcb6fe TI |
9974 | ALC660VD_FIX_ASUS_GPIO1, |
9975 | ALC861VD_FIX_DALLAS, | |
1d045db9 | 9976 | }; |
ce764ab2 | 9977 | |
8fdcb6fe TI |
9978 | /* exclude VREF80 */ |
9979 | static void alc861vd_fixup_dallas(struct hda_codec *codec, | |
1727a771 | 9980 | const struct hda_fixup *fix, int action) |
8fdcb6fe | 9981 | { |
1727a771 | 9982 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
b78562b1 TI |
9983 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
9984 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); | |
8fdcb6fe TI |
9985 | } |
9986 | } | |
9987 | ||
df73d83f TI |
9988 | /* reset GPIO1 */ |
9989 | static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, | |
9990 | const struct hda_fixup *fix, int action) | |
9991 | { | |
9992 | struct alc_spec *spec = codec->spec; | |
9993 | ||
9994 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
9995 | spec->gpio_mask |= 0x02; | |
9996 | alc_fixup_gpio(codec, action, 0x01); | |
9997 | } | |
9998 | ||
1727a771 | 9999 | static const struct hda_fixup alc861vd_fixups[] = { |
1d045db9 | 10000 | [ALC660VD_FIX_ASUS_GPIO1] = { |
df73d83f TI |
10001 | .type = HDA_FIXUP_FUNC, |
10002 | .v.func = alc660vd_fixup_asus_gpio1, | |
1d045db9 | 10003 | }, |
8fdcb6fe | 10004 | [ALC861VD_FIX_DALLAS] = { |
1727a771 | 10005 | .type = HDA_FIXUP_FUNC, |
8fdcb6fe TI |
10006 | .v.func = alc861vd_fixup_dallas, |
10007 | }, | |
1d045db9 | 10008 | }; |
ce764ab2 | 10009 | |
1d045db9 | 10010 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
8fdcb6fe | 10011 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
1d045db9 | 10012 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
8fdcb6fe | 10013 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
1d045db9 TI |
10014 | {} |
10015 | }; | |
ce764ab2 | 10016 | |
1d045db9 TI |
10017 | /* |
10018 | */ | |
1d045db9 | 10019 | static int patch_alc861vd(struct hda_codec *codec) |
ce764ab2 | 10020 | { |
1d045db9 | 10021 | struct alc_spec *spec; |
cb4e4824 | 10022 | int err; |
ce764ab2 | 10023 | |
3de95173 TI |
10024 | err = alc_alloc_spec(codec, 0x0b); |
10025 | if (err < 0) | |
10026 | return err; | |
1d045db9 | 10027 | |
3de95173 | 10028 | spec = codec->spec; |
2722b535 TI |
10029 | if (has_cdefine_beep(codec)) |
10030 | spec->gen.beep_nid = 0x23; | |
1d045db9 | 10031 | |
225068ab TI |
10032 | spec->shutup = alc_eapd_shutup; |
10033 | ||
c9af753f TI |
10034 | alc_pre_init(codec); |
10035 | ||
1727a771 TI |
10036 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
10037 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
1d045db9 | 10038 | |
cb4e4824 TI |
10039 | /* automatic parse from the BIOS config */ |
10040 | err = alc861vd_parse_auto_config(codec); | |
e16fb6d1 TI |
10041 | if (err < 0) |
10042 | goto error; | |
ce764ab2 | 10043 | |
fea80fae TI |
10044 | if (!spec->gen.no_analog) { |
10045 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
10046 | if (err < 0) | |
10047 | goto error; | |
10048 | } | |
1d045db9 | 10049 | |
1727a771 | 10050 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 10051 | |
ce764ab2 | 10052 | return 0; |
e16fb6d1 TI |
10053 | |
10054 | error: | |
10055 | alc_free(codec); | |
10056 | return err; | |
ce764ab2 TI |
10057 | } |
10058 | ||
1d045db9 TI |
10059 | /* |
10060 | * ALC662 support | |
10061 | * | |
10062 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible | |
10063 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
10064 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
10065 | * 6-channel independent captures. | |
10066 | * | |
10067 | * In addition, an independent DAC for the multi-playback (not used in this | |
10068 | * driver yet). | |
10069 | */ | |
1d045db9 TI |
10070 | |
10071 | /* | |
10072 | * BIOS auto configuration | |
10073 | */ | |
10074 | ||
bc9f98a9 KY |
10075 | static int alc662_parse_auto_config(struct hda_codec *codec) |
10076 | { | |
4c6d72d1 | 10077 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
10078 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
10079 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
10080 | const hda_nid_t *ssids; | |
ee979a14 | 10081 | |
7639a06c TI |
10082 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
10083 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || | |
10084 | codec->core.vendor_id == 0x10ec0671) | |
3e6179b8 | 10085 | ssids = alc663_ssids; |
6227cdce | 10086 | else |
3e6179b8 TI |
10087 | ssids = alc662_ssids; |
10088 | return alc_parse_auto_config(codec, alc662_ignore, ssids); | |
bc9f98a9 KY |
10089 | } |
10090 | ||
6be7948f | 10091 | static void alc272_fixup_mario(struct hda_codec *codec, |
1727a771 | 10092 | const struct hda_fixup *fix, int action) |
6fc398cb | 10093 | { |
9bb1f06f | 10094 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
6fc398cb | 10095 | return; |
6be7948f TB |
10096 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
10097 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | | |
10098 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
10099 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
10100 | (0 << AC_AMPCAP_MUTE_SHIFT))) | |
4e76a883 | 10101 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
6be7948f TB |
10102 | } |
10103 | ||
8e383953 TI |
10104 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
10105 | { .channels = 2, | |
10106 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, | |
10107 | { .channels = 4, | |
10108 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, | |
10109 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ | |
10110 | { } | |
10111 | }; | |
10112 | ||
10113 | /* override the 2.1 chmap */ | |
eb9ca3ab | 10114 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
8e383953 TI |
10115 | const struct hda_fixup *fix, int action) |
10116 | { | |
10117 | if (action == HDA_FIXUP_ACT_BUILD) { | |
10118 | struct alc_spec *spec = codec->spec; | |
bbbc7e85 | 10119 | spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; |
8e383953 TI |
10120 | } |
10121 | } | |
10122 | ||
bf68665d TI |
10123 | /* avoid D3 for keeping GPIO up */ |
10124 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, | |
10125 | hda_nid_t nid, | |
10126 | unsigned int power_state) | |
10127 | { | |
10128 | struct alc_spec *spec = codec->spec; | |
d261eec8 | 10129 | if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) |
bf68665d TI |
10130 | return AC_PWRST_D0; |
10131 | return power_state; | |
10132 | } | |
10133 | ||
3e887f37 TI |
10134 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
10135 | const struct hda_fixup *fix, int action) | |
10136 | { | |
10137 | struct alc_spec *spec = codec->spec; | |
3e887f37 | 10138 | |
01e4a275 | 10139 | alc_fixup_hp_gpio_led(codec, action, 0x01, 0); |
3e887f37 | 10140 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
0f32fd19 | 10141 | spec->mute_led_polarity = 1; |
bf68665d | 10142 | codec->power_filter = gpio_led_power_filter; |
3e887f37 TI |
10143 | } |
10144 | } | |
10145 | ||
c6790c8e KY |
10146 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
10147 | struct hda_jack_callback *jack) | |
10148 | { | |
10149 | struct alc_spec *spec = codec->spec; | |
10150 | int vref; | |
10151 | msleep(200); | |
10152 | snd_hda_gen_hp_automute(codec, jack); | |
10153 | ||
10154 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
10155 | msleep(100); | |
10156 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
10157 | vref); | |
10158 | } | |
10159 | ||
10160 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, | |
10161 | const struct hda_fixup *fix, int action) | |
10162 | { | |
10163 | struct alc_spec *spec = codec->spec; | |
10164 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
10165 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
10166 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; | |
10167 | } | |
10168 | } | |
10169 | ||
00066e97 SB |
10170 | static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, |
10171 | struct hda_jack_callback *cb) | |
10172 | { | |
10173 | /* surround speakers at 0x1b already get muted automatically when | |
10174 | * headphones are plugged in, but we have to mute/unmute the remaining | |
10175 | * channels manually: | |
10176 | * 0x15 - front left/front right | |
10177 | * 0x18 - front center/ LFE | |
10178 | */ | |
10179 | if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { | |
10180 | snd_hda_set_pin_ctl_cache(codec, 0x15, 0); | |
10181 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); | |
10182 | } else { | |
10183 | snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); | |
10184 | snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); | |
10185 | } | |
10186 | } | |
10187 | ||
10188 | static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, | |
10189 | const struct hda_fixup *fix, int action) | |
10190 | { | |
10191 | /* Pin 0x1b: shared headphones jack and surround speakers */ | |
10192 | if (!is_jack_detectable(codec, 0x1b)) | |
10193 | return; | |
10194 | ||
10195 | switch (action) { | |
10196 | case HDA_FIXUP_ACT_PRE_PROBE: | |
10197 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
10198 | alc662_aspire_ethos_mute_speakers); | |
336820c4 TI |
10199 | /* subwoofer needs an extra GPIO setting to become audible */ |
10200 | alc_setup_gpio(codec, 0x02); | |
00066e97 SB |
10201 | break; |
10202 | case HDA_FIXUP_ACT_INIT: | |
10203 | /* Make sure to start in a correct state, i.e. if | |
10204 | * headphones have been plugged in before powering up the system | |
10205 | */ | |
10206 | alc662_aspire_ethos_mute_speakers(codec, NULL); | |
10207 | break; | |
10208 | } | |
10209 | } | |
10210 | ||
5af29028 KY |
10211 | static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, |
10212 | const struct hda_fixup *fix, int action) | |
10213 | { | |
10214 | struct alc_spec *spec = codec->spec; | |
10215 | ||
10216 | static const struct hda_pintbl pincfgs[] = { | |
10217 | { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ | |
10218 | { 0x1b, 0x0181304f }, | |
10219 | { } | |
10220 | }; | |
10221 | ||
10222 | switch (action) { | |
10223 | case HDA_FIXUP_ACT_PRE_PROBE: | |
10224 | spec->gen.mixer_nid = 0; | |
10225 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
10226 | snd_hda_apply_pincfgs(codec, pincfgs); | |
10227 | break; | |
10228 | case HDA_FIXUP_ACT_INIT: | |
10229 | alc_write_coef_idx(codec, 0x19, 0xa054); | |
10230 | break; | |
10231 | } | |
10232 | } | |
10233 | ||
6b0f95c4 | 10234 | static const struct coef_fw alc668_coefs[] = { |
f3f9185f KY |
10235 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), |
10236 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), | |
10237 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), | |
10238 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), | |
10239 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), | |
10240 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), | |
10241 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), | |
10242 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), | |
10243 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), | |
10244 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), | |
10245 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), | |
10246 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), | |
10247 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), | |
10248 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), | |
10249 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), | |
10250 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), | |
10251 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), | |
10252 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), | |
10253 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), | |
10254 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), | |
10255 | {} | |
10256 | }; | |
10257 | ||
10258 | static void alc668_restore_default_value(struct hda_codec *codec) | |
10259 | { | |
10260 | alc_process_coef_fw(codec, alc668_coefs); | |
10261 | } | |
10262 | ||
6cb3b707 | 10263 | enum { |
2df03514 | 10264 | ALC662_FIXUP_ASPIRE, |
3e887f37 | 10265 | ALC662_FIXUP_LED_GPIO1, |
6cb3b707 | 10266 | ALC662_FIXUP_IDEAPAD, |
6be7948f | 10267 | ALC272_FIXUP_MARIO, |
f1ec5be1 | 10268 | ALC662_FIXUP_CZC_ET26, |
d2ebd479 | 10269 | ALC662_FIXUP_CZC_P10T, |
94024cd1 | 10270 | ALC662_FIXUP_SKU_IGNORE, |
e59ea3ed | 10271 | ALC662_FIXUP_HP_RP5800, |
53c334ad TI |
10272 | ALC662_FIXUP_ASUS_MODE1, |
10273 | ALC662_FIXUP_ASUS_MODE2, | |
10274 | ALC662_FIXUP_ASUS_MODE3, | |
10275 | ALC662_FIXUP_ASUS_MODE4, | |
10276 | ALC662_FIXUP_ASUS_MODE5, | |
10277 | ALC662_FIXUP_ASUS_MODE6, | |
10278 | ALC662_FIXUP_ASUS_MODE7, | |
10279 | ALC662_FIXUP_ASUS_MODE8, | |
1565cc35 | 10280 | ALC662_FIXUP_NO_JACK_DETECT, |
edfe3bfc | 10281 | ALC662_FIXUP_ZOTAC_Z68, |
125821ae | 10282 | ALC662_FIXUP_INV_DMIC, |
1f8b46cd | 10283 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
73bdd597 | 10284 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 10285 | ALC662_FIXUP_HEADSET_MODE, |
73bdd597 | 10286 | ALC668_FIXUP_HEADSET_MODE, |
8e54b4ac | 10287 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
61a75f13 | 10288 | ALC662_FIXUP_BASS_16, |
a30c9aaa | 10289 | ALC662_FIXUP_BASS_1A, |
8e54b4ac | 10290 | ALC662_FIXUP_BASS_CHMAP, |
493a52a9 | 10291 | ALC668_FIXUP_AUTO_MUTE, |
5e6db669 | 10292 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
033b0a7c | 10293 | ALC668_FIXUP_DELL_XPS13, |
9d4dc584 | 10294 | ALC662_FIXUP_ASUS_Nx50, |
fc7438b1 | 10295 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 10296 | ALC668_FIXUP_ASUS_Nx51, |
5b7c5e1f | 10297 | ALC668_FIXUP_MIC_COEF, |
11ba6111 | 10298 | ALC668_FIXUP_ASUS_G751, |
78f4f7c2 KY |
10299 | ALC891_FIXUP_HEADSET_MODE, |
10300 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, | |
9b51fe3e | 10301 | ALC662_FIXUP_ACER_VERITON, |
1a3f0991 | 10302 | ALC892_FIXUP_ASROCK_MOBO, |
c6790c8e KY |
10303 | ALC662_FIXUP_USI_FUNC, |
10304 | ALC662_FIXUP_USI_HEADSET_MODE, | |
ca169cc2 | 10305 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
00066e97 | 10306 | ALC669_FIXUP_ACER_ASPIRE_ETHOS, |
00066e97 | 10307 | ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, |
5af29028 | 10308 | ALC671_FIXUP_HP_HEADSET_MIC2, |
d858c706 | 10309 | ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
a124458a | 10310 | ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
a3fd1a98 HW |
10311 | ALC668_FIXUP_ASUS_NO_HEADSET_MIC, |
10312 | ALC668_FIXUP_HEADSET_MIC, | |
10313 | ALC668_FIXUP_MIC_DET_COEF, | |
6cb3b707 DH |
10314 | }; |
10315 | ||
1727a771 | 10316 | static const struct hda_fixup alc662_fixups[] = { |
2df03514 | 10317 | [ALC662_FIXUP_ASPIRE] = { |
1727a771 TI |
10318 | .type = HDA_FIXUP_PINS, |
10319 | .v.pins = (const struct hda_pintbl[]) { | |
2df03514 DC |
10320 | { 0x15, 0x99130112 }, /* subwoofer */ |
10321 | { } | |
10322 | } | |
10323 | }, | |
3e887f37 TI |
10324 | [ALC662_FIXUP_LED_GPIO1] = { |
10325 | .type = HDA_FIXUP_FUNC, | |
10326 | .v.func = alc662_fixup_led_gpio1, | |
10327 | }, | |
6cb3b707 | 10328 | [ALC662_FIXUP_IDEAPAD] = { |
1727a771 TI |
10329 | .type = HDA_FIXUP_PINS, |
10330 | .v.pins = (const struct hda_pintbl[]) { | |
6cb3b707 DH |
10331 | { 0x17, 0x99130112 }, /* subwoofer */ |
10332 | { } | |
3e887f37 TI |
10333 | }, |
10334 | .chained = true, | |
10335 | .chain_id = ALC662_FIXUP_LED_GPIO1, | |
6cb3b707 | 10336 | }, |
6be7948f | 10337 | [ALC272_FIXUP_MARIO] = { |
1727a771 | 10338 | .type = HDA_FIXUP_FUNC, |
b5bfbc67 | 10339 | .v.func = alc272_fixup_mario, |
d2ebd479 | 10340 | }, |
f1ec5be1 HC |
10341 | [ALC662_FIXUP_CZC_ET26] = { |
10342 | .type = HDA_FIXUP_PINS, | |
10343 | .v.pins = (const struct hda_pintbl[]) { | |
10344 | {0x12, 0x403cc000}, | |
10345 | {0x14, 0x90170110}, /* speaker */ | |
10346 | {0x15, 0x411111f0}, | |
10347 | {0x16, 0x411111f0}, | |
10348 | {0x18, 0x01a19030}, /* mic */ | |
10349 | {0x19, 0x90a7013f}, /* int-mic */ | |
10350 | {0x1a, 0x01014020}, | |
10351 | {0x1b, 0x0121401f}, | |
10352 | {0x1c, 0x411111f0}, | |
10353 | {0x1d, 0x411111f0}, | |
10354 | {0x1e, 0x40478e35}, | |
10355 | {} | |
10356 | }, | |
10357 | .chained = true, | |
10358 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10359 | }, | |
d2ebd479 | 10360 | [ALC662_FIXUP_CZC_P10T] = { |
1727a771 | 10361 | .type = HDA_FIXUP_VERBS, |
d2ebd479 AA |
10362 | .v.verbs = (const struct hda_verb[]) { |
10363 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
10364 | {} | |
10365 | } | |
10366 | }, | |
94024cd1 | 10367 | [ALC662_FIXUP_SKU_IGNORE] = { |
1727a771 | 10368 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 10369 | .v.func = alc_fixup_sku_ignore, |
c6b35874 | 10370 | }, |
e59ea3ed | 10371 | [ALC662_FIXUP_HP_RP5800] = { |
1727a771 TI |
10372 | .type = HDA_FIXUP_PINS, |
10373 | .v.pins = (const struct hda_pintbl[]) { | |
e59ea3ed TI |
10374 | { 0x14, 0x0221201f }, /* HP out */ |
10375 | { } | |
10376 | }, | |
10377 | .chained = true, | |
10378 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10379 | }, | |
53c334ad | 10380 | [ALC662_FIXUP_ASUS_MODE1] = { |
1727a771 TI |
10381 | .type = HDA_FIXUP_PINS, |
10382 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10383 | { 0x14, 0x99130110 }, /* speaker */ |
10384 | { 0x18, 0x01a19c20 }, /* mic */ | |
10385 | { 0x19, 0x99a3092f }, /* int-mic */ | |
10386 | { 0x21, 0x0121401f }, /* HP out */ | |
10387 | { } | |
10388 | }, | |
10389 | .chained = true, | |
10390 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10391 | }, | |
10392 | [ALC662_FIXUP_ASUS_MODE2] = { | |
1727a771 TI |
10393 | .type = HDA_FIXUP_PINS, |
10394 | .v.pins = (const struct hda_pintbl[]) { | |
2996bdba TI |
10395 | { 0x14, 0x99130110 }, /* speaker */ |
10396 | { 0x18, 0x01a19820 }, /* mic */ | |
10397 | { 0x19, 0x99a3092f }, /* int-mic */ | |
10398 | { 0x1b, 0x0121401f }, /* HP out */ | |
10399 | { } | |
10400 | }, | |
53c334ad TI |
10401 | .chained = true, |
10402 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10403 | }, | |
10404 | [ALC662_FIXUP_ASUS_MODE3] = { | |
1727a771 TI |
10405 | .type = HDA_FIXUP_PINS, |
10406 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10407 | { 0x14, 0x99130110 }, /* speaker */ |
10408 | { 0x15, 0x0121441f }, /* HP */ | |
10409 | { 0x18, 0x01a19840 }, /* mic */ | |
10410 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10411 | { 0x21, 0x01211420 }, /* HP2 */ | |
10412 | { } | |
10413 | }, | |
10414 | .chained = true, | |
10415 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10416 | }, | |
10417 | [ALC662_FIXUP_ASUS_MODE4] = { | |
1727a771 TI |
10418 | .type = HDA_FIXUP_PINS, |
10419 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10420 | { 0x14, 0x99130110 }, /* speaker */ |
10421 | { 0x16, 0x99130111 }, /* speaker */ | |
10422 | { 0x18, 0x01a19840 }, /* mic */ | |
10423 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10424 | { 0x21, 0x0121441f }, /* HP */ | |
10425 | { } | |
10426 | }, | |
10427 | .chained = true, | |
10428 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10429 | }, | |
10430 | [ALC662_FIXUP_ASUS_MODE5] = { | |
1727a771 TI |
10431 | .type = HDA_FIXUP_PINS, |
10432 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10433 | { 0x14, 0x99130110 }, /* speaker */ |
10434 | { 0x15, 0x0121441f }, /* HP */ | |
10435 | { 0x16, 0x99130111 }, /* speaker */ | |
10436 | { 0x18, 0x01a19840 }, /* mic */ | |
10437 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10438 | { } | |
10439 | }, | |
10440 | .chained = true, | |
10441 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10442 | }, | |
10443 | [ALC662_FIXUP_ASUS_MODE6] = { | |
1727a771 TI |
10444 | .type = HDA_FIXUP_PINS, |
10445 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10446 | { 0x14, 0x99130110 }, /* speaker */ |
10447 | { 0x15, 0x01211420 }, /* HP2 */ | |
10448 | { 0x18, 0x01a19840 }, /* mic */ | |
10449 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10450 | { 0x1b, 0x0121441f }, /* HP */ | |
10451 | { } | |
10452 | }, | |
10453 | .chained = true, | |
10454 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10455 | }, | |
10456 | [ALC662_FIXUP_ASUS_MODE7] = { | |
1727a771 TI |
10457 | .type = HDA_FIXUP_PINS, |
10458 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10459 | { 0x14, 0x99130110 }, /* speaker */ |
10460 | { 0x17, 0x99130111 }, /* speaker */ | |
10461 | { 0x18, 0x01a19840 }, /* mic */ | |
10462 | { 0x19, 0x99a3094f }, /* int-mic */ | |
10463 | { 0x1b, 0x01214020 }, /* HP */ | |
10464 | { 0x21, 0x0121401f }, /* HP */ | |
10465 | { } | |
10466 | }, | |
10467 | .chained = true, | |
10468 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
10469 | }, | |
10470 | [ALC662_FIXUP_ASUS_MODE8] = { | |
1727a771 TI |
10471 | .type = HDA_FIXUP_PINS, |
10472 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
10473 | { 0x14, 0x99130110 }, /* speaker */ |
10474 | { 0x12, 0x99a30970 }, /* int-mic */ | |
10475 | { 0x15, 0x01214020 }, /* HP */ | |
10476 | { 0x17, 0x99130111 }, /* speaker */ | |
10477 | { 0x18, 0x01a19840 }, /* mic */ | |
10478 | { 0x21, 0x0121401f }, /* HP */ | |
10479 | { } | |
10480 | }, | |
10481 | .chained = true, | |
10482 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
2996bdba | 10483 | }, |
1565cc35 | 10484 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 10485 | .type = HDA_FIXUP_FUNC, |
1565cc35 TI |
10486 | .v.func = alc_fixup_no_jack_detect, |
10487 | }, | |
edfe3bfc | 10488 | [ALC662_FIXUP_ZOTAC_Z68] = { |
1727a771 TI |
10489 | .type = HDA_FIXUP_PINS, |
10490 | .v.pins = (const struct hda_pintbl[]) { | |
edfe3bfc DH |
10491 | { 0x1b, 0x02214020 }, /* Front HP */ |
10492 | { } | |
10493 | } | |
10494 | }, | |
125821ae | 10495 | [ALC662_FIXUP_INV_DMIC] = { |
1727a771 | 10496 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 10497 | .v.func = alc_fixup_inv_dmic, |
125821ae | 10498 | }, |
033b0a7c GM |
10499 | [ALC668_FIXUP_DELL_XPS13] = { |
10500 | .type = HDA_FIXUP_FUNC, | |
10501 | .v.func = alc_fixup_dell_xps13, | |
10502 | .chained = true, | |
10503 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX | |
10504 | }, | |
5e6db669 GM |
10505 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
10506 | .type = HDA_FIXUP_FUNC, | |
10507 | .v.func = alc_fixup_disable_aamix, | |
10508 | .chained = true, | |
10509 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
10510 | }, | |
493a52a9 HW |
10511 | [ALC668_FIXUP_AUTO_MUTE] = { |
10512 | .type = HDA_FIXUP_FUNC, | |
10513 | .v.func = alc_fixup_auto_mute_via_amp, | |
10514 | .chained = true, | |
10515 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
10516 | }, | |
1f8b46cd DH |
10517 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
10518 | .type = HDA_FIXUP_PINS, | |
10519 | .v.pins = (const struct hda_pintbl[]) { | |
10520 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
10521 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ | |
10522 | { } | |
10523 | }, | |
10524 | .chained = true, | |
10525 | .chain_id = ALC662_FIXUP_HEADSET_MODE | |
10526 | }, | |
10527 | [ALC662_FIXUP_HEADSET_MODE] = { | |
10528 | .type = HDA_FIXUP_FUNC, | |
10529 | .v.func = alc_fixup_headset_mode_alc662, | |
10530 | }, | |
73bdd597 DH |
10531 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
10532 | .type = HDA_FIXUP_PINS, | |
10533 | .v.pins = (const struct hda_pintbl[]) { | |
10534 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
10535 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
10536 | { } | |
10537 | }, | |
10538 | .chained = true, | |
10539 | .chain_id = ALC668_FIXUP_HEADSET_MODE | |
10540 | }, | |
10541 | [ALC668_FIXUP_HEADSET_MODE] = { | |
10542 | .type = HDA_FIXUP_FUNC, | |
10543 | .v.func = alc_fixup_headset_mode_alc668, | |
10544 | }, | |
8e54b4ac | 10545 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
8e383953 | 10546 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 10547 | .v.func = alc_fixup_bass_chmap, |
8e383953 TI |
10548 | .chained = true, |
10549 | .chain_id = ALC662_FIXUP_ASUS_MODE4 | |
10550 | }, | |
61a75f13 DH |
10551 | [ALC662_FIXUP_BASS_16] = { |
10552 | .type = HDA_FIXUP_PINS, | |
10553 | .v.pins = (const struct hda_pintbl[]) { | |
10554 | {0x16, 0x80106111}, /* bass speaker */ | |
10555 | {} | |
10556 | }, | |
10557 | .chained = true, | |
10558 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
10559 | }, | |
a30c9aaa TI |
10560 | [ALC662_FIXUP_BASS_1A] = { |
10561 | .type = HDA_FIXUP_PINS, | |
10562 | .v.pins = (const struct hda_pintbl[]) { | |
10563 | {0x1a, 0x80106111}, /* bass speaker */ | |
10564 | {} | |
10565 | }, | |
8e54b4ac DH |
10566 | .chained = true, |
10567 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
a30c9aaa | 10568 | }, |
8e54b4ac | 10569 | [ALC662_FIXUP_BASS_CHMAP] = { |
a30c9aaa | 10570 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 10571 | .v.func = alc_fixup_bass_chmap, |
a30c9aaa | 10572 | }, |
9d4dc584 BM |
10573 | [ALC662_FIXUP_ASUS_Nx50] = { |
10574 | .type = HDA_FIXUP_FUNC, | |
10575 | .v.func = alc_fixup_auto_mute_via_amp, | |
10576 | .chained = true, | |
10577 | .chain_id = ALC662_FIXUP_BASS_1A | |
10578 | }, | |
fc7438b1 MP |
10579 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
10580 | .type = HDA_FIXUP_FUNC, | |
10581 | .v.func = alc_fixup_headset_mode_alc668, | |
10582 | .chain_id = ALC662_FIXUP_BASS_CHMAP | |
10583 | }, | |
3231e205 YP |
10584 | [ALC668_FIXUP_ASUS_Nx51] = { |
10585 | .type = HDA_FIXUP_PINS, | |
10586 | .v.pins = (const struct hda_pintbl[]) { | |
fc7438b1 MP |
10587 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
10588 | { 0x1a, 0x90170151 }, /* bass speaker */ | |
10589 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
3231e205 YP |
10590 | {} |
10591 | }, | |
10592 | .chained = true, | |
fc7438b1 | 10593 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 10594 | }, |
5b7c5e1f | 10595 | [ALC668_FIXUP_MIC_COEF] = { |
11ba6111 TI |
10596 | .type = HDA_FIXUP_VERBS, |
10597 | .v.verbs = (const struct hda_verb[]) { | |
10598 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, | |
10599 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, | |
10600 | {} | |
10601 | }, | |
10602 | }, | |
5b7c5e1f TI |
10603 | [ALC668_FIXUP_ASUS_G751] = { |
10604 | .type = HDA_FIXUP_PINS, | |
10605 | .v.pins = (const struct hda_pintbl[]) { | |
10606 | { 0x16, 0x0421101f }, /* HP */ | |
10607 | {} | |
10608 | }, | |
10609 | .chained = true, | |
10610 | .chain_id = ALC668_FIXUP_MIC_COEF | |
10611 | }, | |
78f4f7c2 KY |
10612 | [ALC891_FIXUP_HEADSET_MODE] = { |
10613 | .type = HDA_FIXUP_FUNC, | |
10614 | .v.func = alc_fixup_headset_mode, | |
10615 | }, | |
10616 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { | |
10617 | .type = HDA_FIXUP_PINS, | |
10618 | .v.pins = (const struct hda_pintbl[]) { | |
10619 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
10620 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
10621 | { } | |
10622 | }, | |
10623 | .chained = true, | |
10624 | .chain_id = ALC891_FIXUP_HEADSET_MODE | |
10625 | }, | |
9b51fe3e SB |
10626 | [ALC662_FIXUP_ACER_VERITON] = { |
10627 | .type = HDA_FIXUP_PINS, | |
10628 | .v.pins = (const struct hda_pintbl[]) { | |
10629 | { 0x15, 0x50170120 }, /* no internal speaker */ | |
10630 | { } | |
10631 | } | |
10632 | }, | |
1a3f0991 TI |
10633 | [ALC892_FIXUP_ASROCK_MOBO] = { |
10634 | .type = HDA_FIXUP_PINS, | |
10635 | .v.pins = (const struct hda_pintbl[]) { | |
10636 | { 0x15, 0x40f000f0 }, /* disabled */ | |
10637 | { 0x16, 0x40f000f0 }, /* disabled */ | |
1a3f0991 TI |
10638 | { } |
10639 | } | |
10640 | }, | |
c6790c8e KY |
10641 | [ALC662_FIXUP_USI_FUNC] = { |
10642 | .type = HDA_FIXUP_FUNC, | |
10643 | .v.func = alc662_fixup_usi_headset_mic, | |
10644 | }, | |
10645 | [ALC662_FIXUP_USI_HEADSET_MODE] = { | |
10646 | .type = HDA_FIXUP_PINS, | |
10647 | .v.pins = (const struct hda_pintbl[]) { | |
10648 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ | |
10649 | { 0x18, 0x01a1903d }, | |
10650 | { } | |
10651 | }, | |
10652 | .chained = true, | |
10653 | .chain_id = ALC662_FIXUP_USI_FUNC | |
10654 | }, | |
ca169cc2 KY |
10655 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
10656 | .type = HDA_FIXUP_FUNC, | |
10657 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
10658 | }, | |
00066e97 SB |
10659 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { |
10660 | .type = HDA_FIXUP_FUNC, | |
10661 | .v.func = alc662_fixup_aspire_ethos_hp, | |
10662 | }, | |
00066e97 SB |
10663 | [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { |
10664 | .type = HDA_FIXUP_PINS, | |
10665 | .v.pins = (const struct hda_pintbl[]) { | |
10666 | { 0x15, 0x92130110 }, /* front speakers */ | |
10667 | { 0x18, 0x99130111 }, /* center/subwoofer */ | |
10668 | { 0x1b, 0x11130012 }, /* surround plus jack for HP */ | |
10669 | { } | |
10670 | }, | |
10671 | .chained = true, | |
336820c4 | 10672 | .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET |
00066e97 | 10673 | }, |
5af29028 KY |
10674 | [ALC671_FIXUP_HP_HEADSET_MIC2] = { |
10675 | .type = HDA_FIXUP_FUNC, | |
10676 | .v.func = alc671_fixup_hp_headset_mic2, | |
10677 | }, | |
d858c706 JHP |
10678 | [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { |
10679 | .type = HDA_FIXUP_PINS, | |
10680 | .v.pins = (const struct hda_pintbl[]) { | |
10681 | { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ | |
10682 | { } | |
10683 | }, | |
10684 | .chained = true, | |
10685 | .chain_id = ALC662_FIXUP_USI_FUNC | |
10686 | }, | |
a124458a JHP |
10687 | [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { |
10688 | .type = HDA_FIXUP_PINS, | |
10689 | .v.pins = (const struct hda_pintbl[]) { | |
10690 | { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ | |
10691 | { 0x1b, 0x0221144f }, | |
10692 | { } | |
10693 | }, | |
10694 | .chained = true, | |
10695 | .chain_id = ALC662_FIXUP_USI_FUNC | |
10696 | }, | |
a3fd1a98 HW |
10697 | [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = { |
10698 | .type = HDA_FIXUP_PINS, | |
10699 | .v.pins = (const struct hda_pintbl[]) { | |
10700 | { 0x1b, 0x04a1112c }, | |
10701 | { } | |
10702 | }, | |
10703 | .chained = true, | |
10704 | .chain_id = ALC668_FIXUP_HEADSET_MIC | |
10705 | }, | |
10706 | [ALC668_FIXUP_HEADSET_MIC] = { | |
10707 | .type = HDA_FIXUP_FUNC, | |
10708 | .v.func = alc269_fixup_headset_mic, | |
10709 | .chained = true, | |
10710 | .chain_id = ALC668_FIXUP_MIC_DET_COEF | |
10711 | }, | |
10712 | [ALC668_FIXUP_MIC_DET_COEF] = { | |
10713 | .type = HDA_FIXUP_VERBS, | |
10714 | .v.verbs = (const struct hda_verb[]) { | |
10715 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 }, | |
10716 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 }, | |
10717 | {} | |
10718 | }, | |
10719 | }, | |
6cb3b707 DH |
10720 | }; |
10721 | ||
a9111321 | 10722 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
53c334ad | 10723 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
d3d3835c | 10724 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
02f6ff90 | 10725 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
a6c47a85 | 10726 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
94024cd1 | 10727 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
125821ae | 10728 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
1801928e | 10729 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
2df03514 | 10730 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
9edeb110 | 10731 | SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), |
a124458a | 10732 | SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), |
d858c706 | 10733 | SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), |
73bdd597 DH |
10734 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
10735 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
c5d019c3 | 10736 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
033b0a7c | 10737 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
467e1436 | 10738 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
09d2014f | 10739 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
ad8ff99e | 10740 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
8dc9abb9 KY |
10741 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
10742 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
6a98e34b | 10743 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
e59ea3ed | 10744 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
148ebf54 | 10745 | SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), |
2da2dc9e | 10746 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
83a9efb5 | 10747 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
9d4dc584 | 10748 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
11ba6111 | 10749 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
9edeb110 | 10750 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
8e54b4ac | 10751 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
61a75f13 | 10752 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
3231e205 YP |
10753 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
10754 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), | |
a3fd1a98 | 10755 | SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC), |
c7efff92 | 10756 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
61a75f13 | 10757 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
8e54b4ac | 10758 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
1565cc35 | 10759 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
53c334ad | 10760 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
a0e90acc | 10761 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
c6790c8e | 10762 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
ca169cc2 | 10763 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
d4118588 | 10764 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
6cb3b707 | 10765 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
1a3f0991 | 10766 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
edfe3bfc | 10767 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
9b51fe3e | 10768 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
f1ec5be1 | 10769 | SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), |
d2ebd479 | 10770 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
53c334ad TI |
10771 | |
10772 | #if 0 | |
10773 | /* Below is a quirk table taken from the old code. | |
10774 | * Basically the device should work as is without the fixup table. | |
10775 | * If BIOS doesn't give a proper info, enable the corresponding | |
10776 | * fixup entry. | |
7d7eb9ea | 10777 | */ |
53c334ad TI |
10778 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
10779 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), | |
10780 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), | |
10781 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), | |
10782 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10783 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10784 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10785 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), | |
10786 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), | |
10787 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10788 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), | |
10789 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), | |
10790 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), | |
10791 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), | |
10792 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), | |
10793 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10794 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), | |
10795 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), | |
10796 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10797 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
10798 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
10799 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10800 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), | |
10801 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), | |
10802 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), | |
10803 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10804 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), | |
10805 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
10806 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10807 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), | |
10808 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10809 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10810 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), | |
10811 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), | |
10812 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), | |
10813 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), | |
10814 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), | |
10815 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), | |
10816 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), | |
10817 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
10818 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), | |
10819 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), | |
10820 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10821 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), | |
10822 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), | |
10823 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), | |
10824 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), | |
10825 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), | |
10826 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
10827 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), | |
10828 | #endif | |
6cb3b707 DH |
10829 | {} |
10830 | }; | |
10831 | ||
1727a771 | 10832 | static const struct hda_model_fixup alc662_fixup_models[] = { |
aa3841b5 TI |
10833 | {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, |
10834 | {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, | |
6be7948f | 10835 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
aa3841b5 | 10836 | {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, |
53c334ad TI |
10837 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
10838 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, | |
10839 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, | |
10840 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, | |
10841 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, | |
10842 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, | |
10843 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, | |
10844 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, | |
aa3841b5 | 10845 | {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, |
6e72aa5f | 10846 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
aa3841b5 | 10847 | {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, |
e32aa85a | 10848 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
aa3841b5 TI |
10849 | {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, |
10850 | {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, | |
10851 | {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, | |
10852 | {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, | |
10853 | {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, | |
10854 | {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, | |
10855 | {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, | |
10856 | {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, | |
40c51675 | 10857 | {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, |
aa3841b5 TI |
10858 | {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, |
10859 | {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, | |
10860 | {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, | |
10861 | {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, | |
10862 | {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, | |
ba90d6a6 | 10863 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
00066e97 | 10864 | {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, |
6be7948f TB |
10865 | {} |
10866 | }; | |
6cb3b707 | 10867 | |
532895c5 | 10868 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
78f4f7c2 KY |
10869 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
10870 | {0x17, 0x02211010}, | |
10871 | {0x18, 0x01a19030}, | |
10872 | {0x1a, 0x01813040}, | |
10873 | {0x21, 0x01014020}), | |
4b4e0e32 HW |
10874 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
10875 | {0x16, 0x01813030}, | |
10876 | {0x17, 0x02211010}, | |
10877 | {0x18, 0x01a19040}, | |
10878 | {0x21, 0x01014020}), | |
1f8b46cd | 10879 | SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 10880 | {0x14, 0x01014010}, |
1f8b46cd | 10881 | {0x18, 0x01a19020}, |
1f8b46cd | 10882 | {0x1a, 0x0181302f}, |
11580297 | 10883 | {0x1b, 0x0221401f}), |
76c2132e DH |
10884 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
10885 | {0x12, 0x99a30130}, | |
10886 | {0x14, 0x90170110}, | |
10887 | {0x15, 0x0321101f}, | |
11580297 | 10888 | {0x16, 0x03011020}), |
76c2132e DH |
10889 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
10890 | {0x12, 0x99a30140}, | |
10891 | {0x14, 0x90170110}, | |
10892 | {0x15, 0x0321101f}, | |
11580297 | 10893 | {0x16, 0x03011020}), |
76c2132e DH |
10894 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
10895 | {0x12, 0x99a30150}, | |
10896 | {0x14, 0x90170110}, | |
10897 | {0x15, 0x0321101f}, | |
11580297 | 10898 | {0x16, 0x03011020}), |
76c2132e | 10899 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
76c2132e DH |
10900 | {0x14, 0x90170110}, |
10901 | {0x15, 0x0321101f}, | |
11580297 | 10902 | {0x16, 0x03011020}), |
76c2132e DH |
10903 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
10904 | {0x12, 0x90a60130}, | |
10905 | {0x14, 0x90170110}, | |
11580297 | 10906 | {0x15, 0x0321101f}), |
5af29028 KY |
10907 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, |
10908 | {0x14, 0x01014010}, | |
10909 | {0x17, 0x90170150}, | |
f2adbae0 | 10910 | {0x19, 0x02a11060}, |
5af29028 KY |
10911 | {0x1b, 0x01813030}, |
10912 | {0x21, 0x02211020}), | |
10913 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, | |
10914 | {0x14, 0x01014010}, | |
10915 | {0x18, 0x01a19040}, | |
10916 | {0x1b, 0x01813030}, | |
10917 | {0x21, 0x02211020}), | |
10918 | SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, | |
10919 | {0x14, 0x01014020}, | |
10920 | {0x17, 0x90170110}, | |
10921 | {0x18, 0x01a19050}, | |
10922 | {0x1b, 0x01813040}, | |
10923 | {0x21, 0x02211030}), | |
532895c5 HW |
10924 | {} |
10925 | }; | |
10926 | ||
1d045db9 TI |
10927 | /* |
10928 | */ | |
bc9f98a9 KY |
10929 | static int patch_alc662(struct hda_codec *codec) |
10930 | { | |
10931 | struct alc_spec *spec; | |
3de95173 | 10932 | int err; |
bc9f98a9 | 10933 | |
3de95173 TI |
10934 | err = alc_alloc_spec(codec, 0x0b); |
10935 | if (err < 0) | |
10936 | return err; | |
bc9f98a9 | 10937 | |
3de95173 | 10938 | spec = codec->spec; |
1f0f4b80 | 10939 | |
225068ab TI |
10940 | spec->shutup = alc_eapd_shutup; |
10941 | ||
53c334ad TI |
10942 | /* handle multiple HPs as is */ |
10943 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
10944 | ||
2c3bf9ab TI |
10945 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
10946 | ||
7639a06c | 10947 | switch (codec->core.vendor_id) { |
f3f9185f KY |
10948 | case 0x10ec0668: |
10949 | spec->init_hook = alc668_restore_default_value; | |
10950 | break; | |
f3f9185f | 10951 | } |
8663ff75 | 10952 | |
c9af753f TI |
10953 | alc_pre_init(codec); |
10954 | ||
1727a771 | 10955 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
8e5a0509 | 10956 | alc662_fixup_tbl, alc662_fixups); |
0fc1e447 | 10957 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); |
1727a771 | 10958 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
8e5a0509 TI |
10959 | |
10960 | alc_auto_parse_customize_define(codec); | |
10961 | ||
7504b6cd TI |
10962 | if (has_cdefine_beep(codec)) |
10963 | spec->gen.beep_nid = 0x01; | |
10964 | ||
1bb7e43e | 10965 | if ((alc_get_coef0(codec) & (1 << 14)) && |
5100cd07 | 10966 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
e16fb6d1 | 10967 | spec->cdefine.platform_type == 1) { |
6134b1a2 WY |
10968 | err = alc_codec_rename(codec, "ALC272X"); |
10969 | if (err < 0) | |
e16fb6d1 | 10970 | goto error; |
20ca0c35 | 10971 | } |
274693f3 | 10972 | |
b9c5106c TI |
10973 | /* automatic parse from the BIOS config */ |
10974 | err = alc662_parse_auto_config(codec); | |
e16fb6d1 TI |
10975 | if (err < 0) |
10976 | goto error; | |
bc9f98a9 | 10977 | |
7504b6cd | 10978 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
7639a06c | 10979 | switch (codec->core.vendor_id) { |
da00c244 | 10980 | case 0x10ec0662: |
fea80fae | 10981 | err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
da00c244 KY |
10982 | break; |
10983 | case 0x10ec0272: | |
10984 | case 0x10ec0663: | |
10985 | case 0x10ec0665: | |
9ad54547 | 10986 | case 0x10ec0668: |
fea80fae | 10987 | err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
da00c244 KY |
10988 | break; |
10989 | case 0x10ec0273: | |
fea80fae | 10990 | err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
da00c244 KY |
10991 | break; |
10992 | } | |
fea80fae TI |
10993 | if (err < 0) |
10994 | goto error; | |
cec27c89 | 10995 | } |
2134ea4f | 10996 | |
1727a771 | 10997 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 10998 | |
bc9f98a9 | 10999 | return 0; |
801f49d3 | 11000 | |
e16fb6d1 TI |
11001 | error: |
11002 | alc_free(codec); | |
11003 | return err; | |
b478b998 KY |
11004 | } |
11005 | ||
d1eb57f4 KY |
11006 | /* |
11007 | * ALC680 support | |
11008 | */ | |
d1eb57f4 | 11009 | |
d1eb57f4 KY |
11010 | static int alc680_parse_auto_config(struct hda_codec *codec) |
11011 | { | |
3e6179b8 | 11012 | return alc_parse_auto_config(codec, NULL, NULL); |
d1eb57f4 KY |
11013 | } |
11014 | ||
d1eb57f4 | 11015 | /* |
d1eb57f4 | 11016 | */ |
d1eb57f4 KY |
11017 | static int patch_alc680(struct hda_codec *codec) |
11018 | { | |
d1eb57f4 KY |
11019 | int err; |
11020 | ||
1f0f4b80 | 11021 | /* ALC680 has no aa-loopback mixer */ |
3de95173 TI |
11022 | err = alc_alloc_spec(codec, 0); |
11023 | if (err < 0) | |
11024 | return err; | |
1f0f4b80 | 11025 | |
1ebec5f2 TI |
11026 | /* automatic parse from the BIOS config */ |
11027 | err = alc680_parse_auto_config(codec); | |
11028 | if (err < 0) { | |
11029 | alc_free(codec); | |
11030 | return err; | |
d1eb57f4 KY |
11031 | } |
11032 | ||
d1eb57f4 KY |
11033 | return 0; |
11034 | } | |
11035 | ||
1da177e4 LT |
11036 | /* |
11037 | * patch entries | |
11038 | */ | |
b9a94a9c | 11039 | static const struct hda_device_id snd_hda_id_realtek[] = { |
0a6f0600 | 11040 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
b9a94a9c | 11041 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
2a36c16e | 11042 | HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), |
4231430d | 11043 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
1948fc06 | 11044 | HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269), |
b9a94a9c TI |
11045 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
11046 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), | |
dcd4f0db | 11047 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
b9a94a9c | 11048 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
736f20a7 | 11049 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
7fbdcd83 | 11050 | HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), |
b9a94a9c TI |
11051 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
11052 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), | |
f429e7e4 | 11053 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
b9a94a9c TI |
11054 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
11055 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), | |
11056 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), | |
11057 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), | |
11058 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), | |
11059 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), | |
11060 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), | |
dcd4f0db | 11061 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
b9a94a9c TI |
11062 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
11063 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), | |
11064 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), | |
11065 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), | |
11066 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), | |
11067 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), | |
0a6f0600 | 11068 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
b9a94a9c | 11069 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
630e3612 | 11070 | HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), |
b9a94a9c | 11071 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), |
0a6f0600 | 11072 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
b9a94a9c TI |
11073 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
11074 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), | |
11075 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), | |
dcd4f0db | 11076 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
7d727869 | 11077 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
b9a94a9c | 11078 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
28f1f9b2 | 11079 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
1078bef0 | 11080 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
f0778871 | 11081 | HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), |
b9a94a9c TI |
11082 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
11083 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), | |
11084 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), | |
11085 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), | |
11086 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), | |
11087 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), | |
11088 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), | |
11089 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), | |
11090 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), | |
11091 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), | |
11092 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), | |
11093 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), | |
11094 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), | |
11095 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), | |
6fbae35a KY |
11096 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
11097 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), | |
11098 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), | |
83629532 | 11099 | HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), |
78f4f7c2 | 11100 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
b9a94a9c TI |
11101 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
11102 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), | |
11103 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), | |
11104 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), | |
11105 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), | |
11106 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), | |
11107 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), | |
11108 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), | |
11109 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), | |
11110 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), | |
11111 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), | |
e5782a5d | 11112 | HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662), |
b9a94a9c TI |
11113 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), |
11114 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), | |
6d9ffcff | 11115 | HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), |
65553b12 | 11116 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
a535ad57 | 11117 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
1da177e4 LT |
11118 | {} /* terminator */ |
11119 | }; | |
b9a94a9c | 11120 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
1289e9e8 TI |
11121 | |
11122 | MODULE_LICENSE("GPL"); | |
11123 | MODULE_DESCRIPTION("Realtek HD-audio codec"); | |
11124 | ||
d8a766a1 | 11125 | static struct hda_codec_driver realtek_driver = { |
b9a94a9c | 11126 | .id = snd_hda_id_realtek, |
1289e9e8 TI |
11127 | }; |
11128 | ||
d8a766a1 | 11129 | module_hda_codec_driver(realtek_driver); |