]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * Universal Interface for Intel High Definition Audio Codec | |
3 | * | |
1d045db9 | 4 | * HD audio interface patch for Realtek ALC codecs |
1da177e4 | 5 | * |
df694daa KY |
6 | * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw> |
7 | * PeiSen Hou <pshou@realtek.com.tw> | |
1da177e4 | 8 | * Takashi Iwai <tiwai@suse.de> |
409a3e98 | 9 | * Jonathan Woithe <jwoithe@just42.net> |
1da177e4 LT |
10 | * |
11 | * This driver is free software; you can redistribute it and/or modify | |
12 | * it under the terms of the GNU General Public License as published by | |
13 | * the Free Software Foundation; either version 2 of the License, or | |
14 | * (at your option) any later version. | |
15 | * | |
16 | * This driver is distributed in the hope that it will be useful, | |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | * GNU General Public License for more details. | |
20 | * | |
21 | * You should have received a copy of the GNU General Public License | |
22 | * along with this program; if not, write to the Free Software | |
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 | */ | |
25 | ||
1da177e4 LT |
26 | #include <linux/init.h> |
27 | #include <linux/delay.h> | |
28 | #include <linux/slab.h> | |
29 | #include <linux/pci.h> | |
08fb0d0e | 30 | #include <linux/dmi.h> |
da155d5b | 31 | #include <linux/module.h> |
33f4acd3 | 32 | #include <linux/input.h> |
1da177e4 | 33 | #include <sound/core.h> |
9ad0e496 | 34 | #include <sound/jack.h> |
1da177e4 LT |
35 | #include "hda_codec.h" |
36 | #include "hda_local.h" | |
23d30f28 | 37 | #include "hda_auto_parser.h" |
1835a0f9 | 38 | #include "hda_jack.h" |
08c189f2 | 39 | #include "hda_generic.h" |
1da177e4 | 40 | |
cd63a5ff TI |
41 | /* keep halting ALC5505 DSP, for power saving */ |
42 | #define HALT_REALTEK_ALC5505 | |
43 | ||
4a79ba34 TI |
44 | /* extra amp-initialization sequence types */ |
45 | enum { | |
46 | ALC_INIT_NONE, | |
47 | ALC_INIT_DEFAULT, | |
48 | ALC_INIT_GPIO1, | |
49 | ALC_INIT_GPIO2, | |
50 | ALC_INIT_GPIO3, | |
51 | }; | |
52 | ||
73bdd597 DH |
53 | enum { |
54 | ALC_HEADSET_MODE_UNKNOWN, | |
55 | ALC_HEADSET_MODE_UNPLUGGED, | |
56 | ALC_HEADSET_MODE_HEADSET, | |
57 | ALC_HEADSET_MODE_MIC, | |
58 | ALC_HEADSET_MODE_HEADPHONE, | |
59 | }; | |
60 | ||
61 | enum { | |
62 | ALC_HEADSET_TYPE_UNKNOWN, | |
63 | ALC_HEADSET_TYPE_CTIA, | |
64 | ALC_HEADSET_TYPE_OMTP, | |
65 | }; | |
66 | ||
c7b60a89 HW |
67 | enum { |
68 | ALC_KEY_MICMUTE_INDEX, | |
69 | }; | |
70 | ||
da00c244 KY |
71 | struct alc_customize_define { |
72 | unsigned int sku_cfg; | |
73 | unsigned char port_connectivity; | |
74 | unsigned char check_sum; | |
75 | unsigned char customization; | |
76 | unsigned char external_amp; | |
77 | unsigned int enable_pcbeep:1; | |
78 | unsigned int platform_type:1; | |
79 | unsigned int swap:1; | |
80 | unsigned int override:1; | |
90622917 | 81 | unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ |
da00c244 KY |
82 | }; |
83 | ||
1da177e4 | 84 | struct alc_spec { |
08c189f2 | 85 | struct hda_gen_spec gen; /* must be at head */ |
23d30f28 | 86 | |
1da177e4 | 87 | /* codec parameterization */ |
a9111321 | 88 | const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ |
1da177e4 | 89 | unsigned int num_mixers; |
45bdd1c1 | 90 | unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */ |
1da177e4 | 91 | |
da00c244 | 92 | struct alc_customize_define cdefine; |
08c189f2 | 93 | unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ |
834be88d | 94 | |
08fb0d0e TI |
95 | /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */ |
96 | int mute_led_polarity; | |
97 | hda_nid_t mute_led_nid; | |
9c5dc3bf | 98 | hda_nid_t cap_mute_led_nid; |
08fb0d0e | 99 | |
9f5c6faf | 100 | unsigned int gpio_led; /* used for alc269_fixup_hp_gpio_led() */ |
0f32fd19 TI |
101 | unsigned int gpio_mute_led_mask; |
102 | unsigned int gpio_mic_led_mask; | |
9f5c6faf | 103 | |
73bdd597 DH |
104 | hda_nid_t headset_mic_pin; |
105 | hda_nid_t headphone_mic_pin; | |
106 | int current_headset_mode; | |
107 | int current_headset_type; | |
108 | ||
ae6b813a TI |
109 | /* hooks */ |
110 | void (*init_hook)(struct hda_codec *codec); | |
83012a7c | 111 | #ifdef CONFIG_PM |
c97259df | 112 | void (*power_hook)(struct hda_codec *codec); |
f5de24b0 | 113 | #endif |
1c716153 | 114 | void (*shutup)(struct hda_codec *codec); |
70a0976b | 115 | void (*reboot_notify)(struct hda_codec *codec); |
d922b51d | 116 | |
4a79ba34 | 117 | int init_amp; |
d433a678 | 118 | int codec_variant; /* flag for other variants */ |
97a26570 KY |
119 | unsigned int has_alc5505_dsp:1; |
120 | unsigned int no_depop_delay:1; | |
6e25f0c7 | 121 | unsigned int done_hp_init:1; |
b001f661 | 122 | unsigned int no_shutup_pins:1; |
e64f14f4 | 123 | |
2c3bf9ab TI |
124 | /* for PLL fix */ |
125 | hda_nid_t pll_nid; | |
126 | unsigned int pll_coef_idx, pll_coef_bit; | |
1bb7e43e | 127 | unsigned int coef0; |
33f4acd3 | 128 | struct input_dev *kb_dev; |
c7b60a89 | 129 | u8 alc_mute_keycode_map[1]; |
df694daa KY |
130 | }; |
131 | ||
f2a227cd TI |
132 | /* |
133 | * COEF access helper functions | |
134 | */ | |
135 | ||
136 | static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
137 | unsigned int coef_idx) | |
138 | { | |
139 | unsigned int val; | |
140 | ||
141 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
142 | val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); | |
143 | return val; | |
144 | } | |
145 | ||
146 | #define alc_read_coef_idx(codec, coef_idx) \ | |
147 | alc_read_coefex_idx(codec, 0x20, coef_idx) | |
148 | ||
149 | static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, | |
150 | unsigned int coef_idx, unsigned int coef_val) | |
151 | { | |
152 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); | |
153 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); | |
154 | } | |
155 | ||
156 | #define alc_write_coef_idx(codec, coef_idx, coef_val) \ | |
157 | alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) | |
158 | ||
98b24883 TI |
159 | static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, |
160 | unsigned int coef_idx, unsigned int mask, | |
161 | unsigned int bits_set) | |
162 | { | |
163 | unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); | |
164 | ||
165 | if (val != -1) | |
166 | alc_write_coefex_idx(codec, nid, coef_idx, | |
167 | (val & ~mask) | bits_set); | |
168 | } | |
169 | ||
170 | #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ | |
171 | alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) | |
172 | ||
f2a227cd TI |
173 | /* a special bypass for COEF 0; read the cached value at the second time */ |
174 | static unsigned int alc_get_coef0(struct hda_codec *codec) | |
175 | { | |
176 | struct alc_spec *spec = codec->spec; | |
177 | ||
178 | if (!spec->coef0) | |
179 | spec->coef0 = alc_read_coef_idx(codec, 0); | |
180 | return spec->coef0; | |
181 | } | |
182 | ||
54db6c39 TI |
183 | /* coef writes/updates batch */ |
184 | struct coef_fw { | |
185 | unsigned char nid; | |
186 | unsigned char idx; | |
187 | unsigned short mask; | |
188 | unsigned short val; | |
189 | }; | |
190 | ||
191 | #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ | |
192 | { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } | |
193 | #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) | |
194 | #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) | |
195 | #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) | |
196 | ||
197 | static void alc_process_coef_fw(struct hda_codec *codec, | |
198 | const struct coef_fw *fw) | |
199 | { | |
200 | for (; fw->nid; fw++) { | |
201 | if (fw->mask == (unsigned short)-1) | |
202 | alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); | |
203 | else | |
204 | alc_update_coefex_idx(codec, fw->nid, fw->idx, | |
205 | fw->mask, fw->val); | |
206 | } | |
207 | } | |
208 | ||
d88897ea | 209 | /* |
1d045db9 TI |
210 | * Append the given mixer and verb elements for the later use |
211 | * The mixer array is referred in build_controls(), and init_verbs are | |
212 | * called in init(). | |
d88897ea | 213 | */ |
a9111321 | 214 | static void add_mixer(struct alc_spec *spec, const struct snd_kcontrol_new *mix) |
d88897ea TI |
215 | { |
216 | if (snd_BUG_ON(spec->num_mixers >= ARRAY_SIZE(spec->mixers))) | |
217 | return; | |
218 | spec->mixers[spec->num_mixers++] = mix; | |
219 | } | |
220 | ||
df694daa | 221 | /* |
1d045db9 | 222 | * GPIO setup tables, used in initialization |
df694daa | 223 | */ |
bc9f98a9 | 224 | /* Enable GPIO mask and set output */ |
a9111321 | 225 | static const struct hda_verb alc_gpio1_init_verbs[] = { |
bc9f98a9 KY |
226 | {0x01, AC_VERB_SET_GPIO_MASK, 0x01}, |
227 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, | |
228 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, | |
229 | { } | |
230 | }; | |
231 | ||
a9111321 | 232 | static const struct hda_verb alc_gpio2_init_verbs[] = { |
bc9f98a9 KY |
233 | {0x01, AC_VERB_SET_GPIO_MASK, 0x02}, |
234 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x02}, | |
235 | {0x01, AC_VERB_SET_GPIO_DATA, 0x02}, | |
236 | { } | |
237 | }; | |
238 | ||
a9111321 | 239 | static const struct hda_verb alc_gpio3_init_verbs[] = { |
bdd148a3 KY |
240 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
241 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03}, | |
242 | {0x01, AC_VERB_SET_GPIO_DATA, 0x03}, | |
243 | { } | |
244 | }; | |
245 | ||
2c3bf9ab TI |
246 | /* |
247 | * Fix hardware PLL issue | |
248 | * On some codecs, the analog PLL gating control must be off while | |
249 | * the default value is 1. | |
250 | */ | |
251 | static void alc_fix_pll(struct hda_codec *codec) | |
252 | { | |
253 | struct alc_spec *spec = codec->spec; | |
2c3bf9ab | 254 | |
98b24883 TI |
255 | if (spec->pll_nid) |
256 | alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, | |
257 | 1 << spec->pll_coef_bit, 0); | |
2c3bf9ab TI |
258 | } |
259 | ||
260 | static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, | |
261 | unsigned int coef_idx, unsigned int coef_bit) | |
262 | { | |
263 | struct alc_spec *spec = codec->spec; | |
264 | spec->pll_nid = nid; | |
265 | spec->pll_coef_idx = coef_idx; | |
266 | spec->pll_coef_bit = coef_bit; | |
267 | alc_fix_pll(codec); | |
268 | } | |
269 | ||
cf5a2279 | 270 | /* update the master volume per volume-knob's unsol event */ |
1a4f69d5 TI |
271 | static void alc_update_knob_master(struct hda_codec *codec, |
272 | struct hda_jack_callback *jack) | |
cf5a2279 TI |
273 | { |
274 | unsigned int val; | |
275 | struct snd_kcontrol *kctl; | |
276 | struct snd_ctl_elem_value *uctl; | |
277 | ||
278 | kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); | |
279 | if (!kctl) | |
280 | return; | |
281 | uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); | |
282 | if (!uctl) | |
283 | return; | |
2ebab40e | 284 | val = snd_hda_codec_read(codec, jack->nid, 0, |
cf5a2279 TI |
285 | AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); |
286 | val &= HDA_AMP_VOLMASK; | |
287 | uctl->value.integer.value[0] = val; | |
288 | uctl->value.integer.value[1] = val; | |
289 | kctl->put(kctl, uctl); | |
290 | kfree(uctl); | |
291 | } | |
292 | ||
29adc4b9 | 293 | static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) |
f21d78e2 | 294 | { |
29adc4b9 DH |
295 | /* For some reason, the res given from ALC880 is broken. |
296 | Here we adjust it properly. */ | |
297 | snd_hda_jack_unsol_event(codec, res >> 2); | |
f21d78e2 TI |
298 | } |
299 | ||
394c97f8 KY |
300 | /* Change EAPD to verb control */ |
301 | static void alc_fill_eapd_coef(struct hda_codec *codec) | |
302 | { | |
303 | int coef; | |
304 | ||
305 | coef = alc_get_coef0(codec); | |
306 | ||
7639a06c | 307 | switch (codec->core.vendor_id) { |
394c97f8 KY |
308 | case 0x10ec0262: |
309 | alc_update_coef_idx(codec, 0x7, 0, 1<<5); | |
310 | break; | |
311 | case 0x10ec0267: | |
312 | case 0x10ec0268: | |
313 | alc_update_coef_idx(codec, 0x7, 0, 1<<13); | |
314 | break; | |
315 | case 0x10ec0269: | |
316 | if ((coef & 0x00f0) == 0x0010) | |
317 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); | |
318 | if ((coef & 0x00f0) == 0x0020) | |
319 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
320 | if ((coef & 0x00f0) == 0x0030) | |
321 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); | |
322 | break; | |
323 | case 0x10ec0280: | |
324 | case 0x10ec0284: | |
325 | case 0x10ec0290: | |
326 | case 0x10ec0292: | |
327 | alc_update_coef_idx(codec, 0x4, 1<<15, 0); | |
328 | break; | |
4231430d | 329 | case 0x10ec0225: |
44be77c5 TI |
330 | case 0x10ec0295: |
331 | case 0x10ec0299: | |
332 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
333 | /* fallthrough */ | |
334 | case 0x10ec0215: | |
394c97f8 | 335 | case 0x10ec0233: |
583142ca | 336 | case 0x10ec0235: |
736f20a7 | 337 | case 0x10ec0236: |
394c97f8 | 338 | case 0x10ec0255: |
4344aec8 | 339 | case 0x10ec0256: |
f429e7e4 | 340 | case 0x10ec0257: |
394c97f8 KY |
341 | case 0x10ec0282: |
342 | case 0x10ec0283: | |
343 | case 0x10ec0286: | |
344 | case 0x10ec0288: | |
0a6f0600 | 345 | case 0x10ec0285: |
506b62c3 | 346 | case 0x10ec0298: |
0a6f0600 | 347 | case 0x10ec0289: |
9887cf53 | 348 | case 0x10ec0300: |
394c97f8 KY |
349 | alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
350 | break; | |
3aabf94c KY |
351 | case 0x10ec0275: |
352 | alc_update_coef_idx(codec, 0xe, 0, 1<<0); | |
353 | break; | |
394c97f8 KY |
354 | case 0x10ec0293: |
355 | alc_update_coef_idx(codec, 0xa, 1<<13, 0); | |
356 | break; | |
dcd4f0db KY |
357 | case 0x10ec0234: |
358 | case 0x10ec0274: | |
359 | case 0x10ec0294: | |
6fbae35a KY |
360 | case 0x10ec0700: |
361 | case 0x10ec0701: | |
362 | case 0x10ec0703: | |
dcd4f0db KY |
363 | alc_update_coef_idx(codec, 0x10, 1<<15, 0); |
364 | break; | |
394c97f8 KY |
365 | case 0x10ec0662: |
366 | if ((coef & 0x00f0) == 0x0030) | |
367 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ | |
368 | break; | |
369 | case 0x10ec0272: | |
370 | case 0x10ec0273: | |
371 | case 0x10ec0663: | |
372 | case 0x10ec0665: | |
373 | case 0x10ec0670: | |
374 | case 0x10ec0671: | |
375 | case 0x10ec0672: | |
376 | alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ | |
377 | break; | |
378 | case 0x10ec0668: | |
379 | alc_update_coef_idx(codec, 0x7, 3<<13, 0); | |
380 | break; | |
381 | case 0x10ec0867: | |
382 | alc_update_coef_idx(codec, 0x4, 1<<10, 0); | |
383 | break; | |
384 | case 0x10ec0888: | |
385 | if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) | |
386 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); | |
387 | break; | |
388 | case 0x10ec0892: | |
389 | alc_update_coef_idx(codec, 0x7, 1<<5, 0); | |
390 | break; | |
391 | case 0x10ec0899: | |
392 | case 0x10ec0900: | |
65553b12 | 393 | case 0x10ec1168: |
a535ad57 | 394 | case 0x10ec1220: |
394c97f8 KY |
395 | alc_update_coef_idx(codec, 0x7, 1<<1, 0); |
396 | break; | |
397 | } | |
398 | } | |
399 | ||
f9423e7a KY |
400 | /* additional initialization for ALC888 variants */ |
401 | static void alc888_coef_init(struct hda_codec *codec) | |
402 | { | |
1df8874b KY |
403 | switch (alc_get_coef0(codec) & 0x00f0) { |
404 | /* alc888-VA */ | |
405 | case 0x00: | |
406 | /* alc888-VB */ | |
407 | case 0x10: | |
408 | alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ | |
409 | break; | |
410 | } | |
87a8c370 JK |
411 | } |
412 | ||
3fb4a508 TI |
413 | /* turn on/off EAPD control (only if available) */ |
414 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) | |
415 | { | |
416 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) | |
417 | return; | |
418 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) | |
419 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, | |
420 | on ? 2 : 0); | |
421 | } | |
422 | ||
691f1fcc TI |
423 | /* turn on/off EAPD controls of the codec */ |
424 | static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) | |
425 | { | |
426 | /* We currently only handle front, HP */ | |
39fa84e9 | 427 | static hda_nid_t pins[] = { |
af95b414 | 428 | 0x0f, 0x10, 0x14, 0x15, 0x17, 0 |
39fa84e9 TI |
429 | }; |
430 | hda_nid_t *p; | |
431 | for (p = pins; *p; p++) | |
432 | set_eapd(codec, *p, on); | |
691f1fcc TI |
433 | } |
434 | ||
a8cdd64f KY |
435 | static int find_ext_mic_pin(struct hda_codec *codec); |
436 | ||
437 | static void alc_headset_mic_no_shutup(struct hda_codec *codec) | |
438 | { | |
439 | const struct hda_pincfg *pin; | |
440 | int mic_pin = find_ext_mic_pin(codec); | |
441 | int i; | |
442 | ||
443 | /* don't shut up pins when unloading the driver; otherwise it breaks | |
444 | * the default pin setup at the next load of the driver | |
445 | */ | |
446 | if (codec->bus->shutdown) | |
447 | return; | |
448 | ||
449 | for (i = 0; i < codec->init_pins.used; i++) { | |
450 | pin = snd_array_elem(&codec->init_pins, i); | |
451 | /* use read here for syncing after issuing each verb */ | |
452 | if (pin->nid != mic_pin) | |
453 | snd_hda_codec_read(codec, pin->nid, 0, | |
454 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | |
455 | } | |
456 | ||
457 | codec->pins_shutup = 1; | |
458 | } | |
459 | ||
b001f661 TI |
460 | static void alc_shutup_pins(struct hda_codec *codec) |
461 | { | |
462 | struct alc_spec *spec = codec->spec; | |
463 | ||
a8cdd64f KY |
464 | switch (codec->core.vendor_id) { |
465 | case 0x10ec0286: | |
466 | case 0x10ec0288: | |
467 | case 0x10ec0298: | |
468 | alc_headset_mic_no_shutup(codec); | |
469 | break; | |
470 | default: | |
471 | if (!spec->no_shutup_pins) | |
472 | snd_hda_shutup_pins(codec); | |
473 | break; | |
474 | } | |
b001f661 TI |
475 | } |
476 | ||
1c716153 | 477 | /* generic shutup callback; |
4ce8e6a5 | 478 | * just turning off EAPD and a little pause for avoiding pop-noise |
1c716153 TI |
479 | */ |
480 | static void alc_eapd_shutup(struct hda_codec *codec) | |
481 | { | |
97a26570 KY |
482 | struct alc_spec *spec = codec->spec; |
483 | ||
1c716153 | 484 | alc_auto_setup_eapd(codec, false); |
97a26570 KY |
485 | if (!spec->no_depop_delay) |
486 | msleep(200); | |
b001f661 | 487 | alc_shutup_pins(codec); |
1c716153 TI |
488 | } |
489 | ||
1d045db9 | 490 | /* generic EAPD initialization */ |
4a79ba34 | 491 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
bc9f98a9 | 492 | { |
394c97f8 | 493 | alc_fill_eapd_coef(codec); |
39fa84e9 | 494 | alc_auto_setup_eapd(codec, true); |
4a79ba34 TI |
495 | switch (type) { |
496 | case ALC_INIT_GPIO1: | |
bc9f98a9 KY |
497 | snd_hda_sequence_write(codec, alc_gpio1_init_verbs); |
498 | break; | |
4a79ba34 | 499 | case ALC_INIT_GPIO2: |
bc9f98a9 KY |
500 | snd_hda_sequence_write(codec, alc_gpio2_init_verbs); |
501 | break; | |
4a79ba34 | 502 | case ALC_INIT_GPIO3: |
bdd148a3 KY |
503 | snd_hda_sequence_write(codec, alc_gpio3_init_verbs); |
504 | break; | |
4a79ba34 | 505 | case ALC_INIT_DEFAULT: |
7639a06c | 506 | switch (codec->core.vendor_id) { |
c9b58006 | 507 | case 0x10ec0260: |
98b24883 | 508 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); |
c9b58006 | 509 | break; |
c9b58006 KY |
510 | case 0x10ec0880: |
511 | case 0x10ec0882: | |
512 | case 0x10ec0883: | |
513 | case 0x10ec0885: | |
1df8874b | 514 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
c9b58006 | 515 | break; |
f9423e7a | 516 | case 0x10ec0888: |
4a79ba34 | 517 | alc888_coef_init(codec); |
f9423e7a | 518 | break; |
bc9f98a9 | 519 | } |
4a79ba34 TI |
520 | break; |
521 | } | |
522 | } | |
523 | ||
80f10932 TI |
524 | /* get a primary headphone pin if available */ |
525 | static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) | |
526 | { | |
527 | if (spec->gen.autocfg.hp_pins[0]) | |
528 | return spec->gen.autocfg.hp_pins[0]; | |
529 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
530 | return spec->gen.autocfg.line_out_pins[0]; | |
531 | return 0; | |
532 | } | |
08c189f2 | 533 | |
1d045db9 | 534 | /* |
08c189f2 | 535 | * Realtek SSID verification |
1d045db9 | 536 | */ |
42cf0d01 | 537 | |
08c189f2 TI |
538 | /* Could be any non-zero and even value. When used as fixup, tells |
539 | * the driver to ignore any present sku defines. | |
540 | */ | |
541 | #define ALC_FIXUP_SKU_IGNORE (2) | |
1a1455de | 542 | |
08c189f2 TI |
543 | static void alc_fixup_sku_ignore(struct hda_codec *codec, |
544 | const struct hda_fixup *fix, int action) | |
1a1455de | 545 | { |
1a1455de | 546 | struct alc_spec *spec = codec->spec; |
08c189f2 TI |
547 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
548 | spec->cdefine.fixup = 1; | |
549 | spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; | |
1a1455de | 550 | } |
1a1455de TI |
551 | } |
552 | ||
b5c6611f ML |
553 | static void alc_fixup_no_depop_delay(struct hda_codec *codec, |
554 | const struct hda_fixup *fix, int action) | |
555 | { | |
556 | struct alc_spec *spec = codec->spec; | |
557 | ||
84d2dc3e | 558 | if (action == HDA_FIXUP_ACT_PROBE) { |
b5c6611f | 559 | spec->no_depop_delay = 1; |
84d2dc3e ML |
560 | codec->depop_delay = 0; |
561 | } | |
b5c6611f ML |
562 | } |
563 | ||
08c189f2 | 564 | static int alc_auto_parse_customize_define(struct hda_codec *codec) |
4a79ba34 | 565 | { |
08c189f2 TI |
566 | unsigned int ass, tmp, i; |
567 | unsigned nid = 0; | |
4a79ba34 TI |
568 | struct alc_spec *spec = codec->spec; |
569 | ||
08c189f2 | 570 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ |
4a79ba34 | 571 | |
08c189f2 TI |
572 | if (spec->cdefine.fixup) { |
573 | ass = spec->cdefine.sku_cfg; | |
574 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
575 | return -1; | |
576 | goto do_sku; | |
bb35febd TI |
577 | } |
578 | ||
5100cd07 TI |
579 | if (!codec->bus->pci) |
580 | return -1; | |
7639a06c | 581 | ass = codec->core.subsystem_id & 0xffff; |
08c189f2 TI |
582 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
583 | goto do_sku; | |
4a79ba34 | 584 | |
08c189f2 | 585 | nid = 0x1d; |
7639a06c | 586 | if (codec->core.vendor_id == 0x10ec0260) |
08c189f2 TI |
587 | nid = 0x17; |
588 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
42cf0d01 | 589 | |
08c189f2 | 590 | if (!(ass & 1)) { |
4e76a883 | 591 | codec_info(codec, "%s: SKU not ready 0x%08x\n", |
7639a06c | 592 | codec->core.chip_name, ass); |
08c189f2 | 593 | return -1; |
42cf0d01 DH |
594 | } |
595 | ||
08c189f2 TI |
596 | /* check sum */ |
597 | tmp = 0; | |
598 | for (i = 1; i < 16; i++) { | |
599 | if ((ass >> i) & 1) | |
600 | tmp++; | |
ae8a60a5 | 601 | } |
08c189f2 TI |
602 | if (((ass >> 16) & 0xf) != tmp) |
603 | return -1; | |
ae8a60a5 | 604 | |
da00c244 KY |
605 | spec->cdefine.port_connectivity = ass >> 30; |
606 | spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; | |
607 | spec->cdefine.check_sum = (ass >> 16) & 0xf; | |
608 | spec->cdefine.customization = ass >> 8; | |
609 | do_sku: | |
610 | spec->cdefine.sku_cfg = ass; | |
611 | spec->cdefine.external_amp = (ass & 0x38) >> 3; | |
612 | spec->cdefine.platform_type = (ass & 0x4) >> 2; | |
613 | spec->cdefine.swap = (ass & 0x2) >> 1; | |
614 | spec->cdefine.override = ass & 0x1; | |
615 | ||
4e76a883 | 616 | codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", |
da00c244 | 617 | nid, spec->cdefine.sku_cfg); |
4e76a883 | 618 | codec_dbg(codec, "SKU: port_connectivity=0x%x\n", |
da00c244 | 619 | spec->cdefine.port_connectivity); |
4e76a883 TI |
620 | codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); |
621 | codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); | |
622 | codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); | |
623 | codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); | |
624 | codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); | |
625 | codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); | |
626 | codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); | |
da00c244 KY |
627 | |
628 | return 0; | |
629 | } | |
630 | ||
08c189f2 TI |
631 | /* return the position of NID in the list, or -1 if not found */ |
632 | static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) | |
633 | { | |
634 | int i; | |
635 | for (i = 0; i < nums; i++) | |
636 | if (list[i] == nid) | |
637 | return i; | |
638 | return -1; | |
639 | } | |
1d045db9 | 640 | /* return true if the given NID is found in the list */ |
3af9ee6b TI |
641 | static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) |
642 | { | |
21268961 | 643 | return find_idx_in_nid_list(nid, list, nums) >= 0; |
3af9ee6b TI |
644 | } |
645 | ||
4a79ba34 TI |
646 | /* check subsystem ID and set up device-specific initialization; |
647 | * return 1 if initialized, 0 if invalid SSID | |
648 | */ | |
649 | /* 32-bit subsystem ID for BIOS loading in HD Audio codec. | |
650 | * 31 ~ 16 : Manufacture ID | |
651 | * 15 ~ 8 : SKU ID | |
652 | * 7 ~ 0 : Assembly ID | |
653 | * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 | |
654 | */ | |
58c57cfa | 655 | static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) |
4a79ba34 TI |
656 | { |
657 | unsigned int ass, tmp, i; | |
658 | unsigned nid; | |
659 | struct alc_spec *spec = codec->spec; | |
660 | ||
90622917 DH |
661 | if (spec->cdefine.fixup) { |
662 | ass = spec->cdefine.sku_cfg; | |
663 | if (ass == ALC_FIXUP_SKU_IGNORE) | |
664 | return 0; | |
665 | goto do_sku; | |
666 | } | |
667 | ||
7639a06c | 668 | ass = codec->core.subsystem_id & 0xffff; |
5100cd07 TI |
669 | if (codec->bus->pci && |
670 | ass != codec->bus->pci->subsystem_device && (ass & 1)) | |
4a79ba34 TI |
671 | goto do_sku; |
672 | ||
673 | /* invalid SSID, check the special NID pin defcfg instead */ | |
674 | /* | |
def319f9 | 675 | * 31~30 : port connectivity |
4a79ba34 TI |
676 | * 29~21 : reserve |
677 | * 20 : PCBEEP input | |
678 | * 19~16 : Check sum (15:1) | |
679 | * 15~1 : Custom | |
680 | * 0 : override | |
681 | */ | |
682 | nid = 0x1d; | |
7639a06c | 683 | if (codec->core.vendor_id == 0x10ec0260) |
4a79ba34 TI |
684 | nid = 0x17; |
685 | ass = snd_hda_codec_get_pincfg(codec, nid); | |
4e76a883 TI |
686 | codec_dbg(codec, |
687 | "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", | |
cb6605c1 | 688 | ass, nid); |
6227cdce | 689 | if (!(ass & 1)) |
4a79ba34 TI |
690 | return 0; |
691 | if ((ass >> 30) != 1) /* no physical connection */ | |
692 | return 0; | |
693 | ||
694 | /* check sum */ | |
695 | tmp = 0; | |
696 | for (i = 1; i < 16; i++) { | |
697 | if ((ass >> i) & 1) | |
698 | tmp++; | |
699 | } | |
700 | if (((ass >> 16) & 0xf) != tmp) | |
701 | return 0; | |
702 | do_sku: | |
4e76a883 | 703 | codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", |
7639a06c | 704 | ass & 0xffff, codec->core.vendor_id); |
4a79ba34 TI |
705 | /* |
706 | * 0 : override | |
707 | * 1 : Swap Jack | |
708 | * 2 : 0 --> Desktop, 1 --> Laptop | |
709 | * 3~5 : External Amplifier control | |
710 | * 7~6 : Reserved | |
711 | */ | |
712 | tmp = (ass & 0x38) >> 3; /* external Amp control */ | |
713 | switch (tmp) { | |
714 | case 1: | |
715 | spec->init_amp = ALC_INIT_GPIO1; | |
716 | break; | |
717 | case 3: | |
718 | spec->init_amp = ALC_INIT_GPIO2; | |
719 | break; | |
720 | case 7: | |
721 | spec->init_amp = ALC_INIT_GPIO3; | |
722 | break; | |
723 | case 5: | |
5a8cfb4e | 724 | default: |
4a79ba34 | 725 | spec->init_amp = ALC_INIT_DEFAULT; |
bc9f98a9 KY |
726 | break; |
727 | } | |
ea1fb29a | 728 | |
8c427226 | 729 | /* is laptop or Desktop and enable the function "Mute internal speaker |
c9b58006 KY |
730 | * when the external headphone out jack is plugged" |
731 | */ | |
8c427226 | 732 | if (!(ass & 0x8000)) |
4a79ba34 | 733 | return 1; |
c9b58006 KY |
734 | /* |
735 | * 10~8 : Jack location | |
736 | * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered | |
737 | * 14~13: Resvered | |
738 | * 15 : 1 --> enable the function "Mute internal speaker | |
739 | * when the external headphone out jack is plugged" | |
740 | */ | |
80f10932 | 741 | if (!alc_get_hp_pin(spec)) { |
01d4825d | 742 | hda_nid_t nid; |
c9b58006 | 743 | tmp = (ass >> 11) & 0x3; /* HP to chassis */ |
58c57cfa | 744 | nid = ports[tmp]; |
08c189f2 TI |
745 | if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, |
746 | spec->gen.autocfg.line_outs)) | |
3af9ee6b | 747 | return 1; |
08c189f2 | 748 | spec->gen.autocfg.hp_pins[0] = nid; |
c9b58006 | 749 | } |
4a79ba34 TI |
750 | return 1; |
751 | } | |
ea1fb29a | 752 | |
3e6179b8 TI |
753 | /* Check the validity of ALC subsystem-id |
754 | * ports contains an array of 4 pin NIDs for port-A, E, D and I */ | |
755 | static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) | |
4a79ba34 | 756 | { |
58c57cfa | 757 | if (!alc_subsystem_id(codec, ports)) { |
4a79ba34 | 758 | struct alc_spec *spec = codec->spec; |
4e76a883 TI |
759 | codec_dbg(codec, |
760 | "realtek: Enable default setup for auto mode as fallback\n"); | |
4a79ba34 | 761 | spec->init_amp = ALC_INIT_DEFAULT; |
4a79ba34 | 762 | } |
21268961 | 763 | } |
1a1455de | 764 | |
1d045db9 | 765 | /* |
ef8ef5fb | 766 | */ |
f9e336f6 | 767 | |
9d36a7dc DH |
768 | static void alc_fixup_inv_dmic(struct hda_codec *codec, |
769 | const struct hda_fixup *fix, int action) | |
125821ae TI |
770 | { |
771 | struct alc_spec *spec = codec->spec; | |
668d1e96 | 772 | |
9d36a7dc | 773 | spec->gen.inv_dmic_split = 1; |
6e72aa5f TI |
774 | } |
775 | ||
e9edcee0 | 776 | |
1d045db9 TI |
777 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
778 | /* additional beep mixers; the actual parameters are overwritten at build */ | |
779 | static const struct snd_kcontrol_new alc_beep_mixer[] = { | |
780 | HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), | |
781 | HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), | |
16ded525 TI |
782 | { } /* end */ |
783 | }; | |
1d045db9 | 784 | #endif |
16ded525 | 785 | |
08c189f2 | 786 | static int alc_build_controls(struct hda_codec *codec) |
1d045db9 TI |
787 | { |
788 | struct alc_spec *spec = codec->spec; | |
08c189f2 | 789 | int i, err; |
e9427969 | 790 | |
08c189f2 TI |
791 | err = snd_hda_gen_build_controls(codec); |
792 | if (err < 0) | |
793 | return err; | |
1da177e4 LT |
794 | |
795 | for (i = 0; i < spec->num_mixers; i++) { | |
796 | err = snd_hda_add_new_ctls(codec, spec->mixers[i]); | |
797 | if (err < 0) | |
798 | return err; | |
799 | } | |
2134ea4f | 800 | |
67d634c0 | 801 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
45bdd1c1 TI |
802 | /* create beep controls if needed */ |
803 | if (spec->beep_amp) { | |
a9111321 | 804 | const struct snd_kcontrol_new *knew; |
45bdd1c1 TI |
805 | for (knew = alc_beep_mixer; knew->name; knew++) { |
806 | struct snd_kcontrol *kctl; | |
807 | kctl = snd_ctl_new1(knew, codec); | |
808 | if (!kctl) | |
08c189f2 TI |
809 | return -ENOMEM; |
810 | kctl->private_value = spec->beep_amp; | |
811 | err = snd_hda_ctl_add(codec, 0, kctl); | |
812 | if (err < 0) | |
813 | return err; | |
1d045db9 | 814 | } |
863b4518 | 815 | } |
08c189f2 | 816 | #endif |
1c4a54b4 | 817 | |
1727a771 | 818 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); |
1c4a54b4 | 819 | return 0; |
a361d84b KY |
820 | } |
821 | ||
a361d84b | 822 | |
df694daa | 823 | /* |
08c189f2 | 824 | * Common callbacks |
df694daa | 825 | */ |
a361d84b | 826 | |
08c189f2 | 827 | static int alc_init(struct hda_codec *codec) |
1d045db9 TI |
828 | { |
829 | struct alc_spec *spec = codec->spec; | |
a361d84b | 830 | |
08c189f2 TI |
831 | if (spec->init_hook) |
832 | spec->init_hook(codec); | |
a361d84b | 833 | |
08c189f2 TI |
834 | alc_fix_pll(codec); |
835 | alc_auto_init_amp(codec, spec->init_amp); | |
3abf2f36 | 836 | |
08c189f2 | 837 | snd_hda_gen_init(codec); |
a361d84b | 838 | |
1727a771 | 839 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); |
a361d84b | 840 | |
1d045db9 TI |
841 | return 0; |
842 | } | |
a361d84b | 843 | |
08c189f2 | 844 | static inline void alc_shutup(struct hda_codec *codec) |
1d045db9 TI |
845 | { |
846 | struct alc_spec *spec = codec->spec; | |
a361d84b | 847 | |
08c189f2 TI |
848 | if (spec && spec->shutup) |
849 | spec->shutup(codec); | |
9bfb2844 | 850 | else |
b001f661 | 851 | alc_shutup_pins(codec); |
1d045db9 TI |
852 | } |
853 | ||
70a0976b TI |
854 | static void alc_reboot_notify(struct hda_codec *codec) |
855 | { | |
856 | struct alc_spec *spec = codec->spec; | |
857 | ||
858 | if (spec && spec->reboot_notify) | |
859 | spec->reboot_notify(codec); | |
860 | else | |
861 | alc_shutup(codec); | |
862 | } | |
863 | ||
864 | /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */ | |
865 | static void alc_d3_at_reboot(struct hda_codec *codec) | |
866 | { | |
867 | snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3); | |
868 | snd_hda_codec_write(codec, codec->core.afg, 0, | |
869 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); | |
870 | msleep(10); | |
871 | } | |
872 | ||
8a02c0cc | 873 | #define alc_free snd_hda_gen_free |
2134ea4f | 874 | |
08c189f2 TI |
875 | #ifdef CONFIG_PM |
876 | static void alc_power_eapd(struct hda_codec *codec) | |
1d045db9 | 877 | { |
08c189f2 | 878 | alc_auto_setup_eapd(codec, false); |
1d045db9 | 879 | } |
2134ea4f | 880 | |
08c189f2 | 881 | static int alc_suspend(struct hda_codec *codec) |
1d045db9 TI |
882 | { |
883 | struct alc_spec *spec = codec->spec; | |
08c189f2 TI |
884 | alc_shutup(codec); |
885 | if (spec && spec->power_hook) | |
886 | spec->power_hook(codec); | |
a361d84b KY |
887 | return 0; |
888 | } | |
08c189f2 | 889 | #endif |
a361d84b | 890 | |
08c189f2 TI |
891 | #ifdef CONFIG_PM |
892 | static int alc_resume(struct hda_codec *codec) | |
1d045db9 | 893 | { |
97a26570 KY |
894 | struct alc_spec *spec = codec->spec; |
895 | ||
896 | if (!spec->no_depop_delay) | |
897 | msleep(150); /* to avoid pop noise */ | |
08c189f2 | 898 | codec->patch_ops.init(codec); |
eeecd9d1 | 899 | regcache_sync(codec->core.regmap); |
08c189f2 TI |
900 | hda_call_check_power_status(codec, 0x01); |
901 | return 0; | |
1d045db9 | 902 | } |
08c189f2 | 903 | #endif |
f6a92248 | 904 | |
1d045db9 | 905 | /* |
1d045db9 | 906 | */ |
08c189f2 TI |
907 | static const struct hda_codec_ops alc_patch_ops = { |
908 | .build_controls = alc_build_controls, | |
909 | .build_pcms = snd_hda_gen_build_pcms, | |
910 | .init = alc_init, | |
911 | .free = alc_free, | |
912 | .unsol_event = snd_hda_jack_unsol_event, | |
913 | #ifdef CONFIG_PM | |
914 | .resume = alc_resume, | |
08c189f2 | 915 | .suspend = alc_suspend, |
fce52a3b | 916 | .check_power_status = snd_hda_gen_check_power_status, |
08c189f2 | 917 | #endif |
70a0976b | 918 | .reboot_notify = alc_reboot_notify, |
08c189f2 | 919 | }; |
f6a92248 | 920 | |
f53281e6 | 921 | |
ded255be | 922 | #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) |
e01bf509 | 923 | |
e4770629 | 924 | /* |
4b016931 | 925 | * Rename codecs appropriately from COEF value or subvendor id |
e4770629 | 926 | */ |
08c189f2 TI |
927 | struct alc_codec_rename_table { |
928 | unsigned int vendor_id; | |
929 | unsigned short coef_mask; | |
930 | unsigned short coef_bits; | |
931 | const char *name; | |
932 | }; | |
84898e87 | 933 | |
4b016931 KY |
934 | struct alc_codec_rename_pci_table { |
935 | unsigned int codec_vendor_id; | |
936 | unsigned short pci_subvendor; | |
937 | unsigned short pci_subdevice; | |
938 | const char *name; | |
939 | }; | |
940 | ||
08c189f2 | 941 | static struct alc_codec_rename_table rename_tbl[] = { |
e6e5f7ad | 942 | { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, |
08c189f2 TI |
943 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
944 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, | |
945 | { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, | |
946 | { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, | |
947 | { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, | |
948 | { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, | |
949 | { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, | |
950 | { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, | |
e6e5f7ad | 951 | { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, |
08c189f2 TI |
952 | { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, |
953 | { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, | |
954 | { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, | |
955 | { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, | |
956 | { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, | |
957 | { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, | |
958 | { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, | |
959 | { } /* terminator */ | |
960 | }; | |
84898e87 | 961 | |
4b016931 KY |
962 | static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
963 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, | |
964 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, | |
965 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, | |
193177de | 966 | { 0x10ec0288, 0x1028, 0, "ALC3263" }, |
4b016931 | 967 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, |
193177de | 968 | { 0x10ec0293, 0x1028, 0, "ALC3235" }, |
4b016931 KY |
969 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, |
970 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, | |
e6e5f7ad KY |
971 | { 0x10ec0275, 0x1028, 0, "ALC3260" }, |
972 | { 0x10ec0899, 0x1028, 0, "ALC3861" }, | |
2c674fac | 973 | { 0x10ec0298, 0x1028, 0, "ALC3266" }, |
736f20a7 | 974 | { 0x10ec0236, 0x1028, 0, "ALC3204" }, |
82324502 | 975 | { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
4231430d | 976 | { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
7d727869 | 977 | { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
28f1f9b2 | 978 | { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
e6e5f7ad KY |
979 | { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
980 | { 0x10ec0676, 0x1025, 0, "ALC679X" }, | |
981 | { 0x10ec0282, 0x1043, 0, "ALC3229" }, | |
982 | { 0x10ec0233, 0x1043, 0, "ALC3236" }, | |
983 | { 0x10ec0280, 0x103c, 0, "ALC3228" }, | |
984 | { 0x10ec0282, 0x103c, 0, "ALC3227" }, | |
985 | { 0x10ec0286, 0x103c, 0, "ALC3242" }, | |
986 | { 0x10ec0290, 0x103c, 0, "ALC3241" }, | |
987 | { 0x10ec0668, 0x103c, 0, "ALC3662" }, | |
988 | { 0x10ec0283, 0x17aa, 0, "ALC3239" }, | |
989 | { 0x10ec0292, 0x17aa, 0, "ALC3232" }, | |
4b016931 KY |
990 | { } /* terminator */ |
991 | }; | |
992 | ||
08c189f2 | 993 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
1d045db9 | 994 | { |
08c189f2 | 995 | const struct alc_codec_rename_table *p; |
4b016931 | 996 | const struct alc_codec_rename_pci_table *q; |
60db6b53 | 997 | |
08c189f2 | 998 | for (p = rename_tbl; p->vendor_id; p++) { |
7639a06c | 999 | if (p->vendor_id != codec->core.vendor_id) |
08c189f2 TI |
1000 | continue; |
1001 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) | |
1002 | return alc_codec_rename(codec, p->name); | |
1d045db9 | 1003 | } |
4b016931 | 1004 | |
5100cd07 TI |
1005 | if (!codec->bus->pci) |
1006 | return 0; | |
4b016931 | 1007 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { |
7639a06c | 1008 | if (q->codec_vendor_id != codec->core.vendor_id) |
4b016931 KY |
1009 | continue; |
1010 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) | |
1011 | continue; | |
1012 | if (!q->pci_subdevice || | |
1013 | q->pci_subdevice == codec->bus->pci->subsystem_device) | |
1014 | return alc_codec_rename(codec, q->name); | |
1015 | } | |
1016 | ||
08c189f2 | 1017 | return 0; |
1d045db9 | 1018 | } |
f53281e6 | 1019 | |
e4770629 | 1020 | |
1d045db9 TI |
1021 | /* |
1022 | * Digital-beep handlers | |
1023 | */ | |
1024 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | |
1025 | #define set_beep_amp(spec, nid, idx, dir) \ | |
1026 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) | |
84898e87 | 1027 | |
1d045db9 | 1028 | static const struct snd_pci_quirk beep_white_list[] = { |
7110005e | 1029 | SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), |
a4b7f21d | 1030 | SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), |
1d045db9 | 1031 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), |
8554ee40 | 1032 | SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), |
1d045db9 TI |
1033 | SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), |
1034 | SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), | |
1035 | SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), | |
78f8baf1 | 1036 | SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
1d045db9 TI |
1037 | SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
1038 | {} | |
fe3eb0a7 KY |
1039 | }; |
1040 | ||
1d045db9 TI |
1041 | static inline int has_cdefine_beep(struct hda_codec *codec) |
1042 | { | |
1043 | struct alc_spec *spec = codec->spec; | |
1044 | const struct snd_pci_quirk *q; | |
1045 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); | |
1046 | if (q) | |
1047 | return q->value; | |
1048 | return spec->cdefine.enable_pcbeep; | |
1049 | } | |
1050 | #else | |
1051 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ | |
1052 | #define has_cdefine_beep(codec) 0 | |
1053 | #endif | |
84898e87 | 1054 | |
1d045db9 TI |
1055 | /* parse the BIOS configuration and set up the alc_spec */ |
1056 | /* return 1 if successful, 0 if the proper config is not found, | |
1057 | * or a negative error code | |
1058 | */ | |
3e6179b8 TI |
1059 | static int alc_parse_auto_config(struct hda_codec *codec, |
1060 | const hda_nid_t *ignore_nids, | |
1061 | const hda_nid_t *ssid_nids) | |
1d045db9 TI |
1062 | { |
1063 | struct alc_spec *spec = codec->spec; | |
08c189f2 | 1064 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; |
1d045db9 | 1065 | int err; |
26f5df26 | 1066 | |
53c334ad TI |
1067 | err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, |
1068 | spec->parse_flags); | |
1d045db9 TI |
1069 | if (err < 0) |
1070 | return err; | |
3e6179b8 TI |
1071 | |
1072 | if (ssid_nids) | |
1073 | alc_ssid_check(codec, ssid_nids); | |
64154835 | 1074 | |
08c189f2 TI |
1075 | err = snd_hda_gen_parse_auto_config(codec, cfg); |
1076 | if (err < 0) | |
1077 | return err; | |
070cff4c | 1078 | |
1d045db9 | 1079 | return 1; |
60db6b53 | 1080 | } |
f6a92248 | 1081 | |
3de95173 TI |
1082 | /* common preparation job for alc_spec */ |
1083 | static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) | |
1084 | { | |
1085 | struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); | |
1086 | int err; | |
1087 | ||
1088 | if (!spec) | |
1089 | return -ENOMEM; | |
1090 | codec->spec = spec; | |
08c189f2 TI |
1091 | snd_hda_gen_spec_init(&spec->gen); |
1092 | spec->gen.mixer_nid = mixer_nid; | |
1093 | spec->gen.own_eapd_ctl = 1; | |
1098b7c2 | 1094 | codec->single_adc_amp = 1; |
08c189f2 TI |
1095 | /* FIXME: do we need this for all Realtek codec models? */ |
1096 | codec->spdif_status_reset = 1; | |
225068ab | 1097 | codec->patch_ops = alc_patch_ops; |
3de95173 TI |
1098 | |
1099 | err = alc_codec_rename_from_preset(codec); | |
1100 | if (err < 0) { | |
1101 | kfree(spec); | |
1102 | return err; | |
1103 | } | |
1104 | return 0; | |
1105 | } | |
1106 | ||
3e6179b8 TI |
1107 | static int alc880_parse_auto_config(struct hda_codec *codec) |
1108 | { | |
1109 | static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; | |
7d7eb9ea | 1110 | static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
3e6179b8 TI |
1111 | return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); |
1112 | } | |
1113 | ||
ee3b2969 TI |
1114 | /* |
1115 | * ALC880 fix-ups | |
1116 | */ | |
1117 | enum { | |
411225a0 | 1118 | ALC880_FIXUP_GPIO1, |
ee3b2969 TI |
1119 | ALC880_FIXUP_GPIO2, |
1120 | ALC880_FIXUP_MEDION_RIM, | |
dc6af52d | 1121 | ALC880_FIXUP_LG, |
db8a38e5 | 1122 | ALC880_FIXUP_LG_LW25, |
f02aab5d | 1123 | ALC880_FIXUP_W810, |
27e917f8 | 1124 | ALC880_FIXUP_EAPD_COEF, |
b9368f5c | 1125 | ALC880_FIXUP_TCL_S700, |
cf5a2279 TI |
1126 | ALC880_FIXUP_VOL_KNOB, |
1127 | ALC880_FIXUP_FUJITSU, | |
ba533818 | 1128 | ALC880_FIXUP_F1734, |
817de92f | 1129 | ALC880_FIXUP_UNIWILL, |
967b88c4 | 1130 | ALC880_FIXUP_UNIWILL_DIG, |
96e225f6 | 1131 | ALC880_FIXUP_Z71V, |
487a588d | 1132 | ALC880_FIXUP_ASUS_W5A, |
67b6ec31 TI |
1133 | ALC880_FIXUP_3ST_BASE, |
1134 | ALC880_FIXUP_3ST, | |
1135 | ALC880_FIXUP_3ST_DIG, | |
1136 | ALC880_FIXUP_5ST_BASE, | |
1137 | ALC880_FIXUP_5ST, | |
1138 | ALC880_FIXUP_5ST_DIG, | |
1139 | ALC880_FIXUP_6ST_BASE, | |
1140 | ALC880_FIXUP_6ST, | |
1141 | ALC880_FIXUP_6ST_DIG, | |
5397145f | 1142 | ALC880_FIXUP_6ST_AUTOMUTE, |
ee3b2969 TI |
1143 | }; |
1144 | ||
cf5a2279 TI |
1145 | /* enable the volume-knob widget support on NID 0x21 */ |
1146 | static void alc880_fixup_vol_knob(struct hda_codec *codec, | |
1727a771 | 1147 | const struct hda_fixup *fix, int action) |
cf5a2279 | 1148 | { |
1727a771 | 1149 | if (action == HDA_FIXUP_ACT_PROBE) |
62f949bf TI |
1150 | snd_hda_jack_detect_enable_callback(codec, 0x21, |
1151 | alc_update_knob_master); | |
cf5a2279 TI |
1152 | } |
1153 | ||
1727a771 | 1154 | static const struct hda_fixup alc880_fixups[] = { |
411225a0 | 1155 | [ALC880_FIXUP_GPIO1] = { |
1727a771 | 1156 | .type = HDA_FIXUP_VERBS, |
411225a0 TI |
1157 | .v.verbs = alc_gpio1_init_verbs, |
1158 | }, | |
ee3b2969 | 1159 | [ALC880_FIXUP_GPIO2] = { |
1727a771 | 1160 | .type = HDA_FIXUP_VERBS, |
ee3b2969 TI |
1161 | .v.verbs = alc_gpio2_init_verbs, |
1162 | }, | |
1163 | [ALC880_FIXUP_MEDION_RIM] = { | |
1727a771 | 1164 | .type = HDA_FIXUP_VERBS, |
ee3b2969 TI |
1165 | .v.verbs = (const struct hda_verb[]) { |
1166 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1167 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1168 | { } | |
1169 | }, | |
1170 | .chained = true, | |
1171 | .chain_id = ALC880_FIXUP_GPIO2, | |
1172 | }, | |
dc6af52d | 1173 | [ALC880_FIXUP_LG] = { |
1727a771 TI |
1174 | .type = HDA_FIXUP_PINS, |
1175 | .v.pins = (const struct hda_pintbl[]) { | |
dc6af52d TI |
1176 | /* disable bogus unused pins */ |
1177 | { 0x16, 0x411111f0 }, | |
1178 | { 0x18, 0x411111f0 }, | |
1179 | { 0x1a, 0x411111f0 }, | |
1180 | { } | |
1181 | } | |
1182 | }, | |
db8a38e5 TI |
1183 | [ALC880_FIXUP_LG_LW25] = { |
1184 | .type = HDA_FIXUP_PINS, | |
1185 | .v.pins = (const struct hda_pintbl[]) { | |
1186 | { 0x1a, 0x0181344f }, /* line-in */ | |
1187 | { 0x1b, 0x0321403f }, /* headphone */ | |
1188 | { } | |
1189 | } | |
1190 | }, | |
f02aab5d | 1191 | [ALC880_FIXUP_W810] = { |
1727a771 TI |
1192 | .type = HDA_FIXUP_PINS, |
1193 | .v.pins = (const struct hda_pintbl[]) { | |
f02aab5d TI |
1194 | /* disable bogus unused pins */ |
1195 | { 0x17, 0x411111f0 }, | |
1196 | { } | |
1197 | }, | |
1198 | .chained = true, | |
1199 | .chain_id = ALC880_FIXUP_GPIO2, | |
1200 | }, | |
27e917f8 | 1201 | [ALC880_FIXUP_EAPD_COEF] = { |
1727a771 | 1202 | .type = HDA_FIXUP_VERBS, |
27e917f8 TI |
1203 | .v.verbs = (const struct hda_verb[]) { |
1204 | /* change to EAPD mode */ | |
1205 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1206 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
1207 | {} | |
1208 | }, | |
1209 | }, | |
b9368f5c | 1210 | [ALC880_FIXUP_TCL_S700] = { |
1727a771 | 1211 | .type = HDA_FIXUP_VERBS, |
b9368f5c TI |
1212 | .v.verbs = (const struct hda_verb[]) { |
1213 | /* change to EAPD mode */ | |
1214 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
1215 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
1216 | {} | |
1217 | }, | |
1218 | .chained = true, | |
1219 | .chain_id = ALC880_FIXUP_GPIO2, | |
1220 | }, | |
cf5a2279 | 1221 | [ALC880_FIXUP_VOL_KNOB] = { |
1727a771 | 1222 | .type = HDA_FIXUP_FUNC, |
cf5a2279 TI |
1223 | .v.func = alc880_fixup_vol_knob, |
1224 | }, | |
1225 | [ALC880_FIXUP_FUJITSU] = { | |
1226 | /* override all pins as BIOS on old Amilo is broken */ | |
1727a771 TI |
1227 | .type = HDA_FIXUP_PINS, |
1228 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1229 | { 0x14, 0x0121401f }, /* HP */ |
cf5a2279 TI |
1230 | { 0x15, 0x99030120 }, /* speaker */ |
1231 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1232 | { 0x17, 0x411111f0 }, /* N/A */ | |
1233 | { 0x18, 0x411111f0 }, /* N/A */ | |
1234 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1235 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1236 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1237 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1238 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1239 | { 0x1e, 0x01454140 }, /* SPDIF out */ | |
1240 | { } | |
1241 | }, | |
1242 | .chained = true, | |
1243 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1244 | }, | |
ba533818 TI |
1245 | [ALC880_FIXUP_F1734] = { |
1246 | /* almost compatible with FUJITSU, but no bass and SPDIF */ | |
1727a771 TI |
1247 | .type = HDA_FIXUP_PINS, |
1248 | .v.pins = (const struct hda_pintbl[]) { | |
bb148bde | 1249 | { 0x14, 0x0121401f }, /* HP */ |
ba533818 TI |
1250 | { 0x15, 0x99030120 }, /* speaker */ |
1251 | { 0x16, 0x411111f0 }, /* N/A */ | |
1252 | { 0x17, 0x411111f0 }, /* N/A */ | |
1253 | { 0x18, 0x411111f0 }, /* N/A */ | |
1254 | { 0x19, 0x01a19950 }, /* mic-in */ | |
1255 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1256 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1257 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1258 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1259 | { 0x1e, 0x411111f0 }, /* N/A */ | |
1260 | { } | |
1261 | }, | |
1262 | .chained = true, | |
1263 | .chain_id = ALC880_FIXUP_VOL_KNOB, | |
1264 | }, | |
817de92f TI |
1265 | [ALC880_FIXUP_UNIWILL] = { |
1266 | /* need to fix HP and speaker pins to be parsed correctly */ | |
1727a771 TI |
1267 | .type = HDA_FIXUP_PINS, |
1268 | .v.pins = (const struct hda_pintbl[]) { | |
817de92f TI |
1269 | { 0x14, 0x0121411f }, /* HP */ |
1270 | { 0x15, 0x99030120 }, /* speaker */ | |
1271 | { 0x16, 0x99030130 }, /* bass speaker */ | |
1272 | { } | |
1273 | }, | |
1274 | }, | |
967b88c4 | 1275 | [ALC880_FIXUP_UNIWILL_DIG] = { |
1727a771 TI |
1276 | .type = HDA_FIXUP_PINS, |
1277 | .v.pins = (const struct hda_pintbl[]) { | |
967b88c4 TI |
1278 | /* disable bogus unused pins */ |
1279 | { 0x17, 0x411111f0 }, | |
1280 | { 0x19, 0x411111f0 }, | |
1281 | { 0x1b, 0x411111f0 }, | |
1282 | { 0x1f, 0x411111f0 }, | |
1283 | { } | |
1284 | } | |
1285 | }, | |
96e225f6 | 1286 | [ALC880_FIXUP_Z71V] = { |
1727a771 TI |
1287 | .type = HDA_FIXUP_PINS, |
1288 | .v.pins = (const struct hda_pintbl[]) { | |
96e225f6 TI |
1289 | /* set up the whole pins as BIOS is utterly broken */ |
1290 | { 0x14, 0x99030120 }, /* speaker */ | |
1291 | { 0x15, 0x0121411f }, /* HP */ | |
1292 | { 0x16, 0x411111f0 }, /* N/A */ | |
1293 | { 0x17, 0x411111f0 }, /* N/A */ | |
1294 | { 0x18, 0x01a19950 }, /* mic-in */ | |
1295 | { 0x19, 0x411111f0 }, /* N/A */ | |
1296 | { 0x1a, 0x01813031 }, /* line-in */ | |
1297 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1298 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1299 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1300 | { 0x1e, 0x0144111e }, /* SPDIF */ | |
1301 | { } | |
1302 | } | |
1303 | }, | |
487a588d TI |
1304 | [ALC880_FIXUP_ASUS_W5A] = { |
1305 | .type = HDA_FIXUP_PINS, | |
1306 | .v.pins = (const struct hda_pintbl[]) { | |
1307 | /* set up the whole pins as BIOS is utterly broken */ | |
1308 | { 0x14, 0x0121411f }, /* HP */ | |
1309 | { 0x15, 0x411111f0 }, /* N/A */ | |
1310 | { 0x16, 0x411111f0 }, /* N/A */ | |
1311 | { 0x17, 0x411111f0 }, /* N/A */ | |
1312 | { 0x18, 0x90a60160 }, /* mic */ | |
1313 | { 0x19, 0x411111f0 }, /* N/A */ | |
1314 | { 0x1a, 0x411111f0 }, /* N/A */ | |
1315 | { 0x1b, 0x411111f0 }, /* N/A */ | |
1316 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1317 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1318 | { 0x1e, 0xb743111e }, /* SPDIF out */ | |
1319 | { } | |
1320 | }, | |
1321 | .chained = true, | |
1322 | .chain_id = ALC880_FIXUP_GPIO1, | |
1323 | }, | |
67b6ec31 | 1324 | [ALC880_FIXUP_3ST_BASE] = { |
1727a771 TI |
1325 | .type = HDA_FIXUP_PINS, |
1326 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1327 | { 0x14, 0x01014010 }, /* line-out */ |
1328 | { 0x15, 0x411111f0 }, /* N/A */ | |
1329 | { 0x16, 0x411111f0 }, /* N/A */ | |
1330 | { 0x17, 0x411111f0 }, /* N/A */ | |
1331 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1332 | { 0x19, 0x0121411f }, /* HP */ | |
1333 | { 0x1a, 0x01813031 }, /* line-in */ | |
1334 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1335 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1336 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1337 | /* 0x1e is filled in below */ | |
1338 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1339 | { } | |
1340 | } | |
1341 | }, | |
1342 | [ALC880_FIXUP_3ST] = { | |
1727a771 TI |
1343 | .type = HDA_FIXUP_PINS, |
1344 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1345 | { 0x1e, 0x411111f0 }, /* N/A */ |
1346 | { } | |
1347 | }, | |
1348 | .chained = true, | |
1349 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1350 | }, | |
1351 | [ALC880_FIXUP_3ST_DIG] = { | |
1727a771 TI |
1352 | .type = HDA_FIXUP_PINS, |
1353 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1354 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1355 | { } | |
1356 | }, | |
1357 | .chained = true, | |
1358 | .chain_id = ALC880_FIXUP_3ST_BASE, | |
1359 | }, | |
1360 | [ALC880_FIXUP_5ST_BASE] = { | |
1727a771 TI |
1361 | .type = HDA_FIXUP_PINS, |
1362 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1363 | { 0x14, 0x01014010 }, /* front */ |
1364 | { 0x15, 0x411111f0 }, /* N/A */ | |
1365 | { 0x16, 0x01011411 }, /* CLFE */ | |
1366 | { 0x17, 0x01016412 }, /* surr */ | |
1367 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1368 | { 0x19, 0x0121411f }, /* HP */ | |
1369 | { 0x1a, 0x01813031 }, /* line-in */ | |
1370 | { 0x1b, 0x02a19c40 }, /* front-mic */ | |
1371 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1372 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1373 | /* 0x1e is filled in below */ | |
1374 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1375 | { } | |
1376 | } | |
1377 | }, | |
1378 | [ALC880_FIXUP_5ST] = { | |
1727a771 TI |
1379 | .type = HDA_FIXUP_PINS, |
1380 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1381 | { 0x1e, 0x411111f0 }, /* N/A */ |
1382 | { } | |
1383 | }, | |
1384 | .chained = true, | |
1385 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1386 | }, | |
1387 | [ALC880_FIXUP_5ST_DIG] = { | |
1727a771 TI |
1388 | .type = HDA_FIXUP_PINS, |
1389 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1390 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1391 | { } | |
1392 | }, | |
1393 | .chained = true, | |
1394 | .chain_id = ALC880_FIXUP_5ST_BASE, | |
1395 | }, | |
1396 | [ALC880_FIXUP_6ST_BASE] = { | |
1727a771 TI |
1397 | .type = HDA_FIXUP_PINS, |
1398 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1399 | { 0x14, 0x01014010 }, /* front */ |
1400 | { 0x15, 0x01016412 }, /* surr */ | |
1401 | { 0x16, 0x01011411 }, /* CLFE */ | |
1402 | { 0x17, 0x01012414 }, /* side */ | |
1403 | { 0x18, 0x01a19c30 }, /* mic-in */ | |
1404 | { 0x19, 0x02a19c40 }, /* front-mic */ | |
1405 | { 0x1a, 0x01813031 }, /* line-in */ | |
1406 | { 0x1b, 0x0121411f }, /* HP */ | |
1407 | { 0x1c, 0x411111f0 }, /* N/A */ | |
1408 | { 0x1d, 0x411111f0 }, /* N/A */ | |
1409 | /* 0x1e is filled in below */ | |
1410 | { 0x1f, 0x411111f0 }, /* N/A */ | |
1411 | { } | |
1412 | } | |
1413 | }, | |
1414 | [ALC880_FIXUP_6ST] = { | |
1727a771 TI |
1415 | .type = HDA_FIXUP_PINS, |
1416 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1417 | { 0x1e, 0x411111f0 }, /* N/A */ |
1418 | { } | |
1419 | }, | |
1420 | .chained = true, | |
1421 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1422 | }, | |
1423 | [ALC880_FIXUP_6ST_DIG] = { | |
1727a771 TI |
1424 | .type = HDA_FIXUP_PINS, |
1425 | .v.pins = (const struct hda_pintbl[]) { | |
67b6ec31 TI |
1426 | { 0x1e, 0x0144111e }, /* SPDIF */ |
1427 | { } | |
1428 | }, | |
1429 | .chained = true, | |
1430 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1431 | }, | |
5397145f TI |
1432 | [ALC880_FIXUP_6ST_AUTOMUTE] = { |
1433 | .type = HDA_FIXUP_PINS, | |
1434 | .v.pins = (const struct hda_pintbl[]) { | |
1435 | { 0x1b, 0x0121401f }, /* HP with jack detect */ | |
1436 | { } | |
1437 | }, | |
1438 | .chained_before = true, | |
1439 | .chain_id = ALC880_FIXUP_6ST_BASE, | |
1440 | }, | |
ee3b2969 TI |
1441 | }; |
1442 | ||
1443 | static const struct snd_pci_quirk alc880_fixup_tbl[] = { | |
f02aab5d | 1444 | SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), |
487a588d | 1445 | SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), |
96e225f6 | 1446 | SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), |
29e3fdcc | 1447 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), |
6538de03 | 1448 | SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), |
29e3fdcc | 1449 | SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), |
27e917f8 | 1450 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), |
967b88c4 | 1451 | SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), |
ba533818 | 1452 | SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), |
817de92f | 1453 | SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), |
7833c7e8 | 1454 | SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), |
f02aab5d | 1455 | SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), |
ee3b2969 | 1456 | SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), |
5397145f | 1457 | SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), |
a161574e | 1458 | SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), |
cf5a2279 | 1459 | SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), |
ba533818 | 1460 | SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), |
cf5a2279 | 1461 | SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), |
dc6af52d TI |
1462 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), |
1463 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), | |
1464 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), | |
db8a38e5 | 1465 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), |
b9368f5c | 1466 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), |
67b6ec31 TI |
1467 | |
1468 | /* Below is the copied entries from alc880_quirks.c. | |
1469 | * It's not quite sure whether BIOS sets the correct pin-config table | |
1470 | * on these machines, thus they are kept to be compatible with | |
1471 | * the old static quirks. Once when it's confirmed to work without | |
1472 | * these overrides, it'd be better to remove. | |
1473 | */ | |
1474 | SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), | |
1475 | SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), | |
1476 | SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), | |
1477 | SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), | |
1478 | SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), | |
1479 | SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), | |
1480 | SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), | |
1481 | SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), | |
1482 | SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), | |
1483 | SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), | |
1484 | SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), | |
1485 | SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), | |
1486 | SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), | |
1487 | SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), | |
1488 | SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), | |
1489 | SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), | |
1490 | SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), | |
1491 | SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), | |
1492 | SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), | |
1493 | SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), | |
1494 | SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), | |
1495 | SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ | |
1496 | SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), | |
1497 | SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1498 | SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1499 | SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1500 | SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1501 | SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1502 | SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1503 | SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), | |
1504 | SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1505 | SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1506 | SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), | |
1507 | /* default Intel */ | |
1508 | SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), | |
1509 | SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), | |
1510 | SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), | |
1511 | {} | |
1512 | }; | |
1513 | ||
1727a771 | 1514 | static const struct hda_model_fixup alc880_fixup_models[] = { |
67b6ec31 TI |
1515 | {.id = ALC880_FIXUP_3ST, .name = "3stack"}, |
1516 | {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, | |
1517 | {.id = ALC880_FIXUP_5ST, .name = "5stack"}, | |
1518 | {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, | |
1519 | {.id = ALC880_FIXUP_6ST, .name = "6stack"}, | |
1520 | {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, | |
5397145f | 1521 | {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, |
ee3b2969 TI |
1522 | {} |
1523 | }; | |
1524 | ||
1525 | ||
1d045db9 TI |
1526 | /* |
1527 | * OK, here we have finally the patch for ALC880 | |
1528 | */ | |
1d045db9 | 1529 | static int patch_alc880(struct hda_codec *codec) |
60db6b53 | 1530 | { |
1d045db9 | 1531 | struct alc_spec *spec; |
1d045db9 | 1532 | int err; |
f6a92248 | 1533 | |
3de95173 TI |
1534 | err = alc_alloc_spec(codec, 0x0b); |
1535 | if (err < 0) | |
1536 | return err; | |
64154835 | 1537 | |
3de95173 | 1538 | spec = codec->spec; |
08c189f2 | 1539 | spec->gen.need_dac_fix = 1; |
7504b6cd | 1540 | spec->gen.beep_nid = 0x01; |
f53281e6 | 1541 | |
225068ab TI |
1542 | codec->patch_ops.unsol_event = alc880_unsol_event; |
1543 | ||
1727a771 | 1544 | snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, |
67b6ec31 | 1545 | alc880_fixups); |
1727a771 | 1546 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ee3b2969 | 1547 | |
67b6ec31 TI |
1548 | /* automatic parse from the BIOS config */ |
1549 | err = alc880_parse_auto_config(codec); | |
1550 | if (err < 0) | |
1551 | goto error; | |
fe3eb0a7 | 1552 | |
7504b6cd | 1553 | if (!spec->gen.no_analog) |
3e6179b8 | 1554 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
f53281e6 | 1555 | |
1727a771 | 1556 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1557 | |
1d045db9 | 1558 | return 0; |
e16fb6d1 TI |
1559 | |
1560 | error: | |
1561 | alc_free(codec); | |
1562 | return err; | |
226b1ec8 KY |
1563 | } |
1564 | ||
1d045db9 | 1565 | |
60db6b53 | 1566 | /* |
1d045db9 | 1567 | * ALC260 support |
60db6b53 | 1568 | */ |
1d045db9 | 1569 | static int alc260_parse_auto_config(struct hda_codec *codec) |
f6a92248 | 1570 | { |
1d045db9 | 1571 | static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; |
3e6179b8 TI |
1572 | static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; |
1573 | return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); | |
f6a92248 KY |
1574 | } |
1575 | ||
1d045db9 TI |
1576 | /* |
1577 | * Pin config fixes | |
1578 | */ | |
1579 | enum { | |
ca8f0424 TI |
1580 | ALC260_FIXUP_HP_DC5750, |
1581 | ALC260_FIXUP_HP_PIN_0F, | |
1582 | ALC260_FIXUP_COEF, | |
15317ab2 | 1583 | ALC260_FIXUP_GPIO1, |
20f7d928 TI |
1584 | ALC260_FIXUP_GPIO1_TOGGLE, |
1585 | ALC260_FIXUP_REPLACER, | |
0a1c4fa2 | 1586 | ALC260_FIXUP_HP_B1900, |
118cb4a4 | 1587 | ALC260_FIXUP_KN1, |
39aedee7 | 1588 | ALC260_FIXUP_FSC_S7020, |
5ebd3bbd | 1589 | ALC260_FIXUP_FSC_S7020_JWSE, |
d08c5ef2 | 1590 | ALC260_FIXUP_VAIO_PINS, |
1d045db9 TI |
1591 | }; |
1592 | ||
20f7d928 TI |
1593 | static void alc260_gpio1_automute(struct hda_codec *codec) |
1594 | { | |
1595 | struct alc_spec *spec = codec->spec; | |
1596 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | |
08c189f2 | 1597 | spec->gen.hp_jack_present); |
20f7d928 TI |
1598 | } |
1599 | ||
1600 | static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, | |
1727a771 | 1601 | const struct hda_fixup *fix, int action) |
20f7d928 TI |
1602 | { |
1603 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1604 | if (action == HDA_FIXUP_ACT_PROBE) { |
20f7d928 TI |
1605 | /* although the machine has only one output pin, we need to |
1606 | * toggle GPIO1 according to the jack state | |
1607 | */ | |
08c189f2 TI |
1608 | spec->gen.automute_hook = alc260_gpio1_automute; |
1609 | spec->gen.detect_hp = 1; | |
1610 | spec->gen.automute_speaker = 1; | |
1611 | spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ | |
62f949bf | 1612 | snd_hda_jack_detect_enable_callback(codec, 0x0f, |
08c189f2 | 1613 | snd_hda_gen_hp_automute); |
c9ce6b26 | 1614 | snd_hda_add_verbs(codec, alc_gpio1_init_verbs); |
20f7d928 TI |
1615 | } |
1616 | } | |
1617 | ||
118cb4a4 | 1618 | static void alc260_fixup_kn1(struct hda_codec *codec, |
1727a771 | 1619 | const struct hda_fixup *fix, int action) |
118cb4a4 TI |
1620 | { |
1621 | struct alc_spec *spec = codec->spec; | |
1727a771 | 1622 | static const struct hda_pintbl pincfgs[] = { |
118cb4a4 TI |
1623 | { 0x0f, 0x02214000 }, /* HP/speaker */ |
1624 | { 0x12, 0x90a60160 }, /* int mic */ | |
1625 | { 0x13, 0x02a19000 }, /* ext mic */ | |
1626 | { 0x18, 0x01446000 }, /* SPDIF out */ | |
1627 | /* disable bogus I/O pins */ | |
1628 | { 0x10, 0x411111f0 }, | |
1629 | { 0x11, 0x411111f0 }, | |
1630 | { 0x14, 0x411111f0 }, | |
1631 | { 0x15, 0x411111f0 }, | |
1632 | { 0x16, 0x411111f0 }, | |
1633 | { 0x17, 0x411111f0 }, | |
1634 | { 0x19, 0x411111f0 }, | |
1635 | { } | |
1636 | }; | |
1637 | ||
1638 | switch (action) { | |
1727a771 TI |
1639 | case HDA_FIXUP_ACT_PRE_PROBE: |
1640 | snd_hda_apply_pincfgs(codec, pincfgs); | |
118cb4a4 | 1641 | break; |
1727a771 | 1642 | case HDA_FIXUP_ACT_PROBE: |
118cb4a4 TI |
1643 | spec->init_amp = ALC_INIT_NONE; |
1644 | break; | |
1645 | } | |
1646 | } | |
1647 | ||
39aedee7 TI |
1648 | static void alc260_fixup_fsc_s7020(struct hda_codec *codec, |
1649 | const struct hda_fixup *fix, int action) | |
1650 | { | |
1651 | struct alc_spec *spec = codec->spec; | |
5ebd3bbd TI |
1652 | if (action == HDA_FIXUP_ACT_PROBE) |
1653 | spec->init_amp = ALC_INIT_NONE; | |
1654 | } | |
39aedee7 | 1655 | |
5ebd3bbd TI |
1656 | static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, |
1657 | const struct hda_fixup *fix, int action) | |
1658 | { | |
1659 | struct alc_spec *spec = codec->spec; | |
1660 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
f811c3cf | 1661 | spec->gen.add_jack_modes = 1; |
5ebd3bbd | 1662 | spec->gen.hp_mic = 1; |
e6e0ee50 | 1663 | } |
39aedee7 TI |
1664 | } |
1665 | ||
1727a771 | 1666 | static const struct hda_fixup alc260_fixups[] = { |
ca8f0424 | 1667 | [ALC260_FIXUP_HP_DC5750] = { |
1727a771 TI |
1668 | .type = HDA_FIXUP_PINS, |
1669 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
1670 | { 0x11, 0x90130110 }, /* speaker */ |
1671 | { } | |
1672 | } | |
1673 | }, | |
ca8f0424 | 1674 | [ALC260_FIXUP_HP_PIN_0F] = { |
1727a771 TI |
1675 | .type = HDA_FIXUP_PINS, |
1676 | .v.pins = (const struct hda_pintbl[]) { | |
ca8f0424 TI |
1677 | { 0x0f, 0x01214000 }, /* HP */ |
1678 | { } | |
1679 | } | |
1680 | }, | |
1681 | [ALC260_FIXUP_COEF] = { | |
1727a771 | 1682 | .type = HDA_FIXUP_VERBS, |
ca8f0424 | 1683 | .v.verbs = (const struct hda_verb[]) { |
e30cf2d2 RM |
1684 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1685 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, | |
ca8f0424 TI |
1686 | { } |
1687 | }, | |
ca8f0424 | 1688 | }, |
15317ab2 | 1689 | [ALC260_FIXUP_GPIO1] = { |
1727a771 | 1690 | .type = HDA_FIXUP_VERBS, |
15317ab2 TI |
1691 | .v.verbs = alc_gpio1_init_verbs, |
1692 | }, | |
20f7d928 | 1693 | [ALC260_FIXUP_GPIO1_TOGGLE] = { |
1727a771 | 1694 | .type = HDA_FIXUP_FUNC, |
20f7d928 TI |
1695 | .v.func = alc260_fixup_gpio1_toggle, |
1696 | .chained = true, | |
1697 | .chain_id = ALC260_FIXUP_HP_PIN_0F, | |
1698 | }, | |
1699 | [ALC260_FIXUP_REPLACER] = { | |
1727a771 | 1700 | .type = HDA_FIXUP_VERBS, |
20f7d928 | 1701 | .v.verbs = (const struct hda_verb[]) { |
192a98e2 TI |
1702 | { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, |
1703 | { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
20f7d928 TI |
1704 | { } |
1705 | }, | |
1706 | .chained = true, | |
1707 | .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, | |
1708 | }, | |
0a1c4fa2 | 1709 | [ALC260_FIXUP_HP_B1900] = { |
1727a771 | 1710 | .type = HDA_FIXUP_FUNC, |
0a1c4fa2 TI |
1711 | .v.func = alc260_fixup_gpio1_toggle, |
1712 | .chained = true, | |
1713 | .chain_id = ALC260_FIXUP_COEF, | |
118cb4a4 TI |
1714 | }, |
1715 | [ALC260_FIXUP_KN1] = { | |
1727a771 | 1716 | .type = HDA_FIXUP_FUNC, |
118cb4a4 TI |
1717 | .v.func = alc260_fixup_kn1, |
1718 | }, | |
39aedee7 TI |
1719 | [ALC260_FIXUP_FSC_S7020] = { |
1720 | .type = HDA_FIXUP_FUNC, | |
1721 | .v.func = alc260_fixup_fsc_s7020, | |
1722 | }, | |
5ebd3bbd TI |
1723 | [ALC260_FIXUP_FSC_S7020_JWSE] = { |
1724 | .type = HDA_FIXUP_FUNC, | |
1725 | .v.func = alc260_fixup_fsc_s7020_jwse, | |
1726 | .chained = true, | |
1727 | .chain_id = ALC260_FIXUP_FSC_S7020, | |
1728 | }, | |
d08c5ef2 TI |
1729 | [ALC260_FIXUP_VAIO_PINS] = { |
1730 | .type = HDA_FIXUP_PINS, | |
1731 | .v.pins = (const struct hda_pintbl[]) { | |
1732 | /* Pin configs are missing completely on some VAIOs */ | |
1733 | { 0x0f, 0x01211020 }, | |
1734 | { 0x10, 0x0001003f }, | |
1735 | { 0x11, 0x411111f0 }, | |
1736 | { 0x12, 0x01a15930 }, | |
1737 | { 0x13, 0x411111f0 }, | |
1738 | { 0x14, 0x411111f0 }, | |
1739 | { 0x15, 0x411111f0 }, | |
1740 | { 0x16, 0x411111f0 }, | |
1741 | { 0x17, 0x411111f0 }, | |
1742 | { 0x18, 0x411111f0 }, | |
1743 | { 0x19, 0x411111f0 }, | |
1744 | { } | |
1745 | } | |
1746 | }, | |
1d045db9 TI |
1747 | }; |
1748 | ||
1749 | static const struct snd_pci_quirk alc260_fixup_tbl[] = { | |
15317ab2 | 1750 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1751 | SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), |
15317ab2 | 1752 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), |
ca8f0424 | 1753 | SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), |
0a1c4fa2 | 1754 | SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), |
d08c5ef2 | 1755 | SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), |
0f5a5b85 | 1756 | SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), |
39aedee7 | 1757 | SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), |
b1f58085 | 1758 | SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), |
118cb4a4 | 1759 | SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), |
20f7d928 | 1760 | SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), |
ca8f0424 | 1761 | SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), |
1d045db9 TI |
1762 | {} |
1763 | }; | |
1764 | ||
5ebd3bbd TI |
1765 | static const struct hda_model_fixup alc260_fixup_models[] = { |
1766 | {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, | |
1767 | {.id = ALC260_FIXUP_COEF, .name = "coef"}, | |
1768 | {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, | |
1769 | {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, | |
1770 | {} | |
1771 | }; | |
1772 | ||
1d045db9 TI |
1773 | /* |
1774 | */ | |
1d045db9 | 1775 | static int patch_alc260(struct hda_codec *codec) |
977ddd6b | 1776 | { |
1d045db9 | 1777 | struct alc_spec *spec; |
c3c2c9e7 | 1778 | int err; |
1d045db9 | 1779 | |
3de95173 TI |
1780 | err = alc_alloc_spec(codec, 0x07); |
1781 | if (err < 0) | |
1782 | return err; | |
1d045db9 | 1783 | |
3de95173 | 1784 | spec = codec->spec; |
ea46c3c8 TI |
1785 | /* as quite a few machines require HP amp for speaker outputs, |
1786 | * it's easier to enable it unconditionally; even if it's unneeded, | |
1787 | * it's almost harmless. | |
1788 | */ | |
1789 | spec->gen.prefer_hp_amp = 1; | |
7504b6cd | 1790 | spec->gen.beep_nid = 0x01; |
1d045db9 | 1791 | |
225068ab TI |
1792 | spec->shutup = alc_eapd_shutup; |
1793 | ||
5ebd3bbd TI |
1794 | snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, |
1795 | alc260_fixups); | |
1727a771 | 1796 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
977ddd6b | 1797 | |
c3c2c9e7 TI |
1798 | /* automatic parse from the BIOS config */ |
1799 | err = alc260_parse_auto_config(codec); | |
1800 | if (err < 0) | |
1801 | goto error; | |
977ddd6b | 1802 | |
7504b6cd | 1803 | if (!spec->gen.no_analog) |
3e6179b8 | 1804 | set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); |
977ddd6b | 1805 | |
1727a771 | 1806 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 1807 | |
1d045db9 | 1808 | return 0; |
e16fb6d1 TI |
1809 | |
1810 | error: | |
1811 | alc_free(codec); | |
1812 | return err; | |
6981d184 TI |
1813 | } |
1814 | ||
1d045db9 TI |
1815 | |
1816 | /* | |
1817 | * ALC882/883/885/888/889 support | |
1818 | * | |
1819 | * ALC882 is almost identical with ALC880 but has cleaner and more flexible | |
1820 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
1821 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
1822 | * 6-channel independent captures. | |
1823 | * | |
1824 | * In addition, an independent DAC for the multi-playback (not used in this | |
1825 | * driver yet). | |
1826 | */ | |
1d045db9 TI |
1827 | |
1828 | /* | |
1829 | * Pin config fixes | |
1830 | */ | |
ff818c24 | 1831 | enum { |
5c0ebfbe TI |
1832 | ALC882_FIXUP_ABIT_AW9D_MAX, |
1833 | ALC882_FIXUP_LENOVO_Y530, | |
1834 | ALC882_FIXUP_PB_M5210, | |
1835 | ALC882_FIXUP_ACER_ASPIRE_7736, | |
1836 | ALC882_FIXUP_ASUS_W90V, | |
8f239214 | 1837 | ALC889_FIXUP_CD, |
b2c53e20 | 1838 | ALC889_FIXUP_FRONT_HP_NO_PRESENCE, |
5c0ebfbe | 1839 | ALC889_FIXUP_VAIO_TT, |
0e7cc2e7 | 1840 | ALC888_FIXUP_EEE1601, |
177943a3 | 1841 | ALC882_FIXUP_EAPD, |
7a6069bf | 1842 | ALC883_FIXUP_EAPD, |
8812c4f9 | 1843 | ALC883_FIXUP_ACER_EAPD, |
1a97b7f2 TI |
1844 | ALC882_FIXUP_GPIO1, |
1845 | ALC882_FIXUP_GPIO2, | |
eb844d51 | 1846 | ALC882_FIXUP_GPIO3, |
68ef0561 TI |
1847 | ALC889_FIXUP_COEF, |
1848 | ALC882_FIXUP_ASUS_W2JC, | |
c3e837bb TI |
1849 | ALC882_FIXUP_ACER_ASPIRE_4930G, |
1850 | ALC882_FIXUP_ACER_ASPIRE_8930G, | |
1851 | ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
5671087f | 1852 | ALC885_FIXUP_MACPRO_GPIO, |
02a237b2 | 1853 | ALC889_FIXUP_DAC_ROUTE, |
1a97b7f2 TI |
1854 | ALC889_FIXUP_MBP_VREF, |
1855 | ALC889_FIXUP_IMAC91_VREF, | |
e7729a41 | 1856 | ALC889_FIXUP_MBA11_VREF, |
0756f09c | 1857 | ALC889_FIXUP_MBA21_VREF, |
c20f31ec | 1858 | ALC889_FIXUP_MP11_VREF, |
9f660a1c | 1859 | ALC889_FIXUP_MP41_VREF, |
6e72aa5f | 1860 | ALC882_FIXUP_INV_DMIC, |
e427c237 | 1861 | ALC882_FIXUP_NO_PRIMARY_HP, |
1f0bbf03 | 1862 | ALC887_FIXUP_ASUS_BASS, |
eb9ca3ab | 1863 | ALC887_FIXUP_BASS_CHMAP, |
7beb3a6e | 1864 | ALC1220_FIXUP_GB_DUAL_CODECS, |
0202f5cd | 1865 | ALC1220_FIXUP_CLEVO_P950, |
4e0767c9 RS |
1866 | ALC1220_FIXUP_CLEVO_PB51ED, |
1867 | ALC1220_FIXUP_CLEVO_PB51ED_PINS, | |
ff818c24 TI |
1868 | }; |
1869 | ||
68ef0561 | 1870 | static void alc889_fixup_coef(struct hda_codec *codec, |
1727a771 | 1871 | const struct hda_fixup *fix, int action) |
68ef0561 | 1872 | { |
1727a771 | 1873 | if (action != HDA_FIXUP_ACT_INIT) |
68ef0561 | 1874 | return; |
1df8874b | 1875 | alc_update_coef_idx(codec, 7, 0, 0x2030); |
68ef0561 TI |
1876 | } |
1877 | ||
5671087f TI |
1878 | /* toggle speaker-output according to the hp-jack state */ |
1879 | static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted) | |
1880 | { | |
1881 | unsigned int gpiostate, gpiomask, gpiodir; | |
1882 | ||
7639a06c | 1883 | gpiostate = snd_hda_codec_read(codec, codec->core.afg, 0, |
5671087f TI |
1884 | AC_VERB_GET_GPIO_DATA, 0); |
1885 | ||
1886 | if (!muted) | |
1887 | gpiostate |= (1 << pin); | |
1888 | else | |
1889 | gpiostate &= ~(1 << pin); | |
1890 | ||
7639a06c | 1891 | gpiomask = snd_hda_codec_read(codec, codec->core.afg, 0, |
5671087f TI |
1892 | AC_VERB_GET_GPIO_MASK, 0); |
1893 | gpiomask |= (1 << pin); | |
1894 | ||
7639a06c | 1895 | gpiodir = snd_hda_codec_read(codec, codec->core.afg, 0, |
5671087f TI |
1896 | AC_VERB_GET_GPIO_DIRECTION, 0); |
1897 | gpiodir |= (1 << pin); | |
1898 | ||
1899 | ||
7639a06c | 1900 | snd_hda_codec_write(codec, codec->core.afg, 0, |
5671087f | 1901 | AC_VERB_SET_GPIO_MASK, gpiomask); |
7639a06c | 1902 | snd_hda_codec_write(codec, codec->core.afg, 0, |
5671087f TI |
1903 | AC_VERB_SET_GPIO_DIRECTION, gpiodir); |
1904 | ||
1905 | msleep(1); | |
1906 | ||
7639a06c | 1907 | snd_hda_codec_write(codec, codec->core.afg, 0, |
5671087f TI |
1908 | AC_VERB_SET_GPIO_DATA, gpiostate); |
1909 | } | |
1910 | ||
1911 | /* set up GPIO at initialization */ | |
1912 | static void alc885_fixup_macpro_gpio(struct hda_codec *codec, | |
1727a771 | 1913 | const struct hda_fixup *fix, int action) |
5671087f | 1914 | { |
1727a771 | 1915 | if (action != HDA_FIXUP_ACT_INIT) |
5671087f TI |
1916 | return; |
1917 | alc882_gpio_mute(codec, 0, 0); | |
1918 | alc882_gpio_mute(codec, 1, 0); | |
1919 | } | |
1920 | ||
02a237b2 TI |
1921 | /* Fix the connection of some pins for ALC889: |
1922 | * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't | |
1923 | * work correctly (bko#42740) | |
1924 | */ | |
1925 | static void alc889_fixup_dac_route(struct hda_codec *codec, | |
1727a771 | 1926 | const struct hda_fixup *fix, int action) |
02a237b2 | 1927 | { |
1727a771 | 1928 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
ef8d60fb | 1929 | /* fake the connections during parsing the tree */ |
02a237b2 TI |
1930 | hda_nid_t conn1[2] = { 0x0c, 0x0d }; |
1931 | hda_nid_t conn2[2] = { 0x0e, 0x0f }; | |
1932 | snd_hda_override_conn_list(codec, 0x14, 2, conn1); | |
1933 | snd_hda_override_conn_list(codec, 0x15, 2, conn1); | |
1934 | snd_hda_override_conn_list(codec, 0x18, 2, conn2); | |
1935 | snd_hda_override_conn_list(codec, 0x1a, 2, conn2); | |
1727a771 | 1936 | } else if (action == HDA_FIXUP_ACT_PROBE) { |
ef8d60fb TI |
1937 | /* restore the connections */ |
1938 | hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; | |
1939 | snd_hda_override_conn_list(codec, 0x14, 5, conn); | |
1940 | snd_hda_override_conn_list(codec, 0x15, 5, conn); | |
1941 | snd_hda_override_conn_list(codec, 0x18, 5, conn); | |
1942 | snd_hda_override_conn_list(codec, 0x1a, 5, conn); | |
02a237b2 TI |
1943 | } |
1944 | } | |
1945 | ||
1a97b7f2 TI |
1946 | /* Set VREF on HP pin */ |
1947 | static void alc889_fixup_mbp_vref(struct hda_codec *codec, | |
1727a771 | 1948 | const struct hda_fixup *fix, int action) |
1a97b7f2 TI |
1949 | { |
1950 | struct alc_spec *spec = codec->spec; | |
9f660a1c | 1951 | static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 }; |
1a97b7f2 TI |
1952 | int i; |
1953 | ||
1727a771 | 1954 | if (action != HDA_FIXUP_ACT_INIT) |
1a97b7f2 TI |
1955 | return; |
1956 | for (i = 0; i < ARRAY_SIZE(nids); i++) { | |
1957 | unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); | |
1958 | if (get_defcfg_device(val) != AC_JACK_HP_OUT) | |
1959 | continue; | |
d3f02d60 | 1960 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 1961 | val |= AC_PINCTL_VREF_80; |
cdd03ced | 1962 | snd_hda_set_pin_ctl(codec, nids[i], val); |
08c189f2 | 1963 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
1964 | break; |
1965 | } | |
1966 | } | |
1967 | ||
0756f09c TI |
1968 | static void alc889_fixup_mac_pins(struct hda_codec *codec, |
1969 | const hda_nid_t *nids, int num_nids) | |
1a97b7f2 TI |
1970 | { |
1971 | struct alc_spec *spec = codec->spec; | |
1a97b7f2 TI |
1972 | int i; |
1973 | ||
0756f09c | 1974 | for (i = 0; i < num_nids; i++) { |
1a97b7f2 | 1975 | unsigned int val; |
d3f02d60 | 1976 | val = snd_hda_codec_get_pin_target(codec, nids[i]); |
1a97b7f2 | 1977 | val |= AC_PINCTL_VREF_50; |
cdd03ced | 1978 | snd_hda_set_pin_ctl(codec, nids[i], val); |
1a97b7f2 | 1979 | } |
08c189f2 | 1980 | spec->gen.keep_vref_in_automute = 1; |
1a97b7f2 TI |
1981 | } |
1982 | ||
0756f09c TI |
1983 | /* Set VREF on speaker pins on imac91 */ |
1984 | static void alc889_fixup_imac91_vref(struct hda_codec *codec, | |
1985 | const struct hda_fixup *fix, int action) | |
1986 | { | |
1987 | static hda_nid_t nids[2] = { 0x18, 0x1a }; | |
1988 | ||
1989 | if (action == HDA_FIXUP_ACT_INIT) | |
1990 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
1991 | } | |
1992 | ||
e7729a41 AV |
1993 | /* Set VREF on speaker pins on mba11 */ |
1994 | static void alc889_fixup_mba11_vref(struct hda_codec *codec, | |
1995 | const struct hda_fixup *fix, int action) | |
1996 | { | |
1997 | static hda_nid_t nids[1] = { 0x18 }; | |
1998 | ||
1999 | if (action == HDA_FIXUP_ACT_INIT) | |
2000 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2001 | } | |
2002 | ||
0756f09c TI |
2003 | /* Set VREF on speaker pins on mba21 */ |
2004 | static void alc889_fixup_mba21_vref(struct hda_codec *codec, | |
2005 | const struct hda_fixup *fix, int action) | |
2006 | { | |
2007 | static hda_nid_t nids[2] = { 0x18, 0x19 }; | |
2008 | ||
2009 | if (action == HDA_FIXUP_ACT_INIT) | |
2010 | alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); | |
2011 | } | |
2012 | ||
e427c237 | 2013 | /* Don't take HP output as primary |
d9111496 FLVC |
2014 | * Strangely, the speaker output doesn't work on Vaio Z and some Vaio |
2015 | * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 | |
e427c237 TI |
2016 | */ |
2017 | static void alc882_fixup_no_primary_hp(struct hda_codec *codec, | |
1727a771 | 2018 | const struct hda_fixup *fix, int action) |
e427c237 TI |
2019 | { |
2020 | struct alc_spec *spec = codec->spec; | |
da96fb5b | 2021 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
08c189f2 | 2022 | spec->gen.no_primary_hp = 1; |
da96fb5b TI |
2023 | spec->gen.no_multi_io = 1; |
2024 | } | |
e427c237 TI |
2025 | } |
2026 | ||
eb9ca3ab TI |
2027 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
2028 | const struct hda_fixup *fix, int action); | |
2029 | ||
7beb3a6e TI |
2030 | /* For dual-codec configuration, we need to disable some features to avoid |
2031 | * conflicts of kctls and PCM streams | |
2032 | */ | |
2033 | static void alc_fixup_dual_codecs(struct hda_codec *codec, | |
2034 | const struct hda_fixup *fix, int action) | |
2035 | { | |
2036 | struct alc_spec *spec = codec->spec; | |
2037 | ||
2038 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2039 | return; | |
2040 | /* disable vmaster */ | |
2041 | spec->gen.suppress_vmaster = 1; | |
2042 | /* auto-mute and auto-mic switch don't work with multiple codecs */ | |
2043 | spec->gen.suppress_auto_mute = 1; | |
2044 | spec->gen.suppress_auto_mic = 1; | |
2045 | /* disable aamix as well */ | |
2046 | spec->gen.mixer_nid = 0; | |
2047 | /* add location prefix to avoid conflicts */ | |
2048 | codec->force_pin_prefix = 1; | |
2049 | } | |
2050 | ||
2051 | static void rename_ctl(struct hda_codec *codec, const char *oldname, | |
2052 | const char *newname) | |
2053 | { | |
2054 | struct snd_kcontrol *kctl; | |
2055 | ||
2056 | kctl = snd_hda_find_mixer_ctl(codec, oldname); | |
2057 | if (kctl) | |
2058 | strcpy(kctl->id.name, newname); | |
2059 | } | |
2060 | ||
2061 | static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, | |
2062 | const struct hda_fixup *fix, | |
2063 | int action) | |
2064 | { | |
2065 | alc_fixup_dual_codecs(codec, fix, action); | |
2066 | switch (action) { | |
2067 | case HDA_FIXUP_ACT_PRE_PROBE: | |
2068 | /* override card longname to provide a unique UCM profile */ | |
2069 | strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); | |
2070 | break; | |
2071 | case HDA_FIXUP_ACT_BUILD: | |
2072 | /* rename Capture controls depending on the codec */ | |
2073 | rename_ctl(codec, "Capture Volume", | |
2074 | codec->addr == 0 ? | |
2075 | "Rear-Panel Capture Volume" : | |
2076 | "Front-Panel Capture Volume"); | |
2077 | rename_ctl(codec, "Capture Switch", | |
2078 | codec->addr == 0 ? | |
2079 | "Rear-Panel Capture Switch" : | |
2080 | "Front-Panel Capture Switch"); | |
2081 | break; | |
2082 | } | |
2083 | } | |
2084 | ||
0202f5cd P |
2085 | static void alc1220_fixup_clevo_p950(struct hda_codec *codec, |
2086 | const struct hda_fixup *fix, | |
2087 | int action) | |
2088 | { | |
2089 | hda_nid_t conn1[1] = { 0x0c }; | |
2090 | ||
2091 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
2092 | return; | |
2093 | ||
2094 | alc_update_coef_idx(codec, 0x7, 0, 0x3c3); | |
2095 | /* We therefore want to make sure 0x14 (front headphone) and | |
2096 | * 0x1b (speakers) use the stereo DAC 0x02 | |
2097 | */ | |
2098 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); | |
2099 | snd_hda_override_conn_list(codec, 0x1b, 1, conn1); | |
2100 | } | |
2101 | ||
9430d3a6 JS |
2102 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, |
2103 | const struct hda_fixup *fix, int action); | |
2104 | ||
4e0767c9 | 2105 | static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, |
9430d3a6 JS |
2106 | const struct hda_fixup *fix, |
2107 | int action) | |
2108 | { | |
2109 | alc1220_fixup_clevo_p950(codec, fix, action); | |
2110 | alc_fixup_headset_mode_no_hp_mic(codec, fix, action); | |
2111 | } | |
2112 | ||
1727a771 | 2113 | static const struct hda_fixup alc882_fixups[] = { |
5c0ebfbe | 2114 | [ALC882_FIXUP_ABIT_AW9D_MAX] = { |
1727a771 TI |
2115 | .type = HDA_FIXUP_PINS, |
2116 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2117 | { 0x15, 0x01080104 }, /* side */ |
2118 | { 0x16, 0x01011012 }, /* rear */ | |
2119 | { 0x17, 0x01016011 }, /* clfe */ | |
2785591a | 2120 | { } |
145a902b DH |
2121 | } |
2122 | }, | |
5c0ebfbe | 2123 | [ALC882_FIXUP_LENOVO_Y530] = { |
1727a771 TI |
2124 | .type = HDA_FIXUP_PINS, |
2125 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2126 | { 0x15, 0x99130112 }, /* rear int speakers */ |
2127 | { 0x16, 0x99130111 }, /* subwoofer */ | |
ac612407 DH |
2128 | { } |
2129 | } | |
2130 | }, | |
5c0ebfbe | 2131 | [ALC882_FIXUP_PB_M5210] = { |
fd108215 TI |
2132 | .type = HDA_FIXUP_PINCTLS, |
2133 | .v.pins = (const struct hda_pintbl[]) { | |
2134 | { 0x19, PIN_VREF50 }, | |
357f915e KY |
2135 | {} |
2136 | } | |
2137 | }, | |
5c0ebfbe | 2138 | [ALC882_FIXUP_ACER_ASPIRE_7736] = { |
1727a771 | 2139 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 2140 | .v.func = alc_fixup_sku_ignore, |
6981d184 | 2141 | }, |
5c0ebfbe | 2142 | [ALC882_FIXUP_ASUS_W90V] = { |
1727a771 TI |
2143 | .type = HDA_FIXUP_PINS, |
2144 | .v.pins = (const struct hda_pintbl[]) { | |
5cdf745e TI |
2145 | { 0x16, 0x99130110 }, /* fix sequence for CLFE */ |
2146 | { } | |
2147 | } | |
2148 | }, | |
8f239214 | 2149 | [ALC889_FIXUP_CD] = { |
1727a771 TI |
2150 | .type = HDA_FIXUP_PINS, |
2151 | .v.pins = (const struct hda_pintbl[]) { | |
8f239214 MB |
2152 | { 0x1c, 0x993301f0 }, /* CD */ |
2153 | { } | |
2154 | } | |
2155 | }, | |
b2c53e20 DH |
2156 | [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { |
2157 | .type = HDA_FIXUP_PINS, | |
2158 | .v.pins = (const struct hda_pintbl[]) { | |
2159 | { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ | |
2160 | { } | |
2161 | }, | |
2162 | .chained = true, | |
2163 | .chain_id = ALC889_FIXUP_CD, | |
2164 | }, | |
5c0ebfbe | 2165 | [ALC889_FIXUP_VAIO_TT] = { |
1727a771 TI |
2166 | .type = HDA_FIXUP_PINS, |
2167 | .v.pins = (const struct hda_pintbl[]) { | |
5c0ebfbe TI |
2168 | { 0x17, 0x90170111 }, /* hidden surround speaker */ |
2169 | { } | |
2170 | } | |
2171 | }, | |
0e7cc2e7 | 2172 | [ALC888_FIXUP_EEE1601] = { |
1727a771 | 2173 | .type = HDA_FIXUP_VERBS, |
0e7cc2e7 TI |
2174 | .v.verbs = (const struct hda_verb[]) { |
2175 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2176 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, | |
2177 | { } | |
2178 | } | |
177943a3 TI |
2179 | }, |
2180 | [ALC882_FIXUP_EAPD] = { | |
1727a771 | 2181 | .type = HDA_FIXUP_VERBS, |
177943a3 TI |
2182 | .v.verbs = (const struct hda_verb[]) { |
2183 | /* change to EAPD mode */ | |
2184 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2185 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, | |
2186 | { } | |
2187 | } | |
2188 | }, | |
7a6069bf | 2189 | [ALC883_FIXUP_EAPD] = { |
1727a771 | 2190 | .type = HDA_FIXUP_VERBS, |
7a6069bf TI |
2191 | .v.verbs = (const struct hda_verb[]) { |
2192 | /* change to EAPD mode */ | |
2193 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2194 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2195 | { } | |
2196 | } | |
2197 | }, | |
8812c4f9 | 2198 | [ALC883_FIXUP_ACER_EAPD] = { |
1727a771 | 2199 | .type = HDA_FIXUP_VERBS, |
8812c4f9 TI |
2200 | .v.verbs = (const struct hda_verb[]) { |
2201 | /* eanable EAPD on Acer laptops */ | |
2202 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2203 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2204 | { } | |
2205 | } | |
2206 | }, | |
1a97b7f2 | 2207 | [ALC882_FIXUP_GPIO1] = { |
1727a771 | 2208 | .type = HDA_FIXUP_VERBS, |
1a97b7f2 TI |
2209 | .v.verbs = alc_gpio1_init_verbs, |
2210 | }, | |
2211 | [ALC882_FIXUP_GPIO2] = { | |
1727a771 | 2212 | .type = HDA_FIXUP_VERBS, |
1a97b7f2 TI |
2213 | .v.verbs = alc_gpio2_init_verbs, |
2214 | }, | |
eb844d51 | 2215 | [ALC882_FIXUP_GPIO3] = { |
1727a771 | 2216 | .type = HDA_FIXUP_VERBS, |
eb844d51 TI |
2217 | .v.verbs = alc_gpio3_init_verbs, |
2218 | }, | |
68ef0561 | 2219 | [ALC882_FIXUP_ASUS_W2JC] = { |
1727a771 | 2220 | .type = HDA_FIXUP_VERBS, |
68ef0561 TI |
2221 | .v.verbs = alc_gpio1_init_verbs, |
2222 | .chained = true, | |
2223 | .chain_id = ALC882_FIXUP_EAPD, | |
2224 | }, | |
2225 | [ALC889_FIXUP_COEF] = { | |
1727a771 | 2226 | .type = HDA_FIXUP_FUNC, |
68ef0561 TI |
2227 | .v.func = alc889_fixup_coef, |
2228 | }, | |
c3e837bb | 2229 | [ALC882_FIXUP_ACER_ASPIRE_4930G] = { |
1727a771 TI |
2230 | .type = HDA_FIXUP_PINS, |
2231 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2232 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2233 | { 0x17, 0x99130112 }, /* surround speaker */ | |
2234 | { } | |
038d4fef TI |
2235 | }, |
2236 | .chained = true, | |
2237 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb TI |
2238 | }, |
2239 | [ALC882_FIXUP_ACER_ASPIRE_8930G] = { | |
1727a771 TI |
2240 | .type = HDA_FIXUP_PINS, |
2241 | .v.pins = (const struct hda_pintbl[]) { | |
c3e837bb TI |
2242 | { 0x16, 0x99130111 }, /* CLFE speaker */ |
2243 | { 0x1b, 0x99130112 }, /* surround speaker */ | |
2244 | { } | |
2245 | }, | |
2246 | .chained = true, | |
2247 | .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, | |
2248 | }, | |
2249 | [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { | |
2250 | /* additional init verbs for Acer Aspire 8930G */ | |
1727a771 | 2251 | .type = HDA_FIXUP_VERBS, |
c3e837bb TI |
2252 | .v.verbs = (const struct hda_verb[]) { |
2253 | /* Enable all DACs */ | |
2254 | /* DAC DISABLE/MUTE 1? */ | |
2255 | /* setting bits 1-5 disables DAC nids 0x02-0x06 | |
2256 | * apparently. Init=0x38 */ | |
2257 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, | |
2258 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2259 | /* DAC DISABLE/MUTE 2? */ | |
2260 | /* some bit here disables the other DACs. | |
2261 | * Init=0x4900 */ | |
2262 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, | |
2263 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, | |
2264 | /* DMIC fix | |
2265 | * This laptop has a stereo digital microphone. | |
2266 | * The mics are only 1cm apart which makes the stereo | |
2267 | * useless. However, either the mic or the ALC889 | |
2268 | * makes the signal become a difference/sum signal | |
2269 | * instead of standard stereo, which is annoying. | |
2270 | * So instead we flip this bit which makes the | |
2271 | * codec replicate the sum signal to both channels, | |
2272 | * turning it into a normal mono mic. | |
2273 | */ | |
2274 | /* DMIC_CONTROL? Init value = 0x0001 */ | |
2275 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, | |
2276 | { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, | |
2277 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2278 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2279 | { } | |
038d4fef TI |
2280 | }, |
2281 | .chained = true, | |
2282 | .chain_id = ALC882_FIXUP_GPIO1, | |
c3e837bb | 2283 | }, |
5671087f | 2284 | [ALC885_FIXUP_MACPRO_GPIO] = { |
1727a771 | 2285 | .type = HDA_FIXUP_FUNC, |
5671087f TI |
2286 | .v.func = alc885_fixup_macpro_gpio, |
2287 | }, | |
02a237b2 | 2288 | [ALC889_FIXUP_DAC_ROUTE] = { |
1727a771 | 2289 | .type = HDA_FIXUP_FUNC, |
02a237b2 TI |
2290 | .v.func = alc889_fixup_dac_route, |
2291 | }, | |
1a97b7f2 | 2292 | [ALC889_FIXUP_MBP_VREF] = { |
1727a771 | 2293 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2294 | .v.func = alc889_fixup_mbp_vref, |
2295 | .chained = true, | |
2296 | .chain_id = ALC882_FIXUP_GPIO1, | |
2297 | }, | |
2298 | [ALC889_FIXUP_IMAC91_VREF] = { | |
1727a771 | 2299 | .type = HDA_FIXUP_FUNC, |
1a97b7f2 TI |
2300 | .v.func = alc889_fixup_imac91_vref, |
2301 | .chained = true, | |
2302 | .chain_id = ALC882_FIXUP_GPIO1, | |
2303 | }, | |
e7729a41 AV |
2304 | [ALC889_FIXUP_MBA11_VREF] = { |
2305 | .type = HDA_FIXUP_FUNC, | |
2306 | .v.func = alc889_fixup_mba11_vref, | |
2307 | .chained = true, | |
2308 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2309 | }, | |
0756f09c TI |
2310 | [ALC889_FIXUP_MBA21_VREF] = { |
2311 | .type = HDA_FIXUP_FUNC, | |
2312 | .v.func = alc889_fixup_mba21_vref, | |
2313 | .chained = true, | |
2314 | .chain_id = ALC889_FIXUP_MBP_VREF, | |
2315 | }, | |
c20f31ec TI |
2316 | [ALC889_FIXUP_MP11_VREF] = { |
2317 | .type = HDA_FIXUP_FUNC, | |
2318 | .v.func = alc889_fixup_mba11_vref, | |
2319 | .chained = true, | |
2320 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2321 | }, | |
9f660a1c MK |
2322 | [ALC889_FIXUP_MP41_VREF] = { |
2323 | .type = HDA_FIXUP_FUNC, | |
2324 | .v.func = alc889_fixup_mbp_vref, | |
2325 | .chained = true, | |
2326 | .chain_id = ALC885_FIXUP_MACPRO_GPIO, | |
2327 | }, | |
6e72aa5f | 2328 | [ALC882_FIXUP_INV_DMIC] = { |
1727a771 | 2329 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2330 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2331 | }, |
e427c237 | 2332 | [ALC882_FIXUP_NO_PRIMARY_HP] = { |
1727a771 | 2333 | .type = HDA_FIXUP_FUNC, |
e427c237 TI |
2334 | .v.func = alc882_fixup_no_primary_hp, |
2335 | }, | |
1f0bbf03 TI |
2336 | [ALC887_FIXUP_ASUS_BASS] = { |
2337 | .type = HDA_FIXUP_PINS, | |
2338 | .v.pins = (const struct hda_pintbl[]) { | |
2339 | {0x16, 0x99130130}, /* bass speaker */ | |
2340 | {} | |
2341 | }, | |
eb9ca3ab TI |
2342 | .chained = true, |
2343 | .chain_id = ALC887_FIXUP_BASS_CHMAP, | |
2344 | }, | |
2345 | [ALC887_FIXUP_BASS_CHMAP] = { | |
2346 | .type = HDA_FIXUP_FUNC, | |
2347 | .v.func = alc_fixup_bass_chmap, | |
1f0bbf03 | 2348 | }, |
7beb3a6e TI |
2349 | [ALC1220_FIXUP_GB_DUAL_CODECS] = { |
2350 | .type = HDA_FIXUP_FUNC, | |
2351 | .v.func = alc1220_fixup_gb_dual_codecs, | |
2352 | }, | |
0202f5cd P |
2353 | [ALC1220_FIXUP_CLEVO_P950] = { |
2354 | .type = HDA_FIXUP_FUNC, | |
2355 | .v.func = alc1220_fixup_clevo_p950, | |
2356 | }, | |
4e0767c9 | 2357 | [ALC1220_FIXUP_CLEVO_PB51ED] = { |
9430d3a6 | 2358 | .type = HDA_FIXUP_FUNC, |
4e0767c9 | 2359 | .v.func = alc1220_fixup_clevo_pb51ed, |
9430d3a6 | 2360 | }, |
4e0767c9 | 2361 | [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { |
9430d3a6 JS |
2362 | .type = HDA_FIXUP_PINS, |
2363 | .v.pins = (const struct hda_pintbl[]) { | |
2364 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
2365 | {} | |
2366 | }, | |
2367 | .chained = true, | |
4e0767c9 | 2368 | .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, |
9430d3a6 | 2369 | }, |
ff818c24 TI |
2370 | }; |
2371 | ||
1d045db9 | 2372 | static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
8812c4f9 TI |
2373 | SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), |
2374 | SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
b5d724b1 | 2375 | SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), |
8812c4f9 TI |
2376 | SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), |
2377 | SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), | |
2378 | SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), | |
2379 | SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), | |
c3e837bb TI |
2380 | SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", |
2381 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2382 | SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", | |
2383 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2384 | SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", | |
2385 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
2386 | SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", | |
2387 | ALC882_FIXUP_ACER_ASPIRE_8930G), | |
2388 | SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", | |
2389 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2390 | SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", | |
2391 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
2392 | SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", | |
2393 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
5c0ebfbe | 2394 | SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), |
f5c53d89 TI |
2395 | SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", |
2396 | ALC882_FIXUP_ACER_ASPIRE_4930G), | |
02a237b2 | 2397 | SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), |
fe97da1f | 2398 | SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), |
ac9b1cdd | 2399 | SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), |
177943a3 | 2400 | SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), |
5c0ebfbe | 2401 | SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), |
68ef0561 | 2402 | SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), |
0e7cc2e7 | 2403 | SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), |
1f0bbf03 | 2404 | SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), |
85bcf96c | 2405 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
ac9b1cdd | 2406 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
e427c237 | 2407 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
3f3c3714 | 2408 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), |
12e31a78 | 2409 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
c44d9b11 | 2410 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
5671087f TI |
2411 | |
2412 | /* All Apple entries are in codec SSIDs */ | |
1a97b7f2 TI |
2413 | SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), |
2414 | SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), | |
2415 | SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
c20f31ec | 2416 | SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), |
5671087f TI |
2417 | SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), |
2418 | SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), | |
1a97b7f2 TI |
2419 | SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), |
2420 | SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2421 | SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), |
e7729a41 | 2422 | SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), |
0756f09c | 2423 | SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), |
1a97b7f2 TI |
2424 | SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), |
2425 | SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), | |
5671087f | 2426 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), |
1a97b7f2 TI |
2427 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), |
2428 | SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), | |
2429 | SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), | |
9f660a1c | 2430 | SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), |
05193639 | 2431 | SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), |
1a97b7f2 TI |
2432 | SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), |
2433 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), | |
649ccd08 | 2434 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), |
5671087f | 2435 | |
7a6069bf | 2436 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), |
b2c53e20 | 2437 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), |
7beb3a6e | 2438 | SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
d2c3b14e | 2439 | SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), |
63691587 | 2440 | SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), |
d2c3b14e | 2441 | SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
5c0ebfbe | 2442 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
0202f5cd | 2443 | SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
4d10d972 | 2444 | SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
69366066 | 2445 | SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
4e0767c9 RS |
2446 | SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2447 | SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
2448 | SND_PCI_QUIRK(0x1558, 0x65d1, "Tuxedo Book XC1509", ALC1220_FIXUP_CLEVO_PB51ED_PINS), | |
7a6069bf TI |
2449 | SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
2450 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), | |
ac9b1cdd | 2451 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), |
68ef0561 | 2452 | SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), |
ff818c24 TI |
2453 | {} |
2454 | }; | |
2455 | ||
1727a771 | 2456 | static const struct hda_model_fixup alc882_fixup_models[] = { |
912093bc TI |
2457 | {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, |
2458 | {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, | |
2459 | {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, | |
6e72aa5f | 2460 | {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e427c237 | 2461 | {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, |
ba90d6a6 | 2462 | {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, |
912093bc TI |
2463 | {} |
2464 | }; | |
2465 | ||
f6a92248 | 2466 | /* |
1d045db9 | 2467 | * BIOS auto configuration |
f6a92248 | 2468 | */ |
1d045db9 TI |
2469 | /* almost identical with ALC880 parser... */ |
2470 | static int alc882_parse_auto_config(struct hda_codec *codec) | |
2471 | { | |
1d045db9 | 2472 | static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2473 | static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2474 | return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); | |
1d045db9 | 2475 | } |
b896b4eb | 2476 | |
1d045db9 TI |
2477 | /* |
2478 | */ | |
1d045db9 | 2479 | static int patch_alc882(struct hda_codec *codec) |
f6a92248 KY |
2480 | { |
2481 | struct alc_spec *spec; | |
1a97b7f2 | 2482 | int err; |
f6a92248 | 2483 | |
3de95173 TI |
2484 | err = alc_alloc_spec(codec, 0x0b); |
2485 | if (err < 0) | |
2486 | return err; | |
f6a92248 | 2487 | |
3de95173 | 2488 | spec = codec->spec; |
1f0f4b80 | 2489 | |
7639a06c | 2490 | switch (codec->core.vendor_id) { |
1d045db9 TI |
2491 | case 0x10ec0882: |
2492 | case 0x10ec0885: | |
acf08081 | 2493 | case 0x10ec0900: |
a535ad57 | 2494 | case 0x10ec1220: |
1d045db9 TI |
2495 | break; |
2496 | default: | |
2497 | /* ALC883 and variants */ | |
2498 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); | |
2499 | break; | |
c793bec5 | 2500 | } |
977ddd6b | 2501 | |
1727a771 | 2502 | snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, |
912093bc | 2503 | alc882_fixups); |
1727a771 | 2504 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
ff818c24 | 2505 | |
1d045db9 TI |
2506 | alc_auto_parse_customize_define(codec); |
2507 | ||
7504b6cd TI |
2508 | if (has_cdefine_beep(codec)) |
2509 | spec->gen.beep_nid = 0x01; | |
2510 | ||
1a97b7f2 TI |
2511 | /* automatic parse from the BIOS config */ |
2512 | err = alc882_parse_auto_config(codec); | |
2513 | if (err < 0) | |
2514 | goto error; | |
f6a92248 | 2515 | |
7504b6cd | 2516 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
1d045db9 | 2517 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
f6a92248 | 2518 | |
1727a771 | 2519 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2520 | |
f6a92248 | 2521 | return 0; |
e16fb6d1 TI |
2522 | |
2523 | error: | |
2524 | alc_free(codec); | |
2525 | return err; | |
f6a92248 KY |
2526 | } |
2527 | ||
df694daa | 2528 | |
df694daa | 2529 | /* |
1d045db9 | 2530 | * ALC262 support |
df694daa | 2531 | */ |
1d045db9 | 2532 | static int alc262_parse_auto_config(struct hda_codec *codec) |
df694daa | 2533 | { |
1d045db9 | 2534 | static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2535 | static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
2536 | return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); | |
df694daa KY |
2537 | } |
2538 | ||
df694daa | 2539 | /* |
1d045db9 | 2540 | * Pin config fixes |
df694daa | 2541 | */ |
cfc9b06f | 2542 | enum { |
ea4e7af1 | 2543 | ALC262_FIXUP_FSC_H270, |
7513e6da | 2544 | ALC262_FIXUP_FSC_S7110, |
ea4e7af1 TI |
2545 | ALC262_FIXUP_HP_Z200, |
2546 | ALC262_FIXUP_TYAN, | |
c470150c | 2547 | ALC262_FIXUP_LENOVO_3000, |
b42590b8 TI |
2548 | ALC262_FIXUP_BENQ, |
2549 | ALC262_FIXUP_BENQ_T31, | |
6e72aa5f | 2550 | ALC262_FIXUP_INV_DMIC, |
b5c6611f | 2551 | ALC262_FIXUP_INTEL_BAYLEYBAY, |
cfc9b06f TI |
2552 | }; |
2553 | ||
1727a771 | 2554 | static const struct hda_fixup alc262_fixups[] = { |
ea4e7af1 | 2555 | [ALC262_FIXUP_FSC_H270] = { |
1727a771 TI |
2556 | .type = HDA_FIXUP_PINS, |
2557 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
2558 | { 0x14, 0x99130110 }, /* speaker */ |
2559 | { 0x15, 0x0221142f }, /* front HP */ | |
2560 | { 0x1b, 0x0121141f }, /* rear HP */ | |
2561 | { } | |
2562 | } | |
2563 | }, | |
7513e6da TI |
2564 | [ALC262_FIXUP_FSC_S7110] = { |
2565 | .type = HDA_FIXUP_PINS, | |
2566 | .v.pins = (const struct hda_pintbl[]) { | |
2567 | { 0x15, 0x90170110 }, /* speaker */ | |
2568 | { } | |
2569 | }, | |
2570 | .chained = true, | |
2571 | .chain_id = ALC262_FIXUP_BENQ, | |
2572 | }, | |
ea4e7af1 | 2573 | [ALC262_FIXUP_HP_Z200] = { |
1727a771 TI |
2574 | .type = HDA_FIXUP_PINS, |
2575 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 | 2576 | { 0x16, 0x99130120 }, /* internal speaker */ |
73413b12 TI |
2577 | { } |
2578 | } | |
cfc9b06f | 2579 | }, |
ea4e7af1 | 2580 | [ALC262_FIXUP_TYAN] = { |
1727a771 TI |
2581 | .type = HDA_FIXUP_PINS, |
2582 | .v.pins = (const struct hda_pintbl[]) { | |
ea4e7af1 TI |
2583 | { 0x14, 0x1993e1f0 }, /* int AUX */ |
2584 | { } | |
2585 | } | |
2586 | }, | |
c470150c | 2587 | [ALC262_FIXUP_LENOVO_3000] = { |
fd108215 TI |
2588 | .type = HDA_FIXUP_PINCTLS, |
2589 | .v.pins = (const struct hda_pintbl[]) { | |
2590 | { 0x19, PIN_VREF50 }, | |
b42590b8 TI |
2591 | {} |
2592 | }, | |
2593 | .chained = true, | |
2594 | .chain_id = ALC262_FIXUP_BENQ, | |
2595 | }, | |
2596 | [ALC262_FIXUP_BENQ] = { | |
1727a771 | 2597 | .type = HDA_FIXUP_VERBS, |
b42590b8 | 2598 | .v.verbs = (const struct hda_verb[]) { |
c470150c TI |
2599 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, |
2600 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, | |
2601 | {} | |
2602 | } | |
2603 | }, | |
b42590b8 | 2604 | [ALC262_FIXUP_BENQ_T31] = { |
1727a771 | 2605 | .type = HDA_FIXUP_VERBS, |
b42590b8 TI |
2606 | .v.verbs = (const struct hda_verb[]) { |
2607 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, | |
2608 | { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, | |
2609 | {} | |
2610 | } | |
2611 | }, | |
6e72aa5f | 2612 | [ALC262_FIXUP_INV_DMIC] = { |
1727a771 | 2613 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2614 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2615 | }, |
b5c6611f ML |
2616 | [ALC262_FIXUP_INTEL_BAYLEYBAY] = { |
2617 | .type = HDA_FIXUP_FUNC, | |
2618 | .v.func = alc_fixup_no_depop_delay, | |
2619 | }, | |
cfc9b06f TI |
2620 | }; |
2621 | ||
1d045db9 | 2622 | static const struct snd_pci_quirk alc262_fixup_tbl[] = { |
ea4e7af1 | 2623 | SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), |
7513e6da | 2624 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), |
3dcd3be3 | 2625 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), |
ea4e7af1 | 2626 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), |
4bf1bd42 | 2627 | SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), |
ea4e7af1 | 2628 | SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), |
c470150c | 2629 | SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), |
b42590b8 TI |
2630 | SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), |
2631 | SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), | |
b5c6611f | 2632 | SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), |
cfc9b06f TI |
2633 | {} |
2634 | }; | |
df694daa | 2635 | |
1727a771 | 2636 | static const struct hda_model_fixup alc262_fixup_models[] = { |
6e72aa5f TI |
2637 | {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
2638 | {} | |
2639 | }; | |
1d045db9 | 2640 | |
1d045db9 TI |
2641 | /* |
2642 | */ | |
1d045db9 | 2643 | static int patch_alc262(struct hda_codec *codec) |
df694daa KY |
2644 | { |
2645 | struct alc_spec *spec; | |
df694daa KY |
2646 | int err; |
2647 | ||
3de95173 TI |
2648 | err = alc_alloc_spec(codec, 0x0b); |
2649 | if (err < 0) | |
2650 | return err; | |
df694daa | 2651 | |
3de95173 | 2652 | spec = codec->spec; |
08c189f2 | 2653 | spec->gen.shared_mic_vref_pin = 0x18; |
1d045db9 | 2654 | |
225068ab TI |
2655 | spec->shutup = alc_eapd_shutup; |
2656 | ||
1d045db9 TI |
2657 | #if 0 |
2658 | /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is | |
2659 | * under-run | |
2660 | */ | |
98b24883 | 2661 | alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); |
1d045db9 | 2662 | #endif |
1d045db9 TI |
2663 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
2664 | ||
1727a771 | 2665 | snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, |
6e72aa5f | 2666 | alc262_fixups); |
1727a771 | 2667 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
9c7f852e | 2668 | |
af741c15 TI |
2669 | alc_auto_parse_customize_define(codec); |
2670 | ||
7504b6cd TI |
2671 | if (has_cdefine_beep(codec)) |
2672 | spec->gen.beep_nid = 0x01; | |
2673 | ||
42399f7a TI |
2674 | /* automatic parse from the BIOS config */ |
2675 | err = alc262_parse_auto_config(codec); | |
2676 | if (err < 0) | |
2677 | goto error; | |
df694daa | 2678 | |
7504b6cd | 2679 | if (!spec->gen.no_analog && spec->gen.beep_nid) |
1d045db9 | 2680 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
2134ea4f | 2681 | |
1727a771 | 2682 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 2683 | |
1da177e4 | 2684 | return 0; |
e16fb6d1 TI |
2685 | |
2686 | error: | |
2687 | alc_free(codec); | |
2688 | return err; | |
1da177e4 LT |
2689 | } |
2690 | ||
f32610ed | 2691 | /* |
1d045db9 | 2692 | * ALC268 |
f32610ed | 2693 | */ |
1d045db9 | 2694 | /* bind Beep switches of both NID 0x0f and 0x10 */ |
a717777d TI |
2695 | static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, |
2696 | struct snd_ctl_elem_value *ucontrol) | |
2697 | { | |
2698 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | |
2699 | unsigned long pval; | |
2700 | int err; | |
2701 | ||
2702 | mutex_lock(&codec->control_mutex); | |
2703 | pval = kcontrol->private_value; | |
2704 | kcontrol->private_value = (pval & ~0xff) | 0x0f; | |
2705 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2706 | if (err >= 0) { | |
2707 | kcontrol->private_value = (pval & ~0xff) | 0x10; | |
2708 | err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); | |
2709 | } | |
2710 | kcontrol->private_value = pval; | |
2711 | mutex_unlock(&codec->control_mutex); | |
2712 | return err; | |
2713 | } | |
f32610ed | 2714 | |
1d045db9 TI |
2715 | static const struct snd_kcontrol_new alc268_beep_mixer[] = { |
2716 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), | |
a717777d TI |
2717 | { |
2718 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | |
2719 | .name = "Beep Playback Switch", | |
2720 | .subdevice = HDA_SUBDEV_AMP_FLAG, | |
2721 | .info = snd_hda_mixer_amp_switch_info, | |
2722 | .get = snd_hda_mixer_amp_switch_get, | |
2723 | .put = alc268_beep_switch_put, | |
2724 | .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) | |
2725 | }, | |
1d045db9 | 2726 | { } |
f32610ed JS |
2727 | }; |
2728 | ||
1d045db9 TI |
2729 | /* set PCBEEP vol = 0, mute connections */ |
2730 | static const struct hda_verb alc268_beep_init_verbs[] = { | |
2731 | {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | |
2732 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2733 | {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | |
2734 | { } | |
f32610ed JS |
2735 | }; |
2736 | ||
6e72aa5f TI |
2737 | enum { |
2738 | ALC268_FIXUP_INV_DMIC, | |
cb766404 | 2739 | ALC268_FIXUP_HP_EAPD, |
24eff328 | 2740 | ALC268_FIXUP_SPDIF, |
6e72aa5f TI |
2741 | }; |
2742 | ||
1727a771 | 2743 | static const struct hda_fixup alc268_fixups[] = { |
6e72aa5f | 2744 | [ALC268_FIXUP_INV_DMIC] = { |
1727a771 | 2745 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 2746 | .v.func = alc_fixup_inv_dmic, |
6e72aa5f | 2747 | }, |
cb766404 | 2748 | [ALC268_FIXUP_HP_EAPD] = { |
1727a771 | 2749 | .type = HDA_FIXUP_VERBS, |
cb766404 TI |
2750 | .v.verbs = (const struct hda_verb[]) { |
2751 | {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
2752 | {} | |
2753 | } | |
2754 | }, | |
24eff328 TI |
2755 | [ALC268_FIXUP_SPDIF] = { |
2756 | .type = HDA_FIXUP_PINS, | |
2757 | .v.pins = (const struct hda_pintbl[]) { | |
2758 | { 0x1e, 0x014b1180 }, /* enable SPDIF out */ | |
2759 | {} | |
2760 | } | |
2761 | }, | |
6e72aa5f TI |
2762 | }; |
2763 | ||
1727a771 | 2764 | static const struct hda_model_fixup alc268_fixup_models[] = { |
6e72aa5f | 2765 | {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
cb766404 TI |
2766 | {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, |
2767 | {} | |
2768 | }; | |
2769 | ||
2770 | static const struct snd_pci_quirk alc268_fixup_tbl[] = { | |
24eff328 | 2771 | SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), |
fcd8f3b1 | 2772 | SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), |
cb766404 TI |
2773 | /* below is codec SSID since multiple Toshiba laptops have the |
2774 | * same PCI SSID 1179:ff00 | |
2775 | */ | |
2776 | SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), | |
6e72aa5f TI |
2777 | {} |
2778 | }; | |
2779 | ||
f32610ed JS |
2780 | /* |
2781 | * BIOS auto configuration | |
2782 | */ | |
1d045db9 | 2783 | static int alc268_parse_auto_config(struct hda_codec *codec) |
f32610ed | 2784 | { |
3e6179b8 | 2785 | static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
7504b6cd | 2786 | return alc_parse_auto_config(codec, NULL, alc268_ssids); |
f32610ed JS |
2787 | } |
2788 | ||
1d045db9 TI |
2789 | /* |
2790 | */ | |
1d045db9 | 2791 | static int patch_alc268(struct hda_codec *codec) |
f32610ed JS |
2792 | { |
2793 | struct alc_spec *spec; | |
7504b6cd | 2794 | int err; |
f32610ed | 2795 | |
1d045db9 | 2796 | /* ALC268 has no aa-loopback mixer */ |
3de95173 TI |
2797 | err = alc_alloc_spec(codec, 0); |
2798 | if (err < 0) | |
2799 | return err; | |
2800 | ||
2801 | spec = codec->spec; | |
7504b6cd | 2802 | spec->gen.beep_nid = 0x01; |
1f0f4b80 | 2803 | |
225068ab TI |
2804 | spec->shutup = alc_eapd_shutup; |
2805 | ||
1727a771 TI |
2806 | snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); |
2807 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
6e72aa5f | 2808 | |
6ebb8053 TI |
2809 | /* automatic parse from the BIOS config */ |
2810 | err = alc268_parse_auto_config(codec); | |
e16fb6d1 TI |
2811 | if (err < 0) |
2812 | goto error; | |
f32610ed | 2813 | |
7504b6cd TI |
2814 | if (err > 0 && !spec->gen.no_analog && |
2815 | spec->gen.autocfg.speaker_pins[0] != 0x1d) { | |
2816 | add_mixer(spec, alc268_beep_mixer); | |
2817 | snd_hda_add_verbs(codec, alc268_beep_init_verbs); | |
1d045db9 TI |
2818 | if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) |
2819 | /* override the amp caps for beep generator */ | |
2820 | snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, | |
2821 | (0x0c << AC_AMPCAP_OFFSET_SHIFT) | | |
2822 | (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
2823 | (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
2824 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
2f893286 KY |
2825 | } |
2826 | ||
1727a771 | 2827 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
6e72aa5f | 2828 | |
f32610ed | 2829 | return 0; |
e16fb6d1 TI |
2830 | |
2831 | error: | |
2832 | alc_free(codec); | |
2833 | return err; | |
f32610ed JS |
2834 | } |
2835 | ||
bc9f98a9 | 2836 | /* |
1d045db9 | 2837 | * ALC269 |
bc9f98a9 | 2838 | */ |
08c189f2 | 2839 | |
1d045db9 | 2840 | static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { |
1d045db9 | 2841 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 KY |
2842 | }; |
2843 | ||
1d045db9 | 2844 | static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { |
1d045db9 | 2845 | .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ |
bc9f98a9 | 2846 | }; |
291702f0 | 2847 | |
1d045db9 TI |
2848 | /* different alc269-variants */ |
2849 | enum { | |
2850 | ALC269_TYPE_ALC269VA, | |
2851 | ALC269_TYPE_ALC269VB, | |
2852 | ALC269_TYPE_ALC269VC, | |
adcc70b2 | 2853 | ALC269_TYPE_ALC269VD, |
065380f0 KY |
2854 | ALC269_TYPE_ALC280, |
2855 | ALC269_TYPE_ALC282, | |
2af02be7 | 2856 | ALC269_TYPE_ALC283, |
065380f0 | 2857 | ALC269_TYPE_ALC284, |
4731d5de | 2858 | ALC269_TYPE_ALC293, |
7fc7d047 | 2859 | ALC269_TYPE_ALC286, |
506b62c3 | 2860 | ALC269_TYPE_ALC298, |
1d04c9de | 2861 | ALC269_TYPE_ALC255, |
4344aec8 | 2862 | ALC269_TYPE_ALC256, |
f429e7e4 | 2863 | ALC269_TYPE_ALC257, |
0a6f0600 | 2864 | ALC269_TYPE_ALC215, |
4231430d | 2865 | ALC269_TYPE_ALC225, |
dcd4f0db | 2866 | ALC269_TYPE_ALC294, |
9887cf53 | 2867 | ALC269_TYPE_ALC300, |
6fbae35a | 2868 | ALC269_TYPE_ALC700, |
bc9f98a9 KY |
2869 | }; |
2870 | ||
2871 | /* | |
1d045db9 | 2872 | * BIOS auto configuration |
bc9f98a9 | 2873 | */ |
1d045db9 TI |
2874 | static int alc269_parse_auto_config(struct hda_codec *codec) |
2875 | { | |
1d045db9 | 2876 | static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
2877 | static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; |
2878 | static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
2879 | struct alc_spec *spec = codec->spec; | |
adcc70b2 KY |
2880 | const hda_nid_t *ssids; |
2881 | ||
2882 | switch (spec->codec_variant) { | |
2883 | case ALC269_TYPE_ALC269VA: | |
2884 | case ALC269_TYPE_ALC269VC: | |
065380f0 KY |
2885 | case ALC269_TYPE_ALC280: |
2886 | case ALC269_TYPE_ALC284: | |
4731d5de | 2887 | case ALC269_TYPE_ALC293: |
adcc70b2 KY |
2888 | ssids = alc269va_ssids; |
2889 | break; | |
2890 | case ALC269_TYPE_ALC269VB: | |
2891 | case ALC269_TYPE_ALC269VD: | |
065380f0 | 2892 | case ALC269_TYPE_ALC282: |
2af02be7 | 2893 | case ALC269_TYPE_ALC283: |
7fc7d047 | 2894 | case ALC269_TYPE_ALC286: |
506b62c3 | 2895 | case ALC269_TYPE_ALC298: |
1d04c9de | 2896 | case ALC269_TYPE_ALC255: |
4344aec8 | 2897 | case ALC269_TYPE_ALC256: |
f429e7e4 | 2898 | case ALC269_TYPE_ALC257: |
0a6f0600 | 2899 | case ALC269_TYPE_ALC215: |
4231430d | 2900 | case ALC269_TYPE_ALC225: |
dcd4f0db | 2901 | case ALC269_TYPE_ALC294: |
9887cf53 | 2902 | case ALC269_TYPE_ALC300: |
6fbae35a | 2903 | case ALC269_TYPE_ALC700: |
adcc70b2 KY |
2904 | ssids = alc269_ssids; |
2905 | break; | |
2906 | default: | |
2907 | ssids = alc269_ssids; | |
2908 | break; | |
2909 | } | |
bc9f98a9 | 2910 | |
3e6179b8 | 2911 | return alc_parse_auto_config(codec, alc269_ignore, ssids); |
1d045db9 | 2912 | } |
bc9f98a9 | 2913 | |
1387e2d1 | 2914 | static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) |
1d045db9 | 2915 | { |
98b24883 | 2916 | alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); |
1d045db9 | 2917 | } |
291702f0 | 2918 | |
1d045db9 TI |
2919 | static void alc269_shutup(struct hda_codec *codec) |
2920 | { | |
adcc70b2 KY |
2921 | struct alc_spec *spec = codec->spec; |
2922 | ||
1387e2d1 KY |
2923 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
2924 | alc269vb_toggle_power_output(codec, 0); | |
2925 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
2926 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { | |
1d045db9 TI |
2927 | msleep(150); |
2928 | } | |
b001f661 | 2929 | alc_shutup_pins(codec); |
1d045db9 | 2930 | } |
291702f0 | 2931 | |
54db6c39 TI |
2932 | static struct coef_fw alc282_coefs[] = { |
2933 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ | |
32fa7e49 | 2934 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
2935 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
2936 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
2937 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
2938 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
2939 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
2940 | WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ | |
2941 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
2942 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
2943 | WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ | |
2944 | UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ | |
2945 | WRITE_COEF(0x34, 0xa0c0), /* ANC */ | |
2946 | UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ | |
2947 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
2948 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
2949 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
2950 | WRITE_COEF(0x63, 0x2902), /* PLL */ | |
2951 | WRITE_COEF(0x68, 0xa080), /* capless control 2 */ | |
2952 | WRITE_COEF(0x69, 0x3400), /* capless control 3 */ | |
2953 | WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ | |
2954 | WRITE_COEF(0x6b, 0x0), /* capless control 5 */ | |
2955 | UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ | |
2956 | WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ | |
2957 | UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ | |
2958 | WRITE_COEF(0x71, 0x0014), /* class D test 6 */ | |
2959 | WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ | |
2960 | UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ | |
2961 | WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ | |
2962 | {} | |
2963 | }; | |
2964 | ||
cb149cb3 KY |
2965 | static void alc282_restore_default_value(struct hda_codec *codec) |
2966 | { | |
54db6c39 | 2967 | alc_process_coef_fw(codec, alc282_coefs); |
cb149cb3 KY |
2968 | } |
2969 | ||
7b5c7a02 KY |
2970 | static void alc282_init(struct hda_codec *codec) |
2971 | { | |
2972 | struct alc_spec *spec = codec->spec; | |
80f10932 | 2973 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
2974 | bool hp_pin_sense; |
2975 | int coef78; | |
2976 | ||
435e2bb2 KY |
2977 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
2978 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
2979 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
2980 | } | |
2981 | ||
cb149cb3 KY |
2982 | alc282_restore_default_value(codec); |
2983 | ||
7b5c7a02 KY |
2984 | if (!hp_pin) |
2985 | return; | |
2986 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
2987 | coef78 = alc_read_coef_idx(codec, 0x78); | |
2988 | ||
2989 | /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ | |
2990 | /* Headphone capless set to high power mode */ | |
2991 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
2992 | ||
2993 | if (hp_pin_sense) | |
2994 | msleep(2); | |
2995 | ||
2996 | snd_hda_codec_write(codec, hp_pin, 0, | |
2997 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
2998 | ||
2999 | if (hp_pin_sense) | |
3000 | msleep(85); | |
3001 | ||
3002 | snd_hda_codec_write(codec, hp_pin, 0, | |
3003 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3004 | ||
3005 | if (hp_pin_sense) | |
3006 | msleep(100); | |
3007 | ||
3008 | /* Headphone capless set to normal mode */ | |
3009 | alc_write_coef_idx(codec, 0x78, coef78); | |
3010 | } | |
3011 | ||
3012 | static void alc282_shutup(struct hda_codec *codec) | |
3013 | { | |
3014 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3015 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
7b5c7a02 KY |
3016 | bool hp_pin_sense; |
3017 | int coef78; | |
3018 | ||
435e2bb2 KY |
3019 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3020 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3021 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3022 | } | |
3023 | ||
7b5c7a02 KY |
3024 | if (!hp_pin) { |
3025 | alc269_shutup(codec); | |
3026 | return; | |
3027 | } | |
3028 | ||
3029 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3030 | coef78 = alc_read_coef_idx(codec, 0x78); | |
3031 | alc_write_coef_idx(codec, 0x78, 0x9004); | |
3032 | ||
3033 | if (hp_pin_sense) | |
3034 | msleep(2); | |
3035 | ||
3036 | snd_hda_codec_write(codec, hp_pin, 0, | |
3037 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3038 | ||
3039 | if (hp_pin_sense) | |
3040 | msleep(85); | |
3041 | ||
b001f661 TI |
3042 | if (!spec->no_shutup_pins) |
3043 | snd_hda_codec_write(codec, hp_pin, 0, | |
3044 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
7b5c7a02 KY |
3045 | |
3046 | if (hp_pin_sense) | |
3047 | msleep(100); | |
3048 | ||
3049 | alc_auto_setup_eapd(codec, false); | |
b001f661 | 3050 | alc_shutup_pins(codec); |
7b5c7a02 KY |
3051 | alc_write_coef_idx(codec, 0x78, coef78); |
3052 | } | |
3053 | ||
54db6c39 TI |
3054 | static struct coef_fw alc283_coefs[] = { |
3055 | WRITE_COEF(0x03, 0x0002), /* Power Down Control */ | |
56779864 | 3056 | UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ |
54db6c39 TI |
3057 | WRITE_COEF(0x07, 0x0200), /* DMIC control */ |
3058 | UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ | |
3059 | UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ | |
3060 | WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ | |
3061 | WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ | |
3062 | WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ | |
3063 | UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ | |
3064 | UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ | |
3065 | WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ | |
3066 | UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ | |
3067 | WRITE_COEF(0x22, 0xa0c0), /* ANC */ | |
3068 | UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ | |
3069 | UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ | |
3070 | UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ | |
3071 | WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ | |
3072 | WRITE_COEF(0x2e, 0x2902), /* PLL */ | |
3073 | WRITE_COEF(0x33, 0xa080), /* capless control 2 */ | |
3074 | WRITE_COEF(0x34, 0x3400), /* capless control 3 */ | |
3075 | WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ | |
3076 | WRITE_COEF(0x36, 0x0), /* capless control 5 */ | |
3077 | UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ | |
3078 | WRITE_COEF(0x39, 0x110a), /* class D test 3 */ | |
3079 | UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ | |
3080 | WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ | |
3081 | WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ | |
3082 | UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ | |
3083 | WRITE_COEF(0x49, 0x0), /* test mode */ | |
3084 | UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ | |
3085 | UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ | |
3086 | WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ | |
56779864 | 3087 | UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ |
54db6c39 TI |
3088 | {} |
3089 | }; | |
3090 | ||
6bd55b04 KY |
3091 | static void alc283_restore_default_value(struct hda_codec *codec) |
3092 | { | |
54db6c39 | 3093 | alc_process_coef_fw(codec, alc283_coefs); |
6bd55b04 KY |
3094 | } |
3095 | ||
2af02be7 KY |
3096 | static void alc283_init(struct hda_codec *codec) |
3097 | { | |
3098 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3099 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3100 | bool hp_pin_sense; |
2af02be7 | 3101 | |
6bd55b04 KY |
3102 | alc283_restore_default_value(codec); |
3103 | ||
2af02be7 KY |
3104 | if (!hp_pin) |
3105 | return; | |
a59d7199 KY |
3106 | |
3107 | msleep(30); | |
2af02be7 KY |
3108 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); |
3109 | ||
3110 | /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ | |
3111 | /* Headphone capless set to high power mode */ | |
3112 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3113 | ||
3114 | snd_hda_codec_write(codec, hp_pin, 0, | |
3115 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3116 | ||
3117 | if (hp_pin_sense) | |
3118 | msleep(85); | |
3119 | ||
3120 | snd_hda_codec_write(codec, hp_pin, 0, | |
3121 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3122 | ||
3123 | if (hp_pin_sense) | |
3124 | msleep(85); | |
3125 | /* Index 0x46 Combo jack auto switch control 2 */ | |
3126 | /* 3k pull low control for Headset jack. */ | |
98b24883 | 3127 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); |
2af02be7 KY |
3128 | /* Headphone capless set to normal mode */ |
3129 | alc_write_coef_idx(codec, 0x43, 0x9614); | |
3130 | } | |
3131 | ||
3132 | static void alc283_shutup(struct hda_codec *codec) | |
3133 | { | |
3134 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3135 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
2af02be7 | 3136 | bool hp_pin_sense; |
2af02be7 KY |
3137 | |
3138 | if (!hp_pin) { | |
3139 | alc269_shutup(codec); | |
3140 | return; | |
3141 | } | |
3142 | ||
3143 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3144 | ||
3145 | alc_write_coef_idx(codec, 0x43, 0x9004); | |
3146 | ||
b450b17c HP |
3147 | /*depop hp during suspend*/ |
3148 | alc_write_coef_idx(codec, 0x06, 0x2100); | |
3149 | ||
2af02be7 KY |
3150 | snd_hda_codec_write(codec, hp_pin, 0, |
3151 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3152 | ||
3153 | if (hp_pin_sense) | |
88011c09 | 3154 | msleep(100); |
2af02be7 | 3155 | |
b001f661 TI |
3156 | if (!spec->no_shutup_pins) |
3157 | snd_hda_codec_write(codec, hp_pin, 0, | |
3158 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
2af02be7 | 3159 | |
98b24883 | 3160 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
2af02be7 KY |
3161 | |
3162 | if (hp_pin_sense) | |
88011c09 | 3163 | msleep(100); |
0435b3ff | 3164 | alc_auto_setup_eapd(codec, false); |
b001f661 | 3165 | alc_shutup_pins(codec); |
2af02be7 KY |
3166 | alc_write_coef_idx(codec, 0x43, 0x9614); |
3167 | } | |
3168 | ||
4a219ef8 KY |
3169 | static void alc256_init(struct hda_codec *codec) |
3170 | { | |
3171 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3172 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3173 | bool hp_pin_sense; |
3174 | ||
435e2bb2 KY |
3175 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3176 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3177 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3178 | } | |
3179 | ||
4a219ef8 KY |
3180 | if (!hp_pin) |
3181 | return; | |
3182 | ||
3183 | msleep(30); | |
3184 | ||
3185 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3186 | ||
3187 | if (hp_pin_sense) | |
3188 | msleep(2); | |
3189 | ||
3190 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
3191 | ||
3192 | snd_hda_codec_write(codec, hp_pin, 0, | |
3193 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3194 | ||
3195 | if (hp_pin_sense) | |
3196 | msleep(85); | |
3197 | ||
3198 | snd_hda_codec_write(codec, hp_pin, 0, | |
3199 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3200 | ||
3201 | if (hp_pin_sense) | |
3202 | msleep(100); | |
3203 | ||
3204 | alc_update_coef_idx(codec, 0x46, 3 << 12, 0); | |
3205 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
fc434f5a KY |
3206 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ |
3207 | alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); | |
4a219ef8 KY |
3208 | } |
3209 | ||
3210 | static void alc256_shutup(struct hda_codec *codec) | |
3211 | { | |
3212 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3213 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
4a219ef8 KY |
3214 | bool hp_pin_sense; |
3215 | ||
435e2bb2 KY |
3216 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3217 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3218 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3219 | } | |
3220 | ||
4a219ef8 KY |
3221 | if (!hp_pin) { |
3222 | alc269_shutup(codec); | |
3223 | return; | |
3224 | } | |
3225 | ||
3226 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3227 | ||
3228 | if (hp_pin_sense) | |
3229 | msleep(2); | |
3230 | ||
3231 | snd_hda_codec_write(codec, hp_pin, 0, | |
3232 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3233 | ||
3234 | if (hp_pin_sense) | |
3235 | msleep(85); | |
3236 | ||
e9d7786a TI |
3237 | /* 3k pull low control for Headset jack. */ |
3238 | /* NOTE: call this before clearing the pin, otherwise codec stalls */ | |
3239 | alc_update_coef_idx(codec, 0x46, 0, 3 << 12); | |
3240 | ||
b001f661 TI |
3241 | if (!spec->no_shutup_pins) |
3242 | snd_hda_codec_write(codec, hp_pin, 0, | |
3243 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
4a219ef8 | 3244 | |
4a219ef8 KY |
3245 | if (hp_pin_sense) |
3246 | msleep(100); | |
3247 | ||
3248 | alc_auto_setup_eapd(codec, false); | |
b001f661 | 3249 | alc_shutup_pins(codec); |
4a219ef8 KY |
3250 | } |
3251 | ||
0b4d8f55 KY |
3252 | static void alc225_init(struct hda_codec *codec) |
3253 | { | |
3254 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3255 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
0b4d8f55 KY |
3256 | bool hp1_pin_sense, hp2_pin_sense; |
3257 | ||
435e2bb2 KY |
3258 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3259 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3260 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3261 | } | |
3262 | ||
0b4d8f55 KY |
3263 | if (!hp_pin) |
3264 | return; | |
3265 | ||
3266 | msleep(30); | |
3267 | ||
3268 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3269 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3270 | ||
3271 | if (hp1_pin_sense || hp2_pin_sense) | |
3272 | msleep(2); | |
3273 | ||
3274 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ | |
3275 | ||
3276 | if (hp1_pin_sense) | |
3277 | snd_hda_codec_write(codec, hp_pin, 0, | |
3278 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3279 | if (hp2_pin_sense) | |
3280 | snd_hda_codec_write(codec, 0x16, 0, | |
3281 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3282 | ||
3283 | if (hp1_pin_sense || hp2_pin_sense) | |
3284 | msleep(85); | |
3285 | ||
3286 | if (hp1_pin_sense) | |
3287 | snd_hda_codec_write(codec, hp_pin, 0, | |
3288 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3289 | if (hp2_pin_sense) | |
3290 | snd_hda_codec_write(codec, 0x16, 0, | |
3291 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3292 | ||
3293 | if (hp1_pin_sense || hp2_pin_sense) | |
3294 | msleep(100); | |
3295 | ||
3296 | alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); | |
3297 | alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ | |
3298 | } | |
3299 | ||
3300 | static void alc225_shutup(struct hda_codec *codec) | |
3301 | { | |
3302 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3303 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
0b4d8f55 KY |
3304 | bool hp1_pin_sense, hp2_pin_sense; |
3305 | ||
435e2bb2 KY |
3306 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3307 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3308 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3309 | } | |
3310 | ||
0b4d8f55 KY |
3311 | if (!hp_pin) { |
3312 | alc269_shutup(codec); | |
3313 | return; | |
3314 | } | |
3315 | ||
3316 | /* 3k pull low control for Headset jack. */ | |
3317 | alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); | |
3318 | ||
3319 | hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3320 | hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); | |
3321 | ||
3322 | if (hp1_pin_sense || hp2_pin_sense) | |
3323 | msleep(2); | |
3324 | ||
3325 | if (hp1_pin_sense) | |
3326 | snd_hda_codec_write(codec, hp_pin, 0, | |
3327 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3328 | if (hp2_pin_sense) | |
3329 | snd_hda_codec_write(codec, 0x16, 0, | |
3330 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3331 | ||
3332 | if (hp1_pin_sense || hp2_pin_sense) | |
3333 | msleep(85); | |
3334 | ||
3335 | if (hp1_pin_sense) | |
3336 | snd_hda_codec_write(codec, hp_pin, 0, | |
3337 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3338 | if (hp2_pin_sense) | |
3339 | snd_hda_codec_write(codec, 0x16, 0, | |
3340 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3341 | ||
3342 | if (hp1_pin_sense || hp2_pin_sense) | |
3343 | msleep(100); | |
3344 | ||
3345 | alc_auto_setup_eapd(codec, false); | |
b001f661 | 3346 | alc_shutup_pins(codec); |
0b4d8f55 KY |
3347 | } |
3348 | ||
c2d6af53 KY |
3349 | static void alc_default_init(struct hda_codec *codec) |
3350 | { | |
3351 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3352 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3353 | bool hp_pin_sense; |
3354 | ||
435e2bb2 KY |
3355 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3356 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3357 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3358 | } | |
3359 | ||
c2d6af53 KY |
3360 | if (!hp_pin) |
3361 | return; | |
3362 | ||
3363 | msleep(30); | |
3364 | ||
3365 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3366 | ||
3367 | if (hp_pin_sense) | |
3368 | msleep(2); | |
3369 | ||
3370 | snd_hda_codec_write(codec, hp_pin, 0, | |
3371 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3372 | ||
3373 | if (hp_pin_sense) | |
3374 | msleep(85); | |
3375 | ||
3376 | snd_hda_codec_write(codec, hp_pin, 0, | |
3377 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
3378 | ||
3379 | if (hp_pin_sense) | |
3380 | msleep(100); | |
3381 | } | |
3382 | ||
3383 | static void alc_default_shutup(struct hda_codec *codec) | |
3384 | { | |
3385 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3386 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
c2d6af53 KY |
3387 | bool hp_pin_sense; |
3388 | ||
435e2bb2 KY |
3389 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3390 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3391 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3392 | } | |
3393 | ||
c2d6af53 KY |
3394 | if (!hp_pin) { |
3395 | alc269_shutup(codec); | |
3396 | return; | |
3397 | } | |
3398 | ||
3399 | hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); | |
3400 | ||
3401 | if (hp_pin_sense) | |
3402 | msleep(2); | |
3403 | ||
3404 | snd_hda_codec_write(codec, hp_pin, 0, | |
3405 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3406 | ||
3407 | if (hp_pin_sense) | |
3408 | msleep(85); | |
3409 | ||
b001f661 TI |
3410 | if (!spec->no_shutup_pins) |
3411 | snd_hda_codec_write(codec, hp_pin, 0, | |
3412 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
c2d6af53 KY |
3413 | |
3414 | if (hp_pin_sense) | |
3415 | msleep(100); | |
3416 | ||
3417 | alc_auto_setup_eapd(codec, false); | |
b001f661 | 3418 | alc_shutup_pins(codec); |
c2d6af53 KY |
3419 | } |
3420 | ||
6e25f0c7 KY |
3421 | static void alc294_hp_init(struct hda_codec *codec) |
3422 | { | |
3423 | struct alc_spec *spec = codec->spec; | |
80f10932 | 3424 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
6e25f0c7 KY |
3425 | int i, val; |
3426 | ||
435e2bb2 KY |
3427 | if (!spec->gen.autocfg.hp_outs && spec->gen.suppress_auto_mute) { |
3428 | if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) | |
3429 | hp_pin = spec->gen.autocfg.line_out_pins[0]; | |
3430 | } | |
3431 | ||
6e25f0c7 KY |
3432 | if (!hp_pin) |
3433 | return; | |
3434 | ||
3435 | snd_hda_codec_write(codec, hp_pin, 0, | |
3436 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
3437 | ||
3438 | msleep(100); | |
3439 | ||
3440 | snd_hda_codec_write(codec, hp_pin, 0, | |
3441 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
3442 | ||
3443 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ | |
3444 | alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ | |
3445 | ||
3446 | /* Wait for depop procedure finish */ | |
3447 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3448 | for (i = 0; i < 20 && val & 0x0080; i++) { | |
3449 | msleep(50); | |
3450 | val = alc_read_coefex_idx(codec, 0x58, 0x01); | |
3451 | } | |
3452 | /* Set HP depop to auto mode */ | |
3453 | alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); | |
3454 | msleep(50); | |
3455 | } | |
3456 | ||
3457 | static void alc294_init(struct hda_codec *codec) | |
3458 | { | |
3459 | struct alc_spec *spec = codec->spec; | |
3460 | ||
3461 | if (!spec->done_hp_init) { | |
3462 | alc294_hp_init(codec); | |
3463 | spec->done_hp_init = true; | |
3464 | } | |
3465 | alc_default_init(codec); | |
3466 | } | |
3467 | ||
ad60d502 KY |
3468 | static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, |
3469 | unsigned int val) | |
3470 | { | |
3471 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3472 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ | |
3473 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ | |
3474 | } | |
3475 | ||
3476 | static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) | |
3477 | { | |
3478 | unsigned int val; | |
3479 | ||
3480 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); | |
3481 | val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3482 | & 0xffff; | |
3483 | val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) | |
3484 | << 16; | |
3485 | return val; | |
3486 | } | |
3487 | ||
3488 | static void alc5505_dsp_halt(struct hda_codec *codec) | |
3489 | { | |
3490 | unsigned int val; | |
3491 | ||
3492 | alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ | |
3493 | alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ | |
3494 | alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ | |
3495 | alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ | |
3496 | alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ | |
3497 | alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ | |
3498 | alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ | |
3499 | val = alc5505_coef_get(codec, 0x6220); | |
3500 | alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ | |
3501 | } | |
3502 | ||
3503 | static void alc5505_dsp_back_from_halt(struct hda_codec *codec) | |
3504 | { | |
3505 | alc5505_coef_set(codec, 0x61b8, 0x04133302); | |
3506 | alc5505_coef_set(codec, 0x61b0, 0x00005b16); | |
3507 | alc5505_coef_set(codec, 0x61b4, 0x040a2b02); | |
3508 | alc5505_coef_set(codec, 0x6230, 0xf80d4011); | |
3509 | alc5505_coef_set(codec, 0x6220, 0x2002010f); | |
3510 | alc5505_coef_set(codec, 0x880c, 0x00000004); | |
3511 | } | |
3512 | ||
3513 | static void alc5505_dsp_init(struct hda_codec *codec) | |
3514 | { | |
3515 | unsigned int val; | |
3516 | ||
3517 | alc5505_dsp_halt(codec); | |
3518 | alc5505_dsp_back_from_halt(codec); | |
3519 | alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ | |
3520 | alc5505_coef_set(codec, 0x61b0, 0x5b16); | |
3521 | alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ | |
3522 | alc5505_coef_set(codec, 0x61b4, 0x04132b02); | |
3523 | alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ | |
3524 | alc5505_coef_set(codec, 0x61b8, 0x041f3302); | |
3525 | snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ | |
3526 | alc5505_coef_set(codec, 0x61b8, 0x041b3302); | |
3527 | alc5505_coef_set(codec, 0x61b8, 0x04173302); | |
3528 | alc5505_coef_set(codec, 0x61b8, 0x04163302); | |
3529 | alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ | |
3530 | alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ | |
3531 | alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ | |
3532 | ||
3533 | val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ | |
3534 | if (val <= 3) | |
3535 | alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ | |
3536 | else | |
3537 | alc5505_coef_set(codec, 0x6220, 0x6002018f); | |
3538 | ||
3539 | alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ | |
3540 | alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ | |
3541 | alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ | |
3542 | alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ | |
3543 | alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ | |
3544 | alc5505_coef_set(codec, 0x880c, 0x00000003); | |
3545 | alc5505_coef_set(codec, 0x880c, 0x00000010); | |
cd63a5ff TI |
3546 | |
3547 | #ifdef HALT_REALTEK_ALC5505 | |
3548 | alc5505_dsp_halt(codec); | |
3549 | #endif | |
ad60d502 KY |
3550 | } |
3551 | ||
cd63a5ff TI |
3552 | #ifdef HALT_REALTEK_ALC5505 |
3553 | #define alc5505_dsp_suspend(codec) /* NOP */ | |
3554 | #define alc5505_dsp_resume(codec) /* NOP */ | |
3555 | #else | |
3556 | #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) | |
3557 | #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) | |
3558 | #endif | |
3559 | ||
2a43952a | 3560 | #ifdef CONFIG_PM |
ad60d502 KY |
3561 | static int alc269_suspend(struct hda_codec *codec) |
3562 | { | |
3563 | struct alc_spec *spec = codec->spec; | |
3564 | ||
3565 | if (spec->has_alc5505_dsp) | |
cd63a5ff | 3566 | alc5505_dsp_suspend(codec); |
ad60d502 KY |
3567 | return alc_suspend(codec); |
3568 | } | |
3569 | ||
1d045db9 TI |
3570 | static int alc269_resume(struct hda_codec *codec) |
3571 | { | |
adcc70b2 KY |
3572 | struct alc_spec *spec = codec->spec; |
3573 | ||
1387e2d1 KY |
3574 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3575 | alc269vb_toggle_power_output(codec, 0); | |
3576 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3577 | (alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 TI |
3578 | msleep(150); |
3579 | } | |
8c427226 | 3580 | |
1d045db9 | 3581 | codec->patch_ops.init(codec); |
f1d4e28b | 3582 | |
1387e2d1 KY |
3583 | if (spec->codec_variant == ALC269_TYPE_ALC269VB) |
3584 | alc269vb_toggle_power_output(codec, 1); | |
3585 | if (spec->codec_variant == ALC269_TYPE_ALC269VB && | |
adcc70b2 | 3586 | (alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 TI |
3587 | msleep(200); |
3588 | } | |
f1d4e28b | 3589 | |
eeecd9d1 | 3590 | regcache_sync(codec->core.regmap); |
1d045db9 | 3591 | hda_call_check_power_status(codec, 0x01); |
f475371a HW |
3592 | |
3593 | /* on some machine, the BIOS will clear the codec gpio data when enter | |
3594 | * suspend, and won't restore the data after resume, so we restore it | |
3595 | * in the driver. | |
3596 | */ | |
3597 | if (spec->gpio_led) | |
7639a06c | 3598 | snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DATA, |
f475371a HW |
3599 | spec->gpio_led); |
3600 | ||
ad60d502 | 3601 | if (spec->has_alc5505_dsp) |
cd63a5ff | 3602 | alc5505_dsp_resume(codec); |
c5177c86 | 3603 | |
1d045db9 TI |
3604 | return 0; |
3605 | } | |
2a43952a | 3606 | #endif /* CONFIG_PM */ |
f1d4e28b | 3607 | |
108cc108 | 3608 | static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, |
1727a771 | 3609 | const struct hda_fixup *fix, int action) |
108cc108 DH |
3610 | { |
3611 | struct alc_spec *spec = codec->spec; | |
3612 | ||
1727a771 | 3613 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
108cc108 DH |
3614 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
3615 | } | |
3616 | ||
0dcd451c JMG |
3617 | static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, |
3618 | const struct hda_fixup *fix, | |
3619 | int action) | |
3620 | { | |
3621 | unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); | |
3622 | unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); | |
3623 | ||
3624 | if (cfg_headphone && cfg_headset_mic == 0x411111f0) | |
3625 | snd_hda_codec_set_pincfg(codec, 0x19, | |
3626 | (cfg_headphone & ~AC_DEFCFG_DEVICE) | | |
3627 | (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); | |
3628 | } | |
3629 | ||
1d045db9 | 3630 | static void alc269_fixup_hweq(struct hda_codec *codec, |
1727a771 | 3631 | const struct hda_fixup *fix, int action) |
1d045db9 | 3632 | { |
98b24883 TI |
3633 | if (action == HDA_FIXUP_ACT_INIT) |
3634 | alc_update_coef_idx(codec, 0x1e, 0, 0x80); | |
1d045db9 | 3635 | } |
f1d4e28b | 3636 | |
7c478f03 DH |
3637 | static void alc269_fixup_headset_mic(struct hda_codec *codec, |
3638 | const struct hda_fixup *fix, int action) | |
3639 | { | |
3640 | struct alc_spec *spec = codec->spec; | |
3641 | ||
3642 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
3643 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
3644 | } | |
3645 | ||
1d045db9 | 3646 | static void alc271_fixup_dmic(struct hda_codec *codec, |
1727a771 | 3647 | const struct hda_fixup *fix, int action) |
1d045db9 TI |
3648 | { |
3649 | static const struct hda_verb verbs[] = { | |
3650 | {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, | |
3651 | {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, | |
3652 | {} | |
3653 | }; | |
3654 | unsigned int cfg; | |
f1d4e28b | 3655 | |
7639a06c TI |
3656 | if (strcmp(codec->core.chip_name, "ALC271X") && |
3657 | strcmp(codec->core.chip_name, "ALC269VB")) | |
1d045db9 TI |
3658 | return; |
3659 | cfg = snd_hda_codec_get_pincfg(codec, 0x12); | |
3660 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) | |
3661 | snd_hda_sequence_write(codec, verbs); | |
3662 | } | |
f1d4e28b | 3663 | |
017f2a10 | 3664 | static void alc269_fixup_pcm_44k(struct hda_codec *codec, |
1727a771 | 3665 | const struct hda_fixup *fix, int action) |
017f2a10 TI |
3666 | { |
3667 | struct alc_spec *spec = codec->spec; | |
3668 | ||
1727a771 | 3669 | if (action != HDA_FIXUP_ACT_PROBE) |
017f2a10 TI |
3670 | return; |
3671 | ||
3672 | /* Due to a hardware problem on Lenovo Ideadpad, we need to | |
3673 | * fix the sample rate of analog I/O to 44.1kHz | |
3674 | */ | |
08c189f2 TI |
3675 | spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; |
3676 | spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; | |
017f2a10 TI |
3677 | } |
3678 | ||
adabb3ec | 3679 | static void alc269_fixup_stereo_dmic(struct hda_codec *codec, |
1727a771 | 3680 | const struct hda_fixup *fix, int action) |
adabb3ec | 3681 | { |
adabb3ec TI |
3682 | /* The digital-mic unit sends PDM (differential signal) instead of |
3683 | * the standard PCM, thus you can't record a valid mono stream as is. | |
3684 | * Below is a workaround specific to ALC269 to control the dmic | |
3685 | * signal source as mono. | |
3686 | */ | |
98b24883 TI |
3687 | if (action == HDA_FIXUP_ACT_INIT) |
3688 | alc_update_coef_idx(codec, 0x07, 0, 0x80); | |
adabb3ec TI |
3689 | } |
3690 | ||
24519911 TI |
3691 | static void alc269_quanta_automute(struct hda_codec *codec) |
3692 | { | |
08c189f2 | 3693 | snd_hda_gen_update_outputs(codec); |
24519911 | 3694 | |
1687ccc8 TI |
3695 | alc_write_coef_idx(codec, 0x0c, 0x680); |
3696 | alc_write_coef_idx(codec, 0x0c, 0x480); | |
24519911 TI |
3697 | } |
3698 | ||
3699 | static void alc269_fixup_quanta_mute(struct hda_codec *codec, | |
1727a771 | 3700 | const struct hda_fixup *fix, int action) |
24519911 TI |
3701 | { |
3702 | struct alc_spec *spec = codec->spec; | |
1727a771 | 3703 | if (action != HDA_FIXUP_ACT_PROBE) |
24519911 | 3704 | return; |
08c189f2 | 3705 | spec->gen.automute_hook = alc269_quanta_automute; |
24519911 TI |
3706 | } |
3707 | ||
d240d1dc | 3708 | static void alc269_x101_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 3709 | struct hda_jack_callback *jack) |
d240d1dc DH |
3710 | { |
3711 | struct alc_spec *spec = codec->spec; | |
3712 | int vref; | |
3713 | msleep(200); | |
3714 | snd_hda_gen_hp_automute(codec, jack); | |
3715 | ||
3716 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
3717 | msleep(100); | |
3718 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
3719 | vref); | |
3720 | msleep(500); | |
3721 | snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
3722 | vref); | |
3723 | } | |
3724 | ||
3725 | static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, | |
3726 | const struct hda_fixup *fix, int action) | |
3727 | { | |
3728 | struct alc_spec *spec = codec->spec; | |
3729 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
3730 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
3731 | spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; | |
3732 | } | |
3733 | } | |
3734 | ||
3735 | ||
08fb0d0e TI |
3736 | /* update mute-LED according to the speaker mute state via mic VREF pin */ |
3737 | static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) | |
6d3cd5d4 DH |
3738 | { |
3739 | struct hda_codec *codec = private_data; | |
08fb0d0e TI |
3740 | struct alc_spec *spec = codec->spec; |
3741 | unsigned int pinval; | |
3742 | ||
3743 | if (spec->mute_led_polarity) | |
3744 | enabled = !enabled; | |
415d555e TI |
3745 | pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid); |
3746 | pinval &= ~AC_PINCTL_VREFEN; | |
3747 | pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80; | |
52401e2a TI |
3748 | if (spec->mute_led_nid) { |
3749 | /* temporarily power up/down for setting VREF */ | |
3750 | snd_hda_power_up_pm(codec); | |
08fb0d0e | 3751 | snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval); |
52401e2a TI |
3752 | snd_hda_power_down_pm(codec); |
3753 | } | |
6d3cd5d4 DH |
3754 | } |
3755 | ||
d5b6b65e DH |
3756 | /* Make sure the led works even in runtime suspend */ |
3757 | static unsigned int led_power_filter(struct hda_codec *codec, | |
3758 | hda_nid_t nid, | |
3759 | unsigned int power_state) | |
3760 | { | |
3761 | struct alc_spec *spec = codec->spec; | |
3762 | ||
50dd9050 HW |
3763 | if (power_state != AC_PWRST_D3 || nid == 0 || |
3764 | (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) | |
d5b6b65e DH |
3765 | return power_state; |
3766 | ||
3767 | /* Set pin ctl again, it might have just been set to 0 */ | |
3768 | snd_hda_set_pin_ctl(codec, nid, | |
3769 | snd_hda_codec_get_pin_target(codec, nid)); | |
3770 | ||
cffd3966 | 3771 | return snd_hda_gen_path_power_filter(codec, nid, power_state); |
d5b6b65e DH |
3772 | } |
3773 | ||
08fb0d0e TI |
3774 | static void alc269_fixup_hp_mute_led(struct hda_codec *codec, |
3775 | const struct hda_fixup *fix, int action) | |
6d3cd5d4 DH |
3776 | { |
3777 | struct alc_spec *spec = codec->spec; | |
08fb0d0e TI |
3778 | const struct dmi_device *dev = NULL; |
3779 | ||
3780 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
3781 | return; | |
3782 | ||
3783 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { | |
3784 | int pol, pin; | |
3785 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) | |
3786 | continue; | |
3787 | if (pin < 0x0a || pin >= 0x10) | |
3788 | break; | |
3789 | spec->mute_led_polarity = pol; | |
3790 | spec->mute_led_nid = pin - 0x0a + 0x18; | |
3791 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; | |
fd25a97a | 3792 | spec->gen.vmaster_mute_enum = 1; |
d5b6b65e | 3793 | codec->power_filter = led_power_filter; |
4e76a883 TI |
3794 | codec_dbg(codec, |
3795 | "Detected mute LED for %x:%d\n", spec->mute_led_nid, | |
08fb0d0e | 3796 | spec->mute_led_polarity); |
6d3cd5d4 DH |
3797 | break; |
3798 | } | |
3799 | } | |
3800 | ||
d06ac143 DH |
3801 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, |
3802 | const struct hda_fixup *fix, int action) | |
3803 | { | |
3804 | struct alc_spec *spec = codec->spec; | |
3805 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
3806 | spec->mute_led_polarity = 0; | |
3807 | spec->mute_led_nid = 0x18; | |
3808 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; | |
3809 | spec->gen.vmaster_mute_enum = 1; | |
d5b6b65e | 3810 | codec->power_filter = led_power_filter; |
d06ac143 DH |
3811 | } |
3812 | } | |
3813 | ||
08fb0d0e TI |
3814 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
3815 | const struct hda_fixup *fix, int action) | |
420b0feb TI |
3816 | { |
3817 | struct alc_spec *spec = codec->spec; | |
9bb1f06f | 3818 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
08fb0d0e TI |
3819 | spec->mute_led_polarity = 0; |
3820 | spec->mute_led_nid = 0x19; | |
3821 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; | |
fd25a97a | 3822 | spec->gen.vmaster_mute_enum = 1; |
d5b6b65e | 3823 | codec->power_filter = led_power_filter; |
420b0feb TI |
3824 | } |
3825 | } | |
3826 | ||
0f32fd19 TI |
3827 | /* update LED status via GPIO */ |
3828 | static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, | |
3829 | bool enabled) | |
9f5c6faf | 3830 | { |
9f5c6faf TI |
3831 | struct alc_spec *spec = codec->spec; |
3832 | unsigned int oldval = spec->gpio_led; | |
3833 | ||
0f32fd19 TI |
3834 | if (spec->mute_led_polarity) |
3835 | enabled = !enabled; | |
3836 | ||
9f5c6faf | 3837 | if (enabled) |
0f32fd19 | 3838 | spec->gpio_led &= ~mask; |
9f5c6faf | 3839 | else |
0f32fd19 | 3840 | spec->gpio_led |= mask; |
9f5c6faf TI |
3841 | if (spec->gpio_led != oldval) |
3842 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | |
3843 | spec->gpio_led); | |
3844 | } | |
3845 | ||
0f32fd19 TI |
3846 | /* turn on/off mute LED via GPIO per vmaster hook */ |
3847 | static void alc_fixup_gpio_mute_hook(void *private_data, int enabled) | |
9f5c6faf | 3848 | { |
0f32fd19 | 3849 | struct hda_codec *codec = private_data; |
9f5c6faf | 3850 | struct alc_spec *spec = codec->spec; |
9f5c6faf | 3851 | |
0f32fd19 TI |
3852 | alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); |
3853 | } | |
9f5c6faf | 3854 | |
0f32fd19 TI |
3855 | /* turn on/off mic-mute LED via GPIO per capture hook */ |
3856 | static void alc_fixup_gpio_mic_mute_hook(struct hda_codec *codec, | |
3857 | struct snd_kcontrol *kcontrol, | |
3858 | struct snd_ctl_elem_value *ucontrol) | |
3859 | { | |
3860 | struct alc_spec *spec = codec->spec; | |
3861 | ||
3862 | if (ucontrol) | |
3863 | alc_update_gpio_led(codec, spec->gpio_mic_led_mask, | |
3864 | ucontrol->value.integer.value[0] || | |
3865 | ucontrol->value.integer.value[1]); | |
9f5c6faf TI |
3866 | } |
3867 | ||
3868 | static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, | |
3869 | const struct hda_fixup *fix, int action) | |
3870 | { | |
3871 | struct alc_spec *spec = codec->spec; | |
3872 | static const struct hda_verb gpio_init[] = { | |
3873 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, | |
3874 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, | |
3875 | {} | |
3876 | }; | |
3877 | ||
3878 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
0f32fd19 TI |
3879 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
3880 | spec->gen.cap_sync_hook = alc_fixup_gpio_mic_mute_hook; | |
9f5c6faf | 3881 | spec->gpio_led = 0; |
0f32fd19 TI |
3882 | spec->mute_led_polarity = 0; |
3883 | spec->gpio_mute_led_mask = 0x08; | |
3884 | spec->gpio_mic_led_mask = 0x10; | |
9f5c6faf TI |
3885 | snd_hda_add_verbs(codec, gpio_init); |
3886 | } | |
3887 | } | |
3888 | ||
eaa8e5ef KY |
3889 | static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, |
3890 | const struct hda_fixup *fix, int action) | |
3891 | { | |
3892 | struct alc_spec *spec = codec->spec; | |
3893 | static const struct hda_verb gpio_init[] = { | |
3894 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x22 }, | |
3895 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x22 }, | |
3896 | {} | |
3897 | }; | |
3898 | ||
3899 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
3900 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; | |
3901 | spec->gen.cap_sync_hook = alc_fixup_gpio_mic_mute_hook; | |
9f5c6faf | 3902 | spec->gpio_led = 0; |
eaa8e5ef KY |
3903 | spec->mute_led_polarity = 0; |
3904 | spec->gpio_mute_led_mask = 0x02; | |
3905 | spec->gpio_mic_led_mask = 0x20; | |
9f5c6faf TI |
3906 | snd_hda_add_verbs(codec, gpio_init); |
3907 | } | |
3908 | } | |
3909 | ||
9c5dc3bf KY |
3910 | /* turn on/off mic-mute LED per capture hook */ |
3911 | static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec *codec, | |
3912 | struct snd_kcontrol *kcontrol, | |
3913 | struct snd_ctl_elem_value *ucontrol) | |
3914 | { | |
3915 | struct alc_spec *spec = codec->spec; | |
3916 | unsigned int pinval, enable, disable; | |
3917 | ||
fc1fad93 | 3918 | pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid); |
9c5dc3bf KY |
3919 | pinval &= ~AC_PINCTL_VREFEN; |
3920 | enable = pinval | AC_PINCTL_VREF_80; | |
3921 | disable = pinval | AC_PINCTL_VREF_HIZ; | |
3922 | ||
3923 | if (!ucontrol) | |
3924 | return; | |
3925 | ||
3926 | if (ucontrol->value.integer.value[0] || | |
3927 | ucontrol->value.integer.value[1]) | |
3928 | pinval = disable; | |
3929 | else | |
3930 | pinval = enable; | |
3931 | ||
3932 | if (spec->cap_mute_led_nid) | |
3933 | snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval); | |
3934 | } | |
3935 | ||
3936 | static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, | |
3937 | const struct hda_fixup *fix, int action) | |
3938 | { | |
3939 | struct alc_spec *spec = codec->spec; | |
3940 | static const struct hda_verb gpio_init[] = { | |
3941 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x08 }, | |
3942 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x08 }, | |
3943 | {} | |
3944 | }; | |
3945 | ||
3946 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
0f32fd19 | 3947 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
9c5dc3bf KY |
3948 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; |
3949 | spec->gpio_led = 0; | |
0f32fd19 TI |
3950 | spec->mute_led_polarity = 0; |
3951 | spec->gpio_mute_led_mask = 0x08; | |
9c5dc3bf KY |
3952 | spec->cap_mute_led_nid = 0x18; |
3953 | snd_hda_add_verbs(codec, gpio_init); | |
50dd9050 | 3954 | codec->power_filter = led_power_filter; |
9c5dc3bf KY |
3955 | } |
3956 | } | |
3957 | ||
7a5255f1 DH |
3958 | static void alc280_fixup_hp_gpio4(struct hda_codec *codec, |
3959 | const struct hda_fixup *fix, int action) | |
3960 | { | |
3961 | /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */ | |
3962 | struct alc_spec *spec = codec->spec; | |
3963 | static const struct hda_verb gpio_init[] = { | |
3964 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, | |
3965 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, | |
3966 | {} | |
3967 | }; | |
3968 | ||
3969 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
0f32fd19 | 3970 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
7a5255f1 DH |
3971 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; |
3972 | spec->gpio_led = 0; | |
0f32fd19 TI |
3973 | spec->mute_led_polarity = 0; |
3974 | spec->gpio_mute_led_mask = 0x08; | |
7a5255f1 DH |
3975 | spec->cap_mute_led_nid = 0x18; |
3976 | snd_hda_add_verbs(codec, gpio_init); | |
3977 | codec->power_filter = led_power_filter; | |
3978 | } | |
3979 | } | |
3980 | ||
b12263b7 | 3981 | #if IS_REACHABLE(CONFIG_INPUT) |
33f4acd3 DH |
3982 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
3983 | struct hda_jack_callback *event) | |
3984 | { | |
3985 | struct alc_spec *spec = codec->spec; | |
3986 | ||
3987 | /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore | |
3988 | send both key on and key off event for every interrupt. */ | |
c7b60a89 | 3989 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); |
33f4acd3 | 3990 | input_sync(spec->kb_dev); |
c7b60a89 | 3991 | input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); |
33f4acd3 DH |
3992 | input_sync(spec->kb_dev); |
3993 | } | |
33f4acd3 | 3994 | |
3694cb29 K |
3995 | static int alc_register_micmute_input_device(struct hda_codec *codec) |
3996 | { | |
3997 | struct alc_spec *spec = codec->spec; | |
c7b60a89 | 3998 | int i; |
3694cb29 K |
3999 | |
4000 | spec->kb_dev = input_allocate_device(); | |
4001 | if (!spec->kb_dev) { | |
4002 | codec_err(codec, "Out of memory (input_allocate_device)\n"); | |
4003 | return -ENOMEM; | |
4004 | } | |
c7b60a89 HW |
4005 | |
4006 | spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; | |
4007 | ||
3694cb29 K |
4008 | spec->kb_dev->name = "Microphone Mute Button"; |
4009 | spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); | |
c7b60a89 HW |
4010 | spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); |
4011 | spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); | |
4012 | spec->kb_dev->keycode = spec->alc_mute_keycode_map; | |
4013 | for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) | |
4014 | set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); | |
3694cb29 K |
4015 | |
4016 | if (input_register_device(spec->kb_dev)) { | |
4017 | codec_err(codec, "input_register_device failed\n"); | |
4018 | input_free_device(spec->kb_dev); | |
4019 | spec->kb_dev = NULL; | |
4020 | return -ENOMEM; | |
4021 | } | |
4022 | ||
4023 | return 0; | |
4024 | } | |
4025 | ||
33f4acd3 DH |
4026 | static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, |
4027 | const struct hda_fixup *fix, int action) | |
4028 | { | |
33f4acd3 DH |
4029 | /* GPIO1 = set according to SKU external amp |
4030 | GPIO2 = mic mute hotkey | |
4031 | GPIO3 = mute LED | |
4032 | GPIO4 = mic mute LED */ | |
4033 | static const struct hda_verb gpio_init[] = { | |
4034 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x1e }, | |
4035 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x1a }, | |
4036 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x02 }, | |
4037 | {} | |
4038 | }; | |
4039 | ||
4040 | struct alc_spec *spec = codec->spec; | |
4041 | ||
4042 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
3694cb29 | 4043 | if (alc_register_micmute_input_device(codec) != 0) |
33f4acd3 | 4044 | return; |
33f4acd3 DH |
4045 | |
4046 | snd_hda_add_verbs(codec, gpio_init); | |
7639a06c | 4047 | snd_hda_codec_write_cache(codec, codec->core.afg, 0, |
33f4acd3 | 4048 | AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); |
7639a06c | 4049 | snd_hda_jack_detect_enable_callback(codec, codec->core.afg, |
33f4acd3 DH |
4050 | gpio2_mic_hotkey_event); |
4051 | ||
4052 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; | |
4053 | spec->gen.cap_sync_hook = alc_fixup_gpio_mic_mute_hook; | |
4054 | spec->gpio_led = 0; | |
4055 | spec->mute_led_polarity = 0; | |
4056 | spec->gpio_mute_led_mask = 0x08; | |
4057 | spec->gpio_mic_led_mask = 0x10; | |
4058 | return; | |
4059 | } | |
4060 | ||
4061 | if (!spec->kb_dev) | |
4062 | return; | |
4063 | ||
4064 | switch (action) { | |
4065 | case HDA_FIXUP_ACT_PROBE: | |
4066 | spec->init_amp = ALC_INIT_DEFAULT; | |
4067 | break; | |
4068 | case HDA_FIXUP_ACT_FREE: | |
4069 | input_unregister_device(spec->kb_dev); | |
33f4acd3 DH |
4070 | spec->kb_dev = NULL; |
4071 | } | |
33f4acd3 DH |
4072 | } |
4073 | ||
3694cb29 K |
4074 | static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, |
4075 | const struct hda_fixup *fix, int action) | |
4076 | { | |
4077 | /* Line2 = mic mute hotkey | |
4078 | GPIO2 = mic mute LED */ | |
4079 | static const struct hda_verb gpio_init[] = { | |
4080 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, | |
4081 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, | |
4082 | {} | |
4083 | }; | |
4084 | ||
4085 | struct alc_spec *spec = codec->spec; | |
4086 | ||
4087 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4088 | if (alc_register_micmute_input_device(codec) != 0) | |
4089 | return; | |
4090 | ||
4091 | snd_hda_add_verbs(codec, gpio_init); | |
4092 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
4093 | gpio2_mic_hotkey_event); | |
4094 | ||
4095 | spec->gen.cap_sync_hook = alc_fixup_gpio_mic_mute_hook; | |
4096 | spec->gpio_led = 0; | |
4097 | spec->mute_led_polarity = 0; | |
4098 | spec->gpio_mic_led_mask = 0x04; | |
4099 | return; | |
4100 | } | |
4101 | ||
4102 | if (!spec->kb_dev) | |
4103 | return; | |
4104 | ||
4105 | switch (action) { | |
4106 | case HDA_FIXUP_ACT_PROBE: | |
4107 | spec->init_amp = ALC_INIT_DEFAULT; | |
4108 | break; | |
4109 | case HDA_FIXUP_ACT_FREE: | |
4110 | input_unregister_device(spec->kb_dev); | |
4111 | spec->kb_dev = NULL; | |
4112 | } | |
4113 | } | |
63c4da64 TI |
4114 | #else /* INPUT */ |
4115 | #define alc280_fixup_hp_gpio2_mic_hotkey NULL | |
4116 | #define alc233_fixup_lenovo_line2_mic_hotkey NULL | |
4117 | #endif /* INPUT */ | |
3694cb29 | 4118 | |
9c5dc3bf KY |
4119 | static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, |
4120 | const struct hda_fixup *fix, int action) | |
4121 | { | |
4122 | struct alc_spec *spec = codec->spec; | |
4123 | ||
4124 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
4125 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; | |
4126 | spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; | |
4127 | spec->mute_led_polarity = 0; | |
4128 | spec->mute_led_nid = 0x1a; | |
4129 | spec->cap_mute_led_nid = 0x18; | |
4130 | spec->gen.vmaster_mute_enum = 1; | |
4131 | codec->power_filter = led_power_filter; | |
4132 | } | |
4133 | } | |
4134 | ||
5a36767a KY |
4135 | static struct coef_fw alc225_pre_hsmode[] = { |
4136 | UPDATE_COEF(0x4a, 1<<8, 0), | |
4137 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), | |
4138 | UPDATE_COEF(0x63, 3<<14, 3<<14), | |
4139 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4140 | UPDATE_COEF(0x4a, 3<<10, 3<<10), | |
4141 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | |
4142 | UPDATE_COEF(0x4a, 3<<10, 0), | |
4143 | {} | |
4144 | }; | |
4145 | ||
73bdd597 DH |
4146 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
4147 | { | |
54db6c39 | 4148 | static struct coef_fw coef0255[] = { |
54db6c39 TI |
4149 | WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ |
4150 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ | |
4151 | WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ | |
4152 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ | |
4153 | {} | |
4154 | }; | |
e69e7e03 KY |
4155 | static struct coef_fw coef0255_1[] = { |
4156 | WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ | |
4157 | {} | |
4158 | }; | |
4159 | static struct coef_fw coef0256[] = { | |
4160 | WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ | |
4161 | {} | |
4162 | }; | |
54db6c39 TI |
4163 | static struct coef_fw coef0233[] = { |
4164 | WRITE_COEF(0x1b, 0x0c0b), | |
4165 | WRITE_COEF(0x45, 0xc429), | |
4166 | UPDATE_COEF(0x35, 0x4000, 0), | |
4167 | WRITE_COEF(0x06, 0x2104), | |
4168 | WRITE_COEF(0x1a, 0x0001), | |
4169 | WRITE_COEF(0x26, 0x0004), | |
4170 | WRITE_COEF(0x32, 0x42a3), | |
4171 | {} | |
4172 | }; | |
f3b70332 KY |
4173 | static struct coef_fw coef0288[] = { |
4174 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | |
4175 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4176 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4177 | UPDATE_COEF(0x66, 0x0008, 0), | |
4178 | UPDATE_COEF(0x67, 0x2000, 0), | |
4179 | {} | |
4180 | }; | |
89542936 KY |
4181 | static struct coef_fw coef0298[] = { |
4182 | UPDATE_COEF(0x19, 0x1300, 0x0300), | |
4183 | {} | |
4184 | }; | |
54db6c39 TI |
4185 | static struct coef_fw coef0292[] = { |
4186 | WRITE_COEF(0x76, 0x000e), | |
4187 | WRITE_COEF(0x6c, 0x2400), | |
4188 | WRITE_COEF(0x18, 0x7308), | |
4189 | WRITE_COEF(0x6b, 0xc429), | |
4190 | {} | |
4191 | }; | |
4192 | static struct coef_fw coef0293[] = { | |
4193 | UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ | |
4194 | UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ | |
4195 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ | |
4196 | UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ | |
4197 | WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ | |
4198 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ | |
4199 | {} | |
4200 | }; | |
4201 | static struct coef_fw coef0668[] = { | |
4202 | WRITE_COEF(0x15, 0x0d40), | |
4203 | WRITE_COEF(0xb7, 0x802b), | |
4204 | {} | |
4205 | }; | |
4cc9b9d6 | 4206 | static struct coef_fw coef0225[] = { |
5a36767a | 4207 | UPDATE_COEF(0x63, 3<<14, 0), |
4cc9b9d6 KY |
4208 | {} |
4209 | }; | |
71683c32 KY |
4210 | static struct coef_fw coef0274[] = { |
4211 | UPDATE_COEF(0x4a, 0x0100, 0), | |
4212 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), | |
4213 | UPDATE_COEF(0x6b, 0xf000, 0x5000), | |
4214 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4215 | UPDATE_COEF(0x4a, 0x0c00, 0x0c00), | |
4216 | WRITE_COEF(0x45, 0x5289), | |
4217 | UPDATE_COEF(0x4a, 0x0c00, 0), | |
4218 | {} | |
4219 | }; | |
54db6c39 | 4220 | |
7639a06c | 4221 | switch (codec->core.vendor_id) { |
9a22a8f5 | 4222 | case 0x10ec0255: |
e69e7e03 KY |
4223 | alc_process_coef_fw(codec, coef0255_1); |
4224 | alc_process_coef_fw(codec, coef0255); | |
4225 | break; | |
736f20a7 | 4226 | case 0x10ec0236: |
7081adf3 | 4227 | case 0x10ec0256: |
e69e7e03 | 4228 | alc_process_coef_fw(codec, coef0256); |
54db6c39 | 4229 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 4230 | break; |
71683c32 KY |
4231 | case 0x10ec0234: |
4232 | case 0x10ec0274: | |
4233 | case 0x10ec0294: | |
4234 | alc_process_coef_fw(codec, coef0274); | |
4235 | break; | |
13fd08a3 | 4236 | case 0x10ec0233: |
73bdd597 | 4237 | case 0x10ec0283: |
54db6c39 | 4238 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4239 | break; |
f3b70332 KY |
4240 | case 0x10ec0286: |
4241 | case 0x10ec0288: | |
89542936 KY |
4242 | alc_process_coef_fw(codec, coef0288); |
4243 | break; | |
1a5bc8d9 | 4244 | case 0x10ec0298: |
89542936 | 4245 | alc_process_coef_fw(codec, coef0298); |
f3b70332 KY |
4246 | alc_process_coef_fw(codec, coef0288); |
4247 | break; | |
73bdd597 | 4248 | case 0x10ec0292: |
54db6c39 | 4249 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4250 | break; |
a22aa26f | 4251 | case 0x10ec0293: |
54db6c39 | 4252 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4253 | break; |
73bdd597 | 4254 | case 0x10ec0668: |
54db6c39 | 4255 | alc_process_coef_fw(codec, coef0668); |
73bdd597 | 4256 | break; |
638aad63 | 4257 | case 0x10ec0215: |
4cc9b9d6 | 4258 | case 0x10ec0225: |
638aad63 | 4259 | case 0x10ec0285: |
7d727869 | 4260 | case 0x10ec0295: |
638aad63 | 4261 | case 0x10ec0289: |
28f1f9b2 | 4262 | case 0x10ec0299: |
ba6d77fa | 4263 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4264 | alc_process_coef_fw(codec, coef0225); |
4265 | break; | |
78f4f7c2 KY |
4266 | case 0x10ec0867: |
4267 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
4268 | break; | |
73bdd597 | 4269 | } |
4e76a883 | 4270 | codec_dbg(codec, "Headset jack set to unplugged mode.\n"); |
73bdd597 DH |
4271 | } |
4272 | ||
4273 | ||
4274 | static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |
4275 | hda_nid_t mic_pin) | |
4276 | { | |
54db6c39 TI |
4277 | static struct coef_fw coef0255[] = { |
4278 | WRITE_COEFEX(0x57, 0x03, 0x8aa6), | |
4279 | WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ | |
4280 | {} | |
4281 | }; | |
4282 | static struct coef_fw coef0233[] = { | |
4283 | UPDATE_COEF(0x35, 0, 1<<14), | |
4284 | WRITE_COEF(0x06, 0x2100), | |
4285 | WRITE_COEF(0x1a, 0x0021), | |
4286 | WRITE_COEF(0x26, 0x008c), | |
4287 | {} | |
4288 | }; | |
f3b70332 | 4289 | static struct coef_fw coef0288[] = { |
89542936 | 4290 | UPDATE_COEF(0x4f, 0x00c0, 0), |
f3b70332 KY |
4291 | UPDATE_COEF(0x50, 0x2000, 0), |
4292 | UPDATE_COEF(0x56, 0x0006, 0), | |
4293 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | |
4294 | UPDATE_COEF(0x66, 0x0008, 0x0008), | |
4295 | UPDATE_COEF(0x67, 0x2000, 0x2000), | |
4296 | {} | |
4297 | }; | |
54db6c39 TI |
4298 | static struct coef_fw coef0292[] = { |
4299 | WRITE_COEF(0x19, 0xa208), | |
4300 | WRITE_COEF(0x2e, 0xacf0), | |
4301 | {} | |
4302 | }; | |
4303 | static struct coef_fw coef0293[] = { | |
4304 | UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ | |
4305 | UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ | |
4306 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
4307 | {} | |
4308 | }; | |
4309 | static struct coef_fw coef0688[] = { | |
4310 | WRITE_COEF(0xb7, 0x802b), | |
4311 | WRITE_COEF(0xb5, 0x1040), | |
4312 | UPDATE_COEF(0xc3, 0, 1<<12), | |
4313 | {} | |
4314 | }; | |
4cc9b9d6 KY |
4315 | static struct coef_fw coef0225[] = { |
4316 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), | |
4317 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | |
4318 | UPDATE_COEF(0x63, 3<<14, 0), | |
4319 | {} | |
4320 | }; | |
71683c32 KY |
4321 | static struct coef_fw coef0274[] = { |
4322 | UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), | |
4323 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4324 | UPDATE_COEF(0x6b, 0xf000, 0), | |
4325 | {} | |
4326 | }; | |
54db6c39 | 4327 | |
7639a06c | 4328 | switch (codec->core.vendor_id) { |
736f20a7 | 4329 | case 0x10ec0236: |
9a22a8f5 | 4330 | case 0x10ec0255: |
7081adf3 | 4331 | case 0x10ec0256: |
9a22a8f5 KY |
4332 | alc_write_coef_idx(codec, 0x45, 0xc489); |
4333 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4334 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
4335 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4336 | break; | |
71683c32 KY |
4337 | case 0x10ec0234: |
4338 | case 0x10ec0274: | |
4339 | case 0x10ec0294: | |
4340 | alc_write_coef_idx(codec, 0x45, 0x4689); | |
4341 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4342 | alc_process_coef_fw(codec, coef0274); | |
4343 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4344 | break; | |
13fd08a3 | 4345 | case 0x10ec0233: |
73bdd597 DH |
4346 | case 0x10ec0283: |
4347 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4348 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4349 | alc_process_coef_fw(codec, coef0233); |
73bdd597 DH |
4350 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4351 | break; | |
f3b70332 KY |
4352 | case 0x10ec0286: |
4353 | case 0x10ec0288: | |
1a5bc8d9 | 4354 | case 0x10ec0298: |
f3b70332 KY |
4355 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
4356 | alc_process_coef_fw(codec, coef0288); | |
4357 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4358 | break; | |
73bdd597 DH |
4359 | case 0x10ec0292: |
4360 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4361 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4362 | break; |
a22aa26f KY |
4363 | case 0x10ec0293: |
4364 | /* Set to TRS mode */ | |
4365 | alc_write_coef_idx(codec, 0x45, 0xc429); | |
4366 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4367 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
4368 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4369 | break; | |
78f4f7c2 KY |
4370 | case 0x10ec0867: |
4371 | alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); | |
4372 | /* fallthru */ | |
9eb5d0e6 | 4373 | case 0x10ec0221: |
1f8b46cd DH |
4374 | case 0x10ec0662: |
4375 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4376 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4377 | break; | |
73bdd597 DH |
4378 | case 0x10ec0668: |
4379 | alc_write_coef_idx(codec, 0x11, 0x0001); | |
4380 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
54db6c39 | 4381 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
4382 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
4383 | break; | |
638aad63 | 4384 | case 0x10ec0215: |
4cc9b9d6 | 4385 | case 0x10ec0225: |
638aad63 | 4386 | case 0x10ec0285: |
7d727869 | 4387 | case 0x10ec0295: |
638aad63 | 4388 | case 0x10ec0289: |
28f1f9b2 | 4389 | case 0x10ec0299: |
5a36767a | 4390 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4cc9b9d6 KY |
4391 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
4392 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | |
4393 | alc_process_coef_fw(codec, coef0225); | |
4394 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | |
4395 | break; | |
73bdd597 | 4396 | } |
4e76a883 | 4397 | codec_dbg(codec, "Headset jack set to mic-in mode.\n"); |
73bdd597 DH |
4398 | } |
4399 | ||
4400 | static void alc_headset_mode_default(struct hda_codec *codec) | |
4401 | { | |
2ae95577 | 4402 | static struct coef_fw coef0225[] = { |
5a36767a KY |
4403 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
4404 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), | |
4405 | UPDATE_COEF(0x49, 3<<8, 0<<8), | |
4406 | UPDATE_COEF(0x4a, 3<<4, 3<<4), | |
4407 | UPDATE_COEF(0x63, 3<<14, 0), | |
4408 | UPDATE_COEF(0x67, 0xf000, 0x3000), | |
2ae95577 DH |
4409 | {} |
4410 | }; | |
54db6c39 TI |
4411 | static struct coef_fw coef0255[] = { |
4412 | WRITE_COEF(0x45, 0xc089), | |
4413 | WRITE_COEF(0x45, 0xc489), | |
4414 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4415 | WRITE_COEF(0x49, 0x0049), | |
4416 | {} | |
4417 | }; | |
4418 | static struct coef_fw coef0233[] = { | |
4419 | WRITE_COEF(0x06, 0x2100), | |
4420 | WRITE_COEF(0x32, 0x4ea3), | |
4421 | {} | |
4422 | }; | |
f3b70332 KY |
4423 | static struct coef_fw coef0288[] = { |
4424 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ | |
4425 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4426 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4427 | UPDATE_COEF(0x66, 0x0008, 0), | |
4428 | UPDATE_COEF(0x67, 0x2000, 0), | |
4429 | {} | |
4430 | }; | |
54db6c39 TI |
4431 | static struct coef_fw coef0292[] = { |
4432 | WRITE_COEF(0x76, 0x000e), | |
4433 | WRITE_COEF(0x6c, 0x2400), | |
4434 | WRITE_COEF(0x6b, 0xc429), | |
4435 | WRITE_COEF(0x18, 0x7308), | |
4436 | {} | |
4437 | }; | |
4438 | static struct coef_fw coef0293[] = { | |
4439 | UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ | |
4440 | WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ | |
4441 | UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ | |
4442 | {} | |
4443 | }; | |
4444 | static struct coef_fw coef0688[] = { | |
4445 | WRITE_COEF(0x11, 0x0041), | |
4446 | WRITE_COEF(0x15, 0x0d40), | |
4447 | WRITE_COEF(0xb7, 0x802b), | |
4448 | {} | |
4449 | }; | |
71683c32 KY |
4450 | static struct coef_fw coef0274[] = { |
4451 | WRITE_COEF(0x45, 0x4289), | |
4452 | UPDATE_COEF(0x4a, 0x0010, 0x0010), | |
4453 | UPDATE_COEF(0x6b, 0x0f00, 0), | |
4454 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
4455 | {} | |
4456 | }; | |
54db6c39 | 4457 | |
7639a06c | 4458 | switch (codec->core.vendor_id) { |
638aad63 | 4459 | case 0x10ec0215: |
2ae95577 | 4460 | case 0x10ec0225: |
638aad63 | 4461 | case 0x10ec0285: |
7d727869 | 4462 | case 0x10ec0295: |
638aad63 | 4463 | case 0x10ec0289: |
28f1f9b2 | 4464 | case 0x10ec0299: |
5a36767a | 4465 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
2ae95577 DH |
4466 | alc_process_coef_fw(codec, coef0225); |
4467 | break; | |
736f20a7 | 4468 | case 0x10ec0236: |
9a22a8f5 | 4469 | case 0x10ec0255: |
7081adf3 | 4470 | case 0x10ec0256: |
54db6c39 | 4471 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 4472 | break; |
71683c32 KY |
4473 | case 0x10ec0234: |
4474 | case 0x10ec0274: | |
4475 | case 0x10ec0294: | |
4476 | alc_process_coef_fw(codec, coef0274); | |
4477 | break; | |
13fd08a3 | 4478 | case 0x10ec0233: |
73bdd597 | 4479 | case 0x10ec0283: |
54db6c39 | 4480 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4481 | break; |
f3b70332 KY |
4482 | case 0x10ec0286: |
4483 | case 0x10ec0288: | |
1a5bc8d9 | 4484 | case 0x10ec0298: |
f3b70332 KY |
4485 | alc_process_coef_fw(codec, coef0288); |
4486 | break; | |
73bdd597 | 4487 | case 0x10ec0292: |
54db6c39 | 4488 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4489 | break; |
a22aa26f | 4490 | case 0x10ec0293: |
54db6c39 | 4491 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4492 | break; |
73bdd597 | 4493 | case 0x10ec0668: |
54db6c39 | 4494 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 4495 | break; |
78f4f7c2 KY |
4496 | case 0x10ec0867: |
4497 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
4498 | break; | |
73bdd597 | 4499 | } |
4e76a883 | 4500 | codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); |
73bdd597 DH |
4501 | } |
4502 | ||
4503 | /* Iphone type */ | |
4504 | static void alc_headset_mode_ctia(struct hda_codec *codec) | |
4505 | { | |
89542936 KY |
4506 | int val; |
4507 | ||
54db6c39 TI |
4508 | static struct coef_fw coef0255[] = { |
4509 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ | |
4510 | WRITE_COEF(0x1b, 0x0c2b), | |
4511 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4512 | {} | |
4513 | }; | |
e69e7e03 KY |
4514 | static struct coef_fw coef0256[] = { |
4515 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ | |
4516 | WRITE_COEF(0x1b, 0x0c6b), | |
4517 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4518 | {} | |
4519 | }; | |
54db6c39 TI |
4520 | static struct coef_fw coef0233[] = { |
4521 | WRITE_COEF(0x45, 0xd429), | |
4522 | WRITE_COEF(0x1b, 0x0c2b), | |
4523 | WRITE_COEF(0x32, 0x4ea3), | |
4524 | {} | |
4525 | }; | |
f3b70332 KY |
4526 | static struct coef_fw coef0288[] = { |
4527 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4528 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4529 | UPDATE_COEF(0x66, 0x0008, 0), | |
4530 | UPDATE_COEF(0x67, 0x2000, 0), | |
4531 | {} | |
4532 | }; | |
54db6c39 TI |
4533 | static struct coef_fw coef0292[] = { |
4534 | WRITE_COEF(0x6b, 0xd429), | |
4535 | WRITE_COEF(0x76, 0x0008), | |
4536 | WRITE_COEF(0x18, 0x7388), | |
4537 | {} | |
4538 | }; | |
4539 | static struct coef_fw coef0293[] = { | |
4540 | WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ | |
4541 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
4542 | {} | |
4543 | }; | |
4544 | static struct coef_fw coef0688[] = { | |
4545 | WRITE_COEF(0x11, 0x0001), | |
4546 | WRITE_COEF(0x15, 0x0d60), | |
4547 | WRITE_COEF(0xc3, 0x0000), | |
4548 | {} | |
4549 | }; | |
5a36767a | 4550 | static struct coef_fw coef0225_1[] = { |
4cc9b9d6 | 4551 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
5a36767a KY |
4552 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4553 | {} | |
4554 | }; | |
4555 | static struct coef_fw coef0225_2[] = { | |
4556 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), | |
4557 | UPDATE_COEF(0x63, 3<<14, 1<<14), | |
4cc9b9d6 KY |
4558 | {} |
4559 | }; | |
54db6c39 | 4560 | |
7639a06c | 4561 | switch (codec->core.vendor_id) { |
9a22a8f5 | 4562 | case 0x10ec0255: |
54db6c39 | 4563 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 4564 | break; |
736f20a7 | 4565 | case 0x10ec0236: |
e69e7e03 KY |
4566 | case 0x10ec0256: |
4567 | alc_process_coef_fw(codec, coef0256); | |
4568 | break; | |
71683c32 KY |
4569 | case 0x10ec0234: |
4570 | case 0x10ec0274: | |
4571 | case 0x10ec0294: | |
4572 | alc_write_coef_idx(codec, 0x45, 0xd689); | |
4573 | break; | |
13fd08a3 | 4574 | case 0x10ec0233: |
73bdd597 | 4575 | case 0x10ec0283: |
54db6c39 | 4576 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4577 | break; |
1a5bc8d9 | 4578 | case 0x10ec0298: |
89542936 KY |
4579 | val = alc_read_coef_idx(codec, 0x50); |
4580 | if (val & (1 << 12)) { | |
4581 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
4582 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
4583 | msleep(300); | |
4584 | } else { | |
4585 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
4586 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
4587 | msleep(300); | |
4588 | } | |
4589 | break; | |
f3b70332 KY |
4590 | case 0x10ec0286: |
4591 | case 0x10ec0288: | |
4592 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | |
4593 | msleep(300); | |
4594 | alc_process_coef_fw(codec, coef0288); | |
4595 | break; | |
73bdd597 | 4596 | case 0x10ec0292: |
54db6c39 | 4597 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4598 | break; |
a22aa26f | 4599 | case 0x10ec0293: |
54db6c39 | 4600 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4601 | break; |
73bdd597 | 4602 | case 0x10ec0668: |
54db6c39 | 4603 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 4604 | break; |
638aad63 | 4605 | case 0x10ec0215: |
4cc9b9d6 | 4606 | case 0x10ec0225: |
638aad63 | 4607 | case 0x10ec0285: |
7d727869 | 4608 | case 0x10ec0295: |
638aad63 | 4609 | case 0x10ec0289: |
28f1f9b2 | 4610 | case 0x10ec0299: |
5a36767a KY |
4611 | val = alc_read_coef_idx(codec, 0x45); |
4612 | if (val & (1 << 9)) | |
4613 | alc_process_coef_fw(codec, coef0225_2); | |
4614 | else | |
4615 | alc_process_coef_fw(codec, coef0225_1); | |
4cc9b9d6 | 4616 | break; |
78f4f7c2 KY |
4617 | case 0x10ec0867: |
4618 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | |
4619 | break; | |
73bdd597 | 4620 | } |
4e76a883 | 4621 | codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); |
73bdd597 DH |
4622 | } |
4623 | ||
4624 | /* Nokia type */ | |
4625 | static void alc_headset_mode_omtp(struct hda_codec *codec) | |
4626 | { | |
54db6c39 TI |
4627 | static struct coef_fw coef0255[] = { |
4628 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ | |
4629 | WRITE_COEF(0x1b, 0x0c2b), | |
4630 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4631 | {} | |
4632 | }; | |
e69e7e03 KY |
4633 | static struct coef_fw coef0256[] = { |
4634 | WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ | |
4635 | WRITE_COEF(0x1b, 0x0c6b), | |
4636 | WRITE_COEFEX(0x57, 0x03, 0x8ea6), | |
4637 | {} | |
4638 | }; | |
54db6c39 TI |
4639 | static struct coef_fw coef0233[] = { |
4640 | WRITE_COEF(0x45, 0xe429), | |
4641 | WRITE_COEF(0x1b, 0x0c2b), | |
4642 | WRITE_COEF(0x32, 0x4ea3), | |
4643 | {} | |
4644 | }; | |
f3b70332 KY |
4645 | static struct coef_fw coef0288[] = { |
4646 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4647 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4648 | UPDATE_COEF(0x66, 0x0008, 0), | |
4649 | UPDATE_COEF(0x67, 0x2000, 0), | |
4650 | {} | |
4651 | }; | |
54db6c39 TI |
4652 | static struct coef_fw coef0292[] = { |
4653 | WRITE_COEF(0x6b, 0xe429), | |
4654 | WRITE_COEF(0x76, 0x0008), | |
4655 | WRITE_COEF(0x18, 0x7388), | |
4656 | {} | |
4657 | }; | |
4658 | static struct coef_fw coef0293[] = { | |
4659 | WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ | |
4660 | UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ | |
4661 | {} | |
4662 | }; | |
4663 | static struct coef_fw coef0688[] = { | |
4664 | WRITE_COEF(0x11, 0x0001), | |
4665 | WRITE_COEF(0x15, 0x0d50), | |
4666 | WRITE_COEF(0xc3, 0x0000), | |
4667 | {} | |
4668 | }; | |
4cc9b9d6 KY |
4669 | static struct coef_fw coef0225[] = { |
4670 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), | |
5a36767a | 4671 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4cc9b9d6 KY |
4672 | {} |
4673 | }; | |
54db6c39 | 4674 | |
7639a06c | 4675 | switch (codec->core.vendor_id) { |
9a22a8f5 | 4676 | case 0x10ec0255: |
54db6c39 | 4677 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 | 4678 | break; |
736f20a7 | 4679 | case 0x10ec0236: |
e69e7e03 KY |
4680 | case 0x10ec0256: |
4681 | alc_process_coef_fw(codec, coef0256); | |
4682 | break; | |
71683c32 KY |
4683 | case 0x10ec0234: |
4684 | case 0x10ec0274: | |
4685 | case 0x10ec0294: | |
4686 | alc_write_coef_idx(codec, 0x45, 0xe689); | |
4687 | break; | |
13fd08a3 | 4688 | case 0x10ec0233: |
73bdd597 | 4689 | case 0x10ec0283: |
54db6c39 | 4690 | alc_process_coef_fw(codec, coef0233); |
73bdd597 | 4691 | break; |
1a5bc8d9 KY |
4692 | case 0x10ec0298: |
4693 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ | |
89542936 KY |
4694 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
4695 | msleep(300); | |
4696 | break; | |
f3b70332 KY |
4697 | case 0x10ec0286: |
4698 | case 0x10ec0288: | |
4699 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); | |
4700 | msleep(300); | |
4701 | alc_process_coef_fw(codec, coef0288); | |
4702 | break; | |
73bdd597 | 4703 | case 0x10ec0292: |
54db6c39 | 4704 | alc_process_coef_fw(codec, coef0292); |
73bdd597 | 4705 | break; |
a22aa26f | 4706 | case 0x10ec0293: |
54db6c39 | 4707 | alc_process_coef_fw(codec, coef0293); |
a22aa26f | 4708 | break; |
73bdd597 | 4709 | case 0x10ec0668: |
54db6c39 | 4710 | alc_process_coef_fw(codec, coef0688); |
73bdd597 | 4711 | break; |
638aad63 | 4712 | case 0x10ec0215: |
4cc9b9d6 | 4713 | case 0x10ec0225: |
638aad63 | 4714 | case 0x10ec0285: |
7d727869 | 4715 | case 0x10ec0295: |
638aad63 | 4716 | case 0x10ec0289: |
28f1f9b2 | 4717 | case 0x10ec0299: |
4cc9b9d6 KY |
4718 | alc_process_coef_fw(codec, coef0225); |
4719 | break; | |
73bdd597 | 4720 | } |
4e76a883 | 4721 | codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); |
73bdd597 DH |
4722 | } |
4723 | ||
4724 | static void alc_determine_headset_type(struct hda_codec *codec) | |
4725 | { | |
4726 | int val; | |
4727 | bool is_ctia = false; | |
4728 | struct alc_spec *spec = codec->spec; | |
54db6c39 TI |
4729 | static struct coef_fw coef0255[] = { |
4730 | WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ | |
4731 | WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref | |
4732 | conteol) */ | |
4733 | {} | |
4734 | }; | |
f3b70332 KY |
4735 | static struct coef_fw coef0288[] = { |
4736 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ | |
4737 | {} | |
4738 | }; | |
89542936 KY |
4739 | static struct coef_fw coef0298[] = { |
4740 | UPDATE_COEF(0x50, 0x2000, 0x2000), | |
4741 | UPDATE_COEF(0x56, 0x0006, 0x0006), | |
4742 | UPDATE_COEF(0x66, 0x0008, 0), | |
4743 | UPDATE_COEF(0x67, 0x2000, 0), | |
4744 | UPDATE_COEF(0x19, 0x1300, 0x1300), | |
4745 | {} | |
4746 | }; | |
54db6c39 TI |
4747 | static struct coef_fw coef0293[] = { |
4748 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ | |
4749 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ | |
4750 | {} | |
4751 | }; | |
4752 | static struct coef_fw coef0688[] = { | |
4753 | WRITE_COEF(0x11, 0x0001), | |
4754 | WRITE_COEF(0xb7, 0x802b), | |
4755 | WRITE_COEF(0x15, 0x0d60), | |
4756 | WRITE_COEF(0xc3, 0x0c00), | |
4757 | {} | |
4758 | }; | |
71683c32 KY |
4759 | static struct coef_fw coef0274[] = { |
4760 | UPDATE_COEF(0x4a, 0x0010, 0), | |
4761 | UPDATE_COEF(0x4a, 0x8000, 0), | |
4762 | WRITE_COEF(0x45, 0xd289), | |
4763 | UPDATE_COEF(0x49, 0x0300, 0x0300), | |
4764 | {} | |
4765 | }; | |
73bdd597 | 4766 | |
7639a06c | 4767 | switch (codec->core.vendor_id) { |
736f20a7 | 4768 | case 0x10ec0236: |
9a22a8f5 | 4769 | case 0x10ec0255: |
7081adf3 | 4770 | case 0x10ec0256: |
54db6c39 | 4771 | alc_process_coef_fw(codec, coef0255); |
9a22a8f5 KY |
4772 | msleep(300); |
4773 | val = alc_read_coef_idx(codec, 0x46); | |
4774 | is_ctia = (val & 0x0070) == 0x0070; | |
4775 | break; | |
71683c32 KY |
4776 | case 0x10ec0234: |
4777 | case 0x10ec0274: | |
4778 | case 0x10ec0294: | |
4779 | alc_process_coef_fw(codec, coef0274); | |
4780 | msleep(80); | |
4781 | val = alc_read_coef_idx(codec, 0x46); | |
4782 | is_ctia = (val & 0x00f0) == 0x00f0; | |
4783 | break; | |
13fd08a3 | 4784 | case 0x10ec0233: |
73bdd597 DH |
4785 | case 0x10ec0283: |
4786 | alc_write_coef_idx(codec, 0x45, 0xd029); | |
4787 | msleep(300); | |
4788 | val = alc_read_coef_idx(codec, 0x46); | |
4789 | is_ctia = (val & 0x0070) == 0x0070; | |
4790 | break; | |
1a5bc8d9 | 4791 | case 0x10ec0298: |
89542936 KY |
4792 | snd_hda_codec_write(codec, 0x21, 0, |
4793 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
4794 | msleep(100); | |
4795 | snd_hda_codec_write(codec, 0x21, 0, | |
4796 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
4797 | msleep(200); | |
4798 | ||
4799 | val = alc_read_coef_idx(codec, 0x50); | |
4800 | if (val & (1 << 12)) { | |
4801 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | |
4802 | alc_process_coef_fw(codec, coef0288); | |
4803 | msleep(350); | |
4804 | val = alc_read_coef_idx(codec, 0x50); | |
4805 | is_ctia = (val & 0x0070) == 0x0070; | |
4806 | } else { | |
4807 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | |
4808 | alc_process_coef_fw(codec, coef0288); | |
4809 | msleep(350); | |
4810 | val = alc_read_coef_idx(codec, 0x50); | |
4811 | is_ctia = (val & 0x0070) == 0x0070; | |
4812 | } | |
4813 | alc_process_coef_fw(codec, coef0298); | |
4814 | snd_hda_codec_write(codec, 0x21, 0, | |
4815 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); | |
4816 | msleep(75); | |
4817 | snd_hda_codec_write(codec, 0x21, 0, | |
4818 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
4819 | break; | |
f3b70332 KY |
4820 | case 0x10ec0286: |
4821 | case 0x10ec0288: | |
4822 | alc_process_coef_fw(codec, coef0288); | |
4823 | msleep(350); | |
4824 | val = alc_read_coef_idx(codec, 0x50); | |
4825 | is_ctia = (val & 0x0070) == 0x0070; | |
4826 | break; | |
73bdd597 DH |
4827 | case 0x10ec0292: |
4828 | alc_write_coef_idx(codec, 0x6b, 0xd429); | |
4829 | msleep(300); | |
4830 | val = alc_read_coef_idx(codec, 0x6c); | |
4831 | is_ctia = (val & 0x001c) == 0x001c; | |
4832 | break; | |
a22aa26f | 4833 | case 0x10ec0293: |
54db6c39 | 4834 | alc_process_coef_fw(codec, coef0293); |
a22aa26f KY |
4835 | msleep(300); |
4836 | val = alc_read_coef_idx(codec, 0x46); | |
4837 | is_ctia = (val & 0x0070) == 0x0070; | |
4838 | break; | |
73bdd597 | 4839 | case 0x10ec0668: |
54db6c39 | 4840 | alc_process_coef_fw(codec, coef0688); |
73bdd597 DH |
4841 | msleep(300); |
4842 | val = alc_read_coef_idx(codec, 0xbe); | |
4843 | is_ctia = (val & 0x1c02) == 0x1c02; | |
4844 | break; | |
638aad63 | 4845 | case 0x10ec0215: |
4cc9b9d6 | 4846 | case 0x10ec0225: |
638aad63 | 4847 | case 0x10ec0285: |
7d727869 | 4848 | case 0x10ec0295: |
638aad63 | 4849 | case 0x10ec0289: |
28f1f9b2 | 4850 | case 0x10ec0299: |
0b4d8f55 KY |
4851 | snd_hda_codec_write(codec, 0x21, 0, |
4852 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
4853 | msleep(80); | |
4854 | snd_hda_codec_write(codec, 0x21, 0, | |
4855 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | |
4856 | ||
5a36767a KY |
4857 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4858 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); | |
4859 | val = alc_read_coef_idx(codec, 0x45); | |
4860 | if (val & (1 << 9)) { | |
4861 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
4862 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); | |
4863 | msleep(800); | |
4864 | val = alc_read_coef_idx(codec, 0x46); | |
4865 | is_ctia = (val & 0x00f0) == 0x00f0; | |
4866 | } else { | |
4867 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | |
4868 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); | |
4869 | msleep(800); | |
4870 | val = alc_read_coef_idx(codec, 0x46); | |
4871 | is_ctia = (val & 0x00f0) == 0x00f0; | |
4872 | } | |
4873 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); | |
4874 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); | |
4875 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | |
0b4d8f55 KY |
4876 | |
4877 | snd_hda_codec_write(codec, 0x21, 0, | |
4878 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); | |
4879 | msleep(80); | |
4880 | snd_hda_codec_write(codec, 0x21, 0, | |
4881 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | |
4cc9b9d6 | 4882 | break; |
78f4f7c2 KY |
4883 | case 0x10ec0867: |
4884 | is_ctia = true; | |
4885 | break; | |
73bdd597 DH |
4886 | } |
4887 | ||
4e76a883 | 4888 | codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", |
73bdd597 DH |
4889 | is_ctia ? "yes" : "no"); |
4890 | spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; | |
4891 | } | |
4892 | ||
4893 | static void alc_update_headset_mode(struct hda_codec *codec) | |
4894 | { | |
4895 | struct alc_spec *spec = codec->spec; | |
4896 | ||
4897 | hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; | |
80f10932 | 4898 | hda_nid_t hp_pin = alc_get_hp_pin(spec); |
73bdd597 DH |
4899 | |
4900 | int new_headset_mode; | |
4901 | ||
4902 | if (!snd_hda_jack_detect(codec, hp_pin)) | |
4903 | new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; | |
4904 | else if (mux_pin == spec->headset_mic_pin) | |
4905 | new_headset_mode = ALC_HEADSET_MODE_HEADSET; | |
4906 | else if (mux_pin == spec->headphone_mic_pin) | |
4907 | new_headset_mode = ALC_HEADSET_MODE_MIC; | |
4908 | else | |
4909 | new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; | |
4910 | ||
5959a6bc DH |
4911 | if (new_headset_mode == spec->current_headset_mode) { |
4912 | snd_hda_gen_update_outputs(codec); | |
73bdd597 | 4913 | return; |
5959a6bc | 4914 | } |
73bdd597 DH |
4915 | |
4916 | switch (new_headset_mode) { | |
4917 | case ALC_HEADSET_MODE_UNPLUGGED: | |
4918 | alc_headset_mode_unplugged(codec); | |
4919 | spec->gen.hp_jack_present = false; | |
4920 | break; | |
4921 | case ALC_HEADSET_MODE_HEADSET: | |
4922 | if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) | |
4923 | alc_determine_headset_type(codec); | |
4924 | if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) | |
4925 | alc_headset_mode_ctia(codec); | |
4926 | else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) | |
4927 | alc_headset_mode_omtp(codec); | |
4928 | spec->gen.hp_jack_present = true; | |
4929 | break; | |
4930 | case ALC_HEADSET_MODE_MIC: | |
4931 | alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); | |
4932 | spec->gen.hp_jack_present = false; | |
4933 | break; | |
4934 | case ALC_HEADSET_MODE_HEADPHONE: | |
4935 | alc_headset_mode_default(codec); | |
4936 | spec->gen.hp_jack_present = true; | |
4937 | break; | |
4938 | } | |
4939 | if (new_headset_mode != ALC_HEADSET_MODE_MIC) { | |
4940 | snd_hda_set_pin_ctl_cache(codec, hp_pin, | |
4941 | AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); | |
1f8b46cd | 4942 | if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) |
73bdd597 DH |
4943 | snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, |
4944 | PIN_VREFHIZ); | |
4945 | } | |
4946 | spec->current_headset_mode = new_headset_mode; | |
4947 | ||
4948 | snd_hda_gen_update_outputs(codec); | |
4949 | } | |
4950 | ||
4951 | static void alc_update_headset_mode_hook(struct hda_codec *codec, | |
7fe30711 TI |
4952 | struct snd_kcontrol *kcontrol, |
4953 | struct snd_ctl_elem_value *ucontrol) | |
73bdd597 DH |
4954 | { |
4955 | alc_update_headset_mode(codec); | |
4956 | } | |
4957 | ||
1a4f69d5 TI |
4958 | static void alc_update_headset_jack_cb(struct hda_codec *codec, |
4959 | struct hda_jack_callback *jack) | |
73bdd597 DH |
4960 | { |
4961 | struct alc_spec *spec = codec->spec; | |
5db4d34b | 4962 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
73bdd597 DH |
4963 | snd_hda_gen_hp_automute(codec, jack); |
4964 | } | |
4965 | ||
4966 | static void alc_probe_headset_mode(struct hda_codec *codec) | |
4967 | { | |
4968 | int i; | |
4969 | struct alc_spec *spec = codec->spec; | |
4970 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
4971 | ||
4972 | /* Find mic pins */ | |
4973 | for (i = 0; i < cfg->num_inputs; i++) { | |
4974 | if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) | |
4975 | spec->headset_mic_pin = cfg->inputs[i].pin; | |
4976 | if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) | |
4977 | spec->headphone_mic_pin = cfg->inputs[i].pin; | |
4978 | } | |
4979 | ||
4980 | spec->gen.cap_sync_hook = alc_update_headset_mode_hook; | |
4981 | spec->gen.automute_hook = alc_update_headset_mode; | |
4982 | spec->gen.hp_automute_hook = alc_update_headset_jack_cb; | |
4983 | } | |
4984 | ||
4985 | static void alc_fixup_headset_mode(struct hda_codec *codec, | |
4986 | const struct hda_fixup *fix, int action) | |
4987 | { | |
4988 | struct alc_spec *spec = codec->spec; | |
4989 | ||
4990 | switch (action) { | |
4991 | case HDA_FIXUP_ACT_PRE_PROBE: | |
4992 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; | |
4993 | break; | |
4994 | case HDA_FIXUP_ACT_PROBE: | |
4995 | alc_probe_headset_mode(codec); | |
4996 | break; | |
4997 | case HDA_FIXUP_ACT_INIT: | |
4998 | spec->current_headset_mode = 0; | |
4999 | alc_update_headset_mode(codec); | |
5000 | break; | |
5001 | } | |
5002 | } | |
5003 | ||
5004 | static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, | |
5005 | const struct hda_fixup *fix, int action) | |
5006 | { | |
5007 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5008 | struct alc_spec *spec = codec->spec; | |
5009 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5010 | } | |
5011 | else | |
5012 | alc_fixup_headset_mode(codec, fix, action); | |
5013 | } | |
5014 | ||
31278997 KY |
5015 | static void alc255_set_default_jack_type(struct hda_codec *codec) |
5016 | { | |
5017 | /* Set to iphone type */ | |
e69e7e03 | 5018 | static struct coef_fw alc255fw[] = { |
54db6c39 TI |
5019 | WRITE_COEF(0x1b, 0x880b), |
5020 | WRITE_COEF(0x45, 0xd089), | |
5021 | WRITE_COEF(0x1b, 0x080b), | |
5022 | WRITE_COEF(0x46, 0x0004), | |
5023 | WRITE_COEF(0x1b, 0x0c0b), | |
5024 | {} | |
5025 | }; | |
e69e7e03 KY |
5026 | static struct coef_fw alc256fw[] = { |
5027 | WRITE_COEF(0x1b, 0x884b), | |
5028 | WRITE_COEF(0x45, 0xd089), | |
5029 | WRITE_COEF(0x1b, 0x084b), | |
5030 | WRITE_COEF(0x46, 0x0004), | |
5031 | WRITE_COEF(0x1b, 0x0c4b), | |
5032 | {} | |
5033 | }; | |
5034 | switch (codec->core.vendor_id) { | |
5035 | case 0x10ec0255: | |
5036 | alc_process_coef_fw(codec, alc255fw); | |
5037 | break; | |
736f20a7 | 5038 | case 0x10ec0236: |
e69e7e03 KY |
5039 | case 0x10ec0256: |
5040 | alc_process_coef_fw(codec, alc256fw); | |
5041 | break; | |
5042 | } | |
31278997 KY |
5043 | msleep(30); |
5044 | } | |
5045 | ||
9a22a8f5 KY |
5046 | static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, |
5047 | const struct hda_fixup *fix, int action) | |
5048 | { | |
5049 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
31278997 | 5050 | alc255_set_default_jack_type(codec); |
9a22a8f5 KY |
5051 | } |
5052 | alc_fixup_headset_mode(codec, fix, action); | |
5053 | } | |
5054 | ||
31278997 KY |
5055 | static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, |
5056 | const struct hda_fixup *fix, int action) | |
5057 | { | |
5058 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5059 | struct alc_spec *spec = codec->spec; | |
5060 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5061 | alc255_set_default_jack_type(codec); | |
5062 | } | |
5063 | else | |
5064 | alc_fixup_headset_mode(codec, fix, action); | |
5065 | } | |
5066 | ||
e1e62b98 KY |
5067 | static void alc288_update_headset_jack_cb(struct hda_codec *codec, |
5068 | struct hda_jack_callback *jack) | |
5069 | { | |
5070 | struct alc_spec *spec = codec->spec; | |
5071 | int present; | |
5072 | ||
5073 | alc_update_headset_jack_cb(codec, jack); | |
5074 | /* Headset Mic enable or disable, only for Dell Dino */ | |
5075 | present = spec->gen.hp_jack_present ? 0x40 : 0; | |
5076 | snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, | |
5077 | present); | |
5078 | } | |
5079 | ||
5080 | static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, | |
5081 | const struct hda_fixup *fix, int action) | |
5082 | { | |
5083 | alc_fixup_headset_mode(codec, fix, action); | |
5084 | if (action == HDA_FIXUP_ACT_PROBE) { | |
5085 | struct alc_spec *spec = codec->spec; | |
5086 | spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; | |
5087 | } | |
5088 | } | |
5089 | ||
493a52a9 HW |
5090 | static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, |
5091 | const struct hda_fixup *fix, int action) | |
5092 | { | |
5093 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5094 | struct alc_spec *spec = codec->spec; | |
5095 | spec->gen.auto_mute_via_amp = 1; | |
5096 | } | |
5097 | } | |
5098 | ||
9b745ab8 TI |
5099 | static void alc_fixup_no_shutup(struct hda_codec *codec, |
5100 | const struct hda_fixup *fix, int action) | |
5101 | { | |
972aa2c7 | 5102 | if (action == HDA_FIXUP_ACT_PROBE) { |
9b745ab8 | 5103 | struct alc_spec *spec = codec->spec; |
b001f661 | 5104 | spec->no_shutup_pins = 1; |
9b745ab8 TI |
5105 | } |
5106 | } | |
5107 | ||
5e6db669 GM |
5108 | static void alc_fixup_disable_aamix(struct hda_codec *codec, |
5109 | const struct hda_fixup *fix, int action) | |
5110 | { | |
5111 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5112 | struct alc_spec *spec = codec->spec; | |
5113 | /* Disable AA-loopback as it causes white noise */ | |
5114 | spec->gen.mixer_nid = 0; | |
5115 | } | |
5116 | } | |
5117 | ||
7f57d803 TI |
5118 | /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ |
5119 | static void alc_fixup_tpt440_dock(struct hda_codec *codec, | |
5120 | const struct hda_fixup *fix, int action) | |
5121 | { | |
5122 | static const struct hda_pintbl pincfgs[] = { | |
5123 | { 0x16, 0x21211010 }, /* dock headphone */ | |
5124 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5125 | { } | |
5126 | }; | |
5127 | struct alc_spec *spec = codec->spec; | |
5128 | ||
5129 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
70a0976b | 5130 | spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */ |
7f57d803 TI |
5131 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
5132 | codec->power_save_node = 0; /* avoid click noises */ | |
5133 | snd_hda_apply_pincfgs(codec, pincfgs); | |
5134 | } | |
5135 | } | |
5136 | ||
114745cd KY |
5137 | static void alc_fixup_tpt470_dock(struct hda_codec *codec, |
5138 | const struct hda_fixup *fix, int action) | |
5139 | { | |
5140 | static const struct hda_pintbl pincfgs[] = { | |
5141 | { 0x17, 0x21211010 }, /* dock headphone */ | |
5142 | { 0x19, 0x21a11010 }, /* dock mic */ | |
5143 | { } | |
5144 | }; | |
595263d2 TI |
5145 | /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise |
5146 | * the speaker output becomes too low by some reason on Thinkpads with | |
5147 | * ALC298 codec | |
5148 | */ | |
5149 | static hda_nid_t preferred_pairs[] = { | |
5150 | 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, | |
5151 | 0 | |
5152 | }; | |
114745cd KY |
5153 | struct alc_spec *spec = codec->spec; |
5154 | ||
5155 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
595263d2 | 5156 | spec->gen.preferred_dacs = preferred_pairs; |
114745cd | 5157 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; |
35bc709a TI |
5158 | snd_hda_apply_pincfgs(codec, pincfgs); |
5159 | } else if (action == HDA_FIXUP_ACT_INIT) { | |
114745cd KY |
5160 | /* Enable DOCK device */ |
5161 | snd_hda_codec_write(codec, 0x17, 0, | |
5162 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
5163 | /* Enable DOCK device */ | |
5164 | snd_hda_codec_write(codec, 0x19, 0, | |
5165 | AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); | |
114745cd KY |
5166 | } |
5167 | } | |
5168 | ||
9476d369 | 5169 | static void alc_shutup_dell_xps13(struct hda_codec *codec) |
033b0a7c GM |
5170 | { |
5171 | struct alc_spec *spec = codec->spec; | |
80f10932 | 5172 | int hp_pin = alc_get_hp_pin(spec); |
033b0a7c | 5173 | |
9476d369 GM |
5174 | /* Prevent pop noises when headphones are plugged in */ |
5175 | snd_hda_codec_write(codec, hp_pin, 0, | |
5176 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); | |
5177 | msleep(20); | |
033b0a7c GM |
5178 | } |
5179 | ||
5180 | static void alc_fixup_dell_xps13(struct hda_codec *codec, | |
5181 | const struct hda_fixup *fix, int action) | |
5182 | { | |
3e1b0c4a TI |
5183 | struct alc_spec *spec = codec->spec; |
5184 | struct hda_input_mux *imux = &spec->gen.input_mux; | |
5185 | int i; | |
f38663ab | 5186 | |
3e1b0c4a TI |
5187 | switch (action) { |
5188 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5189 | /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise | |
5190 | * it causes a click noise at start up | |
5191 | */ | |
5192 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
5193 | break; | |
5194 | case HDA_FIXUP_ACT_PROBE: | |
9476d369 | 5195 | spec->shutup = alc_shutup_dell_xps13; |
f38663ab GM |
5196 | |
5197 | /* Make the internal mic the default input source. */ | |
5198 | for (i = 0; i < imux->num_items; i++) { | |
5199 | if (spec->gen.imux_pins[i] == 0x12) { | |
5200 | spec->gen.cur_mux[0] = i; | |
5201 | break; | |
5202 | } | |
5203 | } | |
3e1b0c4a | 5204 | break; |
033b0a7c GM |
5205 | } |
5206 | } | |
5207 | ||
1f8b46cd DH |
5208 | static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, |
5209 | const struct hda_fixup *fix, int action) | |
5210 | { | |
5211 | struct alc_spec *spec = codec->spec; | |
5212 | ||
5213 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5214 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
5215 | spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ | |
b40eda64 DH |
5216 | |
5217 | /* Disable boost for mic-in permanently. (This code is only called | |
5218 | from quirks that guarantee that the headphone is at NID 0x1b.) */ | |
5219 | snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); | |
5220 | snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); | |
1f8b46cd DH |
5221 | } else |
5222 | alc_fixup_headset_mode(codec, fix, action); | |
5223 | } | |
5224 | ||
73bdd597 DH |
5225 | static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, |
5226 | const struct hda_fixup *fix, int action) | |
5227 | { | |
5228 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
73bdd597 | 5229 | alc_write_coef_idx(codec, 0xc4, 0x8000); |
98b24883 | 5230 | alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); |
73bdd597 DH |
5231 | snd_hda_set_pin_ctl_cache(codec, 0x18, 0); |
5232 | } | |
5233 | alc_fixup_headset_mode(codec, fix, action); | |
5234 | } | |
5235 | ||
bde7bc60 CCC |
5236 | /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ |
5237 | static int find_ext_mic_pin(struct hda_codec *codec) | |
5238 | { | |
5239 | struct alc_spec *spec = codec->spec; | |
5240 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5241 | hda_nid_t nid; | |
5242 | unsigned int defcfg; | |
5243 | int i; | |
5244 | ||
5245 | for (i = 0; i < cfg->num_inputs; i++) { | |
5246 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5247 | continue; | |
5248 | nid = cfg->inputs[i].pin; | |
5249 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5250 | if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) | |
5251 | continue; | |
5252 | return nid; | |
5253 | } | |
5254 | ||
5255 | return 0; | |
5256 | } | |
5257 | ||
08a978db | 5258 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |
1727a771 | 5259 | const struct hda_fixup *fix, |
08a978db DR |
5260 | int action) |
5261 | { | |
5262 | struct alc_spec *spec = codec->spec; | |
5263 | ||
0db75790 | 5264 | if (action == HDA_FIXUP_ACT_PROBE) { |
bde7bc60 | 5265 | int mic_pin = find_ext_mic_pin(codec); |
80f10932 | 5266 | int hp_pin = alc_get_hp_pin(spec); |
bde7bc60 CCC |
5267 | |
5268 | if (snd_BUG_ON(!mic_pin || !hp_pin)) | |
0db75790 | 5269 | return; |
bde7bc60 | 5270 | snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); |
0db75790 | 5271 | } |
08a978db | 5272 | } |
693b613d | 5273 | |
3e0d611b DH |
5274 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, |
5275 | const struct hda_fixup *fix, | |
5276 | int action) | |
5277 | { | |
5278 | struct alc_spec *spec = codec->spec; | |
5279 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | |
5280 | int i; | |
5281 | ||
5282 | /* The mic boosts on level 2 and 3 are too noisy | |
5283 | on the internal mic input. | |
5284 | Therefore limit the boost to 0 or 1. */ | |
5285 | ||
5286 | if (action != HDA_FIXUP_ACT_PROBE) | |
5287 | return; | |
5288 | ||
5289 | for (i = 0; i < cfg->num_inputs; i++) { | |
5290 | hda_nid_t nid = cfg->inputs[i].pin; | |
5291 | unsigned int defcfg; | |
5292 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | |
5293 | continue; | |
5294 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | |
5295 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) | |
5296 | continue; | |
5297 | ||
5298 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, | |
5299 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | | |
5300 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
5301 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
5302 | (0 << AC_AMPCAP_MUTE_SHIFT)); | |
5303 | } | |
5304 | } | |
5305 | ||
cd217a63 | 5306 | static void alc283_hp_automute_hook(struct hda_codec *codec, |
1a4f69d5 | 5307 | struct hda_jack_callback *jack) |
cd217a63 KY |
5308 | { |
5309 | struct alc_spec *spec = codec->spec; | |
5310 | int vref; | |
5311 | ||
5312 | msleep(200); | |
5313 | snd_hda_gen_hp_automute(codec, jack); | |
5314 | ||
5315 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
5316 | ||
5317 | msleep(600); | |
5318 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
5319 | vref); | |
5320 | } | |
5321 | ||
cd217a63 KY |
5322 | static void alc283_fixup_chromebook(struct hda_codec *codec, |
5323 | const struct hda_fixup *fix, int action) | |
5324 | { | |
5325 | struct alc_spec *spec = codec->spec; | |
cd217a63 KY |
5326 | |
5327 | switch (action) { | |
5328 | case HDA_FIXUP_ACT_PRE_PROBE: | |
0202e99c | 5329 | snd_hda_override_wcaps(codec, 0x03, 0); |
d2e92709 TI |
5330 | /* Disable AA-loopback as it causes white noise */ |
5331 | spec->gen.mixer_nid = 0; | |
38070219 | 5332 | break; |
0202e99c | 5333 | case HDA_FIXUP_ACT_INIT: |
de9481cb KY |
5334 | /* MIC2-VREF control */ |
5335 | /* Set to manual mode */ | |
98b24883 | 5336 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
0202e99c | 5337 | /* Enable Line1 input control by verb */ |
98b24883 | 5338 | alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); |
0202e99c KY |
5339 | break; |
5340 | } | |
5341 | } | |
5342 | ||
5343 | static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, | |
5344 | const struct hda_fixup *fix, int action) | |
5345 | { | |
5346 | struct alc_spec *spec = codec->spec; | |
0202e99c KY |
5347 | |
5348 | switch (action) { | |
5349 | case HDA_FIXUP_ACT_PRE_PROBE: | |
cd217a63 | 5350 | spec->gen.hp_automute_hook = alc283_hp_automute_hook; |
38070219 KY |
5351 | break; |
5352 | case HDA_FIXUP_ACT_INIT: | |
cd217a63 KY |
5353 | /* MIC2-VREF control */ |
5354 | /* Set to manual mode */ | |
98b24883 | 5355 | alc_update_coef_idx(codec, 0x06, 0x000c, 0); |
cd217a63 KY |
5356 | break; |
5357 | } | |
5358 | } | |
5359 | ||
7bba2157 TI |
5360 | /* mute tablet speaker pin (0x14) via dock plugging in addition */ |
5361 | static void asus_tx300_automute(struct hda_codec *codec) | |
5362 | { | |
5363 | struct alc_spec *spec = codec->spec; | |
5364 | snd_hda_gen_update_outputs(codec); | |
5365 | if (snd_hda_jack_detect(codec, 0x1b)) | |
5366 | spec->gen.mute_bits |= (1ULL << 0x14); | |
5367 | } | |
5368 | ||
5369 | static void alc282_fixup_asus_tx300(struct hda_codec *codec, | |
5370 | const struct hda_fixup *fix, int action) | |
5371 | { | |
5372 | struct alc_spec *spec = codec->spec; | |
5373 | /* TX300 needs to set up GPIO2 for the speaker amp */ | |
5374 | static const struct hda_verb gpio2_verbs[] = { | |
5375 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, | |
5376 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, | |
5377 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x04 }, | |
5378 | {} | |
5379 | }; | |
5380 | static const struct hda_pintbl dock_pins[] = { | |
5381 | { 0x1b, 0x21114000 }, /* dock speaker pin */ | |
5382 | {} | |
5383 | }; | |
7bba2157 TI |
5384 | |
5385 | switch (action) { | |
5386 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5387 | snd_hda_add_verbs(codec, gpio2_verbs); | |
5388 | snd_hda_apply_pincfgs(codec, dock_pins); | |
5389 | spec->gen.auto_mute_via_amp = 1; | |
5390 | spec->gen.automute_hook = asus_tx300_automute; | |
5391 | snd_hda_jack_detect_enable_callback(codec, 0x1b, | |
7bba2157 TI |
5392 | snd_hda_gen_hp_automute); |
5393 | break; | |
5394 | case HDA_FIXUP_ACT_BUILD: | |
5395 | /* this is a bit tricky; give more sane names for the main | |
5396 | * (tablet) speaker and the dock speaker, respectively | |
5397 | */ | |
56798e6b TI |
5398 | rename_ctl(codec, "Speaker Playback Switch", |
5399 | "Dock Speaker Playback Switch"); | |
5400 | rename_ctl(codec, "Bass Speaker Playback Switch", | |
5401 | "Speaker Playback Switch"); | |
7bba2157 TI |
5402 | break; |
5403 | } | |
5404 | } | |
5405 | ||
338cae56 DH |
5406 | static void alc290_fixup_mono_speakers(struct hda_codec *codec, |
5407 | const struct hda_fixup *fix, int action) | |
5408 | { | |
0f4881dc DH |
5409 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
5410 | /* DAC node 0x03 is giving mono output. We therefore want to | |
5411 | make sure 0x14 (front speaker) and 0x15 (headphones) use the | |
5412 | stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ | |
5413 | hda_nid_t conn1[2] = { 0x0c }; | |
5414 | snd_hda_override_conn_list(codec, 0x14, 1, conn1); | |
5415 | snd_hda_override_conn_list(codec, 0x15, 1, conn1); | |
5416 | } | |
338cae56 DH |
5417 | } |
5418 | ||
dd9aa335 HW |
5419 | static void alc298_fixup_speaker_volume(struct hda_codec *codec, |
5420 | const struct hda_fixup *fix, int action) | |
5421 | { | |
5422 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5423 | /* The speaker is routed to the Node 0x06 by a mistake, as a result | |
5424 | we can't adjust the speaker's volume since this node does not has | |
5425 | Amp-out capability. we change the speaker's route to: | |
5426 | Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( | |
5427 | Pin Complex), since Node 0x02 has Amp-out caps, we can adjust | |
5428 | speaker's volume now. */ | |
5429 | ||
5430 | hda_nid_t conn1[1] = { 0x0c }; | |
5431 | snd_hda_override_conn_list(codec, 0x17, 1, conn1); | |
5432 | } | |
5433 | } | |
5434 | ||
214839a8 TI |
5435 | /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ |
5436 | static void alc295_fixup_disable_dac3(struct hda_codec *codec, | |
5437 | const struct hda_fixup *fix, int action) | |
5438 | { | |
5439 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5440 | hda_nid_t conn[2] = { 0x02, 0x03 }; | |
5441 | snd_hda_override_conn_list(codec, 0x17, 2, conn); | |
5442 | } | |
5443 | } | |
5444 | ||
98973f2f KP |
5445 | /* Hook to update amp GPIO4 for automute */ |
5446 | static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, | |
5447 | struct hda_jack_callback *jack) | |
5448 | { | |
5449 | struct alc_spec *spec = codec->spec; | |
5450 | ||
5451 | snd_hda_gen_hp_automute(codec, jack); | |
5452 | /* mute_led_polarity is set to 0, so we pass inverted value here */ | |
5453 | alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present); | |
5454 | } | |
5455 | ||
5456 | /* Manage GPIOs for HP EliteBook Folio 9480m. | |
5457 | * | |
5458 | * GPIO4 is the headphone amplifier power control | |
5459 | * GPIO3 is the audio output mute indicator LED | |
5460 | */ | |
5461 | ||
5462 | static void alc280_fixup_hp_9480m(struct hda_codec *codec, | |
5463 | const struct hda_fixup *fix, | |
5464 | int action) | |
5465 | { | |
5466 | struct alc_spec *spec = codec->spec; | |
5467 | static const struct hda_verb gpio_init[] = { | |
5468 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, | |
5469 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, | |
5470 | {} | |
5471 | }; | |
5472 | ||
5473 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
5474 | /* Set the hooks to turn the headphone amp on/off | |
5475 | * as needed | |
5476 | */ | |
5477 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; | |
5478 | spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; | |
5479 | ||
5480 | /* The GPIOs are currently off */ | |
5481 | spec->gpio_led = 0; | |
5482 | ||
5483 | /* GPIO3 is connected to the output mute LED, | |
5484 | * high is on, low is off | |
5485 | */ | |
5486 | spec->mute_led_polarity = 0; | |
5487 | spec->gpio_mute_led_mask = 0x08; | |
5488 | ||
5489 | /* Initialize GPIO configuration */ | |
5490 | snd_hda_add_verbs(codec, gpio_init); | |
5491 | } | |
5492 | } | |
5493 | ||
ca169cc2 KY |
5494 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, |
5495 | const struct hda_fixup *fix, | |
5496 | int action) | |
5497 | { | |
5498 | alc_fixup_dual_codecs(codec, fix, action); | |
5499 | switch (action) { | |
5500 | case HDA_FIXUP_ACT_PRE_PROBE: | |
5501 | /* override card longname to provide a unique UCM profile */ | |
5502 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); | |
5503 | break; | |
5504 | case HDA_FIXUP_ACT_BUILD: | |
5505 | /* rename Capture controls depending on the codec */ | |
5506 | rename_ctl(codec, "Capture Volume", | |
5507 | codec->addr == 0 ? | |
5508 | "Rear-Panel Capture Volume" : | |
5509 | "Front-Panel Capture Volume"); | |
5510 | rename_ctl(codec, "Capture Switch", | |
5511 | codec->addr == 0 ? | |
5512 | "Rear-Panel Capture Switch" : | |
5513 | "Front-Panel Capture Switch"); | |
5514 | break; | |
5515 | } | |
5516 | } | |
5517 | ||
92266651 KY |
5518 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ |
5519 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, | |
5520 | const struct hda_fixup *fix, int action) | |
5521 | { | |
5522 | struct alc_spec *spec = codec->spec; | |
5523 | static hda_nid_t preferred_pairs[] = { | |
5524 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, | |
5525 | 0 | |
5526 | }; | |
5527 | ||
5528 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
5529 | return; | |
5530 | ||
5531 | spec->gen.preferred_dacs = preferred_pairs; | |
fde563b0 KY |
5532 | spec->gen.auto_mute_via_amp = 1; |
5533 | codec->power_save_node = 0; | |
92266651 KY |
5534 | } |
5535 | ||
ea7118da HW |
5536 | /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ |
5537 | static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, | |
5538 | const struct hda_fixup *fix, int action) | |
5539 | { | |
5540 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | |
5541 | return; | |
5542 | ||
5543 | snd_hda_override_wcaps(codec, 0x03, 0); | |
5544 | } | |
5545 | ||
f4ccb37c KY |
5546 | static void alc_fixup_disable_mic_vref(struct hda_codec *codec, |
5547 | const struct hda_fixup *fix, int action) | |
5548 | { | |
5549 | if (action == HDA_FIXUP_ACT_PRE_PROBE) | |
5550 | snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); | |
5551 | } | |
5552 | ||
b317b032 TI |
5553 | /* for hda_fixup_thinkpad_acpi() */ |
5554 | #include "thinkpad_helper.c" | |
b67ae3f1 | 5555 | |
2ae22638 TI |
5556 | static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, |
5557 | const struct hda_fixup *fix, int action) | |
5558 | { | |
5559 | alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ | |
5560 | hda_fixup_thinkpad_acpi(codec, fix, action); | |
5561 | } | |
5562 | ||
00ef9940 HW |
5563 | /* for dell wmi mic mute led */ |
5564 | #include "dell_wmi_helper.c" | |
5565 | ||
1d045db9 TI |
5566 | enum { |
5567 | ALC269_FIXUP_SONY_VAIO, | |
5568 | ALC275_FIXUP_SONY_VAIO_GPIO2, | |
5569 | ALC269_FIXUP_DELL_M101Z, | |
5570 | ALC269_FIXUP_SKU_IGNORE, | |
5571 | ALC269_FIXUP_ASUS_G73JW, | |
5572 | ALC269_FIXUP_LENOVO_EAPD, | |
5573 | ALC275_FIXUP_SONY_HWEQ, | |
e9bd7d5c | 5574 | ALC275_FIXUP_SONY_DISABLE_AAMIX, |
1d045db9 | 5575 | ALC271_FIXUP_DMIC, |
017f2a10 | 5576 | ALC269_FIXUP_PCM_44K, |
adabb3ec | 5577 | ALC269_FIXUP_STEREO_DMIC, |
7c478f03 | 5578 | ALC269_FIXUP_HEADSET_MIC, |
24519911 TI |
5579 | ALC269_FIXUP_QUANTA_MUTE, |
5580 | ALC269_FIXUP_LIFEBOOK, | |
2041d564 | 5581 | ALC269_FIXUP_LIFEBOOK_EXTMIC, |
cc7016ab | 5582 | ALC269_FIXUP_LIFEBOOK_HP_PIN, |
4df3fd17 | 5583 | ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, |
0dcd451c | 5584 | ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, |
a4297b5d TI |
5585 | ALC269_FIXUP_AMIC, |
5586 | ALC269_FIXUP_DMIC, | |
5587 | ALC269VB_FIXUP_AMIC, | |
5588 | ALC269VB_FIXUP_DMIC, | |
08fb0d0e | 5589 | ALC269_FIXUP_HP_MUTE_LED, |
d06ac143 | 5590 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
08fb0d0e | 5591 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
9f5c6faf | 5592 | ALC269_FIXUP_HP_GPIO_LED, |
9c5dc3bf KY |
5593 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
5594 | ALC269_FIXUP_HP_LINE1_MIC1_LED, | |
693b613d | 5595 | ALC269_FIXUP_INV_DMIC, |
108cc108 | 5596 | ALC269_FIXUP_LENOVO_DOCK, |
9b745ab8 | 5597 | ALC269_FIXUP_NO_SHUTUP, |
88cfcf86 | 5598 | ALC286_FIXUP_SONY_MIC_NO_PRESENCE, |
108cc108 | 5599 | ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, |
73bdd597 DH |
5600 | ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
5601 | ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, | |
338cae56 | 5602 | ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
fcc6c877 | 5603 | ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
73bdd597 DH |
5604 | ALC269_FIXUP_HEADSET_MODE, |
5605 | ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, | |
7819717b | 5606 | ALC269_FIXUP_ASPIRE_HEADSET_MIC, |
d240d1dc DH |
5607 | ALC269_FIXUP_ASUS_X101_FUNC, |
5608 | ALC269_FIXUP_ASUS_X101_VERB, | |
5609 | ALC269_FIXUP_ASUS_X101, | |
08a978db DR |
5610 | ALC271_FIXUP_AMIC_MIC2, |
5611 | ALC271_FIXUP_HP_GATE_MIC_JACK, | |
b1e8972e | 5612 | ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, |
42397004 | 5613 | ALC269_FIXUP_ACER_AC700, |
3e0d611b | 5614 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, |
2cede303 | 5615 | ALC269VB_FIXUP_ASUS_ZENBOOK, |
23870831 | 5616 | ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, |
8e35cd4a | 5617 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, |
02b504d9 | 5618 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
cd217a63 | 5619 | ALC283_FIXUP_CHROME_BOOK, |
0202e99c | 5620 | ALC283_FIXUP_SENSE_COMBO_JACK, |
7bba2157 | 5621 | ALC282_FIXUP_ASUS_TX300, |
1bb3e062 | 5622 | ALC283_FIXUP_INT_MIC, |
338cae56 | 5623 | ALC290_FIXUP_MONO_SPEAKERS, |
0f4881dc DH |
5624 | ALC290_FIXUP_MONO_SPEAKERS_HSJACK, |
5625 | ALC290_FIXUP_SUBWOOFER, | |
5626 | ALC290_FIXUP_SUBWOOFER_HSJACK, | |
b67ae3f1 | 5627 | ALC269_FIXUP_THINKPAD_ACPI, |
56f27013 | 5628 | ALC269_FIXUP_DMIC_THINKPAD_ACPI, |
5824ce8d | 5629 | ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
615966ad | 5630 | ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
9a22a8f5 | 5631 | ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
31278997 | 5632 | ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
9a22a8f5 | 5633 | ALC255_FIXUP_HEADSET_MODE, |
31278997 | 5634 | ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, |
a22aa26f | 5635 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
1c37c223 | 5636 | ALC292_FIXUP_TPT440_DOCK, |
9a811230 | 5637 | ALC292_FIXUP_TPT440, |
abaa2274 | 5638 | ALC283_FIXUP_HEADSET_MIC, |
00ef9940 | 5639 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, |
1a22e775 | 5640 | ALC282_FIXUP_ASPIRE_V5_PINS, |
7a5255f1 | 5641 | ALC280_FIXUP_HP_GPIO4, |
eaa8e5ef | 5642 | ALC286_FIXUP_HP_GPIO_LED, |
33f4acd3 | 5643 | ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, |
b4b33f9d | 5644 | ALC280_FIXUP_HP_DOCK_PINS, |
04d5466a | 5645 | ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, |
98973f2f | 5646 | ALC280_FIXUP_HP_9480M, |
e1e62b98 KY |
5647 | ALC288_FIXUP_DELL_HEADSET_MODE, |
5648 | ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, | |
5649 | ALC288_FIXUP_DELL_XPS_13_GPIO6, | |
831bfdf9 HW |
5650 | ALC288_FIXUP_DELL_XPS_13, |
5651 | ALC288_FIXUP_DISABLE_AAMIX, | |
8b99aba7 TI |
5652 | ALC292_FIXUP_DELL_E7X, |
5653 | ALC292_FIXUP_DISABLE_AAMIX, | |
c04017ea | 5654 | ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, |
977e6276 | 5655 | ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
2f726aec | 5656 | ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
6ed1131f | 5657 | ALC275_FIXUP_DELL_XPS, |
8c69729b | 5658 | ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, |
23adc192 | 5659 | ALC293_FIXUP_LENOVO_SPK_NOISE, |
3694cb29 | 5660 | ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
3b43b71f | 5661 | ALC255_FIXUP_DELL_SPK_NOISE, |
f4ccb37c | 5662 | ALC225_FIXUP_DISABLE_MIC_VREF, |
2ae95577 | 5663 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
214839a8 | 5664 | ALC295_FIXUP_DISABLE_DAC3, |
f883982d | 5665 | ALC280_FIXUP_HP_HEADSET_MIC, |
e549d190 | 5666 | ALC221_FIXUP_HP_FRONT_MIC, |
c636b95e | 5667 | ALC292_FIXUP_TPT460, |
dd9aa335 | 5668 | ALC298_FIXUP_SPK_VOLUME, |
fd06c77e | 5669 | ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, |
823ff161 | 5670 | ALC269_FIXUP_ATIV_BOOK_8, |
9eb5d0e6 | 5671 | ALC221_FIXUP_HP_MIC_NO_PRESENCE, |
c1732ede CC |
5672 | ALC256_FIXUP_ASUS_HEADSET_MODE, |
5673 | ALC256_FIXUP_ASUS_MIC, | |
eeed4cd1 | 5674 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
216d7aeb CC |
5675 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
5676 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, | |
ca169cc2 | 5677 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
f33f79f3 | 5678 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
9423a273 | 5679 | ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, |
b84e8436 | 5680 | ALC700_FIXUP_INTEL_REFERENCE, |
92266651 KY |
5681 | ALC274_FIXUP_DELL_BIND_DACS, |
5682 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, | |
114745cd | 5683 | ALC298_FIXUP_TPT470_DOCK, |
9cfdabca | 5684 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
4c574ad4 | 5685 | ALC255_FIXUP_DELL_HEADSET_MIC, |
32e2ee86 | 5686 | ALC221_FIXUP_HP_HEADSET_MIC, |
ea7118da | 5687 | ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, |
9c54c712 | 5688 | ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
0a60c116 | 5689 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
09416ef0 | 5690 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
dad6c4f4 | 5691 | ALC294_FIXUP_ASUS_MIC, |
7398055e JHP |
5692 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
5693 | ALC294_FIXUP_ASUS_SPK, | |
20616fb0 KY |
5694 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, |
5695 | ALC225_FIXUP_WYSE_AUTO_MUTE, | |
5696 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, | |
1a1fcf1f | 5697 | ALC286_FIXUP_ACER_AIO_HEADSET_MIC, |
4f7f74da | 5698 | ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
128a4c8d | 5699 | ALC299_FIXUP_PREDATOR_SPK, |
f1d4e28b KY |
5700 | }; |
5701 | ||
1727a771 | 5702 | static const struct hda_fixup alc269_fixups[] = { |
1d045db9 | 5703 | [ALC269_FIXUP_SONY_VAIO] = { |
fd108215 TI |
5704 | .type = HDA_FIXUP_PINCTLS, |
5705 | .v.pins = (const struct hda_pintbl[]) { | |
5706 | {0x19, PIN_VREFGRD}, | |
1d045db9 TI |
5707 | {} |
5708 | } | |
f1d4e28b | 5709 | }, |
1d045db9 | 5710 | [ALC275_FIXUP_SONY_VAIO_GPIO2] = { |
1727a771 | 5711 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
5712 | .v.verbs = (const struct hda_verb[]) { |
5713 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, | |
5714 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, | |
5715 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, | |
5716 | { } | |
5717 | }, | |
5718 | .chained = true, | |
5719 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
5720 | }, | |
5721 | [ALC269_FIXUP_DELL_M101Z] = { | |
1727a771 | 5722 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
5723 | .v.verbs = (const struct hda_verb[]) { |
5724 | /* Enables internal speaker */ | |
5725 | {0x20, AC_VERB_SET_COEF_INDEX, 13}, | |
5726 | {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, | |
5727 | {} | |
5728 | } | |
5729 | }, | |
5730 | [ALC269_FIXUP_SKU_IGNORE] = { | |
1727a771 | 5731 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 5732 | .v.func = alc_fixup_sku_ignore, |
1d045db9 TI |
5733 | }, |
5734 | [ALC269_FIXUP_ASUS_G73JW] = { | |
1727a771 TI |
5735 | .type = HDA_FIXUP_PINS, |
5736 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
5737 | { 0x17, 0x99130111 }, /* subwoofer */ |
5738 | { } | |
5739 | } | |
5740 | }, | |
5741 | [ALC269_FIXUP_LENOVO_EAPD] = { | |
1727a771 | 5742 | .type = HDA_FIXUP_VERBS, |
1d045db9 TI |
5743 | .v.verbs = (const struct hda_verb[]) { |
5744 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
5745 | {} | |
5746 | } | |
5747 | }, | |
5748 | [ALC275_FIXUP_SONY_HWEQ] = { | |
1727a771 | 5749 | .type = HDA_FIXUP_FUNC, |
1d045db9 TI |
5750 | .v.func = alc269_fixup_hweq, |
5751 | .chained = true, | |
5752 | .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 | |
5753 | }, | |
e9bd7d5c TI |
5754 | [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { |
5755 | .type = HDA_FIXUP_FUNC, | |
5756 | .v.func = alc_fixup_disable_aamix, | |
5757 | .chained = true, | |
5758 | .chain_id = ALC269_FIXUP_SONY_VAIO | |
5759 | }, | |
1d045db9 | 5760 | [ALC271_FIXUP_DMIC] = { |
1727a771 | 5761 | .type = HDA_FIXUP_FUNC, |
1d045db9 | 5762 | .v.func = alc271_fixup_dmic, |
f1d4e28b | 5763 | }, |
017f2a10 | 5764 | [ALC269_FIXUP_PCM_44K] = { |
1727a771 | 5765 | .type = HDA_FIXUP_FUNC, |
017f2a10 | 5766 | .v.func = alc269_fixup_pcm_44k, |
012e7eb1 DH |
5767 | .chained = true, |
5768 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
017f2a10 | 5769 | }, |
adabb3ec | 5770 | [ALC269_FIXUP_STEREO_DMIC] = { |
1727a771 | 5771 | .type = HDA_FIXUP_FUNC, |
adabb3ec TI |
5772 | .v.func = alc269_fixup_stereo_dmic, |
5773 | }, | |
7c478f03 DH |
5774 | [ALC269_FIXUP_HEADSET_MIC] = { |
5775 | .type = HDA_FIXUP_FUNC, | |
5776 | .v.func = alc269_fixup_headset_mic, | |
5777 | }, | |
24519911 | 5778 | [ALC269_FIXUP_QUANTA_MUTE] = { |
1727a771 | 5779 | .type = HDA_FIXUP_FUNC, |
24519911 TI |
5780 | .v.func = alc269_fixup_quanta_mute, |
5781 | }, | |
5782 | [ALC269_FIXUP_LIFEBOOK] = { | |
1727a771 TI |
5783 | .type = HDA_FIXUP_PINS, |
5784 | .v.pins = (const struct hda_pintbl[]) { | |
24519911 TI |
5785 | { 0x1a, 0x2101103f }, /* dock line-out */ |
5786 | { 0x1b, 0x23a11040 }, /* dock mic-in */ | |
5787 | { } | |
5788 | }, | |
5789 | .chained = true, | |
5790 | .chain_id = ALC269_FIXUP_QUANTA_MUTE | |
5791 | }, | |
2041d564 DH |
5792 | [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { |
5793 | .type = HDA_FIXUP_PINS, | |
5794 | .v.pins = (const struct hda_pintbl[]) { | |
5795 | { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ | |
5796 | { } | |
5797 | }, | |
5798 | }, | |
cc7016ab TI |
5799 | [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { |
5800 | .type = HDA_FIXUP_PINS, | |
5801 | .v.pins = (const struct hda_pintbl[]) { | |
5802 | { 0x21, 0x0221102f }, /* HP out */ | |
5803 | { } | |
5804 | }, | |
5805 | }, | |
4df3fd17 TI |
5806 | [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { |
5807 | .type = HDA_FIXUP_FUNC, | |
5808 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, | |
5809 | }, | |
0dcd451c JMG |
5810 | [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { |
5811 | .type = HDA_FIXUP_FUNC, | |
5812 | .v.func = alc269_fixup_pincfg_U7x7_headset_mic, | |
5813 | }, | |
a4297b5d | 5814 | [ALC269_FIXUP_AMIC] = { |
1727a771 TI |
5815 | .type = HDA_FIXUP_PINS, |
5816 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
5817 | { 0x14, 0x99130110 }, /* speaker */ |
5818 | { 0x15, 0x0121401f }, /* HP out */ | |
5819 | { 0x18, 0x01a19c20 }, /* mic */ | |
5820 | { 0x19, 0x99a3092f }, /* int-mic */ | |
5821 | { } | |
5822 | }, | |
5823 | }, | |
5824 | [ALC269_FIXUP_DMIC] = { | |
1727a771 TI |
5825 | .type = HDA_FIXUP_PINS, |
5826 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
5827 | { 0x12, 0x99a3092f }, /* int-mic */ |
5828 | { 0x14, 0x99130110 }, /* speaker */ | |
5829 | { 0x15, 0x0121401f }, /* HP out */ | |
5830 | { 0x18, 0x01a19c20 }, /* mic */ | |
5831 | { } | |
5832 | }, | |
5833 | }, | |
5834 | [ALC269VB_FIXUP_AMIC] = { | |
1727a771 TI |
5835 | .type = HDA_FIXUP_PINS, |
5836 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
5837 | { 0x14, 0x99130110 }, /* speaker */ |
5838 | { 0x18, 0x01a19c20 }, /* mic */ | |
5839 | { 0x19, 0x99a3092f }, /* int-mic */ | |
5840 | { 0x21, 0x0121401f }, /* HP out */ | |
5841 | { } | |
5842 | }, | |
5843 | }, | |
2267ea97 | 5844 | [ALC269VB_FIXUP_DMIC] = { |
1727a771 TI |
5845 | .type = HDA_FIXUP_PINS, |
5846 | .v.pins = (const struct hda_pintbl[]) { | |
a4297b5d TI |
5847 | { 0x12, 0x99a3092f }, /* int-mic */ |
5848 | { 0x14, 0x99130110 }, /* speaker */ | |
5849 | { 0x18, 0x01a19c20 }, /* mic */ | |
5850 | { 0x21, 0x0121401f }, /* HP out */ | |
5851 | { } | |
5852 | }, | |
5853 | }, | |
08fb0d0e | 5854 | [ALC269_FIXUP_HP_MUTE_LED] = { |
1727a771 | 5855 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 5856 | .v.func = alc269_fixup_hp_mute_led, |
6d3cd5d4 | 5857 | }, |
d06ac143 DH |
5858 | [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { |
5859 | .type = HDA_FIXUP_FUNC, | |
5860 | .v.func = alc269_fixup_hp_mute_led_mic1, | |
5861 | }, | |
08fb0d0e | 5862 | [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { |
1727a771 | 5863 | .type = HDA_FIXUP_FUNC, |
08fb0d0e | 5864 | .v.func = alc269_fixup_hp_mute_led_mic2, |
420b0feb | 5865 | }, |
9f5c6faf TI |
5866 | [ALC269_FIXUP_HP_GPIO_LED] = { |
5867 | .type = HDA_FIXUP_FUNC, | |
5868 | .v.func = alc269_fixup_hp_gpio_led, | |
5869 | }, | |
9c5dc3bf KY |
5870 | [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { |
5871 | .type = HDA_FIXUP_FUNC, | |
5872 | .v.func = alc269_fixup_hp_gpio_mic1_led, | |
5873 | }, | |
5874 | [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { | |
5875 | .type = HDA_FIXUP_FUNC, | |
5876 | .v.func = alc269_fixup_hp_line1_mic1_led, | |
5877 | }, | |
693b613d | 5878 | [ALC269_FIXUP_INV_DMIC] = { |
1727a771 | 5879 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 5880 | .v.func = alc_fixup_inv_dmic, |
693b613d | 5881 | }, |
9b745ab8 TI |
5882 | [ALC269_FIXUP_NO_SHUTUP] = { |
5883 | .type = HDA_FIXUP_FUNC, | |
5884 | .v.func = alc_fixup_no_shutup, | |
5885 | }, | |
108cc108 | 5886 | [ALC269_FIXUP_LENOVO_DOCK] = { |
1727a771 TI |
5887 | .type = HDA_FIXUP_PINS, |
5888 | .v.pins = (const struct hda_pintbl[]) { | |
108cc108 DH |
5889 | { 0x19, 0x23a11040 }, /* dock mic */ |
5890 | { 0x1b, 0x2121103f }, /* dock headphone */ | |
5891 | { } | |
5892 | }, | |
5893 | .chained = true, | |
5894 | .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT | |
5895 | }, | |
5896 | [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { | |
1727a771 | 5897 | .type = HDA_FIXUP_FUNC, |
108cc108 | 5898 | .v.func = alc269_fixup_pincfg_no_hp_to_lineout, |
52129000 DH |
5899 | .chained = true, |
5900 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
108cc108 | 5901 | }, |
73bdd597 DH |
5902 | [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
5903 | .type = HDA_FIXUP_PINS, | |
5904 | .v.pins = (const struct hda_pintbl[]) { | |
5905 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
5906 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
5907 | { } | |
5908 | }, | |
5909 | .chained = true, | |
5910 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
5911 | }, | |
5912 | [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { | |
5913 | .type = HDA_FIXUP_PINS, | |
5914 | .v.pins = (const struct hda_pintbl[]) { | |
5915 | { 0x16, 0x21014020 }, /* dock line out */ | |
5916 | { 0x19, 0x21a19030 }, /* dock mic */ | |
5917 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
5918 | { } | |
5919 | }, | |
5920 | .chained = true, | |
5921 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
5922 | }, | |
338cae56 DH |
5923 | [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { |
5924 | .type = HDA_FIXUP_PINS, | |
5925 | .v.pins = (const struct hda_pintbl[]) { | |
5926 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
5927 | { } | |
5928 | }, | |
5929 | .chained = true, | |
5930 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
5931 | }, | |
fcc6c877 KY |
5932 | [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { |
5933 | .type = HDA_FIXUP_PINS, | |
5934 | .v.pins = (const struct hda_pintbl[]) { | |
5935 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
5936 | { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
5937 | { } | |
5938 | }, | |
5939 | .chained = true, | |
5940 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
5941 | }, | |
73bdd597 DH |
5942 | [ALC269_FIXUP_HEADSET_MODE] = { |
5943 | .type = HDA_FIXUP_FUNC, | |
5944 | .v.func = alc_fixup_headset_mode, | |
6676f308 HW |
5945 | .chained = true, |
5946 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED | |
73bdd597 DH |
5947 | }, |
5948 | [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { | |
5949 | .type = HDA_FIXUP_FUNC, | |
5950 | .v.func = alc_fixup_headset_mode_no_hp_mic, | |
5951 | }, | |
7819717b TI |
5952 | [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { |
5953 | .type = HDA_FIXUP_PINS, | |
5954 | .v.pins = (const struct hda_pintbl[]) { | |
5955 | { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ | |
5956 | { } | |
5957 | }, | |
5958 | .chained = true, | |
5959 | .chain_id = ALC269_FIXUP_HEADSET_MODE, | |
5960 | }, | |
88cfcf86 DH |
5961 | [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { |
5962 | .type = HDA_FIXUP_PINS, | |
5963 | .v.pins = (const struct hda_pintbl[]) { | |
5964 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
5965 | { } | |
5966 | }, | |
fbc78ad6 DH |
5967 | .chained = true, |
5968 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
88cfcf86 | 5969 | }, |
d240d1dc DH |
5970 | [ALC269_FIXUP_ASUS_X101_FUNC] = { |
5971 | .type = HDA_FIXUP_FUNC, | |
5972 | .v.func = alc269_fixup_x101_headset_mic, | |
5973 | }, | |
5974 | [ALC269_FIXUP_ASUS_X101_VERB] = { | |
5975 | .type = HDA_FIXUP_VERBS, | |
5976 | .v.verbs = (const struct hda_verb[]) { | |
5977 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, | |
5978 | {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, | |
5979 | {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, | |
5980 | { } | |
5981 | }, | |
5982 | .chained = true, | |
5983 | .chain_id = ALC269_FIXUP_ASUS_X101_FUNC | |
5984 | }, | |
5985 | [ALC269_FIXUP_ASUS_X101] = { | |
5986 | .type = HDA_FIXUP_PINS, | |
5987 | .v.pins = (const struct hda_pintbl[]) { | |
5988 | { 0x18, 0x04a1182c }, /* Headset mic */ | |
5989 | { } | |
5990 | }, | |
5991 | .chained = true, | |
5992 | .chain_id = ALC269_FIXUP_ASUS_X101_VERB | |
5993 | }, | |
08a978db | 5994 | [ALC271_FIXUP_AMIC_MIC2] = { |
1727a771 TI |
5995 | .type = HDA_FIXUP_PINS, |
5996 | .v.pins = (const struct hda_pintbl[]) { | |
08a978db DR |
5997 | { 0x14, 0x99130110 }, /* speaker */ |
5998 | { 0x19, 0x01a19c20 }, /* mic */ | |
5999 | { 0x1b, 0x99a7012f }, /* int-mic */ | |
6000 | { 0x21, 0x0121401f }, /* HP out */ | |
6001 | { } | |
6002 | }, | |
6003 | }, | |
6004 | [ALC271_FIXUP_HP_GATE_MIC_JACK] = { | |
1727a771 | 6005 | .type = HDA_FIXUP_FUNC, |
08a978db DR |
6006 | .v.func = alc271_hp_gate_mic_jack, |
6007 | .chained = true, | |
6008 | .chain_id = ALC271_FIXUP_AMIC_MIC2, | |
6009 | }, | |
b1e8972e OR |
6010 | [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { |
6011 | .type = HDA_FIXUP_FUNC, | |
6012 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6013 | .chained = true, | |
6014 | .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, | |
6015 | }, | |
42397004 DR |
6016 | [ALC269_FIXUP_ACER_AC700] = { |
6017 | .type = HDA_FIXUP_PINS, | |
6018 | .v.pins = (const struct hda_pintbl[]) { | |
6019 | { 0x12, 0x99a3092f }, /* int-mic */ | |
6020 | { 0x14, 0x99130110 }, /* speaker */ | |
6021 | { 0x18, 0x03a11c20 }, /* mic */ | |
6022 | { 0x1e, 0x0346101e }, /* SPDIF1 */ | |
6023 | { 0x21, 0x0321101f }, /* HP out */ | |
6024 | { } | |
6025 | }, | |
6026 | .chained = true, | |
6027 | .chain_id = ALC271_FIXUP_DMIC, | |
6028 | }, | |
3e0d611b DH |
6029 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { |
6030 | .type = HDA_FIXUP_FUNC, | |
6031 | .v.func = alc269_fixup_limit_int_mic_boost, | |
2793769f DH |
6032 | .chained = true, |
6033 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
3e0d611b | 6034 | }, |
2cede303 OR |
6035 | [ALC269VB_FIXUP_ASUS_ZENBOOK] = { |
6036 | .type = HDA_FIXUP_FUNC, | |
6037 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6038 | .chained = true, | |
6039 | .chain_id = ALC269VB_FIXUP_DMIC, | |
6040 | }, | |
23870831 TI |
6041 | [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { |
6042 | .type = HDA_FIXUP_VERBS, | |
6043 | .v.verbs = (const struct hda_verb[]) { | |
6044 | /* class-D output amp +5dB */ | |
6045 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, | |
6046 | { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, | |
6047 | {} | |
6048 | }, | |
6049 | .chained = true, | |
6050 | .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, | |
6051 | }, | |
8e35cd4a DH |
6052 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { |
6053 | .type = HDA_FIXUP_FUNC, | |
6054 | .v.func = alc269_fixup_limit_int_mic_boost, | |
6055 | .chained = true, | |
6056 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
6057 | }, | |
02b504d9 AA |
6058 | [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { |
6059 | .type = HDA_FIXUP_PINS, | |
6060 | .v.pins = (const struct hda_pintbl[]) { | |
6061 | { 0x12, 0x99a3092f }, /* int-mic */ | |
6062 | { 0x18, 0x03a11d20 }, /* mic */ | |
6063 | { 0x19, 0x411111f0 }, /* Unused bogus pin */ | |
6064 | { } | |
6065 | }, | |
6066 | }, | |
cd217a63 KY |
6067 | [ALC283_FIXUP_CHROME_BOOK] = { |
6068 | .type = HDA_FIXUP_FUNC, | |
6069 | .v.func = alc283_fixup_chromebook, | |
6070 | }, | |
0202e99c KY |
6071 | [ALC283_FIXUP_SENSE_COMBO_JACK] = { |
6072 | .type = HDA_FIXUP_FUNC, | |
6073 | .v.func = alc283_fixup_sense_combo_jack, | |
6074 | .chained = true, | |
6075 | .chain_id = ALC283_FIXUP_CHROME_BOOK, | |
6076 | }, | |
7bba2157 TI |
6077 | [ALC282_FIXUP_ASUS_TX300] = { |
6078 | .type = HDA_FIXUP_FUNC, | |
6079 | .v.func = alc282_fixup_asus_tx300, | |
6080 | }, | |
1bb3e062 KY |
6081 | [ALC283_FIXUP_INT_MIC] = { |
6082 | .type = HDA_FIXUP_VERBS, | |
6083 | .v.verbs = (const struct hda_verb[]) { | |
6084 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, | |
6085 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, | |
6086 | { } | |
6087 | }, | |
6088 | .chained = true, | |
6089 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
6090 | }, | |
0f4881dc DH |
6091 | [ALC290_FIXUP_SUBWOOFER_HSJACK] = { |
6092 | .type = HDA_FIXUP_PINS, | |
6093 | .v.pins = (const struct hda_pintbl[]) { | |
6094 | { 0x17, 0x90170112 }, /* subwoofer */ | |
6095 | { } | |
6096 | }, | |
6097 | .chained = true, | |
6098 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, | |
6099 | }, | |
6100 | [ALC290_FIXUP_SUBWOOFER] = { | |
6101 | .type = HDA_FIXUP_PINS, | |
6102 | .v.pins = (const struct hda_pintbl[]) { | |
6103 | { 0x17, 0x90170112 }, /* subwoofer */ | |
6104 | { } | |
6105 | }, | |
6106 | .chained = true, | |
6107 | .chain_id = ALC290_FIXUP_MONO_SPEAKERS, | |
6108 | }, | |
338cae56 DH |
6109 | [ALC290_FIXUP_MONO_SPEAKERS] = { |
6110 | .type = HDA_FIXUP_FUNC, | |
6111 | .v.func = alc290_fixup_mono_speakers, | |
0f4881dc DH |
6112 | }, |
6113 | [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { | |
6114 | .type = HDA_FIXUP_FUNC, | |
6115 | .v.func = alc290_fixup_mono_speakers, | |
338cae56 DH |
6116 | .chained = true, |
6117 | .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, | |
6118 | }, | |
b67ae3f1 DH |
6119 | [ALC269_FIXUP_THINKPAD_ACPI] = { |
6120 | .type = HDA_FIXUP_FUNC, | |
2ae22638 | 6121 | .v.func = alc_fixup_thinkpad_acpi, |
09da111a TI |
6122 | .chained = true, |
6123 | .chain_id = ALC269_FIXUP_SKU_IGNORE, | |
b67ae3f1 | 6124 | }, |
56f27013 DH |
6125 | [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { |
6126 | .type = HDA_FIXUP_FUNC, | |
6127 | .v.func = alc_fixup_inv_dmic, | |
6128 | .chained = true, | |
6129 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI, | |
6130 | }, | |
5824ce8d CC |
6131 | [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { |
6132 | .type = HDA_FIXUP_PINS, | |
6133 | .v.pins = (const struct hda_pintbl[]) { | |
6134 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6135 | { } | |
6136 | }, | |
6137 | .chained = true, | |
6138 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
6139 | }, | |
615966ad CC |
6140 | [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
6141 | .type = HDA_FIXUP_PINS, | |
6142 | .v.pins = (const struct hda_pintbl[]) { | |
6143 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6144 | { } | |
6145 | }, | |
6146 | .chained = true, | |
6147 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
6148 | }, | |
9a22a8f5 KY |
6149 | [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6150 | .type = HDA_FIXUP_PINS, | |
6151 | .v.pins = (const struct hda_pintbl[]) { | |
6152 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6153 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6154 | { } | |
6155 | }, | |
6156 | .chained = true, | |
6157 | .chain_id = ALC255_FIXUP_HEADSET_MODE | |
6158 | }, | |
31278997 KY |
6159 | [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { |
6160 | .type = HDA_FIXUP_PINS, | |
6161 | .v.pins = (const struct hda_pintbl[]) { | |
6162 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6163 | { } | |
6164 | }, | |
6165 | .chained = true, | |
6166 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6167 | }, | |
9a22a8f5 KY |
6168 | [ALC255_FIXUP_HEADSET_MODE] = { |
6169 | .type = HDA_FIXUP_FUNC, | |
6170 | .v.func = alc_fixup_headset_mode_alc255, | |
4a83d42a HW |
6171 | .chained = true, |
6172 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED | |
9a22a8f5 | 6173 | }, |
31278997 KY |
6174 | [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { |
6175 | .type = HDA_FIXUP_FUNC, | |
6176 | .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, | |
6177 | }, | |
a22aa26f KY |
6178 | [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6179 | .type = HDA_FIXUP_PINS, | |
6180 | .v.pins = (const struct hda_pintbl[]) { | |
6181 | { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6182 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6183 | { } | |
6184 | }, | |
6185 | .chained = true, | |
6186 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6187 | }, | |
1c37c223 | 6188 | [ALC292_FIXUP_TPT440_DOCK] = { |
ec56af67 | 6189 | .type = HDA_FIXUP_FUNC, |
7f57d803 | 6190 | .v.func = alc_fixup_tpt440_dock, |
1c37c223 TI |
6191 | .chained = true, |
6192 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | |
6193 | }, | |
9a811230 TI |
6194 | [ALC292_FIXUP_TPT440] = { |
6195 | .type = HDA_FIXUP_FUNC, | |
157f0b7f | 6196 | .v.func = alc_fixup_disable_aamix, |
9a811230 TI |
6197 | .chained = true, |
6198 | .chain_id = ALC292_FIXUP_TPT440_DOCK, | |
6199 | }, | |
abaa2274 | 6200 | [ALC283_FIXUP_HEADSET_MIC] = { |
9dc12862 DD |
6201 | .type = HDA_FIXUP_PINS, |
6202 | .v.pins = (const struct hda_pintbl[]) { | |
6203 | { 0x19, 0x04a110f0 }, | |
6204 | { }, | |
6205 | }, | |
6206 | }, | |
00ef9940 HW |
6207 | [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED] = { |
6208 | .type = HDA_FIXUP_FUNC, | |
6209 | .v.func = alc_fixup_dell_wmi, | |
00ef9940 | 6210 | }, |
1a22e775 TI |
6211 | [ALC282_FIXUP_ASPIRE_V5_PINS] = { |
6212 | .type = HDA_FIXUP_PINS, | |
6213 | .v.pins = (const struct hda_pintbl[]) { | |
6214 | { 0x12, 0x90a60130 }, | |
6215 | { 0x14, 0x90170110 }, | |
6216 | { 0x17, 0x40000008 }, | |
6217 | { 0x18, 0x411111f0 }, | |
0420694d | 6218 | { 0x19, 0x01a1913c }, |
1a22e775 TI |
6219 | { 0x1a, 0x411111f0 }, |
6220 | { 0x1b, 0x411111f0 }, | |
6221 | { 0x1d, 0x40f89b2d }, | |
6222 | { 0x1e, 0x411111f0 }, | |
6223 | { 0x21, 0x0321101f }, | |
6224 | { }, | |
6225 | }, | |
6226 | }, | |
7a5255f1 DH |
6227 | [ALC280_FIXUP_HP_GPIO4] = { |
6228 | .type = HDA_FIXUP_FUNC, | |
6229 | .v.func = alc280_fixup_hp_gpio4, | |
6230 | }, | |
eaa8e5ef KY |
6231 | [ALC286_FIXUP_HP_GPIO_LED] = { |
6232 | .type = HDA_FIXUP_FUNC, | |
6233 | .v.func = alc286_fixup_hp_gpio_led, | |
6234 | }, | |
33f4acd3 DH |
6235 | [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { |
6236 | .type = HDA_FIXUP_FUNC, | |
6237 | .v.func = alc280_fixup_hp_gpio2_mic_hotkey, | |
6238 | }, | |
b4b33f9d TC |
6239 | [ALC280_FIXUP_HP_DOCK_PINS] = { |
6240 | .type = HDA_FIXUP_PINS, | |
6241 | .v.pins = (const struct hda_pintbl[]) { | |
6242 | { 0x1b, 0x21011020 }, /* line-out */ | |
6243 | { 0x1a, 0x01a1903c }, /* headset mic */ | |
6244 | { 0x18, 0x2181103f }, /* line-in */ | |
6245 | { }, | |
6246 | }, | |
6247 | .chained = true, | |
6248 | .chain_id = ALC280_FIXUP_HP_GPIO4 | |
6249 | }, | |
04d5466a JK |
6250 | [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { |
6251 | .type = HDA_FIXUP_PINS, | |
6252 | .v.pins = (const struct hda_pintbl[]) { | |
6253 | { 0x1b, 0x21011020 }, /* line-out */ | |
6254 | { 0x18, 0x2181103f }, /* line-in */ | |
6255 | { }, | |
6256 | }, | |
6257 | .chained = true, | |
6258 | .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED | |
6259 | }, | |
98973f2f KP |
6260 | [ALC280_FIXUP_HP_9480M] = { |
6261 | .type = HDA_FIXUP_FUNC, | |
6262 | .v.func = alc280_fixup_hp_9480m, | |
6263 | }, | |
e1e62b98 KY |
6264 | [ALC288_FIXUP_DELL_HEADSET_MODE] = { |
6265 | .type = HDA_FIXUP_FUNC, | |
6266 | .v.func = alc_fixup_headset_mode_dell_alc288, | |
6267 | .chained = true, | |
6268 | .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED | |
6269 | }, | |
6270 | [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { | |
6271 | .type = HDA_FIXUP_PINS, | |
6272 | .v.pins = (const struct hda_pintbl[]) { | |
6273 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6274 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6275 | { } | |
6276 | }, | |
6277 | .chained = true, | |
6278 | .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE | |
6279 | }, | |
6280 | [ALC288_FIXUP_DELL_XPS_13_GPIO6] = { | |
6281 | .type = HDA_FIXUP_VERBS, | |
6282 | .v.verbs = (const struct hda_verb[]) { | |
6283 | {0x01, AC_VERB_SET_GPIO_MASK, 0x40}, | |
6284 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x40}, | |
6285 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, | |
6286 | { } | |
6287 | }, | |
6288 | .chained = true, | |
6289 | .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE | |
6290 | }, | |
831bfdf9 HW |
6291 | [ALC288_FIXUP_DISABLE_AAMIX] = { |
6292 | .type = HDA_FIXUP_FUNC, | |
6293 | .v.func = alc_fixup_disable_aamix, | |
6294 | .chained = true, | |
6295 | .chain_id = ALC288_FIXUP_DELL_XPS_13_GPIO6 | |
6296 | }, | |
6297 | [ALC288_FIXUP_DELL_XPS_13] = { | |
6298 | .type = HDA_FIXUP_FUNC, | |
6299 | .v.func = alc_fixup_dell_xps13, | |
6300 | .chained = true, | |
6301 | .chain_id = ALC288_FIXUP_DISABLE_AAMIX | |
6302 | }, | |
8b99aba7 TI |
6303 | [ALC292_FIXUP_DISABLE_AAMIX] = { |
6304 | .type = HDA_FIXUP_FUNC, | |
6305 | .v.func = alc_fixup_disable_aamix, | |
831bfdf9 HW |
6306 | .chained = true, |
6307 | .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE | |
8b99aba7 | 6308 | }, |
c04017ea DH |
6309 | [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { |
6310 | .type = HDA_FIXUP_FUNC, | |
6311 | .v.func = alc_fixup_disable_aamix, | |
6312 | .chained = true, | |
6313 | .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE | |
6314 | }, | |
8b99aba7 TI |
6315 | [ALC292_FIXUP_DELL_E7X] = { |
6316 | .type = HDA_FIXUP_FUNC, | |
6317 | .v.func = alc_fixup_dell_xps13, | |
6318 | .chained = true, | |
6319 | .chain_id = ALC292_FIXUP_DISABLE_AAMIX | |
6320 | }, | |
977e6276 KY |
6321 | [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6322 | .type = HDA_FIXUP_PINS, | |
6323 | .v.pins = (const struct hda_pintbl[]) { | |
6324 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6325 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6326 | { } | |
6327 | }, | |
6328 | .chained = true, | |
6329 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6330 | }, | |
2f726aec HW |
6331 | [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { |
6332 | .type = HDA_FIXUP_PINS, | |
6333 | .v.pins = (const struct hda_pintbl[]) { | |
6334 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6335 | { } | |
6336 | }, | |
6337 | .chained = true, | |
6338 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6339 | }, | |
6ed1131f KY |
6340 | [ALC275_FIXUP_DELL_XPS] = { |
6341 | .type = HDA_FIXUP_VERBS, | |
6342 | .v.verbs = (const struct hda_verb[]) { | |
6343 | /* Enables internal speaker */ | |
6344 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, | |
6345 | {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, | |
6346 | {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, | |
6347 | {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, | |
6348 | {} | |
6349 | } | |
6350 | }, | |
8c69729b HW |
6351 | [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE] = { |
6352 | .type = HDA_FIXUP_VERBS, | |
6353 | .v.verbs = (const struct hda_verb[]) { | |
6354 | /* Disable pass-through path for FRONT 14h */ | |
6355 | {0x20, AC_VERB_SET_COEF_INDEX, 0x36}, | |
6356 | {0x20, AC_VERB_SET_PROC_COEF, 0x1737}, | |
6357 | {} | |
6358 | }, | |
6359 | .chained = true, | |
6360 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
6361 | }, | |
23adc192 HW |
6362 | [ALC293_FIXUP_LENOVO_SPK_NOISE] = { |
6363 | .type = HDA_FIXUP_FUNC, | |
6364 | .v.func = alc_fixup_disable_aamix, | |
6365 | .chained = true, | |
6366 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
6367 | }, | |
3694cb29 K |
6368 | [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { |
6369 | .type = HDA_FIXUP_FUNC, | |
6370 | .v.func = alc233_fixup_lenovo_line2_mic_hotkey, | |
6371 | }, | |
3b43b71f KHF |
6372 | [ALC255_FIXUP_DELL_SPK_NOISE] = { |
6373 | .type = HDA_FIXUP_FUNC, | |
6374 | .v.func = alc_fixup_disable_aamix, | |
6375 | .chained = true, | |
6376 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
6377 | }, | |
f4ccb37c KY |
6378 | [ALC225_FIXUP_DISABLE_MIC_VREF] = { |
6379 | .type = HDA_FIXUP_FUNC, | |
6380 | .v.func = alc_fixup_disable_mic_vref, | |
6381 | .chained = true, | |
6382 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
6383 | }, | |
2ae95577 DH |
6384 | [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { |
6385 | .type = HDA_FIXUP_VERBS, | |
6386 | .v.verbs = (const struct hda_verb[]) { | |
6387 | /* Disable pass-through path for FRONT 14h */ | |
6388 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
6389 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
6390 | {} | |
6391 | }, | |
6392 | .chained = true, | |
f4ccb37c | 6393 | .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF |
2ae95577 | 6394 | }, |
f883982d TI |
6395 | [ALC280_FIXUP_HP_HEADSET_MIC] = { |
6396 | .type = HDA_FIXUP_FUNC, | |
6397 | .v.func = alc_fixup_disable_aamix, | |
6398 | .chained = true, | |
6399 | .chain_id = ALC269_FIXUP_HEADSET_MIC, | |
6400 | }, | |
e549d190 HW |
6401 | [ALC221_FIXUP_HP_FRONT_MIC] = { |
6402 | .type = HDA_FIXUP_PINS, | |
6403 | .v.pins = (const struct hda_pintbl[]) { | |
6404 | { 0x19, 0x02a19020 }, /* Front Mic */ | |
6405 | { } | |
6406 | }, | |
6407 | }, | |
c636b95e SE |
6408 | [ALC292_FIXUP_TPT460] = { |
6409 | .type = HDA_FIXUP_FUNC, | |
6410 | .v.func = alc_fixup_tpt440_dock, | |
6411 | .chained = true, | |
6412 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, | |
6413 | }, | |
dd9aa335 HW |
6414 | [ALC298_FIXUP_SPK_VOLUME] = { |
6415 | .type = HDA_FIXUP_FUNC, | |
6416 | .v.func = alc298_fixup_speaker_volume, | |
59ec4b57 | 6417 | .chained = true, |
2f726aec | 6418 | .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, |
dd9aa335 | 6419 | }, |
214839a8 TI |
6420 | [ALC295_FIXUP_DISABLE_DAC3] = { |
6421 | .type = HDA_FIXUP_FUNC, | |
6422 | .v.func = alc295_fixup_disable_dac3, | |
6423 | }, | |
fd06c77e KHF |
6424 | [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { |
6425 | .type = HDA_FIXUP_PINS, | |
6426 | .v.pins = (const struct hda_pintbl[]) { | |
6427 | { 0x1b, 0x90170151 }, | |
6428 | { } | |
6429 | }, | |
6430 | .chained = true, | |
6431 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
6432 | }, | |
823ff161 GM |
6433 | [ALC269_FIXUP_ATIV_BOOK_8] = { |
6434 | .type = HDA_FIXUP_FUNC, | |
6435 | .v.func = alc_fixup_auto_mute_via_amp, | |
6436 | .chained = true, | |
6437 | .chain_id = ALC269_FIXUP_NO_SHUTUP | |
6438 | }, | |
9eb5d0e6 KY |
6439 | [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { |
6440 | .type = HDA_FIXUP_PINS, | |
6441 | .v.pins = (const struct hda_pintbl[]) { | |
6442 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6443 | { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ | |
6444 | { } | |
6445 | }, | |
6446 | .chained = true, | |
6447 | .chain_id = ALC269_FIXUP_HEADSET_MODE | |
6448 | }, | |
c1732ede CC |
6449 | [ALC256_FIXUP_ASUS_HEADSET_MODE] = { |
6450 | .type = HDA_FIXUP_FUNC, | |
6451 | .v.func = alc_fixup_headset_mode, | |
6452 | }, | |
6453 | [ALC256_FIXUP_ASUS_MIC] = { | |
6454 | .type = HDA_FIXUP_PINS, | |
6455 | .v.pins = (const struct hda_pintbl[]) { | |
6456 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
6457 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
6458 | { } | |
6459 | }, | |
6460 | .chained = true, | |
6461 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
6462 | }, | |
eeed4cd1 CC |
6463 | [ALC256_FIXUP_ASUS_AIO_GPIO2] = { |
6464 | .type = HDA_FIXUP_VERBS, | |
6465 | .v.verbs = (const struct hda_verb[]) { | |
6466 | /* Set up GPIO2 for the speaker amp */ | |
6467 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x04 }, | |
6468 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04 }, | |
6469 | { 0x01, AC_VERB_SET_GPIO_DATA, 0x04 }, | |
6470 | {} | |
6471 | }, | |
6472 | }, | |
216d7aeb CC |
6473 | [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
6474 | .type = HDA_FIXUP_PINS, | |
6475 | .v.pins = (const struct hda_pintbl[]) { | |
6476 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6477 | { } | |
6478 | }, | |
6479 | .chained = true, | |
6480 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
6481 | }, | |
6482 | [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { | |
6483 | .type = HDA_FIXUP_VERBS, | |
6484 | .v.verbs = (const struct hda_verb[]) { | |
6485 | /* Enables internal speaker */ | |
6486 | {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, | |
6487 | {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, | |
6488 | {} | |
6489 | }, | |
6490 | .chained = true, | |
6491 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | |
6492 | }, | |
ca169cc2 KY |
6493 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { |
6494 | .type = HDA_FIXUP_FUNC, | |
6495 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
6496 | }, | |
f33f79f3 HW |
6497 | [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { |
6498 | .type = HDA_FIXUP_PINS, | |
6499 | .v.pins = (const struct hda_pintbl[]) { | |
6500 | /* Change the mic location from front to right, otherwise there are | |
6501 | two front mics with the same name, pulseaudio can't handle them. | |
6502 | This is just a temporary workaround, after applying this fixup, | |
6503 | there will be one "Front Mic" and one "Mic" in this machine. | |
6504 | */ | |
6505 | { 0x1a, 0x04a19040 }, | |
6506 | { } | |
6507 | }, | |
6508 | }, | |
9423a273 KY |
6509 | [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { |
6510 | .type = HDA_FIXUP_PINS, | |
6511 | .v.pins = (const struct hda_pintbl[]) { | |
6512 | { 0x16, 0x0101102f }, /* Rear Headset HP */ | |
6513 | { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ | |
6514 | { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ | |
6515 | { 0x1b, 0x02011020 }, | |
6516 | { } | |
6517 | }, | |
6518 | .chained = true, | |
6519 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6520 | }, | |
b84e8436 PH |
6521 | [ALC700_FIXUP_INTEL_REFERENCE] = { |
6522 | .type = HDA_FIXUP_VERBS, | |
6523 | .v.verbs = (const struct hda_verb[]) { | |
6524 | /* Enables internal speaker */ | |
6525 | {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, | |
6526 | {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, | |
6527 | {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, | |
6528 | {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, | |
6529 | {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, | |
6530 | {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, | |
6531 | {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, | |
6532 | {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, | |
6533 | {} | |
6534 | } | |
6535 | }, | |
92266651 KY |
6536 | [ALC274_FIXUP_DELL_BIND_DACS] = { |
6537 | .type = HDA_FIXUP_FUNC, | |
6538 | .v.func = alc274_fixup_bind_dacs, | |
6539 | .chained = true, | |
6540 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | |
6541 | }, | |
6542 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { | |
6543 | .type = HDA_FIXUP_PINS, | |
6544 | .v.pins = (const struct hda_pintbl[]) { | |
6545 | { 0x1b, 0x0401102f }, | |
6546 | { } | |
6547 | }, | |
6548 | .chained = true, | |
6549 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS | |
6550 | }, | |
114745cd KY |
6551 | [ALC298_FIXUP_TPT470_DOCK] = { |
6552 | .type = HDA_FIXUP_FUNC, | |
6553 | .v.func = alc_fixup_tpt470_dock, | |
6554 | .chained = true, | |
6555 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE | |
6556 | }, | |
9cfdabca KY |
6557 | [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { |
6558 | .type = HDA_FIXUP_PINS, | |
6559 | .v.pins = (const struct hda_pintbl[]) { | |
6560 | { 0x14, 0x0201101f }, | |
6561 | { } | |
6562 | }, | |
6563 | .chained = true, | |
6564 | .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE | |
6565 | }, | |
4c574ad4 KY |
6566 | [ALC255_FIXUP_DELL_HEADSET_MIC] = { |
6567 | .type = HDA_FIXUP_PINS, | |
6568 | .v.pins = (const struct hda_pintbl[]) { | |
6569 | { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6570 | { } | |
6571 | }, | |
431b427b HW |
6572 | .chained = true, |
6573 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
4c574ad4 | 6574 | }, |
32e2ee86 KY |
6575 | [ALC221_FIXUP_HP_HEADSET_MIC] = { |
6576 | .type = HDA_FIXUP_PINS, | |
6577 | .v.pins = (const struct hda_pintbl[]) { | |
6578 | { 0x19, 0x0181313f}, | |
6579 | { } | |
6580 | }, | |
6581 | .chained = true, | |
6582 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
6583 | }, | |
ea7118da HW |
6584 | [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { |
6585 | .type = HDA_FIXUP_FUNC, | |
6586 | .v.func = alc285_fixup_invalidate_dacs, | |
3b01ea18 HW |
6587 | .chained = true, |
6588 | .chain_id = ALC269_FIXUP_THINKPAD_ACPI | |
ea7118da | 6589 | }, |
0a60c116 HW |
6590 | [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { |
6591 | .type = HDA_FIXUP_VERBS, | |
6592 | .v.verbs = (const struct hda_verb[]) { | |
6593 | /* Disable PCBEEP-IN passthrough */ | |
6594 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, | |
6595 | { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, | |
6596 | { } | |
6597 | }, | |
6598 | .chained = true, | |
6599 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE | |
6600 | }, | |
09416ef0 JS |
6601 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
6602 | .type = HDA_FIXUP_PINS, | |
6603 | .v.pins = (const struct hda_pintbl[]) { | |
6604 | { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6605 | { } | |
6606 | }, | |
6607 | .chained = true, | |
6608 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6609 | }, | |
20616fb0 KY |
6610 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { |
6611 | .type = HDA_FIXUP_PINS, | |
6612 | .v.pins = (const struct hda_pintbl[]) { | |
6613 | { 0x16, 0x01011020 }, /* Rear Line out */ | |
6614 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ | |
6615 | { } | |
6616 | }, | |
6617 | .chained = true, | |
6618 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE | |
6619 | }, | |
6620 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { | |
6621 | .type = HDA_FIXUP_FUNC, | |
6622 | .v.func = alc_fixup_auto_mute_via_amp, | |
6623 | .chained = true, | |
6624 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF | |
6625 | }, | |
6626 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { | |
6627 | .type = HDA_FIXUP_FUNC, | |
6628 | .v.func = alc_fixup_disable_mic_vref, | |
6629 | .chained = true, | |
6630 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6631 | }, | |
9c54c712 CC |
6632 | [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { |
6633 | .type = HDA_FIXUP_PINS, | |
6634 | .v.pins = (const struct hda_pintbl[]) { | |
6635 | { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ | |
6636 | { } | |
6637 | }, | |
6638 | .chained = true, | |
6639 | .chain_id = ALC269_FIXUP_HEADSET_MIC | |
6640 | }, | |
dad6c4f4 CC |
6641 | [ALC294_FIXUP_ASUS_MIC] = { |
6642 | .type = HDA_FIXUP_PINS, | |
6643 | .v.pins = (const struct hda_pintbl[]) { | |
6644 | { 0x13, 0x90a60160 }, /* use as internal mic */ | |
6645 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
6646 | { } | |
6647 | }, | |
6648 | .chained = true, | |
6649 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6650 | }, | |
7398055e JHP |
6651 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { |
6652 | .type = HDA_FIXUP_PINS, | |
6653 | .v.pins = (const struct hda_pintbl[]) { | |
8f5982cc | 6654 | { 0x19, 0x01a1103c }, /* use as headset mic */ |
7398055e JHP |
6655 | { } |
6656 | }, | |
6657 | .chained = true, | |
6658 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | |
6659 | }, | |
6660 | [ALC294_FIXUP_ASUS_SPK] = { | |
6661 | .type = HDA_FIXUP_VERBS, | |
6662 | .v.verbs = (const struct hda_verb[]) { | |
6663 | /* Set EAPD high */ | |
6664 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, | |
6665 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, | |
6666 | { } | |
6667 | }, | |
6668 | .chained = true, | |
6669 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | |
6670 | }, | |
1a1fcf1f JHP |
6671 | [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { |
6672 | .type = HDA_FIXUP_VERBS, | |
6673 | .v.verbs = (const struct hda_verb[]) { | |
6674 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, | |
6675 | { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, | |
6676 | { } | |
6677 | }, | |
6678 | .chained = true, | |
6679 | .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE | |
6680 | }, | |
4f7f74da JHP |
6681 | [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { |
6682 | .type = HDA_FIXUP_PINS, | |
6683 | .v.pins = (const struct hda_pintbl[]) { | |
6684 | { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ | |
6685 | { } | |
6686 | }, | |
6687 | .chained = true, | |
6688 | .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | |
6689 | }, | |
128a4c8d BR |
6690 | [ALC299_FIXUP_PREDATOR_SPK] = { |
6691 | .type = HDA_FIXUP_PINS, | |
6692 | .v.pins = (const struct hda_pintbl[]) { | |
6693 | { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ | |
6694 | { } | |
6695 | } | |
6696 | }, | |
f1d4e28b KY |
6697 | }; |
6698 | ||
1d045db9 | 6699 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
a6b92b66 | 6700 | SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), |
693b613d DH |
6701 | SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), |
6702 | SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), | |
aaedfb47 | 6703 | SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), |
7819717b TI |
6704 | SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), |
6705 | SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), | |
aaedfb47 DH |
6706 | SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), |
6707 | SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), | |
02322ac9 | 6708 | SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
b1e8972e | 6709 | SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), |
1a22e775 | 6710 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
b085c988 | 6711 | SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
b9c2fa52 | 6712 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
4b1784ee CC |
6713 | SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), |
6714 | SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), | |
128a4c8d | 6715 | SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), |
1a1fcf1f JHP |
6716 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
6717 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
6718 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | |
b5ed743b | 6719 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), |
aaedfb47 | 6720 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
6ed1131f | 6721 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
86f799b8 | 6722 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
cf52103a | 6723 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
8b99aba7 TI |
6724 | SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), |
6725 | SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), | |
0f4881dc | 6726 | SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), |
73bdd597 DH |
6727 | SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), |
6728 | SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
6729 | SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), | |
0f4881dc DH |
6730 | SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), |
6731 | SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), | |
98070576 | 6732 | SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), |
4275554d | 6733 | SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), |
0f4881dc | 6734 | SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), |
a22aa26f KY |
6735 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
6736 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
831bfdf9 | 6737 | SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), |
afecb146 | 6738 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
3a05d12f | 6739 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
8b72415d | 6740 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
b734304f KY |
6741 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
6742 | SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
c04017ea DH |
6743 | SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), |
6744 | SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
6745 | SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
6746 | SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
6747 | SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), | |
423cd785 | 6748 | SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
fd06c77e | 6749 | SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
3b43b71f | 6750 | SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), |
b001f661 | 6751 | SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), |
423cd785 | 6752 | SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
feda862c | 6753 | SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), |
dd9aa335 | 6754 | SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), |
214839a8 | 6755 | SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), |
493de342 | 6756 | SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), |
9423a273 | 6757 | SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), |
e4c9fd10 | 6758 | SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), |
a98cf497 KY |
6759 | SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
6760 | SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), | |
4c574ad4 KY |
6761 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
6762 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | |
9cfdabca | 6763 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
20616fb0 | 6764 | SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), |
1fddba4b | 6765 | SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), |
1b48c755 | 6766 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
a22aa26f KY |
6767 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
6768 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | |
08fb0d0e | 6769 | SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
9f5c6faf | 6770 | SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), |
8e35cd4a | 6771 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
33f4acd3 | 6772 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
c60666bd | 6773 | /* ALC282 */ |
7976eb49 | 6774 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 6775 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 | 6776 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
9c5dc3bf KY |
6777 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
6778 | SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
6779 | SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
6780 | SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | |
9c5dc3bf | 6781 | SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
c60666bd | 6782 | SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
6783 | SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6784 | SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
8a02b164 | 6785 | SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
eaa8e5ef | 6786 | SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), |
b4b33f9d | 6787 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
3271cb22 | 6788 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), |
c60666bd | 6789 | SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
6790 | SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6791 | SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
6792 | SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd | 6793 | SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
98973f2f | 6794 | SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), |
9c5dc3bf KY |
6795 | SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
6796 | SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
c60666bd | 6797 | /* ALC290 */ |
9c5dc3bf | 6798 | SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
9c5dc3bf | 6799 | SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
9c5dc3bf | 6800 | SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
9c5dc3bf KY |
6801 | SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
6802 | SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
6803 | SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
6804 | SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
6805 | SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf | 6806 | SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
04d5466a | 6807 | SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), |
c60666bd | 6808 | SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
6809 | SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6810 | SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
6811 | SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
9c5dc3bf KY |
6812 | SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
6813 | SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), | |
9c5dc3bf | 6814 | SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), |
c60666bd | 6815 | SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 6816 | SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd | 6817 | SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
c60666bd KY |
6818 | SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6819 | SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd KY |
6820 | SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6821 | SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
c60666bd | 6822 | SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
8a02b164 KY |
6823 | SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6824 | SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
6825 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
6826 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | |
f883982d | 6827 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
b0759c99 JK |
6828 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6829 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
e549d190 | 6830 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
b0759c99 JK |
6831 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6832 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | |
c1732ede | 6833 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
7bba2157 | 6834 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
3e0d611b | 6835 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
ff0e5460 | 6836 | SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), |
c1732ede | 6837 | SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
4eab0ea1 | 6838 | SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
3e0d611b | 6839 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
4eab0ea1 TI |
6840 | SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
6841 | SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), | |
6842 | SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), | |
c1732ede CC |
6843 | SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
6844 | SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), | |
6845 | SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), | |
2cede303 | 6846 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), |
23870831 | 6847 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), |
3e0d611b | 6848 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), |
017f2a10 | 6849 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
28e8af8a | 6850 | SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
693b613d | 6851 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
615966ad | 6852 | SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
4eab0ea1 | 6853 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
c1732ede | 6854 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), |
eeed4cd1 | 6855 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), |
adabb3ec TI |
6856 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
6857 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), | |
6858 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
6859 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | |
d240d1dc | 6860 | SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), |
f88abaa0 | 6861 | SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
88cfcf86 | 6862 | SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), |
1d045db9 TI |
6863 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), |
6864 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
6865 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), | |
e9bd7d5c | 6866 | SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), |
24519911 | 6867 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), |
4df3fd17 | 6868 | SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), |
cc7016ab | 6869 | SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
88776f36 | 6870 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
0dcd451c | 6871 | SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
2041d564 | 6872 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
b84e8436 | 6873 | SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
f4900a15 | 6874 | SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
a33cc48d | 6875 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
823ff161 | 6876 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
abaa2274 AA |
6877 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
6878 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), | |
dbfe90df | 6879 | SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), |
09416ef0 | 6880 | SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
8ece3055 | 6881 | SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
6f616691 JS |
6882 | SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), |
6883 | SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), | |
6884 | SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), | |
ca169cc2 | 6885 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), |
1d045db9 TI |
6886 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
6887 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), | |
6888 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | |
6889 | SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), | |
6890 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), | |
707fba3f | 6891 | SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), |
c8415a48 | 6892 | SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), |
84f98fdf | 6893 | SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), |
4407be6b | 6894 | SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), |
108cc108 | 6895 | SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), |
aaedfb47 | 6896 | SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), |
9a811230 | 6897 | SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), |
1c37c223 | 6898 | SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), |
a12137e7 | 6899 | SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), |
59a51a6b | 6900 | SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), |
6d16941a | 6901 | SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), |
7c21539c | 6902 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), |
a4a9e082 | 6903 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
b6903c0e | 6904 | SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), |
d05ea7da | 6905 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
c0278669 | 6906 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
114745cd KY |
6907 | SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
6908 | SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
dab38e43 | 6909 | SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), |
c636b95e | 6910 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
114745cd KY |
6911 | SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), |
6912 | SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
6913 | SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
3051e378 | 6914 | SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), |
114745cd KY |
6915 | SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
6916 | SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
6917 | SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
8c85df50 | 6918 | SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
3694cb29 | 6919 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
6ef2f68f | 6920 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
f33f79f3 | 6921 | SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
b4ceb446 | 6922 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
74ef8b43 | 6923 | SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
8da5bbfc | 6924 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
56f27013 | 6925 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
fedb2245 | 6926 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
9b745ab8 | 6927 | SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), |
a4a9e082 | 6928 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
1bb3e062 | 6929 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
c497d9f9 | 6930 | SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), |
cd5302c0 | 6931 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
f2aa1110 | 6932 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
80b311d3 | 6933 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
09ea9976 | 6934 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
037e1197 | 6935 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), |
23adc192 | 6936 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
0f087ee3 | 6937 | SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), |
9cd25743 | 6938 | SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), |
0f087ee3 | 6939 | SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), |
114745cd KY |
6940 | SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
6941 | SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
6942 | SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
cd5302c0 | 6943 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
114745cd KY |
6944 | SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), |
6945 | SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), | |
012e7eb1 | 6946 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
1d045db9 | 6947 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
02b504d9 | 6948 | SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
a4297b5d | 6949 | |
a7f3eedc | 6950 | #if 0 |
a4297b5d TI |
6951 | /* Below is a quirk table taken from the old code. |
6952 | * Basically the device should work as is without the fixup table. | |
6953 | * If BIOS doesn't give a proper info, enable the corresponding | |
6954 | * fixup entry. | |
7d7eb9ea | 6955 | */ |
a4297b5d TI |
6956 | SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", |
6957 | ALC269_FIXUP_AMIC), | |
6958 | SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), | |
a4297b5d TI |
6959 | SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), |
6960 | SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), | |
6961 | SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), | |
6962 | SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), | |
6963 | SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), | |
6964 | SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), | |
6965 | SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), | |
6966 | SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), | |
6967 | SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), | |
6968 | SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), | |
6969 | SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), | |
6970 | SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), | |
6971 | SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), | |
6972 | SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), | |
6973 | SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), | |
6974 | SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), | |
6975 | SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), | |
6976 | SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), | |
6977 | SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), | |
6978 | SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), | |
6979 | SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), | |
6980 | SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), | |
6981 | SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), | |
6982 | SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), | |
6983 | SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), | |
6984 | SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), | |
6985 | SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), | |
6986 | SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), | |
6987 | SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), | |
6988 | SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), | |
6989 | SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), | |
6990 | SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), | |
6991 | SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), | |
6992 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), | |
6993 | SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), | |
6994 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), | |
6995 | SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), | |
6996 | SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), | |
6997 | #endif | |
6998 | {} | |
6999 | }; | |
7000 | ||
214eef76 DH |
7001 | static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { |
7002 | SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), | |
7003 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), | |
7004 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | |
7005 | SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), | |
7006 | {} | |
7007 | }; | |
7008 | ||
1727a771 | 7009 | static const struct hda_model_fixup alc269_fixup_models[] = { |
a4297b5d TI |
7010 | {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, |
7011 | {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, | |
6e72aa5f TI |
7012 | {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, |
7013 | {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, | |
7014 | {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, | |
7c478f03 | 7015 | {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, |
b016951e TI |
7016 | {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, |
7017 | {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, | |
108cc108 | 7018 | {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, |
9f5c6faf | 7019 | {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, |
04d5466a | 7020 | {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, |
e32aa85a DH |
7021 | {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
7022 | {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, | |
128a4c8d | 7023 | {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, |
be8ef16a | 7024 | {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, |
0202e99c | 7025 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
1c37c223 | 7026 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
9a811230 | 7027 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
c636b95e | 7028 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, |
ba90d6a6 | 7029 | {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
28d1d6d2 | 7030 | {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, |
1d045db9 | 7031 | {} |
6dda9f4a | 7032 | }; |
cfc5a845 | 7033 | #define ALC225_STANDARD_PINS \ |
cfc5a845 | 7034 | {0x21, 0x04211020} |
6dda9f4a | 7035 | |
e8191a8e HW |
7036 | #define ALC256_STANDARD_PINS \ |
7037 | {0x12, 0x90a60140}, \ | |
7038 | {0x14, 0x90170110}, \ | |
e8191a8e HW |
7039 | {0x21, 0x02211020} |
7040 | ||
fea185e2 | 7041 | #define ALC282_STANDARD_PINS \ |
11580297 | 7042 | {0x14, 0x90170110} |
e1e62b98 | 7043 | |
fea185e2 | 7044 | #define ALC290_STANDARD_PINS \ |
11580297 | 7045 | {0x12, 0x99a30130} |
fea185e2 DH |
7046 | |
7047 | #define ALC292_STANDARD_PINS \ | |
7048 | {0x14, 0x90170110}, \ | |
11580297 | 7049 | {0x15, 0x0221401f} |
977e6276 | 7050 | |
3f640970 HW |
7051 | #define ALC295_STANDARD_PINS \ |
7052 | {0x12, 0xb7a60130}, \ | |
7053 | {0x14, 0x90170110}, \ | |
3f640970 HW |
7054 | {0x21, 0x04211020} |
7055 | ||
703867e2 WS |
7056 | #define ALC298_STANDARD_PINS \ |
7057 | {0x12, 0x90a60130}, \ | |
7058 | {0x21, 0x03211020} | |
7059 | ||
e1918938 | 7060 | static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
32e2ee86 KY |
7061 | SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, |
7062 | {0x14, 0x01014020}, | |
7063 | {0x17, 0x90170110}, | |
7064 | {0x18, 0x02a11030}, | |
7065 | {0x19, 0x0181303F}, | |
7066 | {0x21, 0x0221102f}), | |
5824ce8d CC |
7067 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, |
7068 | {0x12, 0x90a601c0}, | |
7069 | {0x14, 0x90171120}, | |
7070 | {0x21, 0x02211030}), | |
615966ad CC |
7071 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, |
7072 | {0x14, 0x90170110}, | |
7073 | {0x1b, 0x90a70130}, | |
7074 | {0x21, 0x03211020}), | |
7075 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, | |
7076 | {0x1a, 0x90a70130}, | |
7077 | {0x1b, 0x90170110}, | |
7078 | {0x21, 0x03211020}), | |
2ae95577 | 7079 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 7080 | ALC225_STANDARD_PINS, |
8a132099 | 7081 | {0x12, 0xb7a60130}, |
cfc5a845 | 7082 | {0x14, 0x901701a0}), |
2ae95577 | 7083 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
cfc5a845 | 7084 | ALC225_STANDARD_PINS, |
8a132099 | 7085 | {0x12, 0xb7a60130}, |
cfc5a845 | 7086 | {0x14, 0x901701b0}), |
8a132099 HW |
7087 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
7088 | ALC225_STANDARD_PINS, | |
7089 | {0x12, 0xb7a60150}, | |
7090 | {0x14, 0x901701a0}), | |
7091 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7092 | ALC225_STANDARD_PINS, | |
7093 | {0x12, 0xb7a60150}, | |
7094 | {0x14, 0x901701b0}), | |
7095 | SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7096 | ALC225_STANDARD_PINS, | |
7097 | {0x12, 0xb7a60130}, | |
7098 | {0x1b, 0x90170110}), | |
0ce48e17 KHF |
7099 | SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
7100 | {0x1b, 0x01111010}, | |
7101 | {0x1e, 0x01451130}, | |
7102 | {0x21, 0x02211020}), | |
56d3b887 HW |
7103 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
7104 | {0x12, 0x90a60140}, | |
7105 | {0x14, 0x90170110}, | |
7106 | {0x19, 0x02a11030}, | |
7107 | {0x21, 0x02211020}), | |
74ef8b43 HW |
7108 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
7109 | {0x14, 0x90170110}, | |
7110 | {0x19, 0x02a11030}, | |
7111 | {0x1a, 0x02a11040}, | |
7112 | {0x1b, 0x01014020}, | |
7113 | {0x21, 0x0221101f}), | |
66a0e1cc HW |
7114 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
7115 | {0x14, 0x90170110}, | |
7116 | {0x19, 0x02a11030}, | |
7117 | {0x1a, 0x02a11040}, | |
7118 | {0x1b, 0x01011020}, | |
7119 | {0x21, 0x0221101f}), | |
3374ea95 HW |
7120 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, |
7121 | {0x14, 0x90170110}, | |
7122 | {0x19, 0x02a11020}, | |
7123 | {0x1a, 0x02a11030}, | |
7124 | {0x21, 0x0221101f}), | |
f265788c HW |
7125 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7126 | {0x12, 0x90a60140}, | |
7127 | {0x14, 0x90170110}, | |
7128 | {0x21, 0x02211020}), | |
19412c71 TI |
7129 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, |
7130 | {0x12, 0x90a60140}, | |
7131 | {0x14, 0x90170110}, | |
7132 | {0x19, 0x02a11030}, | |
7133 | {0x21, 0x02211020}), | |
f265788c HW |
7134 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7135 | {0x12, 0x90a60140}, | |
7136 | {0x14, 0x90170150}, | |
7137 | {0x21, 0x02211020}), | |
be620cc7 HW |
7138 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7139 | {0x21, 0x02211020}), | |
c77900e6 | 7140 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
c77900e6 | 7141 | {0x14, 0x90170110}, |
c77900e6 | 7142 | {0x21, 0x02211020}), |
86c72d1c HW |
7143 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7144 | {0x14, 0x90170130}, | |
7145 | {0x21, 0x02211040}), | |
76c2132e DH |
7146 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7147 | {0x12, 0x90a60140}, | |
7148 | {0x14, 0x90170110}, | |
76c2132e DH |
7149 | {0x21, 0x02211020}), |
7150 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7151 | {0x12, 0x90a60160}, | |
7152 | {0x14, 0x90170120}, | |
76c2132e | 7153 | {0x21, 0x02211030}), |
392c9da2 HW |
7154 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7155 | {0x14, 0x90170110}, | |
7156 | {0x1b, 0x02011020}, | |
7157 | {0x21, 0x0221101f}), | |
6aecd871 HW |
7158 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7159 | {0x14, 0x90170110}, | |
7160 | {0x1b, 0x01011020}, | |
7161 | {0x21, 0x0221101f}), | |
cba59972 | 7162 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
cba59972 | 7163 | {0x14, 0x90170130}, |
cba59972 | 7164 | {0x1b, 0x01014020}, |
cba59972 | 7165 | {0x21, 0x0221103f}), |
6aecd871 HW |
7166 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7167 | {0x14, 0x90170130}, | |
7168 | {0x1b, 0x01011020}, | |
7169 | {0x21, 0x0221103f}), | |
59ec4b57 HW |
7170 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7171 | {0x14, 0x90170130}, | |
7172 | {0x1b, 0x02011020}, | |
7173 | {0x21, 0x0221103f}), | |
e9c28e16 | 7174 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
e9c28e16 | 7175 | {0x14, 0x90170150}, |
e9c28e16 | 7176 | {0x1b, 0x02011020}, |
e9c28e16 WS |
7177 | {0x21, 0x0221105f}), |
7178 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
e9c28e16 | 7179 | {0x14, 0x90170110}, |
e9c28e16 | 7180 | {0x1b, 0x01014020}, |
e9c28e16 | 7181 | {0x21, 0x0221101f}), |
76c2132e DH |
7182 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7183 | {0x12, 0x90a60160}, | |
7184 | {0x14, 0x90170120}, | |
7185 | {0x17, 0x90170140}, | |
76c2132e DH |
7186 | {0x21, 0x0321102f}), |
7187 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7188 | {0x12, 0x90a60160}, | |
7189 | {0x14, 0x90170130}, | |
76c2132e DH |
7190 | {0x21, 0x02211040}), |
7191 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7192 | {0x12, 0x90a60160}, | |
7193 | {0x14, 0x90170140}, | |
76c2132e DH |
7194 | {0x21, 0x02211050}), |
7195 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7196 | {0x12, 0x90a60170}, | |
7197 | {0x14, 0x90170120}, | |
76c2132e DH |
7198 | {0x21, 0x02211030}), |
7199 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7200 | {0x12, 0x90a60170}, | |
7201 | {0x14, 0x90170130}, | |
76c2132e | 7202 | {0x21, 0x02211040}), |
0a1f90a9 HW |
7203 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7204 | {0x12, 0x90a60170}, | |
7205 | {0x14, 0x90171130}, | |
7206 | {0x21, 0x02211040}), | |
70658b99 | 7207 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
70658b99 HW |
7208 | {0x12, 0x90a60170}, |
7209 | {0x14, 0x90170140}, | |
70658b99 | 7210 | {0x21, 0x02211050}), |
9b5a4e39 | 7211 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
9b5a4e39 DH |
7212 | {0x12, 0x90a60180}, |
7213 | {0x14, 0x90170130}, | |
9b5a4e39 | 7214 | {0x21, 0x02211040}), |
f90d83b3 AK |
7215 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7216 | {0x12, 0x90a60180}, | |
7217 | {0x14, 0x90170120}, | |
7218 | {0x21, 0x02211030}), | |
989dbe4a HW |
7219 | SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7220 | {0x1b, 0x01011020}, | |
7221 | {0x21, 0x02211010}), | |
285d5ddc HW |
7222 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7223 | {0x12, 0x90a60130}, | |
7224 | {0x14, 0x90170110}, | |
7225 | {0x1b, 0x01011020}, | |
7226 | {0x21, 0x0221101f}), | |
81a1231b | 7227 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
81a1231b KY |
7228 | {0x12, 0x90a60160}, |
7229 | {0x14, 0x90170120}, | |
81a1231b | 7230 | {0x21, 0x02211030}), |
f83c3292 WS |
7231 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7232 | {0x12, 0x90a60170}, | |
7233 | {0x14, 0x90170120}, | |
7234 | {0x21, 0x02211030}), | |
311042d1 SB |
7235 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7236 | {0x12, 0x90a60180}, | |
7237 | {0x14, 0x90170120}, | |
7238 | {0x21, 0x02211030}), | |
3f640970 HW |
7239 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7240 | {0x12, 0xb7a60130}, | |
7241 | {0x14, 0x90170110}, | |
7242 | {0x21, 0x02211020}), | |
b4fd4012 HW |
7243 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7244 | {0x12, 0x90a60130}, | |
7245 | {0x14, 0x90170110}, | |
7246 | {0x14, 0x01011020}, | |
7247 | {0x21, 0x0221101f}), | |
7081adf3 | 7248 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
11580297 | 7249 | ALC256_STANDARD_PINS), |
be620cc7 HW |
7250 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
7251 | {0x14, 0x90170110}, | |
7252 | {0x1b, 0x01011020}, | |
7253 | {0x21, 0x0221101f}), | |
c1732ede CC |
7254 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, |
7255 | {0x14, 0x90170110}, | |
7256 | {0x1b, 0x90a70130}, | |
7257 | {0x21, 0x04211020}), | |
7258 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, | |
7259 | {0x14, 0x90170110}, | |
7260 | {0x1b, 0x90a70130}, | |
7261 | {0x21, 0x03211020}), | |
0c17ee73 CC |
7262 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
7263 | {0x12, 0x90a60130}, | |
7264 | {0x14, 0x90170110}, | |
7265 | {0x21, 0x03211020}), | |
8c63db5b JHP |
7266 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
7267 | {0x12, 0x90a60130}, | |
7268 | {0x14, 0x90170110}, | |
7269 | {0x21, 0x04211020}), | |
4f7f74da JHP |
7270 | SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, |
7271 | {0x1a, 0x90a70130}, | |
7272 | {0x1b, 0x90170110}, | |
7273 | {0x21, 0x03211020}), | |
92266651 | 7274 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
75ee94b2 HW |
7275 | {0x12, 0xb7a60130}, |
7276 | {0x13, 0xb8a61140}, | |
7277 | {0x16, 0x90170110}, | |
7278 | {0x21, 0x04211020}), | |
cf51eb9d DH |
7279 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
7280 | {0x12, 0x90a60130}, | |
cf51eb9d DH |
7281 | {0x14, 0x90170110}, |
7282 | {0x15, 0x0421101f}, | |
11580297 | 7283 | {0x1a, 0x04a11020}), |
0279661b HW |
7284 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, |
7285 | {0x12, 0x90a60140}, | |
0279661b HW |
7286 | {0x14, 0x90170110}, |
7287 | {0x15, 0x0421101f}, | |
0279661b | 7288 | {0x18, 0x02811030}, |
0279661b | 7289 | {0x1a, 0x04a1103f}, |
11580297 | 7290 | {0x1b, 0x02011020}), |
42304474 | 7291 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7292 | ALC282_STANDARD_PINS, |
42304474 | 7293 | {0x12, 0x99a30130}, |
42304474 | 7294 | {0x19, 0x03a11020}, |
42304474 | 7295 | {0x21, 0x0321101f}), |
2c609999 | 7296 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7297 | ALC282_STANDARD_PINS, |
2c609999 | 7298 | {0x12, 0x99a30130}, |
2c609999 | 7299 | {0x19, 0x03a11020}, |
2c609999 HW |
7300 | {0x21, 0x03211040}), |
7301 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 7302 | ALC282_STANDARD_PINS, |
2c609999 | 7303 | {0x12, 0x99a30130}, |
2c609999 | 7304 | {0x19, 0x03a11030}, |
2c609999 HW |
7305 | {0x21, 0x03211020}), |
7306 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, | |
aec856d0 | 7307 | ALC282_STANDARD_PINS, |
2c609999 | 7308 | {0x12, 0x99a30130}, |
2c609999 | 7309 | {0x19, 0x04a11020}, |
2c609999 | 7310 | {0x21, 0x0421101f}), |
200afc09 | 7311 | SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, |
aec856d0 | 7312 | ALC282_STANDARD_PINS, |
200afc09 | 7313 | {0x12, 0x90a60140}, |
200afc09 | 7314 | {0x19, 0x04a11030}, |
200afc09 | 7315 | {0x21, 0x04211020}), |
76c2132e | 7316 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 7317 | ALC282_STANDARD_PINS, |
76c2132e | 7318 | {0x12, 0x90a60130}, |
76c2132e DH |
7319 | {0x21, 0x0321101f}), |
7320 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7321 | {0x12, 0x90a60160}, | |
7322 | {0x14, 0x90170120}, | |
76c2132e | 7323 | {0x21, 0x02211030}), |
bc262179 | 7324 | SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 7325 | ALC282_STANDARD_PINS, |
bc262179 | 7326 | {0x12, 0x90a60130}, |
bc262179 | 7327 | {0x19, 0x03a11020}, |
bc262179 | 7328 | {0x21, 0x0321101f}), |
0a60c116 | 7329 | SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
ea7118da HW |
7330 | {0x12, 0x90a60130}, |
7331 | {0x14, 0x90170110}, | |
7332 | {0x19, 0x04a11040}, | |
7333 | {0x21, 0x04211020}), | |
e1e62b98 | 7334 | SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6, |
e1e62b98 | 7335 | {0x12, 0x90a60120}, |
e1e62b98 | 7336 | {0x14, 0x90170110}, |
e1e62b98 | 7337 | {0x21, 0x0321101f}), |
1c303728 | 7338 | SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
b4fd4012 HW |
7339 | {0x12, 0xb7a60130}, |
7340 | {0x14, 0x90170110}, | |
7341 | {0x21, 0x04211020}), | |
e4442bcf | 7342 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7343 | ALC290_STANDARD_PINS, |
e4442bcf | 7344 | {0x15, 0x04211040}, |
e4442bcf | 7345 | {0x18, 0x90170112}, |
11580297 | 7346 | {0x1a, 0x04a11020}), |
e4442bcf | 7347 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7348 | ALC290_STANDARD_PINS, |
e4442bcf | 7349 | {0x15, 0x04211040}, |
e4442bcf | 7350 | {0x18, 0x90170110}, |
11580297 | 7351 | {0x1a, 0x04a11020}), |
e4442bcf | 7352 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7353 | ALC290_STANDARD_PINS, |
e4442bcf | 7354 | {0x15, 0x0421101f}, |
11580297 | 7355 | {0x1a, 0x04a11020}), |
e4442bcf | 7356 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7357 | ALC290_STANDARD_PINS, |
e4442bcf | 7358 | {0x15, 0x04211020}, |
11580297 | 7359 | {0x1a, 0x04a11040}), |
e4442bcf | 7360 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7361 | ALC290_STANDARD_PINS, |
e4442bcf HW |
7362 | {0x14, 0x90170110}, |
7363 | {0x15, 0x04211020}, | |
11580297 | 7364 | {0x1a, 0x04a11040}), |
e4442bcf | 7365 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7366 | ALC290_STANDARD_PINS, |
e4442bcf HW |
7367 | {0x14, 0x90170110}, |
7368 | {0x15, 0x04211020}, | |
11580297 | 7369 | {0x1a, 0x04a11020}), |
e4442bcf | 7370 | SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, |
aec856d0 | 7371 | ALC290_STANDARD_PINS, |
e4442bcf HW |
7372 | {0x14, 0x90170110}, |
7373 | {0x15, 0x0421101f}, | |
11580297 | 7374 | {0x1a, 0x04a11020}), |
e8818fa8 | 7375 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 7376 | ALC292_STANDARD_PINS, |
e8818fa8 | 7377 | {0x12, 0x90a60140}, |
e8818fa8 | 7378 | {0x16, 0x01014020}, |
11580297 | 7379 | {0x19, 0x01a19030}), |
e8818fa8 | 7380 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, |
aec856d0 | 7381 | ALC292_STANDARD_PINS, |
e8818fa8 | 7382 | {0x12, 0x90a60140}, |
e8818fa8 HW |
7383 | {0x16, 0x01014020}, |
7384 | {0x18, 0x02a19031}, | |
11580297 | 7385 | {0x19, 0x01a1903e}), |
76c2132e | 7386 | SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, |
aec856d0 | 7387 | ALC292_STANDARD_PINS, |
11580297 | 7388 | {0x12, 0x90a60140}), |
76c2132e | 7389 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 7390 | ALC292_STANDARD_PINS, |
76c2132e | 7391 | {0x13, 0x90a60140}, |
76c2132e | 7392 | {0x16, 0x21014020}, |
11580297 | 7393 | {0x19, 0x21a19030}), |
e03fdbde | 7394 | SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
aec856d0 | 7395 | ALC292_STANDARD_PINS, |
11580297 | 7396 | {0x13, 0x90a60140}), |
dad6c4f4 CC |
7397 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, |
7398 | {0x14, 0x90170110}, | |
7399 | {0x1b, 0x90a70130}, | |
7400 | {0x21, 0x04211020}), | |
32557ebe JHP |
7401 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
7402 | {0x12, 0x90a60130}, | |
7403 | {0x17, 0x90170110}, | |
7404 | {0x21, 0x03211020}), | |
3794a5cd JHP |
7405 | SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, |
7406 | {0x12, 0x90a60130}, | |
7407 | {0x17, 0x90170110}, | |
7408 | {0x21, 0x04211020}), | |
3f640970 | 7409 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
f771d5bb HW |
7410 | ALC295_STANDARD_PINS, |
7411 | {0x17, 0x21014020}, | |
7412 | {0x18, 0x21a19030}), | |
7413 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7414 | ALC295_STANDARD_PINS, | |
7415 | {0x17, 0x21014040}, | |
7416 | {0x18, 0x21a19050}), | |
3f307834 HW |
7417 | SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
7418 | ALC295_STANDARD_PINS), | |
9f502ff5 TI |
7419 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
7420 | ALC298_STANDARD_PINS, | |
7421 | {0x17, 0x90170110}), | |
977e6276 | 7422 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
703867e2 WS |
7423 | ALC298_STANDARD_PINS, |
7424 | {0x17, 0x90170140}), | |
7425 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, | |
7426 | ALC298_STANDARD_PINS, | |
9f502ff5 | 7427 | {0x17, 0x90170150}), |
9f1bc2c4 KHF |
7428 | SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, |
7429 | {0x12, 0xb7a60140}, | |
7430 | {0x13, 0xb7a60150}, | |
7431 | {0x17, 0x90170110}, | |
7432 | {0x1a, 0x03011020}, | |
7433 | {0x21, 0x03211030}), | |
fcc6c877 KY |
7434 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
7435 | ALC225_STANDARD_PINS, | |
7436 | {0x12, 0xb7a60130}, | |
fcc6c877 | 7437 | {0x17, 0x90170110}), |
9c54c712 CC |
7438 | SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, |
7439 | {0x12, 0x90a60130}, | |
7440 | {0x17, 0x90170110}, | |
7441 | {0x21, 0x02211020}), | |
e1918938 HW |
7442 | {} |
7443 | }; | |
6dda9f4a | 7444 | |
546bb678 | 7445 | static void alc269_fill_coef(struct hda_codec *codec) |
1d045db9 | 7446 | { |
526af6eb | 7447 | struct alc_spec *spec = codec->spec; |
1d045db9 | 7448 | int val; |
ebb83eeb | 7449 | |
526af6eb | 7450 | if (spec->codec_variant != ALC269_TYPE_ALC269VB) |
546bb678 | 7451 | return; |
526af6eb | 7452 | |
1bb7e43e | 7453 | if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { |
1d045db9 TI |
7454 | alc_write_coef_idx(codec, 0xf, 0x960b); |
7455 | alc_write_coef_idx(codec, 0xe, 0x8817); | |
7456 | } | |
ebb83eeb | 7457 | |
1bb7e43e | 7458 | if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { |
1d045db9 TI |
7459 | alc_write_coef_idx(codec, 0xf, 0x960b); |
7460 | alc_write_coef_idx(codec, 0xe, 0x8814); | |
7461 | } | |
ebb83eeb | 7462 | |
1bb7e43e | 7463 | if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { |
1d045db9 | 7464 | /* Power up output pin */ |
98b24883 | 7465 | alc_update_coef_idx(codec, 0x04, 0, 1<<11); |
1d045db9 | 7466 | } |
ebb83eeb | 7467 | |
1bb7e43e | 7468 | if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { |
1d045db9 | 7469 | val = alc_read_coef_idx(codec, 0xd); |
f3ee07d8 | 7470 | if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { |
1d045db9 TI |
7471 | /* Capless ramp up clock control */ |
7472 | alc_write_coef_idx(codec, 0xd, val | (1<<10)); | |
7473 | } | |
7474 | val = alc_read_coef_idx(codec, 0x17); | |
f3ee07d8 | 7475 | if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { |
1d045db9 TI |
7476 | /* Class D power on reset */ |
7477 | alc_write_coef_idx(codec, 0x17, val | (1<<7)); | |
7478 | } | |
7479 | } | |
ebb83eeb | 7480 | |
98b24883 TI |
7481 | /* HP */ |
7482 | alc_update_coef_idx(codec, 0x4, 0, 1<<11); | |
1d045db9 | 7483 | } |
a7f2371f | 7484 | |
1d045db9 TI |
7485 | /* |
7486 | */ | |
1d045db9 TI |
7487 | static int patch_alc269(struct hda_codec *codec) |
7488 | { | |
7489 | struct alc_spec *spec; | |
3de95173 | 7490 | int err; |
f1d4e28b | 7491 | |
3de95173 | 7492 | err = alc_alloc_spec(codec, 0x0b); |
e16fb6d1 | 7493 | if (err < 0) |
3de95173 TI |
7494 | return err; |
7495 | ||
7496 | spec = codec->spec; | |
08c189f2 | 7497 | spec->gen.shared_mic_vref_pin = 0x18; |
8b99aba7 | 7498 | codec->power_save_node = 1; |
e16fb6d1 | 7499 | |
225068ab TI |
7500 | #ifdef CONFIG_PM |
7501 | codec->patch_ops.suspend = alc269_suspend; | |
7502 | codec->patch_ops.resume = alc269_resume; | |
7503 | #endif | |
c2d6af53 KY |
7504 | spec->shutup = alc_default_shutup; |
7505 | spec->init_hook = alc_default_init; | |
225068ab | 7506 | |
1727a771 | 7507 | snd_hda_pick_fixup(codec, alc269_fixup_models, |
9f720bb9 | 7508 | alc269_fixup_tbl, alc269_fixups); |
e1918938 | 7509 | snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups); |
214eef76 DH |
7510 | snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, |
7511 | alc269_fixups); | |
1727a771 | 7512 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
9f720bb9 HRK |
7513 | |
7514 | alc_auto_parse_customize_define(codec); | |
7515 | ||
7504b6cd TI |
7516 | if (has_cdefine_beep(codec)) |
7517 | spec->gen.beep_nid = 0x01; | |
7518 | ||
7639a06c | 7519 | switch (codec->core.vendor_id) { |
065380f0 | 7520 | case 0x10ec0269: |
1d045db9 | 7521 | spec->codec_variant = ALC269_TYPE_ALC269VA; |
1bb7e43e TI |
7522 | switch (alc_get_coef0(codec) & 0x00f0) { |
7523 | case 0x0010: | |
5100cd07 TI |
7524 | if (codec->bus->pci && |
7525 | codec->bus->pci->subsystem_vendor == 0x1025 && | |
e16fb6d1 | 7526 | spec->cdefine.platform_type == 1) |
20ca0c35 | 7527 | err = alc_codec_rename(codec, "ALC271X"); |
1d045db9 | 7528 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
1bb7e43e TI |
7529 | break; |
7530 | case 0x0020: | |
5100cd07 TI |
7531 | if (codec->bus->pci && |
7532 | codec->bus->pci->subsystem_vendor == 0x17aa && | |
e16fb6d1 | 7533 | codec->bus->pci->subsystem_device == 0x21f3) |
20ca0c35 | 7534 | err = alc_codec_rename(codec, "ALC3202"); |
1d045db9 | 7535 | spec->codec_variant = ALC269_TYPE_ALC269VC; |
1bb7e43e | 7536 | break; |
adcc70b2 KY |
7537 | case 0x0030: |
7538 | spec->codec_variant = ALC269_TYPE_ALC269VD; | |
7539 | break; | |
1bb7e43e | 7540 | default: |
1d045db9 | 7541 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
1bb7e43e | 7542 | } |
e16fb6d1 TI |
7543 | if (err < 0) |
7544 | goto error; | |
c2d6af53 | 7545 | spec->shutup = alc269_shutup; |
546bb678 | 7546 | spec->init_hook = alc269_fill_coef; |
1d045db9 | 7547 | alc269_fill_coef(codec); |
065380f0 KY |
7548 | break; |
7549 | ||
7550 | case 0x10ec0280: | |
7551 | case 0x10ec0290: | |
7552 | spec->codec_variant = ALC269_TYPE_ALC280; | |
7553 | break; | |
7554 | case 0x10ec0282: | |
065380f0 | 7555 | spec->codec_variant = ALC269_TYPE_ALC282; |
7b5c7a02 KY |
7556 | spec->shutup = alc282_shutup; |
7557 | spec->init_hook = alc282_init; | |
065380f0 | 7558 | break; |
2af02be7 KY |
7559 | case 0x10ec0233: |
7560 | case 0x10ec0283: | |
7561 | spec->codec_variant = ALC269_TYPE_ALC283; | |
7562 | spec->shutup = alc283_shutup; | |
7563 | spec->init_hook = alc283_init; | |
7564 | break; | |
065380f0 KY |
7565 | case 0x10ec0284: |
7566 | case 0x10ec0292: | |
7567 | spec->codec_variant = ALC269_TYPE_ALC284; | |
7568 | break; | |
161ebf29 | 7569 | case 0x10ec0293: |
4731d5de | 7570 | spec->codec_variant = ALC269_TYPE_ALC293; |
161ebf29 | 7571 | break; |
7fc7d047 | 7572 | case 0x10ec0286: |
7c665932 | 7573 | case 0x10ec0288: |
7fc7d047 KY |
7574 | spec->codec_variant = ALC269_TYPE_ALC286; |
7575 | break; | |
506b62c3 KY |
7576 | case 0x10ec0298: |
7577 | spec->codec_variant = ALC269_TYPE_ALC298; | |
7578 | break; | |
583142ca | 7579 | case 0x10ec0235: |
1d04c9de KY |
7580 | case 0x10ec0255: |
7581 | spec->codec_variant = ALC269_TYPE_ALC255; | |
016c6fdd KY |
7582 | spec->shutup = alc256_shutup; |
7583 | spec->init_hook = alc256_init; | |
1d04c9de | 7584 | break; |
736f20a7 | 7585 | case 0x10ec0236: |
4344aec8 KY |
7586 | case 0x10ec0256: |
7587 | spec->codec_variant = ALC269_TYPE_ALC256; | |
4a219ef8 KY |
7588 | spec->shutup = alc256_shutup; |
7589 | spec->init_hook = alc256_init; | |
7d1b6e29 | 7590 | spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ |
d32b6666 | 7591 | alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/ |
4344aec8 | 7592 | break; |
f429e7e4 KY |
7593 | case 0x10ec0257: |
7594 | spec->codec_variant = ALC269_TYPE_ALC257; | |
fc434f5a KY |
7595 | spec->shutup = alc256_shutup; |
7596 | spec->init_hook = alc256_init; | |
f429e7e4 KY |
7597 | spec->gen.mixer_nid = 0; |
7598 | break; | |
0a6f0600 KY |
7599 | case 0x10ec0215: |
7600 | case 0x10ec0285: | |
7601 | case 0x10ec0289: | |
7602 | spec->codec_variant = ALC269_TYPE_ALC215; | |
7603 | spec->gen.mixer_nid = 0; | |
7604 | break; | |
4231430d | 7605 | case 0x10ec0225: |
7d727869 | 7606 | case 0x10ec0295: |
fa16b69f | 7607 | spec->codec_variant = ALC269_TYPE_ALC225; |
e674ac9a | 7608 | spec->gen.mixer_nid = 0; /* no loopback on ALC225 ALC295 */ |
fa16b69f | 7609 | break; |
28f1f9b2 | 7610 | case 0x10ec0299: |
4231430d | 7611 | spec->codec_variant = ALC269_TYPE_ALC225; |
0b4d8f55 KY |
7612 | spec->shutup = alc225_shutup; |
7613 | spec->init_hook = alc225_init; | |
7614 | spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ | |
4231430d | 7615 | break; |
dcd4f0db KY |
7616 | case 0x10ec0234: |
7617 | case 0x10ec0274: | |
7618 | case 0x10ec0294: | |
7619 | spec->codec_variant = ALC269_TYPE_ALC294; | |
532a7784 | 7620 | spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ |
71683c32 | 7621 | alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ |
6e25f0c7 | 7622 | spec->init_hook = alc294_init; |
dcd4f0db | 7623 | break; |
9887cf53 KY |
7624 | case 0x10ec0300: |
7625 | spec->codec_variant = ALC269_TYPE_ALC300; | |
7626 | spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ | |
7627 | break; | |
6fbae35a KY |
7628 | case 0x10ec0700: |
7629 | case 0x10ec0701: | |
7630 | case 0x10ec0703: | |
7631 | spec->codec_variant = ALC269_TYPE_ALC700; | |
7632 | spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ | |
2d7fe618 | 7633 | alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ |
6e25f0c7 | 7634 | spec->init_hook = alc294_init; |
6fbae35a KY |
7635 | break; |
7636 | ||
1d045db9 | 7637 | } |
6dda9f4a | 7638 | |
ad60d502 | 7639 | if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { |
97a26570 | 7640 | spec->has_alc5505_dsp = 1; |
ad60d502 KY |
7641 | spec->init_hook = alc5505_dsp_init; |
7642 | } | |
7643 | ||
a4297b5d TI |
7644 | /* automatic parse from the BIOS config */ |
7645 | err = alc269_parse_auto_config(codec); | |
e16fb6d1 TI |
7646 | if (err < 0) |
7647 | goto error; | |
6dda9f4a | 7648 | |
7d1b6e29 DH |
7649 | if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) |
7650 | set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); | |
f1d4e28b | 7651 | |
1727a771 | 7652 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 7653 | |
1d045db9 | 7654 | return 0; |
e16fb6d1 TI |
7655 | |
7656 | error: | |
7657 | alc_free(codec); | |
7658 | return err; | |
1d045db9 | 7659 | } |
f1d4e28b | 7660 | |
1d045db9 TI |
7661 | /* |
7662 | * ALC861 | |
7663 | */ | |
622e84cd | 7664 | |
1d045db9 | 7665 | static int alc861_parse_auto_config(struct hda_codec *codec) |
6dda9f4a | 7666 | { |
1d045db9 | 7667 | static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
7668 | static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; |
7669 | return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); | |
604401a9 TI |
7670 | } |
7671 | ||
1d045db9 TI |
7672 | /* Pin config fixes */ |
7673 | enum { | |
e652f4c8 TI |
7674 | ALC861_FIXUP_FSC_AMILO_PI1505, |
7675 | ALC861_FIXUP_AMP_VREF_0F, | |
7676 | ALC861_FIXUP_NO_JACK_DETECT, | |
7677 | ALC861_FIXUP_ASUS_A6RP, | |
6ddf0fd1 | 7678 | ALC660_FIXUP_ASUS_W7J, |
1d045db9 | 7679 | }; |
7085ec12 | 7680 | |
31150f23 TI |
7681 | /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ |
7682 | static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, | |
1727a771 | 7683 | const struct hda_fixup *fix, int action) |
31150f23 TI |
7684 | { |
7685 | struct alc_spec *spec = codec->spec; | |
7686 | unsigned int val; | |
7687 | ||
1727a771 | 7688 | if (action != HDA_FIXUP_ACT_INIT) |
31150f23 | 7689 | return; |
d3f02d60 | 7690 | val = snd_hda_codec_get_pin_target(codec, 0x0f); |
31150f23 TI |
7691 | if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) |
7692 | val |= AC_PINCTL_IN_EN; | |
7693 | val |= AC_PINCTL_VREF_50; | |
cdd03ced | 7694 | snd_hda_set_pin_ctl(codec, 0x0f, val); |
08c189f2 | 7695 | spec->gen.keep_vref_in_automute = 1; |
31150f23 TI |
7696 | } |
7697 | ||
e652f4c8 TI |
7698 | /* suppress the jack-detection */ |
7699 | static void alc_fixup_no_jack_detect(struct hda_codec *codec, | |
1727a771 | 7700 | const struct hda_fixup *fix, int action) |
e652f4c8 | 7701 | { |
1727a771 | 7702 | if (action == HDA_FIXUP_ACT_PRE_PROBE) |
e652f4c8 | 7703 | codec->no_jack_detect = 1; |
7d7eb9ea | 7704 | } |
e652f4c8 | 7705 | |
1727a771 | 7706 | static const struct hda_fixup alc861_fixups[] = { |
e652f4c8 | 7707 | [ALC861_FIXUP_FSC_AMILO_PI1505] = { |
1727a771 TI |
7708 | .type = HDA_FIXUP_PINS, |
7709 | .v.pins = (const struct hda_pintbl[]) { | |
1d045db9 TI |
7710 | { 0x0b, 0x0221101f }, /* HP */ |
7711 | { 0x0f, 0x90170310 }, /* speaker */ | |
7712 | { } | |
7713 | } | |
7714 | }, | |
e652f4c8 | 7715 | [ALC861_FIXUP_AMP_VREF_0F] = { |
1727a771 | 7716 | .type = HDA_FIXUP_FUNC, |
31150f23 | 7717 | .v.func = alc861_fixup_asus_amp_vref_0f, |
3b25eb69 | 7718 | }, |
e652f4c8 | 7719 | [ALC861_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 7720 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
7721 | .v.func = alc_fixup_no_jack_detect, |
7722 | }, | |
7723 | [ALC861_FIXUP_ASUS_A6RP] = { | |
1727a771 | 7724 | .type = HDA_FIXUP_FUNC, |
e652f4c8 TI |
7725 | .v.func = alc861_fixup_asus_amp_vref_0f, |
7726 | .chained = true, | |
7727 | .chain_id = ALC861_FIXUP_NO_JACK_DETECT, | |
6ddf0fd1 TI |
7728 | }, |
7729 | [ALC660_FIXUP_ASUS_W7J] = { | |
7730 | .type = HDA_FIXUP_VERBS, | |
7731 | .v.verbs = (const struct hda_verb[]) { | |
7732 | /* ASUS W7J needs a magic pin setup on unused NID 0x10 | |
7733 | * for enabling outputs | |
7734 | */ | |
7735 | {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, | |
7736 | { } | |
7737 | }, | |
e652f4c8 | 7738 | } |
1d045db9 | 7739 | }; |
7085ec12 | 7740 | |
1d045db9 | 7741 | static const struct snd_pci_quirk alc861_fixup_tbl[] = { |
6ddf0fd1 | 7742 | SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), |
e7ca237b | 7743 | SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), |
e652f4c8 TI |
7744 | SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), |
7745 | SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), | |
7746 | SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), | |
7747 | SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), | |
7748 | SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), | |
7749 | SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), | |
1d045db9 TI |
7750 | {} |
7751 | }; | |
3af9ee6b | 7752 | |
1d045db9 TI |
7753 | /* |
7754 | */ | |
1d045db9 | 7755 | static int patch_alc861(struct hda_codec *codec) |
7085ec12 | 7756 | { |
1d045db9 | 7757 | struct alc_spec *spec; |
1d045db9 | 7758 | int err; |
7085ec12 | 7759 | |
3de95173 TI |
7760 | err = alc_alloc_spec(codec, 0x15); |
7761 | if (err < 0) | |
7762 | return err; | |
1d045db9 | 7763 | |
3de95173 | 7764 | spec = codec->spec; |
7504b6cd | 7765 | spec->gen.beep_nid = 0x23; |
1d045db9 | 7766 | |
225068ab TI |
7767 | #ifdef CONFIG_PM |
7768 | spec->power_hook = alc_power_eapd; | |
7769 | #endif | |
7770 | ||
1727a771 TI |
7771 | snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); |
7772 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
3af9ee6b | 7773 | |
cb4e4824 TI |
7774 | /* automatic parse from the BIOS config */ |
7775 | err = alc861_parse_auto_config(codec); | |
e16fb6d1 TI |
7776 | if (err < 0) |
7777 | goto error; | |
3af9ee6b | 7778 | |
7504b6cd | 7779 | if (!spec->gen.no_analog) |
3e6179b8 | 7780 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
7085ec12 | 7781 | |
1727a771 | 7782 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 7783 | |
1d045db9 | 7784 | return 0; |
e16fb6d1 TI |
7785 | |
7786 | error: | |
7787 | alc_free(codec); | |
7788 | return err; | |
7085ec12 TI |
7789 | } |
7790 | ||
1d045db9 TI |
7791 | /* |
7792 | * ALC861-VD support | |
7793 | * | |
7794 | * Based on ALC882 | |
7795 | * | |
7796 | * In addition, an independent DAC | |
7797 | */ | |
1d045db9 | 7798 | static int alc861vd_parse_auto_config(struct hda_codec *codec) |
bc9f98a9 | 7799 | { |
1d045db9 | 7800 | static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
7801 | static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; |
7802 | return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); | |
ce764ab2 TI |
7803 | } |
7804 | ||
1d045db9 | 7805 | enum { |
8fdcb6fe TI |
7806 | ALC660VD_FIX_ASUS_GPIO1, |
7807 | ALC861VD_FIX_DALLAS, | |
1d045db9 | 7808 | }; |
ce764ab2 | 7809 | |
8fdcb6fe TI |
7810 | /* exclude VREF80 */ |
7811 | static void alc861vd_fixup_dallas(struct hda_codec *codec, | |
1727a771 | 7812 | const struct hda_fixup *fix, int action) |
8fdcb6fe | 7813 | { |
1727a771 | 7814 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
b78562b1 TI |
7815 | snd_hda_override_pin_caps(codec, 0x18, 0x00000734); |
7816 | snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); | |
8fdcb6fe TI |
7817 | } |
7818 | } | |
7819 | ||
1727a771 | 7820 | static const struct hda_fixup alc861vd_fixups[] = { |
1d045db9 | 7821 | [ALC660VD_FIX_ASUS_GPIO1] = { |
1727a771 | 7822 | .type = HDA_FIXUP_VERBS, |
1d045db9 | 7823 | .v.verbs = (const struct hda_verb[]) { |
8fdcb6fe | 7824 | /* reset GPIO1 */ |
1d045db9 TI |
7825 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, |
7826 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, | |
7827 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, | |
7828 | { } | |
7829 | } | |
7830 | }, | |
8fdcb6fe | 7831 | [ALC861VD_FIX_DALLAS] = { |
1727a771 | 7832 | .type = HDA_FIXUP_FUNC, |
8fdcb6fe TI |
7833 | .v.func = alc861vd_fixup_dallas, |
7834 | }, | |
1d045db9 | 7835 | }; |
ce764ab2 | 7836 | |
1d045db9 | 7837 | static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { |
8fdcb6fe | 7838 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), |
1d045db9 | 7839 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), |
8fdcb6fe | 7840 | SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), |
1d045db9 TI |
7841 | {} |
7842 | }; | |
ce764ab2 | 7843 | |
1d045db9 TI |
7844 | /* |
7845 | */ | |
1d045db9 | 7846 | static int patch_alc861vd(struct hda_codec *codec) |
ce764ab2 | 7847 | { |
1d045db9 | 7848 | struct alc_spec *spec; |
cb4e4824 | 7849 | int err; |
ce764ab2 | 7850 | |
3de95173 TI |
7851 | err = alc_alloc_spec(codec, 0x0b); |
7852 | if (err < 0) | |
7853 | return err; | |
1d045db9 | 7854 | |
3de95173 | 7855 | spec = codec->spec; |
7504b6cd | 7856 | spec->gen.beep_nid = 0x23; |
1d045db9 | 7857 | |
225068ab TI |
7858 | spec->shutup = alc_eapd_shutup; |
7859 | ||
1727a771 TI |
7860 | snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); |
7861 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | |
1d045db9 | 7862 | |
cb4e4824 TI |
7863 | /* automatic parse from the BIOS config */ |
7864 | err = alc861vd_parse_auto_config(codec); | |
e16fb6d1 TI |
7865 | if (err < 0) |
7866 | goto error; | |
ce764ab2 | 7867 | |
7504b6cd | 7868 | if (!spec->gen.no_analog) |
3e6179b8 | 7869 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
1d045db9 | 7870 | |
1727a771 | 7871 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 7872 | |
ce764ab2 | 7873 | return 0; |
e16fb6d1 TI |
7874 | |
7875 | error: | |
7876 | alc_free(codec); | |
7877 | return err; | |
ce764ab2 TI |
7878 | } |
7879 | ||
1d045db9 TI |
7880 | /* |
7881 | * ALC662 support | |
7882 | * | |
7883 | * ALC662 is almost identical with ALC880 but has cleaner and more flexible | |
7884 | * configuration. Each pin widget can choose any input DACs and a mixer. | |
7885 | * Each ADC is connected from a mixer of all inputs. This makes possible | |
7886 | * 6-channel independent captures. | |
7887 | * | |
7888 | * In addition, an independent DAC for the multi-playback (not used in this | |
7889 | * driver yet). | |
7890 | */ | |
1d045db9 TI |
7891 | |
7892 | /* | |
7893 | * BIOS auto configuration | |
7894 | */ | |
7895 | ||
bc9f98a9 KY |
7896 | static int alc662_parse_auto_config(struct hda_codec *codec) |
7897 | { | |
4c6d72d1 | 7898 | static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; |
3e6179b8 TI |
7899 | static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; |
7900 | static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; | |
7901 | const hda_nid_t *ssids; | |
ee979a14 | 7902 | |
7639a06c TI |
7903 | if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || |
7904 | codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || | |
7905 | codec->core.vendor_id == 0x10ec0671) | |
3e6179b8 | 7906 | ssids = alc663_ssids; |
6227cdce | 7907 | else |
3e6179b8 TI |
7908 | ssids = alc662_ssids; |
7909 | return alc_parse_auto_config(codec, alc662_ignore, ssids); | |
bc9f98a9 KY |
7910 | } |
7911 | ||
6be7948f | 7912 | static void alc272_fixup_mario(struct hda_codec *codec, |
1727a771 | 7913 | const struct hda_fixup *fix, int action) |
6fc398cb | 7914 | { |
9bb1f06f | 7915 | if (action != HDA_FIXUP_ACT_PRE_PROBE) |
6fc398cb | 7916 | return; |
6be7948f TB |
7917 | if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, |
7918 | (0x3b << AC_AMPCAP_OFFSET_SHIFT) | | |
7919 | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | | |
7920 | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | | |
7921 | (0 << AC_AMPCAP_MUTE_SHIFT))) | |
4e76a883 | 7922 | codec_warn(codec, "failed to override amp caps for NID 0x2\n"); |
6be7948f TB |
7923 | } |
7924 | ||
8e383953 TI |
7925 | static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { |
7926 | { .channels = 2, | |
7927 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, | |
7928 | { .channels = 4, | |
7929 | .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, | |
7930 | SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ | |
7931 | { } | |
7932 | }; | |
7933 | ||
7934 | /* override the 2.1 chmap */ | |
eb9ca3ab | 7935 | static void alc_fixup_bass_chmap(struct hda_codec *codec, |
8e383953 TI |
7936 | const struct hda_fixup *fix, int action) |
7937 | { | |
7938 | if (action == HDA_FIXUP_ACT_BUILD) { | |
7939 | struct alc_spec *spec = codec->spec; | |
bbbc7e85 | 7940 | spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; |
8e383953 TI |
7941 | } |
7942 | } | |
7943 | ||
bf68665d TI |
7944 | /* avoid D3 for keeping GPIO up */ |
7945 | static unsigned int gpio_led_power_filter(struct hda_codec *codec, | |
7946 | hda_nid_t nid, | |
7947 | unsigned int power_state) | |
7948 | { | |
7949 | struct alc_spec *spec = codec->spec; | |
7639a06c | 7950 | if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_led) |
bf68665d TI |
7951 | return AC_PWRST_D0; |
7952 | return power_state; | |
7953 | } | |
7954 | ||
3e887f37 TI |
7955 | static void alc662_fixup_led_gpio1(struct hda_codec *codec, |
7956 | const struct hda_fixup *fix, int action) | |
7957 | { | |
7958 | struct alc_spec *spec = codec->spec; | |
7959 | static const struct hda_verb gpio_init[] = { | |
7960 | { 0x01, AC_VERB_SET_GPIO_MASK, 0x01 }, | |
7961 | { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01 }, | |
7962 | {} | |
7963 | }; | |
7964 | ||
7965 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
0f32fd19 | 7966 | spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook; |
3e887f37 | 7967 | spec->gpio_led = 0; |
0f32fd19 TI |
7968 | spec->mute_led_polarity = 1; |
7969 | spec->gpio_mute_led_mask = 0x01; | |
3e887f37 | 7970 | snd_hda_add_verbs(codec, gpio_init); |
bf68665d | 7971 | codec->power_filter = gpio_led_power_filter; |
3e887f37 TI |
7972 | } |
7973 | } | |
7974 | ||
c6790c8e KY |
7975 | static void alc662_usi_automute_hook(struct hda_codec *codec, |
7976 | struct hda_jack_callback *jack) | |
7977 | { | |
7978 | struct alc_spec *spec = codec->spec; | |
7979 | int vref; | |
7980 | msleep(200); | |
7981 | snd_hda_gen_hp_automute(codec, jack); | |
7982 | ||
7983 | vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; | |
7984 | msleep(100); | |
7985 | snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | |
7986 | vref); | |
7987 | } | |
7988 | ||
7989 | static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, | |
7990 | const struct hda_fixup *fix, int action) | |
7991 | { | |
7992 | struct alc_spec *spec = codec->spec; | |
7993 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | |
7994 | spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; | |
7995 | spec->gen.hp_automute_hook = alc662_usi_automute_hook; | |
7996 | } | |
7997 | } | |
7998 | ||
f3f9185f KY |
7999 | static struct coef_fw alc668_coefs[] = { |
8000 | WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), | |
8001 | WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), | |
8002 | WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), | |
8003 | WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), | |
8004 | WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), | |
8005 | WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), | |
8006 | WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), | |
8007 | WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), | |
8008 | WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), | |
8009 | WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), | |
8010 | WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), | |
8011 | WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), | |
8012 | WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), | |
8013 | WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), | |
8014 | WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), | |
8015 | WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), | |
8016 | WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), | |
8017 | WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), | |
8018 | WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), | |
8019 | WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), | |
8020 | {} | |
8021 | }; | |
8022 | ||
8023 | static void alc668_restore_default_value(struct hda_codec *codec) | |
8024 | { | |
8025 | alc_process_coef_fw(codec, alc668_coefs); | |
8026 | } | |
8027 | ||
6cb3b707 | 8028 | enum { |
2df03514 | 8029 | ALC662_FIXUP_ASPIRE, |
3e887f37 | 8030 | ALC662_FIXUP_LED_GPIO1, |
6cb3b707 | 8031 | ALC662_FIXUP_IDEAPAD, |
6be7948f | 8032 | ALC272_FIXUP_MARIO, |
d2ebd479 | 8033 | ALC662_FIXUP_CZC_P10T, |
94024cd1 | 8034 | ALC662_FIXUP_SKU_IGNORE, |
e59ea3ed | 8035 | ALC662_FIXUP_HP_RP5800, |
53c334ad TI |
8036 | ALC662_FIXUP_ASUS_MODE1, |
8037 | ALC662_FIXUP_ASUS_MODE2, | |
8038 | ALC662_FIXUP_ASUS_MODE3, | |
8039 | ALC662_FIXUP_ASUS_MODE4, | |
8040 | ALC662_FIXUP_ASUS_MODE5, | |
8041 | ALC662_FIXUP_ASUS_MODE6, | |
8042 | ALC662_FIXUP_ASUS_MODE7, | |
8043 | ALC662_FIXUP_ASUS_MODE8, | |
1565cc35 | 8044 | ALC662_FIXUP_NO_JACK_DETECT, |
edfe3bfc | 8045 | ALC662_FIXUP_ZOTAC_Z68, |
125821ae | 8046 | ALC662_FIXUP_INV_DMIC, |
1f8b46cd | 8047 | ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
73bdd597 | 8048 | ALC668_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 8049 | ALC662_FIXUP_HEADSET_MODE, |
73bdd597 | 8050 | ALC668_FIXUP_HEADSET_MODE, |
8e54b4ac | 8051 | ALC662_FIXUP_BASS_MODE4_CHMAP, |
61a75f13 | 8052 | ALC662_FIXUP_BASS_16, |
a30c9aaa | 8053 | ALC662_FIXUP_BASS_1A, |
8e54b4ac | 8054 | ALC662_FIXUP_BASS_CHMAP, |
493a52a9 | 8055 | ALC668_FIXUP_AUTO_MUTE, |
5e6db669 | 8056 | ALC668_FIXUP_DELL_DISABLE_AAMIX, |
033b0a7c | 8057 | ALC668_FIXUP_DELL_XPS13, |
9d4dc584 | 8058 | ALC662_FIXUP_ASUS_Nx50, |
fc7438b1 | 8059 | ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 8060 | ALC668_FIXUP_ASUS_Nx51, |
73d9844f | 8061 | ALC668_FIXUP_MIC_COEF, |
495b327b | 8062 | ALC668_FIXUP_ASUS_G751, |
78f4f7c2 KY |
8063 | ALC891_FIXUP_HEADSET_MODE, |
8064 | ALC891_FIXUP_DELL_MIC_NO_PRESENCE, | |
9b51fe3e | 8065 | ALC662_FIXUP_ACER_VERITON, |
1a3f0991 | 8066 | ALC892_FIXUP_ASROCK_MOBO, |
c6790c8e KY |
8067 | ALC662_FIXUP_USI_FUNC, |
8068 | ALC662_FIXUP_USI_HEADSET_MODE, | |
ca169cc2 | 8069 | ALC662_FIXUP_LENOVO_MULTI_CODECS, |
6cb3b707 DH |
8070 | }; |
8071 | ||
1727a771 | 8072 | static const struct hda_fixup alc662_fixups[] = { |
2df03514 | 8073 | [ALC662_FIXUP_ASPIRE] = { |
1727a771 TI |
8074 | .type = HDA_FIXUP_PINS, |
8075 | .v.pins = (const struct hda_pintbl[]) { | |
2df03514 DC |
8076 | { 0x15, 0x99130112 }, /* subwoofer */ |
8077 | { } | |
8078 | } | |
8079 | }, | |
3e887f37 TI |
8080 | [ALC662_FIXUP_LED_GPIO1] = { |
8081 | .type = HDA_FIXUP_FUNC, | |
8082 | .v.func = alc662_fixup_led_gpio1, | |
8083 | }, | |
6cb3b707 | 8084 | [ALC662_FIXUP_IDEAPAD] = { |
1727a771 TI |
8085 | .type = HDA_FIXUP_PINS, |
8086 | .v.pins = (const struct hda_pintbl[]) { | |
6cb3b707 DH |
8087 | { 0x17, 0x99130112 }, /* subwoofer */ |
8088 | { } | |
3e887f37 TI |
8089 | }, |
8090 | .chained = true, | |
8091 | .chain_id = ALC662_FIXUP_LED_GPIO1, | |
6cb3b707 | 8092 | }, |
6be7948f | 8093 | [ALC272_FIXUP_MARIO] = { |
1727a771 | 8094 | .type = HDA_FIXUP_FUNC, |
b5bfbc67 | 8095 | .v.func = alc272_fixup_mario, |
d2ebd479 AA |
8096 | }, |
8097 | [ALC662_FIXUP_CZC_P10T] = { | |
1727a771 | 8098 | .type = HDA_FIXUP_VERBS, |
d2ebd479 AA |
8099 | .v.verbs = (const struct hda_verb[]) { |
8100 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | |
8101 | {} | |
8102 | } | |
8103 | }, | |
94024cd1 | 8104 | [ALC662_FIXUP_SKU_IGNORE] = { |
1727a771 | 8105 | .type = HDA_FIXUP_FUNC, |
23d30f28 | 8106 | .v.func = alc_fixup_sku_ignore, |
c6b35874 | 8107 | }, |
e59ea3ed | 8108 | [ALC662_FIXUP_HP_RP5800] = { |
1727a771 TI |
8109 | .type = HDA_FIXUP_PINS, |
8110 | .v.pins = (const struct hda_pintbl[]) { | |
e59ea3ed TI |
8111 | { 0x14, 0x0221201f }, /* HP out */ |
8112 | { } | |
8113 | }, | |
8114 | .chained = true, | |
8115 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8116 | }, | |
53c334ad | 8117 | [ALC662_FIXUP_ASUS_MODE1] = { |
1727a771 TI |
8118 | .type = HDA_FIXUP_PINS, |
8119 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
8120 | { 0x14, 0x99130110 }, /* speaker */ |
8121 | { 0x18, 0x01a19c20 }, /* mic */ | |
8122 | { 0x19, 0x99a3092f }, /* int-mic */ | |
8123 | { 0x21, 0x0121401f }, /* HP out */ | |
8124 | { } | |
8125 | }, | |
8126 | .chained = true, | |
8127 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8128 | }, | |
8129 | [ALC662_FIXUP_ASUS_MODE2] = { | |
1727a771 TI |
8130 | .type = HDA_FIXUP_PINS, |
8131 | .v.pins = (const struct hda_pintbl[]) { | |
2996bdba TI |
8132 | { 0x14, 0x99130110 }, /* speaker */ |
8133 | { 0x18, 0x01a19820 }, /* mic */ | |
8134 | { 0x19, 0x99a3092f }, /* int-mic */ | |
8135 | { 0x1b, 0x0121401f }, /* HP out */ | |
8136 | { } | |
8137 | }, | |
53c334ad TI |
8138 | .chained = true, |
8139 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8140 | }, | |
8141 | [ALC662_FIXUP_ASUS_MODE3] = { | |
1727a771 TI |
8142 | .type = HDA_FIXUP_PINS, |
8143 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
8144 | { 0x14, 0x99130110 }, /* speaker */ |
8145 | { 0x15, 0x0121441f }, /* HP */ | |
8146 | { 0x18, 0x01a19840 }, /* mic */ | |
8147 | { 0x19, 0x99a3094f }, /* int-mic */ | |
8148 | { 0x21, 0x01211420 }, /* HP2 */ | |
8149 | { } | |
8150 | }, | |
8151 | .chained = true, | |
8152 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8153 | }, | |
8154 | [ALC662_FIXUP_ASUS_MODE4] = { | |
1727a771 TI |
8155 | .type = HDA_FIXUP_PINS, |
8156 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
8157 | { 0x14, 0x99130110 }, /* speaker */ |
8158 | { 0x16, 0x99130111 }, /* speaker */ | |
8159 | { 0x18, 0x01a19840 }, /* mic */ | |
8160 | { 0x19, 0x99a3094f }, /* int-mic */ | |
8161 | { 0x21, 0x0121441f }, /* HP */ | |
8162 | { } | |
8163 | }, | |
8164 | .chained = true, | |
8165 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8166 | }, | |
8167 | [ALC662_FIXUP_ASUS_MODE5] = { | |
1727a771 TI |
8168 | .type = HDA_FIXUP_PINS, |
8169 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
8170 | { 0x14, 0x99130110 }, /* speaker */ |
8171 | { 0x15, 0x0121441f }, /* HP */ | |
8172 | { 0x16, 0x99130111 }, /* speaker */ | |
8173 | { 0x18, 0x01a19840 }, /* mic */ | |
8174 | { 0x19, 0x99a3094f }, /* int-mic */ | |
8175 | { } | |
8176 | }, | |
8177 | .chained = true, | |
8178 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8179 | }, | |
8180 | [ALC662_FIXUP_ASUS_MODE6] = { | |
1727a771 TI |
8181 | .type = HDA_FIXUP_PINS, |
8182 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
8183 | { 0x14, 0x99130110 }, /* speaker */ |
8184 | { 0x15, 0x01211420 }, /* HP2 */ | |
8185 | { 0x18, 0x01a19840 }, /* mic */ | |
8186 | { 0x19, 0x99a3094f }, /* int-mic */ | |
8187 | { 0x1b, 0x0121441f }, /* HP */ | |
8188 | { } | |
8189 | }, | |
8190 | .chained = true, | |
8191 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8192 | }, | |
8193 | [ALC662_FIXUP_ASUS_MODE7] = { | |
1727a771 TI |
8194 | .type = HDA_FIXUP_PINS, |
8195 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
8196 | { 0x14, 0x99130110 }, /* speaker */ |
8197 | { 0x17, 0x99130111 }, /* speaker */ | |
8198 | { 0x18, 0x01a19840 }, /* mic */ | |
8199 | { 0x19, 0x99a3094f }, /* int-mic */ | |
8200 | { 0x1b, 0x01214020 }, /* HP */ | |
8201 | { 0x21, 0x0121401f }, /* HP */ | |
8202 | { } | |
8203 | }, | |
8204 | .chained = true, | |
8205 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
8206 | }, | |
8207 | [ALC662_FIXUP_ASUS_MODE8] = { | |
1727a771 TI |
8208 | .type = HDA_FIXUP_PINS, |
8209 | .v.pins = (const struct hda_pintbl[]) { | |
53c334ad TI |
8210 | { 0x14, 0x99130110 }, /* speaker */ |
8211 | { 0x12, 0x99a30970 }, /* int-mic */ | |
8212 | { 0x15, 0x01214020 }, /* HP */ | |
8213 | { 0x17, 0x99130111 }, /* speaker */ | |
8214 | { 0x18, 0x01a19840 }, /* mic */ | |
8215 | { 0x21, 0x0121401f }, /* HP */ | |
8216 | { } | |
8217 | }, | |
8218 | .chained = true, | |
8219 | .chain_id = ALC662_FIXUP_SKU_IGNORE | |
2996bdba | 8220 | }, |
1565cc35 | 8221 | [ALC662_FIXUP_NO_JACK_DETECT] = { |
1727a771 | 8222 | .type = HDA_FIXUP_FUNC, |
1565cc35 TI |
8223 | .v.func = alc_fixup_no_jack_detect, |
8224 | }, | |
edfe3bfc | 8225 | [ALC662_FIXUP_ZOTAC_Z68] = { |
1727a771 TI |
8226 | .type = HDA_FIXUP_PINS, |
8227 | .v.pins = (const struct hda_pintbl[]) { | |
edfe3bfc DH |
8228 | { 0x1b, 0x02214020 }, /* Front HP */ |
8229 | { } | |
8230 | } | |
8231 | }, | |
125821ae | 8232 | [ALC662_FIXUP_INV_DMIC] = { |
1727a771 | 8233 | .type = HDA_FIXUP_FUNC, |
9d36a7dc | 8234 | .v.func = alc_fixup_inv_dmic, |
125821ae | 8235 | }, |
033b0a7c GM |
8236 | [ALC668_FIXUP_DELL_XPS13] = { |
8237 | .type = HDA_FIXUP_FUNC, | |
8238 | .v.func = alc_fixup_dell_xps13, | |
8239 | .chained = true, | |
8240 | .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX | |
8241 | }, | |
5e6db669 GM |
8242 | [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { |
8243 | .type = HDA_FIXUP_FUNC, | |
8244 | .v.func = alc_fixup_disable_aamix, | |
8245 | .chained = true, | |
8246 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
8247 | }, | |
493a52a9 HW |
8248 | [ALC668_FIXUP_AUTO_MUTE] = { |
8249 | .type = HDA_FIXUP_FUNC, | |
8250 | .v.func = alc_fixup_auto_mute_via_amp, | |
8251 | .chained = true, | |
8252 | .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE | |
8253 | }, | |
1f8b46cd DH |
8254 | [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { |
8255 | .type = HDA_FIXUP_PINS, | |
8256 | .v.pins = (const struct hda_pintbl[]) { | |
8257 | { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
8258 | /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ | |
8259 | { } | |
8260 | }, | |
8261 | .chained = true, | |
8262 | .chain_id = ALC662_FIXUP_HEADSET_MODE | |
8263 | }, | |
8264 | [ALC662_FIXUP_HEADSET_MODE] = { | |
8265 | .type = HDA_FIXUP_FUNC, | |
8266 | .v.func = alc_fixup_headset_mode_alc662, | |
8267 | }, | |
73bdd597 DH |
8268 | [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { |
8269 | .type = HDA_FIXUP_PINS, | |
8270 | .v.pins = (const struct hda_pintbl[]) { | |
8271 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
8272 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
8273 | { } | |
8274 | }, | |
8275 | .chained = true, | |
8276 | .chain_id = ALC668_FIXUP_HEADSET_MODE | |
8277 | }, | |
8278 | [ALC668_FIXUP_HEADSET_MODE] = { | |
8279 | .type = HDA_FIXUP_FUNC, | |
8280 | .v.func = alc_fixup_headset_mode_alc668, | |
8281 | }, | |
8e54b4ac | 8282 | [ALC662_FIXUP_BASS_MODE4_CHMAP] = { |
8e383953 | 8283 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 8284 | .v.func = alc_fixup_bass_chmap, |
8e383953 TI |
8285 | .chained = true, |
8286 | .chain_id = ALC662_FIXUP_ASUS_MODE4 | |
8287 | }, | |
61a75f13 DH |
8288 | [ALC662_FIXUP_BASS_16] = { |
8289 | .type = HDA_FIXUP_PINS, | |
8290 | .v.pins = (const struct hda_pintbl[]) { | |
8291 | {0x16, 0x80106111}, /* bass speaker */ | |
8292 | {} | |
8293 | }, | |
8294 | .chained = true, | |
8295 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
8296 | }, | |
a30c9aaa TI |
8297 | [ALC662_FIXUP_BASS_1A] = { |
8298 | .type = HDA_FIXUP_PINS, | |
8299 | .v.pins = (const struct hda_pintbl[]) { | |
8300 | {0x1a, 0x80106111}, /* bass speaker */ | |
8301 | {} | |
8302 | }, | |
8e54b4ac DH |
8303 | .chained = true, |
8304 | .chain_id = ALC662_FIXUP_BASS_CHMAP, | |
a30c9aaa | 8305 | }, |
8e54b4ac | 8306 | [ALC662_FIXUP_BASS_CHMAP] = { |
a30c9aaa | 8307 | .type = HDA_FIXUP_FUNC, |
eb9ca3ab | 8308 | .v.func = alc_fixup_bass_chmap, |
a30c9aaa | 8309 | }, |
9d4dc584 BM |
8310 | [ALC662_FIXUP_ASUS_Nx50] = { |
8311 | .type = HDA_FIXUP_FUNC, | |
8312 | .v.func = alc_fixup_auto_mute_via_amp, | |
8313 | .chained = true, | |
8314 | .chain_id = ALC662_FIXUP_BASS_1A | |
8315 | }, | |
fc7438b1 MP |
8316 | [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { |
8317 | .type = HDA_FIXUP_FUNC, | |
8318 | .v.func = alc_fixup_headset_mode_alc668, | |
8319 | .chain_id = ALC662_FIXUP_BASS_CHMAP | |
8320 | }, | |
3231e205 YP |
8321 | [ALC668_FIXUP_ASUS_Nx51] = { |
8322 | .type = HDA_FIXUP_PINS, | |
8323 | .v.pins = (const struct hda_pintbl[]) { | |
fc7438b1 MP |
8324 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ |
8325 | { 0x1a, 0x90170151 }, /* bass speaker */ | |
8326 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
3231e205 YP |
8327 | {} |
8328 | }, | |
8329 | .chained = true, | |
fc7438b1 | 8330 | .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, |
3231e205 | 8331 | }, |
73d9844f | 8332 | [ALC668_FIXUP_MIC_COEF] = { |
495b327b TI |
8333 | .type = HDA_FIXUP_VERBS, |
8334 | .v.verbs = (const struct hda_verb[]) { | |
8335 | { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, | |
8336 | { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, | |
8337 | {} | |
8338 | }, | |
8339 | }, | |
73d9844f TI |
8340 | [ALC668_FIXUP_ASUS_G751] = { |
8341 | .type = HDA_FIXUP_PINS, | |
8342 | .v.pins = (const struct hda_pintbl[]) { | |
8343 | { 0x16, 0x0421101f }, /* HP */ | |
8344 | {} | |
8345 | }, | |
8346 | .chained = true, | |
8347 | .chain_id = ALC668_FIXUP_MIC_COEF | |
8348 | }, | |
78f4f7c2 KY |
8349 | [ALC891_FIXUP_HEADSET_MODE] = { |
8350 | .type = HDA_FIXUP_FUNC, | |
8351 | .v.func = alc_fixup_headset_mode, | |
8352 | }, | |
8353 | [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { | |
8354 | .type = HDA_FIXUP_PINS, | |
8355 | .v.pins = (const struct hda_pintbl[]) { | |
8356 | { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ | |
8357 | { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ | |
8358 | { } | |
8359 | }, | |
8360 | .chained = true, | |
8361 | .chain_id = ALC891_FIXUP_HEADSET_MODE | |
8362 | }, | |
9b51fe3e SB |
8363 | [ALC662_FIXUP_ACER_VERITON] = { |
8364 | .type = HDA_FIXUP_PINS, | |
8365 | .v.pins = (const struct hda_pintbl[]) { | |
8366 | { 0x15, 0x50170120 }, /* no internal speaker */ | |
8367 | { } | |
8368 | } | |
8369 | }, | |
1a3f0991 TI |
8370 | [ALC892_FIXUP_ASROCK_MOBO] = { |
8371 | .type = HDA_FIXUP_PINS, | |
8372 | .v.pins = (const struct hda_pintbl[]) { | |
8373 | { 0x15, 0x40f000f0 }, /* disabled */ | |
8374 | { 0x16, 0x40f000f0 }, /* disabled */ | |
1a3f0991 TI |
8375 | { } |
8376 | } | |
8377 | }, | |
c6790c8e KY |
8378 | [ALC662_FIXUP_USI_FUNC] = { |
8379 | .type = HDA_FIXUP_FUNC, | |
8380 | .v.func = alc662_fixup_usi_headset_mic, | |
8381 | }, | |
8382 | [ALC662_FIXUP_USI_HEADSET_MODE] = { | |
8383 | .type = HDA_FIXUP_PINS, | |
8384 | .v.pins = (const struct hda_pintbl[]) { | |
8385 | { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ | |
8386 | { 0x18, 0x01a1903d }, | |
8387 | { } | |
8388 | }, | |
8389 | .chained = true, | |
8390 | .chain_id = ALC662_FIXUP_USI_FUNC | |
8391 | }, | |
ca169cc2 KY |
8392 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { |
8393 | .type = HDA_FIXUP_FUNC, | |
8394 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | |
8395 | }, | |
6cb3b707 DH |
8396 | }; |
8397 | ||
a9111321 | 8398 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
53c334ad | 8399 | SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), |
d3d3835c | 8400 | SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), |
02f6ff90 | 8401 | SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), |
a6c47a85 | 8402 | SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), |
94024cd1 | 8403 | SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), |
125821ae | 8404 | SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), |
1801928e | 8405 | SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), |
2df03514 | 8406 | SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), |
73bdd597 DH |
8407 | SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
8408 | SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
c5d019c3 | 8409 | SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), |
033b0a7c | 8410 | SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), |
467e1436 | 8411 | SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), |
09d2014f | 8412 | SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
ad8ff99e | 8413 | SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
8dc9abb9 KY |
8414 | SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
8415 | SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), | |
6a98e34b | 8416 | SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), |
e59ea3ed | 8417 | SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), |
2da2dc9e | 8418 | SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), |
83a9efb5 | 8419 | SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), |
db8948e6 | 8420 | SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), |
9d4dc584 | 8421 | SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), |
495b327b | 8422 | SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), |
8e54b4ac | 8423 | SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
61a75f13 | 8424 | SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
3231e205 YP |
8425 | SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
8426 | SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), | |
c7efff92 | 8427 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
61a75f13 | 8428 | SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
8e54b4ac | 8429 | SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
1565cc35 | 8430 | SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), |
53c334ad | 8431 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
a0e90acc | 8432 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
c6790c8e | 8433 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
ca169cc2 | 8434 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), |
d4118588 | 8435 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
6cb3b707 | 8436 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
1a3f0991 | 8437 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |
edfe3bfc | 8438 | SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), |
9b51fe3e | 8439 | SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), |
d2ebd479 | 8440 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), |
53c334ad TI |
8441 | |
8442 | #if 0 | |
8443 | /* Below is a quirk table taken from the old code. | |
8444 | * Basically the device should work as is without the fixup table. | |
8445 | * If BIOS doesn't give a proper info, enable the corresponding | |
8446 | * fixup entry. | |
7d7eb9ea | 8447 | */ |
53c334ad TI |
8448 | SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), |
8449 | SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), | |
8450 | SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), | |
8451 | SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), | |
8452 | SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
8453 | SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8454 | SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
8455 | SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), | |
8456 | SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), | |
8457 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8458 | SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), | |
8459 | SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), | |
8460 | SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), | |
8461 | SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), | |
8462 | SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), | |
8463 | SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8464 | SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), | |
8465 | SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), | |
8466 | SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8467 | SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
8468 | SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
8469 | SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8470 | SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), | |
8471 | SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), | |
8472 | SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), | |
8473 | SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8474 | SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), | |
8475 | SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), | |
8476 | SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8477 | SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), | |
8478 | SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8479 | SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8480 | SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), | |
8481 | SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), | |
8482 | SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), | |
8483 | SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), | |
8484 | SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), | |
8485 | SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), | |
8486 | SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), | |
8487 | SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), | |
8488 | SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), | |
8489 | SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), | |
8490 | SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
8491 | SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), | |
8492 | SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), | |
8493 | SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), | |
8494 | SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), | |
8495 | SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), | |
8496 | SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), | |
8497 | SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), | |
8498 | #endif | |
6cb3b707 DH |
8499 | {} |
8500 | }; | |
8501 | ||
1727a771 | 8502 | static const struct hda_model_fixup alc662_fixup_models[] = { |
6be7948f | 8503 | {.id = ALC272_FIXUP_MARIO, .name = "mario"}, |
53c334ad TI |
8504 | {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, |
8505 | {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, | |
8506 | {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, | |
8507 | {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, | |
8508 | {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, | |
8509 | {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, | |
8510 | {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, | |
8511 | {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, | |
6e72aa5f | 8512 | {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, |
e32aa85a | 8513 | {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, |
ba90d6a6 | 8514 | {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, |
6be7948f TB |
8515 | {} |
8516 | }; | |
6cb3b707 | 8517 | |
532895c5 | 8518 | static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { |
78f4f7c2 KY |
8519 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
8520 | {0x17, 0x02211010}, | |
8521 | {0x18, 0x01a19030}, | |
8522 | {0x1a, 0x01813040}, | |
8523 | {0x21, 0x01014020}), | |
0b6758d3 HW |
8524 | SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, |
8525 | {0x16, 0x01813030}, | |
8526 | {0x17, 0x02211010}, | |
8527 | {0x18, 0x01a19040}, | |
8528 | {0x21, 0x01014020}), | |
1f8b46cd | 8529 | SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, |
1f8b46cd | 8530 | {0x14, 0x01014010}, |
1f8b46cd | 8531 | {0x18, 0x01a19020}, |
1f8b46cd | 8532 | {0x1a, 0x0181302f}, |
11580297 | 8533 | {0x1b, 0x0221401f}), |
76c2132e DH |
8534 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
8535 | {0x12, 0x99a30130}, | |
8536 | {0x14, 0x90170110}, | |
8537 | {0x15, 0x0321101f}, | |
11580297 | 8538 | {0x16, 0x03011020}), |
76c2132e DH |
8539 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
8540 | {0x12, 0x99a30140}, | |
8541 | {0x14, 0x90170110}, | |
8542 | {0x15, 0x0321101f}, | |
11580297 | 8543 | {0x16, 0x03011020}), |
76c2132e DH |
8544 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
8545 | {0x12, 0x99a30150}, | |
8546 | {0x14, 0x90170110}, | |
8547 | {0x15, 0x0321101f}, | |
11580297 | 8548 | {0x16, 0x03011020}), |
76c2132e | 8549 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, |
76c2132e DH |
8550 | {0x14, 0x90170110}, |
8551 | {0x15, 0x0321101f}, | |
11580297 | 8552 | {0x16, 0x03011020}), |
76c2132e DH |
8553 | SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, |
8554 | {0x12, 0x90a60130}, | |
8555 | {0x14, 0x90170110}, | |
11580297 | 8556 | {0x15, 0x0321101f}), |
532895c5 HW |
8557 | {} |
8558 | }; | |
8559 | ||
1d045db9 TI |
8560 | /* |
8561 | */ | |
bc9f98a9 KY |
8562 | static int patch_alc662(struct hda_codec *codec) |
8563 | { | |
8564 | struct alc_spec *spec; | |
3de95173 | 8565 | int err; |
bc9f98a9 | 8566 | |
3de95173 TI |
8567 | err = alc_alloc_spec(codec, 0x0b); |
8568 | if (err < 0) | |
8569 | return err; | |
bc9f98a9 | 8570 | |
3de95173 | 8571 | spec = codec->spec; |
1f0f4b80 | 8572 | |
225068ab TI |
8573 | spec->shutup = alc_eapd_shutup; |
8574 | ||
53c334ad TI |
8575 | /* handle multiple HPs as is */ |
8576 | spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; | |
8577 | ||
2c3bf9ab TI |
8578 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
8579 | ||
7639a06c | 8580 | switch (codec->core.vendor_id) { |
f3f9185f KY |
8581 | case 0x10ec0668: |
8582 | spec->init_hook = alc668_restore_default_value; | |
8583 | break; | |
f3f9185f | 8584 | } |
8663ff75 | 8585 | |
1727a771 | 8586 | snd_hda_pick_fixup(codec, alc662_fixup_models, |
8e5a0509 | 8587 | alc662_fixup_tbl, alc662_fixups); |
532895c5 | 8588 | snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups); |
1727a771 | 8589 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
8e5a0509 TI |
8590 | |
8591 | alc_auto_parse_customize_define(codec); | |
8592 | ||
7504b6cd TI |
8593 | if (has_cdefine_beep(codec)) |
8594 | spec->gen.beep_nid = 0x01; | |
8595 | ||
1bb7e43e | 8596 | if ((alc_get_coef0(codec) & (1 << 14)) && |
5100cd07 | 8597 | codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && |
e16fb6d1 | 8598 | spec->cdefine.platform_type == 1) { |
6134b1a2 WY |
8599 | err = alc_codec_rename(codec, "ALC272X"); |
8600 | if (err < 0) | |
e16fb6d1 | 8601 | goto error; |
20ca0c35 | 8602 | } |
274693f3 | 8603 | |
b9c5106c TI |
8604 | /* automatic parse from the BIOS config */ |
8605 | err = alc662_parse_auto_config(codec); | |
e16fb6d1 TI |
8606 | if (err < 0) |
8607 | goto error; | |
bc9f98a9 | 8608 | |
7504b6cd | 8609 | if (!spec->gen.no_analog && spec->gen.beep_nid) { |
7639a06c | 8610 | switch (codec->core.vendor_id) { |
da00c244 KY |
8611 | case 0x10ec0662: |
8612 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | |
8613 | break; | |
8614 | case 0x10ec0272: | |
8615 | case 0x10ec0663: | |
8616 | case 0x10ec0665: | |
9ad54547 | 8617 | case 0x10ec0668: |
da00c244 KY |
8618 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
8619 | break; | |
8620 | case 0x10ec0273: | |
8621 | set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); | |
8622 | break; | |
8623 | } | |
cec27c89 | 8624 | } |
2134ea4f | 8625 | |
1727a771 | 8626 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); |
589876e2 | 8627 | |
bc9f98a9 | 8628 | return 0; |
801f49d3 | 8629 | |
e16fb6d1 TI |
8630 | error: |
8631 | alc_free(codec); | |
8632 | return err; | |
b478b998 KY |
8633 | } |
8634 | ||
d1eb57f4 KY |
8635 | /* |
8636 | * ALC680 support | |
8637 | */ | |
d1eb57f4 | 8638 | |
d1eb57f4 KY |
8639 | static int alc680_parse_auto_config(struct hda_codec *codec) |
8640 | { | |
3e6179b8 | 8641 | return alc_parse_auto_config(codec, NULL, NULL); |
d1eb57f4 KY |
8642 | } |
8643 | ||
d1eb57f4 | 8644 | /* |
d1eb57f4 | 8645 | */ |
d1eb57f4 KY |
8646 | static int patch_alc680(struct hda_codec *codec) |
8647 | { | |
d1eb57f4 KY |
8648 | int err; |
8649 | ||
1f0f4b80 | 8650 | /* ALC680 has no aa-loopback mixer */ |
3de95173 TI |
8651 | err = alc_alloc_spec(codec, 0); |
8652 | if (err < 0) | |
8653 | return err; | |
1f0f4b80 | 8654 | |
1ebec5f2 TI |
8655 | /* automatic parse from the BIOS config */ |
8656 | err = alc680_parse_auto_config(codec); | |
8657 | if (err < 0) { | |
8658 | alc_free(codec); | |
8659 | return err; | |
d1eb57f4 KY |
8660 | } |
8661 | ||
d1eb57f4 KY |
8662 | return 0; |
8663 | } | |
8664 | ||
1da177e4 LT |
8665 | /* |
8666 | * patch entries | |
8667 | */ | |
b9a94a9c | 8668 | static const struct hda_device_id snd_hda_id_realtek[] = { |
0a6f0600 | 8669 | HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), |
b9a94a9c | 8670 | HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), |
4231430d | 8671 | HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), |
b9a94a9c TI |
8672 | HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), |
8673 | HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), | |
dcd4f0db | 8674 | HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), |
b9a94a9c | 8675 | HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), |
736f20a7 | 8676 | HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), |
b9a94a9c TI |
8677 | HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), |
8678 | HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), | |
f429e7e4 | 8679 | HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), |
b9a94a9c TI |
8680 | HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), |
8681 | HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), | |
8682 | HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), | |
8683 | HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), | |
8684 | HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), | |
8685 | HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), | |
8686 | HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), | |
dcd4f0db | 8687 | HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), |
b9a94a9c TI |
8688 | HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), |
8689 | HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), | |
8690 | HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), | |
8691 | HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), | |
8692 | HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), | |
8693 | HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), | |
0a6f0600 | 8694 | HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), |
b9a94a9c TI |
8695 | HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), |
8696 | HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), | |
0a6f0600 | 8697 | HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), |
b9a94a9c TI |
8698 | HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), |
8699 | HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), | |
8700 | HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), | |
dcd4f0db | 8701 | HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
7d727869 | 8702 | HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
b9a94a9c | 8703 | HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
28f1f9b2 | 8704 | HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
9887cf53 | 8705 | HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), |
b9a94a9c TI |
8706 | HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
8707 | HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), | |
8708 | HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), | |
8709 | HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), | |
8710 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), | |
8711 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), | |
8712 | HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), | |
8713 | HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), | |
8714 | HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), | |
8715 | HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), | |
8716 | HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), | |
8717 | HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), | |
8718 | HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), | |
8719 | HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), | |
6fbae35a KY |
8720 | HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), |
8721 | HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), | |
8722 | HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), | |
78f4f7c2 | 8723 | HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), |
b9a94a9c TI |
8724 | HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), |
8725 | HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), | |
8726 | HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), | |
8727 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), | |
8728 | HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), | |
8729 | HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), | |
8730 | HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), | |
8731 | HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), | |
8732 | HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), | |
8733 | HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), | |
8734 | HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), | |
8735 | HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), | |
8736 | HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), | |
65553b12 | 8737 | HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), |
a535ad57 | 8738 | HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), |
1da177e4 LT |
8739 | {} /* terminator */ |
8740 | }; | |
b9a94a9c | 8741 | MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); |
1289e9e8 TI |
8742 | |
8743 | MODULE_LICENSE("GPL"); | |
8744 | MODULE_DESCRIPTION("Realtek HD-audio codec"); | |
8745 | ||
d8a766a1 | 8746 | static struct hda_codec_driver realtek_driver = { |
b9a94a9c | 8747 | .id = snd_hda_id_realtek, |
1289e9e8 TI |
8748 | }; |
8749 | ||
d8a766a1 | 8750 | module_hda_codec_driver(realtek_driver); |