1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Universal Interface for Intel High Definition Audio Codec 4 * 5 * HD audio interface patch for Realtek ALC codecs 6 * 7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw> 8 * PeiSen Hou <pshou@realtek.com.tw> 9 * Takashi Iwai <tiwai@suse.de> 10 * Jonathan Woithe <jwoithe@just42.net> 11 */ 12 13 #include <linux/acpi.h> 14 #include <linux/cleanup.h> 15 #include <linux/init.h> 16 #include <linux/delay.h> 17 #include <linux/slab.h> 18 #include <linux/pci.h> 19 #include <linux/dmi.h> 20 #include <linux/module.h> 21 #include <linux/i2c.h> 22 #include <linux/input.h> 23 #include <linux/leds.h> 24 #include <linux/ctype.h> 25 #include <linux/spi/spi.h> 26 #include <sound/core.h> 27 #include <sound/jack.h> 28 #include <sound/hda_codec.h> 29 #include "hda_local.h" 30 #include "hda_auto_parser.h" 31 #include "hda_jack.h" 32 #include "hda_generic.h" 33 #include "hda_component.h" 34 35 /* keep halting ALC5505 DSP, for power saving */ 36 #define HALT_REALTEK_ALC5505 37 38 /* extra amp-initialization sequence types */ 39 enum { 40 ALC_INIT_UNDEFINED, 41 ALC_INIT_NONE, 42 ALC_INIT_DEFAULT, 43 }; 44 45 enum { 46 ALC_HEADSET_MODE_UNKNOWN, 47 ALC_HEADSET_MODE_UNPLUGGED, 48 ALC_HEADSET_MODE_HEADSET, 49 ALC_HEADSET_MODE_MIC, 50 ALC_HEADSET_MODE_HEADPHONE, 51 }; 52 53 enum { 54 ALC_HEADSET_TYPE_UNKNOWN, 55 ALC_HEADSET_TYPE_CTIA, 56 ALC_HEADSET_TYPE_OMTP, 57 }; 58 59 enum { 60 ALC_KEY_MICMUTE_INDEX, 61 }; 62 63 struct alc_customize_define { 64 unsigned int sku_cfg; 65 unsigned char port_connectivity; 66 unsigned char check_sum; 67 unsigned char customization; 68 unsigned char external_amp; 69 unsigned int enable_pcbeep:1; 70 unsigned int platform_type:1; 71 unsigned int swap:1; 72 unsigned int override:1; 73 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ 74 }; 75 76 struct alc_coef_led { 77 unsigned int idx; 78 unsigned int mask; 79 unsigned int on; 80 unsigned int off; 81 }; 82 83 struct alc_spec { 84 struct hda_gen_spec gen; /* must be at head */ 85 86 /* codec parameterization */ 87 struct alc_customize_define cdefine; 88 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ 89 90 /* GPIO bits */ 91 unsigned int gpio_mask; 92 unsigned int gpio_dir; 93 unsigned int gpio_data; 94 bool gpio_write_delay; /* add a delay before writing gpio_data */ 95 96 /* mute LED for HP laptops, see vref_mute_led_set() */ 97 int mute_led_polarity; 98 int micmute_led_polarity; 99 hda_nid_t mute_led_nid; 100 hda_nid_t cap_mute_led_nid; 101 102 unsigned int gpio_mute_led_mask; 103 unsigned int gpio_mic_led_mask; 104 struct alc_coef_led mute_led_coef; 105 struct alc_coef_led mic_led_coef; 106 struct mutex coef_mutex; 107 108 hda_nid_t headset_mic_pin; 109 hda_nid_t headphone_mic_pin; 110 int current_headset_mode; 111 int current_headset_type; 112 113 /* hooks */ 114 void (*init_hook)(struct hda_codec *codec); 115 void (*power_hook)(struct hda_codec *codec); 116 void (*shutup)(struct hda_codec *codec); 117 118 int init_amp; 119 int codec_variant; /* flag for other variants */ 120 unsigned int has_alc5505_dsp:1; 121 unsigned int no_depop_delay:1; 122 unsigned int done_hp_init:1; 123 unsigned int no_shutup_pins:1; 124 unsigned int ultra_low_power:1; 125 unsigned int has_hs_key:1; 126 unsigned int no_internal_mic_pin:1; 127 unsigned int en_3kpull_low:1; 128 int num_speaker_amps; 129 130 /* for PLL fix */ 131 hda_nid_t pll_nid; 132 unsigned int pll_coef_idx, pll_coef_bit; 133 unsigned int coef0; 134 struct input_dev *kb_dev; 135 u8 alc_mute_keycode_map[1]; 136 137 /* component binding */ 138 struct hda_component_parent comps; 139 }; 140 141 /* 142 * COEF access helper functions 143 */ 144 145 static void coef_mutex_lock(struct hda_codec *codec) 146 { 147 struct alc_spec *spec = codec->spec; 148 149 snd_hda_power_up_pm(codec); 150 mutex_lock(&spec->coef_mutex); 151 } 152 153 static void coef_mutex_unlock(struct hda_codec *codec) 154 { 155 struct alc_spec *spec = codec->spec; 156 157 mutex_unlock(&spec->coef_mutex); 158 snd_hda_power_down_pm(codec); 159 } 160 161 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 162 unsigned int coef_idx) 163 { 164 unsigned int val; 165 166 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 167 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); 168 return val; 169 } 170 171 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 172 unsigned int coef_idx) 173 { 174 unsigned int val; 175 176 coef_mutex_lock(codec); 177 val = __alc_read_coefex_idx(codec, nid, coef_idx); 178 coef_mutex_unlock(codec); 179 return val; 180 } 181 182 #define alc_read_coef_idx(codec, coef_idx) \ 183 alc_read_coefex_idx(codec, 0x20, coef_idx) 184 185 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 186 unsigned int coef_idx, unsigned int coef_val) 187 { 188 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 189 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); 190 } 191 192 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 193 unsigned int coef_idx, unsigned int coef_val) 194 { 195 coef_mutex_lock(codec); 196 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val); 197 coef_mutex_unlock(codec); 198 } 199 200 #define alc_write_coef_idx(codec, coef_idx, coef_val) \ 201 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) 202 203 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 204 unsigned int coef_idx, unsigned int mask, 205 unsigned int bits_set) 206 { 207 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx); 208 209 if (val != -1) 210 __alc_write_coefex_idx(codec, nid, coef_idx, 211 (val & ~mask) | bits_set); 212 } 213 214 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 215 unsigned int coef_idx, unsigned int mask, 216 unsigned int bits_set) 217 { 218 coef_mutex_lock(codec); 219 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set); 220 coef_mutex_unlock(codec); 221 } 222 223 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ 224 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) 225 226 /* a special bypass for COEF 0; read the cached value at the second time */ 227 static unsigned int alc_get_coef0(struct hda_codec *codec) 228 { 229 struct alc_spec *spec = codec->spec; 230 231 if (!spec->coef0) 232 spec->coef0 = alc_read_coef_idx(codec, 0); 233 return spec->coef0; 234 } 235 236 /* coef writes/updates batch */ 237 struct coef_fw { 238 unsigned char nid; 239 unsigned char idx; 240 unsigned short mask; 241 unsigned short val; 242 }; 243 244 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ 245 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } 246 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) 247 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) 248 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) 249 250 static void alc_process_coef_fw(struct hda_codec *codec, 251 const struct coef_fw *fw) 252 { 253 coef_mutex_lock(codec); 254 for (; fw->nid; fw++) { 255 if (fw->mask == (unsigned short)-1) 256 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); 257 else 258 __alc_update_coefex_idx(codec, fw->nid, fw->idx, 259 fw->mask, fw->val); 260 } 261 coef_mutex_unlock(codec); 262 } 263 264 /* 265 * GPIO setup tables, used in initialization 266 */ 267 268 /* Enable GPIO mask and set output */ 269 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) 270 { 271 struct alc_spec *spec = codec->spec; 272 273 spec->gpio_mask |= mask; 274 spec->gpio_dir |= mask; 275 spec->gpio_data |= mask; 276 } 277 278 static void alc_write_gpio_data(struct hda_codec *codec) 279 { 280 struct alc_spec *spec = codec->spec; 281 282 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 283 spec->gpio_data); 284 } 285 286 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, 287 bool on) 288 { 289 struct alc_spec *spec = codec->spec; 290 unsigned int oldval = spec->gpio_data; 291 292 if (on) 293 spec->gpio_data |= mask; 294 else 295 spec->gpio_data &= ~mask; 296 if (oldval != spec->gpio_data) 297 alc_write_gpio_data(codec); 298 } 299 300 static void alc_write_gpio(struct hda_codec *codec) 301 { 302 struct alc_spec *spec = codec->spec; 303 304 if (!spec->gpio_mask) 305 return; 306 307 snd_hda_codec_write(codec, codec->core.afg, 0, 308 AC_VERB_SET_GPIO_MASK, spec->gpio_mask); 309 snd_hda_codec_write(codec, codec->core.afg, 0, 310 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); 311 if (spec->gpio_write_delay) 312 msleep(1); 313 alc_write_gpio_data(codec); 314 } 315 316 static void alc_fixup_gpio(struct hda_codec *codec, int action, 317 unsigned int mask) 318 { 319 if (action == HDA_FIXUP_ACT_PRE_PROBE) 320 alc_setup_gpio(codec, mask); 321 } 322 323 static void alc_fixup_gpio1(struct hda_codec *codec, 324 const struct hda_fixup *fix, int action) 325 { 326 alc_fixup_gpio(codec, action, 0x01); 327 } 328 329 static void alc_fixup_gpio2(struct hda_codec *codec, 330 const struct hda_fixup *fix, int action) 331 { 332 alc_fixup_gpio(codec, action, 0x02); 333 } 334 335 static void alc_fixup_gpio3(struct hda_codec *codec, 336 const struct hda_fixup *fix, int action) 337 { 338 alc_fixup_gpio(codec, action, 0x03); 339 } 340 341 static void alc_fixup_gpio4(struct hda_codec *codec, 342 const struct hda_fixup *fix, int action) 343 { 344 alc_fixup_gpio(codec, action, 0x04); 345 } 346 347 static void alc_fixup_micmute_led(struct hda_codec *codec, 348 const struct hda_fixup *fix, int action) 349 { 350 if (action == HDA_FIXUP_ACT_PRE_PROBE) 351 snd_hda_gen_add_micmute_led_cdev(codec, NULL); 352 } 353 354 /* 355 * Fix hardware PLL issue 356 * On some codecs, the analog PLL gating control must be off while 357 * the default value is 1. 358 */ 359 static void alc_fix_pll(struct hda_codec *codec) 360 { 361 struct alc_spec *spec = codec->spec; 362 363 if (spec->pll_nid) 364 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, 365 1 << spec->pll_coef_bit, 0); 366 } 367 368 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, 369 unsigned int coef_idx, unsigned int coef_bit) 370 { 371 struct alc_spec *spec = codec->spec; 372 spec->pll_nid = nid; 373 spec->pll_coef_idx = coef_idx; 374 spec->pll_coef_bit = coef_bit; 375 alc_fix_pll(codec); 376 } 377 378 /* update the master volume per volume-knob's unsol event */ 379 static void alc_update_knob_master(struct hda_codec *codec, 380 struct hda_jack_callback *jack) 381 { 382 unsigned int val; 383 struct snd_kcontrol *kctl; 384 struct snd_ctl_elem_value *uctl; 385 386 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); 387 if (!kctl) 388 return; 389 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); 390 if (!uctl) 391 return; 392 val = snd_hda_codec_read(codec, jack->nid, 0, 393 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); 394 val &= HDA_AMP_VOLMASK; 395 uctl->value.integer.value[0] = val; 396 uctl->value.integer.value[1] = val; 397 kctl->put(kctl, uctl); 398 kfree(uctl); 399 } 400 401 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) 402 { 403 /* For some reason, the res given from ALC880 is broken. 404 Here we adjust it properly. */ 405 snd_hda_jack_unsol_event(codec, res >> 2); 406 } 407 408 /* Change EAPD to verb control */ 409 static void alc_fill_eapd_coef(struct hda_codec *codec) 410 { 411 int coef; 412 413 coef = alc_get_coef0(codec); 414 415 switch (codec->core.vendor_id) { 416 case 0x10ec0262: 417 alc_update_coef_idx(codec, 0x7, 0, 1<<5); 418 break; 419 case 0x10ec0267: 420 case 0x10ec0268: 421 alc_update_coef_idx(codec, 0x7, 0, 1<<13); 422 break; 423 case 0x10ec0269: 424 if ((coef & 0x00f0) == 0x0010) 425 alc_update_coef_idx(codec, 0xd, 0, 1<<14); 426 if ((coef & 0x00f0) == 0x0020) 427 alc_update_coef_idx(codec, 0x4, 1<<15, 0); 428 if ((coef & 0x00f0) == 0x0030) 429 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 430 break; 431 case 0x10ec0280: 432 case 0x10ec0284: 433 case 0x10ec0290: 434 case 0x10ec0292: 435 alc_update_coef_idx(codec, 0x4, 1<<15, 0); 436 break; 437 case 0x10ec0225: 438 case 0x10ec0295: 439 case 0x10ec0299: 440 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 441 fallthrough; 442 case 0x10ec0215: 443 case 0x10ec0285: 444 case 0x10ec0289: 445 alc_update_coef_idx(codec, 0x36, 1<<13, 0); 446 fallthrough; 447 case 0x10ec0230: 448 case 0x10ec0233: 449 case 0x10ec0235: 450 case 0x10ec0236: 451 case 0x10ec0245: 452 case 0x10ec0255: 453 case 0x10ec0256: 454 case 0x19e58326: 455 case 0x10ec0257: 456 case 0x10ec0282: 457 case 0x10ec0283: 458 case 0x10ec0286: 459 case 0x10ec0288: 460 case 0x10ec0298: 461 case 0x10ec0300: 462 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 463 break; 464 case 0x10ec0275: 465 alc_update_coef_idx(codec, 0xe, 0, 1<<0); 466 break; 467 case 0x10ec0287: 468 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 469 alc_write_coef_idx(codec, 0x8, 0x4ab7); 470 break; 471 case 0x10ec0293: 472 alc_update_coef_idx(codec, 0xa, 1<<13, 0); 473 break; 474 case 0x10ec0234: 475 case 0x10ec0274: 476 alc_write_coef_idx(codec, 0x6e, 0x0c25); 477 fallthrough; 478 case 0x10ec0294: 479 case 0x10ec0700: 480 case 0x10ec0701: 481 case 0x10ec0703: 482 case 0x10ec0711: 483 alc_update_coef_idx(codec, 0x10, 1<<15, 0); 484 break; 485 case 0x10ec0662: 486 if ((coef & 0x00f0) == 0x0030) 487 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ 488 break; 489 case 0x10ec0272: 490 case 0x10ec0273: 491 case 0x10ec0663: 492 case 0x10ec0665: 493 case 0x10ec0670: 494 case 0x10ec0671: 495 case 0x10ec0672: 496 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ 497 break; 498 case 0x10ec0222: 499 case 0x10ec0623: 500 alc_update_coef_idx(codec, 0x19, 1<<13, 0); 501 break; 502 case 0x10ec0668: 503 alc_update_coef_idx(codec, 0x7, 3<<13, 0); 504 break; 505 case 0x10ec0867: 506 alc_update_coef_idx(codec, 0x4, 1<<10, 0); 507 break; 508 case 0x10ec0888: 509 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) 510 alc_update_coef_idx(codec, 0x7, 1<<5, 0); 511 break; 512 case 0x10ec0892: 513 case 0x10ec0897: 514 alc_update_coef_idx(codec, 0x7, 1<<5, 0); 515 break; 516 case 0x10ec0899: 517 case 0x10ec0900: 518 case 0x10ec0b00: 519 case 0x10ec1168: 520 case 0x10ec1220: 521 alc_update_coef_idx(codec, 0x7, 1<<1, 0); 522 break; 523 } 524 } 525 526 /* additional initialization for ALC888 variants */ 527 static void alc888_coef_init(struct hda_codec *codec) 528 { 529 switch (alc_get_coef0(codec) & 0x00f0) { 530 /* alc888-VA */ 531 case 0x00: 532 /* alc888-VB */ 533 case 0x10: 534 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ 535 break; 536 } 537 } 538 539 /* turn on/off EAPD control (only if available) */ 540 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) 541 { 542 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) 543 return; 544 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) 545 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, 546 on ? 2 : 0); 547 } 548 549 /* turn on/off EAPD controls of the codec */ 550 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) 551 { 552 /* We currently only handle front, HP */ 553 static const hda_nid_t pins[] = { 554 0x0f, 0x10, 0x14, 0x15, 0x17, 0 555 }; 556 const hda_nid_t *p; 557 for (p = pins; *p; p++) 558 set_eapd(codec, *p, on); 559 } 560 561 static int find_ext_mic_pin(struct hda_codec *codec); 562 563 static void alc_headset_mic_no_shutup(struct hda_codec *codec) 564 { 565 const struct hda_pincfg *pin; 566 int mic_pin = find_ext_mic_pin(codec); 567 int i; 568 569 /* don't shut up pins when unloading the driver; otherwise it breaks 570 * the default pin setup at the next load of the driver 571 */ 572 if (codec->bus->shutdown) 573 return; 574 575 snd_array_for_each(&codec->init_pins, i, pin) { 576 /* use read here for syncing after issuing each verb */ 577 if (pin->nid != mic_pin) 578 snd_hda_codec_read(codec, pin->nid, 0, 579 AC_VERB_SET_PIN_WIDGET_CONTROL, 0); 580 } 581 582 codec->pins_shutup = 1; 583 } 584 585 static void alc_shutup_pins(struct hda_codec *codec) 586 { 587 struct alc_spec *spec = codec->spec; 588 589 switch (codec->core.vendor_id) { 590 case 0x10ec0236: 591 case 0x10ec0256: 592 case 0x10ec0257: 593 case 0x19e58326: 594 case 0x10ec0283: 595 case 0x10ec0285: 596 case 0x10ec0286: 597 case 0x10ec0287: 598 case 0x10ec0288: 599 case 0x10ec0295: 600 case 0x10ec0298: 601 alc_headset_mic_no_shutup(codec); 602 break; 603 default: 604 if (!spec->no_shutup_pins) 605 snd_hda_shutup_pins(codec); 606 break; 607 } 608 } 609 610 /* generic shutup callback; 611 * just turning off EAPD and a little pause for avoiding pop-noise 612 */ 613 static void alc_eapd_shutup(struct hda_codec *codec) 614 { 615 struct alc_spec *spec = codec->spec; 616 617 alc_auto_setup_eapd(codec, false); 618 if (!spec->no_depop_delay) 619 msleep(200); 620 alc_shutup_pins(codec); 621 } 622 623 /* generic EAPD initialization */ 624 static void alc_auto_init_amp(struct hda_codec *codec, int type) 625 { 626 alc_auto_setup_eapd(codec, true); 627 alc_write_gpio(codec); 628 switch (type) { 629 case ALC_INIT_DEFAULT: 630 switch (codec->core.vendor_id) { 631 case 0x10ec0260: 632 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); 633 break; 634 case 0x10ec0880: 635 case 0x10ec0882: 636 case 0x10ec0883: 637 case 0x10ec0885: 638 alc_update_coef_idx(codec, 7, 0, 0x2030); 639 break; 640 case 0x10ec0888: 641 alc888_coef_init(codec); 642 break; 643 } 644 break; 645 } 646 } 647 648 /* get a primary headphone pin if available */ 649 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) 650 { 651 if (spec->gen.autocfg.hp_pins[0]) 652 return spec->gen.autocfg.hp_pins[0]; 653 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) 654 return spec->gen.autocfg.line_out_pins[0]; 655 return 0; 656 } 657 658 /* 659 * Realtek SSID verification 660 */ 661 662 /* Could be any non-zero and even value. When used as fixup, tells 663 * the driver to ignore any present sku defines. 664 */ 665 #define ALC_FIXUP_SKU_IGNORE (2) 666 667 static void alc_fixup_sku_ignore(struct hda_codec *codec, 668 const struct hda_fixup *fix, int action) 669 { 670 struct alc_spec *spec = codec->spec; 671 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 672 spec->cdefine.fixup = 1; 673 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; 674 } 675 } 676 677 static void alc_fixup_no_depop_delay(struct hda_codec *codec, 678 const struct hda_fixup *fix, int action) 679 { 680 struct alc_spec *spec = codec->spec; 681 682 if (action == HDA_FIXUP_ACT_PROBE) { 683 spec->no_depop_delay = 1; 684 codec->depop_delay = 0; 685 } 686 } 687 688 static int alc_auto_parse_customize_define(struct hda_codec *codec) 689 { 690 unsigned int ass, tmp, i; 691 unsigned nid = 0; 692 struct alc_spec *spec = codec->spec; 693 694 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ 695 696 if (spec->cdefine.fixup) { 697 ass = spec->cdefine.sku_cfg; 698 if (ass == ALC_FIXUP_SKU_IGNORE) 699 return -1; 700 goto do_sku; 701 } 702 703 if (!codec->bus->pci) 704 return -1; 705 ass = codec->core.subsystem_id & 0xffff; 706 if (ass != codec->bus->pci->subsystem_device && (ass & 1)) 707 goto do_sku; 708 709 nid = 0x1d; 710 if (codec->core.vendor_id == 0x10ec0260) 711 nid = 0x17; 712 ass = snd_hda_codec_get_pincfg(codec, nid); 713 714 if (!(ass & 1)) { 715 codec_info(codec, "%s: SKU not ready 0x%08x\n", 716 codec->core.chip_name, ass); 717 return -1; 718 } 719 720 /* check sum */ 721 tmp = 0; 722 for (i = 1; i < 16; i++) { 723 if ((ass >> i) & 1) 724 tmp++; 725 } 726 if (((ass >> 16) & 0xf) != tmp) 727 return -1; 728 729 spec->cdefine.port_connectivity = ass >> 30; 730 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; 731 spec->cdefine.check_sum = (ass >> 16) & 0xf; 732 spec->cdefine.customization = ass >> 8; 733 do_sku: 734 spec->cdefine.sku_cfg = ass; 735 spec->cdefine.external_amp = (ass & 0x38) >> 3; 736 spec->cdefine.platform_type = (ass & 0x4) >> 2; 737 spec->cdefine.swap = (ass & 0x2) >> 1; 738 spec->cdefine.override = ass & 0x1; 739 740 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", 741 nid, spec->cdefine.sku_cfg); 742 codec_dbg(codec, "SKU: port_connectivity=0x%x\n", 743 spec->cdefine.port_connectivity); 744 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); 745 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); 746 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); 747 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); 748 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); 749 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); 750 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); 751 752 return 0; 753 } 754 755 /* return the position of NID in the list, or -1 if not found */ 756 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) 757 { 758 int i; 759 for (i = 0; i < nums; i++) 760 if (list[i] == nid) 761 return i; 762 return -1; 763 } 764 /* return true if the given NID is found in the list */ 765 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) 766 { 767 return find_idx_in_nid_list(nid, list, nums) >= 0; 768 } 769 770 /* check subsystem ID and set up device-specific initialization; 771 * return 1 if initialized, 0 if invalid SSID 772 */ 773 /* 32-bit subsystem ID for BIOS loading in HD Audio codec. 774 * 31 ~ 16 : Manufacture ID 775 * 15 ~ 8 : SKU ID 776 * 7 ~ 0 : Assembly ID 777 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 778 */ 779 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) 780 { 781 unsigned int ass, tmp, i; 782 unsigned nid; 783 struct alc_spec *spec = codec->spec; 784 785 if (spec->cdefine.fixup) { 786 ass = spec->cdefine.sku_cfg; 787 if (ass == ALC_FIXUP_SKU_IGNORE) 788 return 0; 789 goto do_sku; 790 } 791 792 ass = codec->core.subsystem_id & 0xffff; 793 if (codec->bus->pci && 794 ass != codec->bus->pci->subsystem_device && (ass & 1)) 795 goto do_sku; 796 797 /* invalid SSID, check the special NID pin defcfg instead */ 798 /* 799 * 31~30 : port connectivity 800 * 29~21 : reserve 801 * 20 : PCBEEP input 802 * 19~16 : Check sum (15:1) 803 * 15~1 : Custom 804 * 0 : override 805 */ 806 nid = 0x1d; 807 if (codec->core.vendor_id == 0x10ec0260) 808 nid = 0x17; 809 ass = snd_hda_codec_get_pincfg(codec, nid); 810 codec_dbg(codec, 811 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", 812 ass, nid); 813 if (!(ass & 1)) 814 return 0; 815 if ((ass >> 30) != 1) /* no physical connection */ 816 return 0; 817 818 /* check sum */ 819 tmp = 0; 820 for (i = 1; i < 16; i++) { 821 if ((ass >> i) & 1) 822 tmp++; 823 } 824 if (((ass >> 16) & 0xf) != tmp) 825 return 0; 826 do_sku: 827 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", 828 ass & 0xffff, codec->core.vendor_id); 829 /* 830 * 0 : override 831 * 1 : Swap Jack 832 * 2 : 0 --> Desktop, 1 --> Laptop 833 * 3~5 : External Amplifier control 834 * 7~6 : Reserved 835 */ 836 tmp = (ass & 0x38) >> 3; /* external Amp control */ 837 if (spec->init_amp == ALC_INIT_UNDEFINED) { 838 switch (tmp) { 839 case 1: 840 alc_setup_gpio(codec, 0x01); 841 break; 842 case 3: 843 alc_setup_gpio(codec, 0x02); 844 break; 845 case 7: 846 alc_setup_gpio(codec, 0x04); 847 break; 848 case 5: 849 default: 850 spec->init_amp = ALC_INIT_DEFAULT; 851 break; 852 } 853 } 854 855 /* is laptop or Desktop and enable the function "Mute internal speaker 856 * when the external headphone out jack is plugged" 857 */ 858 if (!(ass & 0x8000)) 859 return 1; 860 /* 861 * 10~8 : Jack location 862 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered 863 * 14~13: Resvered 864 * 15 : 1 --> enable the function "Mute internal speaker 865 * when the external headphone out jack is plugged" 866 */ 867 if (!alc_get_hp_pin(spec)) { 868 hda_nid_t nid; 869 tmp = (ass >> 11) & 0x3; /* HP to chassis */ 870 nid = ports[tmp]; 871 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, 872 spec->gen.autocfg.line_outs)) 873 return 1; 874 spec->gen.autocfg.hp_pins[0] = nid; 875 } 876 return 1; 877 } 878 879 /* Check the validity of ALC subsystem-id 880 * ports contains an array of 4 pin NIDs for port-A, E, D and I */ 881 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) 882 { 883 if (!alc_subsystem_id(codec, ports)) { 884 struct alc_spec *spec = codec->spec; 885 if (spec->init_amp == ALC_INIT_UNDEFINED) { 886 codec_dbg(codec, 887 "realtek: Enable default setup for auto mode as fallback\n"); 888 spec->init_amp = ALC_INIT_DEFAULT; 889 } 890 } 891 } 892 893 /* 894 */ 895 896 static void alc_fixup_inv_dmic(struct hda_codec *codec, 897 const struct hda_fixup *fix, int action) 898 { 899 struct alc_spec *spec = codec->spec; 900 901 spec->gen.inv_dmic_split = 1; 902 } 903 904 905 static int alc_build_controls(struct hda_codec *codec) 906 { 907 int err; 908 909 err = snd_hda_gen_build_controls(codec); 910 if (err < 0) 911 return err; 912 913 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); 914 return 0; 915 } 916 917 918 /* 919 * Common callbacks 920 */ 921 922 static void alc_pre_init(struct hda_codec *codec) 923 { 924 alc_fill_eapd_coef(codec); 925 } 926 927 #define is_s3_resume(codec) \ 928 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) 929 #define is_s4_resume(codec) \ 930 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) 931 #define is_s4_suspend(codec) \ 932 ((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE) 933 934 static int alc_init(struct hda_codec *codec) 935 { 936 struct alc_spec *spec = codec->spec; 937 938 /* hibernation resume needs the full chip initialization */ 939 if (is_s4_resume(codec)) 940 alc_pre_init(codec); 941 942 if (spec->init_hook) 943 spec->init_hook(codec); 944 945 spec->gen.skip_verbs = 1; /* applied in below */ 946 snd_hda_gen_init(codec); 947 alc_fix_pll(codec); 948 alc_auto_init_amp(codec, spec->init_amp); 949 snd_hda_apply_verbs(codec); /* apply verbs here after own init */ 950 951 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); 952 953 return 0; 954 } 955 956 /* forward declaration */ 957 static const struct component_master_ops comp_master_ops; 958 959 static void alc_free(struct hda_codec *codec) 960 { 961 struct alc_spec *spec = codec->spec; 962 963 if (spec) 964 hda_component_manager_free(&spec->comps, &comp_master_ops); 965 966 snd_hda_gen_free(codec); 967 } 968 969 static inline void alc_shutup(struct hda_codec *codec) 970 { 971 struct alc_spec *spec = codec->spec; 972 973 if (!snd_hda_get_bool_hint(codec, "shutup")) 974 return; /* disabled explicitly by hints */ 975 976 if (spec && spec->shutup) 977 spec->shutup(codec); 978 else 979 alc_shutup_pins(codec); 980 } 981 982 static void alc_power_eapd(struct hda_codec *codec) 983 { 984 alc_auto_setup_eapd(codec, false); 985 } 986 987 static int alc_suspend(struct hda_codec *codec) 988 { 989 struct alc_spec *spec = codec->spec; 990 alc_shutup(codec); 991 if (spec && spec->power_hook) 992 spec->power_hook(codec); 993 return 0; 994 } 995 996 static int alc_resume(struct hda_codec *codec) 997 { 998 struct alc_spec *spec = codec->spec; 999 1000 if (!spec->no_depop_delay) 1001 msleep(150); /* to avoid pop noise */ 1002 codec->patch_ops.init(codec); 1003 snd_hda_regmap_sync(codec); 1004 hda_call_check_power_status(codec, 0x01); 1005 return 0; 1006 } 1007 1008 /* 1009 */ 1010 static const struct hda_codec_ops alc_patch_ops = { 1011 .build_controls = alc_build_controls, 1012 .build_pcms = snd_hda_gen_build_pcms, 1013 .init = alc_init, 1014 .free = alc_free, 1015 .unsol_event = snd_hda_jack_unsol_event, 1016 .resume = alc_resume, 1017 .suspend = alc_suspend, 1018 .check_power_status = snd_hda_gen_check_power_status, 1019 }; 1020 1021 1022 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) 1023 1024 /* 1025 * Rename codecs appropriately from COEF value or subvendor id 1026 */ 1027 struct alc_codec_rename_table { 1028 unsigned int vendor_id; 1029 unsigned short coef_mask; 1030 unsigned short coef_bits; 1031 const char *name; 1032 }; 1033 1034 struct alc_codec_rename_pci_table { 1035 unsigned int codec_vendor_id; 1036 unsigned short pci_subvendor; 1037 unsigned short pci_subdevice; 1038 const char *name; 1039 }; 1040 1041 static const struct alc_codec_rename_table rename_tbl[] = { 1042 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, 1043 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, 1044 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, 1045 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, 1046 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, 1047 { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, 1048 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, 1049 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, 1050 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, 1051 { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, 1052 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, 1053 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, 1054 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, 1055 { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, 1056 { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, 1057 { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, 1058 { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, 1059 { } /* terminator */ 1060 }; 1061 1062 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { 1063 { 0x10ec0280, 0x1028, 0, "ALC3220" }, 1064 { 0x10ec0282, 0x1028, 0, "ALC3221" }, 1065 { 0x10ec0283, 0x1028, 0, "ALC3223" }, 1066 { 0x10ec0288, 0x1028, 0, "ALC3263" }, 1067 { 0x10ec0292, 0x1028, 0, "ALC3226" }, 1068 { 0x10ec0293, 0x1028, 0, "ALC3235" }, 1069 { 0x10ec0255, 0x1028, 0, "ALC3234" }, 1070 { 0x10ec0668, 0x1028, 0, "ALC3661" }, 1071 { 0x10ec0275, 0x1028, 0, "ALC3260" }, 1072 { 0x10ec0899, 0x1028, 0, "ALC3861" }, 1073 { 0x10ec0298, 0x1028, 0, "ALC3266" }, 1074 { 0x10ec0236, 0x1028, 0, "ALC3204" }, 1075 { 0x10ec0256, 0x1028, 0, "ALC3246" }, 1076 { 0x10ec0225, 0x1028, 0, "ALC3253" }, 1077 { 0x10ec0295, 0x1028, 0, "ALC3254" }, 1078 { 0x10ec0299, 0x1028, 0, "ALC3271" }, 1079 { 0x10ec0670, 0x1025, 0, "ALC669X" }, 1080 { 0x10ec0676, 0x1025, 0, "ALC679X" }, 1081 { 0x10ec0282, 0x1043, 0, "ALC3229" }, 1082 { 0x10ec0233, 0x1043, 0, "ALC3236" }, 1083 { 0x10ec0280, 0x103c, 0, "ALC3228" }, 1084 { 0x10ec0282, 0x103c, 0, "ALC3227" }, 1085 { 0x10ec0286, 0x103c, 0, "ALC3242" }, 1086 { 0x10ec0290, 0x103c, 0, "ALC3241" }, 1087 { 0x10ec0668, 0x103c, 0, "ALC3662" }, 1088 { 0x10ec0283, 0x17aa, 0, "ALC3239" }, 1089 { 0x10ec0292, 0x17aa, 0, "ALC3232" }, 1090 { } /* terminator */ 1091 }; 1092 1093 static int alc_codec_rename_from_preset(struct hda_codec *codec) 1094 { 1095 const struct alc_codec_rename_table *p; 1096 const struct alc_codec_rename_pci_table *q; 1097 1098 for (p = rename_tbl; p->vendor_id; p++) { 1099 if (p->vendor_id != codec->core.vendor_id) 1100 continue; 1101 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) 1102 return alc_codec_rename(codec, p->name); 1103 } 1104 1105 if (!codec->bus->pci) 1106 return 0; 1107 for (q = rename_pci_tbl; q->codec_vendor_id; q++) { 1108 if (q->codec_vendor_id != codec->core.vendor_id) 1109 continue; 1110 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) 1111 continue; 1112 if (!q->pci_subdevice || 1113 q->pci_subdevice == codec->bus->pci->subsystem_device) 1114 return alc_codec_rename(codec, q->name); 1115 } 1116 1117 return 0; 1118 } 1119 1120 1121 /* 1122 * Digital-beep handlers 1123 */ 1124 #ifdef CONFIG_SND_HDA_INPUT_BEEP 1125 1126 /* additional beep mixers; private_value will be overwritten */ 1127 static const struct snd_kcontrol_new alc_beep_mixer[] = { 1128 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), 1129 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), 1130 }; 1131 1132 /* set up and create beep controls */ 1133 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, 1134 int idx, int dir) 1135 { 1136 struct snd_kcontrol_new *knew; 1137 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); 1138 int i; 1139 1140 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { 1141 knew = snd_hda_gen_add_kctl(&spec->gen, NULL, 1142 &alc_beep_mixer[i]); 1143 if (!knew) 1144 return -ENOMEM; 1145 knew->private_value = beep_amp; 1146 } 1147 return 0; 1148 } 1149 1150 static const struct snd_pci_quirk beep_allow_list[] = { 1151 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), 1152 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), 1153 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), 1154 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), 1155 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), 1156 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), 1157 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), 1158 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), 1159 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), 1160 /* denylist -- no beep available */ 1161 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), 1162 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), 1163 {} 1164 }; 1165 1166 static inline int has_cdefine_beep(struct hda_codec *codec) 1167 { 1168 struct alc_spec *spec = codec->spec; 1169 const struct snd_pci_quirk *q; 1170 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); 1171 if (q) 1172 return q->value; 1173 return spec->cdefine.enable_pcbeep; 1174 } 1175 #else 1176 #define set_beep_amp(spec, nid, idx, dir) 0 1177 #define has_cdefine_beep(codec) 0 1178 #endif 1179 1180 /* parse the BIOS configuration and set up the alc_spec */ 1181 /* return 1 if successful, 0 if the proper config is not found, 1182 * or a negative error code 1183 */ 1184 static int alc_parse_auto_config(struct hda_codec *codec, 1185 const hda_nid_t *ignore_nids, 1186 const hda_nid_t *ssid_nids) 1187 { 1188 struct alc_spec *spec = codec->spec; 1189 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 1190 int err; 1191 1192 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, 1193 spec->parse_flags); 1194 if (err < 0) 1195 return err; 1196 1197 if (ssid_nids) 1198 alc_ssid_check(codec, ssid_nids); 1199 1200 err = snd_hda_gen_parse_auto_config(codec, cfg); 1201 if (err < 0) 1202 return err; 1203 1204 return 1; 1205 } 1206 1207 /* common preparation job for alc_spec */ 1208 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) 1209 { 1210 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); 1211 int err; 1212 1213 if (!spec) 1214 return -ENOMEM; 1215 codec->spec = spec; 1216 snd_hda_gen_spec_init(&spec->gen); 1217 spec->gen.mixer_nid = mixer_nid; 1218 spec->gen.own_eapd_ctl = 1; 1219 codec->single_adc_amp = 1; 1220 /* FIXME: do we need this for all Realtek codec models? */ 1221 codec->spdif_status_reset = 1; 1222 codec->forced_resume = 1; 1223 codec->patch_ops = alc_patch_ops; 1224 mutex_init(&spec->coef_mutex); 1225 1226 err = alc_codec_rename_from_preset(codec); 1227 if (err < 0) { 1228 kfree(spec); 1229 return err; 1230 } 1231 return 0; 1232 } 1233 1234 static int alc880_parse_auto_config(struct hda_codec *codec) 1235 { 1236 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; 1237 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 1238 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); 1239 } 1240 1241 /* 1242 * ALC880 fix-ups 1243 */ 1244 enum { 1245 ALC880_FIXUP_GPIO1, 1246 ALC880_FIXUP_GPIO2, 1247 ALC880_FIXUP_MEDION_RIM, 1248 ALC880_FIXUP_LG, 1249 ALC880_FIXUP_LG_LW25, 1250 ALC880_FIXUP_W810, 1251 ALC880_FIXUP_EAPD_COEF, 1252 ALC880_FIXUP_TCL_S700, 1253 ALC880_FIXUP_VOL_KNOB, 1254 ALC880_FIXUP_FUJITSU, 1255 ALC880_FIXUP_F1734, 1256 ALC880_FIXUP_UNIWILL, 1257 ALC880_FIXUP_UNIWILL_DIG, 1258 ALC880_FIXUP_Z71V, 1259 ALC880_FIXUP_ASUS_W5A, 1260 ALC880_FIXUP_3ST_BASE, 1261 ALC880_FIXUP_3ST, 1262 ALC880_FIXUP_3ST_DIG, 1263 ALC880_FIXUP_5ST_BASE, 1264 ALC880_FIXUP_5ST, 1265 ALC880_FIXUP_5ST_DIG, 1266 ALC880_FIXUP_6ST_BASE, 1267 ALC880_FIXUP_6ST, 1268 ALC880_FIXUP_6ST_DIG, 1269 ALC880_FIXUP_6ST_AUTOMUTE, 1270 }; 1271 1272 /* enable the volume-knob widget support on NID 0x21 */ 1273 static void alc880_fixup_vol_knob(struct hda_codec *codec, 1274 const struct hda_fixup *fix, int action) 1275 { 1276 if (action == HDA_FIXUP_ACT_PROBE) 1277 snd_hda_jack_detect_enable_callback(codec, 0x21, 1278 alc_update_knob_master); 1279 } 1280 1281 static const struct hda_fixup alc880_fixups[] = { 1282 [ALC880_FIXUP_GPIO1] = { 1283 .type = HDA_FIXUP_FUNC, 1284 .v.func = alc_fixup_gpio1, 1285 }, 1286 [ALC880_FIXUP_GPIO2] = { 1287 .type = HDA_FIXUP_FUNC, 1288 .v.func = alc_fixup_gpio2, 1289 }, 1290 [ALC880_FIXUP_MEDION_RIM] = { 1291 .type = HDA_FIXUP_VERBS, 1292 .v.verbs = (const struct hda_verb[]) { 1293 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1294 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 1295 { } 1296 }, 1297 .chained = true, 1298 .chain_id = ALC880_FIXUP_GPIO2, 1299 }, 1300 [ALC880_FIXUP_LG] = { 1301 .type = HDA_FIXUP_PINS, 1302 .v.pins = (const struct hda_pintbl[]) { 1303 /* disable bogus unused pins */ 1304 { 0x16, 0x411111f0 }, 1305 { 0x18, 0x411111f0 }, 1306 { 0x1a, 0x411111f0 }, 1307 { } 1308 } 1309 }, 1310 [ALC880_FIXUP_LG_LW25] = { 1311 .type = HDA_FIXUP_PINS, 1312 .v.pins = (const struct hda_pintbl[]) { 1313 { 0x1a, 0x0181344f }, /* line-in */ 1314 { 0x1b, 0x0321403f }, /* headphone */ 1315 { } 1316 } 1317 }, 1318 [ALC880_FIXUP_W810] = { 1319 .type = HDA_FIXUP_PINS, 1320 .v.pins = (const struct hda_pintbl[]) { 1321 /* disable bogus unused pins */ 1322 { 0x17, 0x411111f0 }, 1323 { } 1324 }, 1325 .chained = true, 1326 .chain_id = ALC880_FIXUP_GPIO2, 1327 }, 1328 [ALC880_FIXUP_EAPD_COEF] = { 1329 .type = HDA_FIXUP_VERBS, 1330 .v.verbs = (const struct hda_verb[]) { 1331 /* change to EAPD mode */ 1332 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1333 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 1334 {} 1335 }, 1336 }, 1337 [ALC880_FIXUP_TCL_S700] = { 1338 .type = HDA_FIXUP_VERBS, 1339 .v.verbs = (const struct hda_verb[]) { 1340 /* change to EAPD mode */ 1341 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1342 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 1343 {} 1344 }, 1345 .chained = true, 1346 .chain_id = ALC880_FIXUP_GPIO2, 1347 }, 1348 [ALC880_FIXUP_VOL_KNOB] = { 1349 .type = HDA_FIXUP_FUNC, 1350 .v.func = alc880_fixup_vol_knob, 1351 }, 1352 [ALC880_FIXUP_FUJITSU] = { 1353 /* override all pins as BIOS on old Amilo is broken */ 1354 .type = HDA_FIXUP_PINS, 1355 .v.pins = (const struct hda_pintbl[]) { 1356 { 0x14, 0x0121401f }, /* HP */ 1357 { 0x15, 0x99030120 }, /* speaker */ 1358 { 0x16, 0x99030130 }, /* bass speaker */ 1359 { 0x17, 0x411111f0 }, /* N/A */ 1360 { 0x18, 0x411111f0 }, /* N/A */ 1361 { 0x19, 0x01a19950 }, /* mic-in */ 1362 { 0x1a, 0x411111f0 }, /* N/A */ 1363 { 0x1b, 0x411111f0 }, /* N/A */ 1364 { 0x1c, 0x411111f0 }, /* N/A */ 1365 { 0x1d, 0x411111f0 }, /* N/A */ 1366 { 0x1e, 0x01454140 }, /* SPDIF out */ 1367 { } 1368 }, 1369 .chained = true, 1370 .chain_id = ALC880_FIXUP_VOL_KNOB, 1371 }, 1372 [ALC880_FIXUP_F1734] = { 1373 /* almost compatible with FUJITSU, but no bass and SPDIF */ 1374 .type = HDA_FIXUP_PINS, 1375 .v.pins = (const struct hda_pintbl[]) { 1376 { 0x14, 0x0121401f }, /* HP */ 1377 { 0x15, 0x99030120 }, /* speaker */ 1378 { 0x16, 0x411111f0 }, /* N/A */ 1379 { 0x17, 0x411111f0 }, /* N/A */ 1380 { 0x18, 0x411111f0 }, /* N/A */ 1381 { 0x19, 0x01a19950 }, /* mic-in */ 1382 { 0x1a, 0x411111f0 }, /* N/A */ 1383 { 0x1b, 0x411111f0 }, /* N/A */ 1384 { 0x1c, 0x411111f0 }, /* N/A */ 1385 { 0x1d, 0x411111f0 }, /* N/A */ 1386 { 0x1e, 0x411111f0 }, /* N/A */ 1387 { } 1388 }, 1389 .chained = true, 1390 .chain_id = ALC880_FIXUP_VOL_KNOB, 1391 }, 1392 [ALC880_FIXUP_UNIWILL] = { 1393 /* need to fix HP and speaker pins to be parsed correctly */ 1394 .type = HDA_FIXUP_PINS, 1395 .v.pins = (const struct hda_pintbl[]) { 1396 { 0x14, 0x0121411f }, /* HP */ 1397 { 0x15, 0x99030120 }, /* speaker */ 1398 { 0x16, 0x99030130 }, /* bass speaker */ 1399 { } 1400 }, 1401 }, 1402 [ALC880_FIXUP_UNIWILL_DIG] = { 1403 .type = HDA_FIXUP_PINS, 1404 .v.pins = (const struct hda_pintbl[]) { 1405 /* disable bogus unused pins */ 1406 { 0x17, 0x411111f0 }, 1407 { 0x19, 0x411111f0 }, 1408 { 0x1b, 0x411111f0 }, 1409 { 0x1f, 0x411111f0 }, 1410 { } 1411 } 1412 }, 1413 [ALC880_FIXUP_Z71V] = { 1414 .type = HDA_FIXUP_PINS, 1415 .v.pins = (const struct hda_pintbl[]) { 1416 /* set up the whole pins as BIOS is utterly broken */ 1417 { 0x14, 0x99030120 }, /* speaker */ 1418 { 0x15, 0x0121411f }, /* HP */ 1419 { 0x16, 0x411111f0 }, /* N/A */ 1420 { 0x17, 0x411111f0 }, /* N/A */ 1421 { 0x18, 0x01a19950 }, /* mic-in */ 1422 { 0x19, 0x411111f0 }, /* N/A */ 1423 { 0x1a, 0x01813031 }, /* line-in */ 1424 { 0x1b, 0x411111f0 }, /* N/A */ 1425 { 0x1c, 0x411111f0 }, /* N/A */ 1426 { 0x1d, 0x411111f0 }, /* N/A */ 1427 { 0x1e, 0x0144111e }, /* SPDIF */ 1428 { } 1429 } 1430 }, 1431 [ALC880_FIXUP_ASUS_W5A] = { 1432 .type = HDA_FIXUP_PINS, 1433 .v.pins = (const struct hda_pintbl[]) { 1434 /* set up the whole pins as BIOS is utterly broken */ 1435 { 0x14, 0x0121411f }, /* HP */ 1436 { 0x15, 0x411111f0 }, /* N/A */ 1437 { 0x16, 0x411111f0 }, /* N/A */ 1438 { 0x17, 0x411111f0 }, /* N/A */ 1439 { 0x18, 0x90a60160 }, /* mic */ 1440 { 0x19, 0x411111f0 }, /* N/A */ 1441 { 0x1a, 0x411111f0 }, /* N/A */ 1442 { 0x1b, 0x411111f0 }, /* N/A */ 1443 { 0x1c, 0x411111f0 }, /* N/A */ 1444 { 0x1d, 0x411111f0 }, /* N/A */ 1445 { 0x1e, 0xb743111e }, /* SPDIF out */ 1446 { } 1447 }, 1448 .chained = true, 1449 .chain_id = ALC880_FIXUP_GPIO1, 1450 }, 1451 [ALC880_FIXUP_3ST_BASE] = { 1452 .type = HDA_FIXUP_PINS, 1453 .v.pins = (const struct hda_pintbl[]) { 1454 { 0x14, 0x01014010 }, /* line-out */ 1455 { 0x15, 0x411111f0 }, /* N/A */ 1456 { 0x16, 0x411111f0 }, /* N/A */ 1457 { 0x17, 0x411111f0 }, /* N/A */ 1458 { 0x18, 0x01a19c30 }, /* mic-in */ 1459 { 0x19, 0x0121411f }, /* HP */ 1460 { 0x1a, 0x01813031 }, /* line-in */ 1461 { 0x1b, 0x02a19c40 }, /* front-mic */ 1462 { 0x1c, 0x411111f0 }, /* N/A */ 1463 { 0x1d, 0x411111f0 }, /* N/A */ 1464 /* 0x1e is filled in below */ 1465 { 0x1f, 0x411111f0 }, /* N/A */ 1466 { } 1467 } 1468 }, 1469 [ALC880_FIXUP_3ST] = { 1470 .type = HDA_FIXUP_PINS, 1471 .v.pins = (const struct hda_pintbl[]) { 1472 { 0x1e, 0x411111f0 }, /* N/A */ 1473 { } 1474 }, 1475 .chained = true, 1476 .chain_id = ALC880_FIXUP_3ST_BASE, 1477 }, 1478 [ALC880_FIXUP_3ST_DIG] = { 1479 .type = HDA_FIXUP_PINS, 1480 .v.pins = (const struct hda_pintbl[]) { 1481 { 0x1e, 0x0144111e }, /* SPDIF */ 1482 { } 1483 }, 1484 .chained = true, 1485 .chain_id = ALC880_FIXUP_3ST_BASE, 1486 }, 1487 [ALC880_FIXUP_5ST_BASE] = { 1488 .type = HDA_FIXUP_PINS, 1489 .v.pins = (const struct hda_pintbl[]) { 1490 { 0x14, 0x01014010 }, /* front */ 1491 { 0x15, 0x411111f0 }, /* N/A */ 1492 { 0x16, 0x01011411 }, /* CLFE */ 1493 { 0x17, 0x01016412 }, /* surr */ 1494 { 0x18, 0x01a19c30 }, /* mic-in */ 1495 { 0x19, 0x0121411f }, /* HP */ 1496 { 0x1a, 0x01813031 }, /* line-in */ 1497 { 0x1b, 0x02a19c40 }, /* front-mic */ 1498 { 0x1c, 0x411111f0 }, /* N/A */ 1499 { 0x1d, 0x411111f0 }, /* N/A */ 1500 /* 0x1e is filled in below */ 1501 { 0x1f, 0x411111f0 }, /* N/A */ 1502 { } 1503 } 1504 }, 1505 [ALC880_FIXUP_5ST] = { 1506 .type = HDA_FIXUP_PINS, 1507 .v.pins = (const struct hda_pintbl[]) { 1508 { 0x1e, 0x411111f0 }, /* N/A */ 1509 { } 1510 }, 1511 .chained = true, 1512 .chain_id = ALC880_FIXUP_5ST_BASE, 1513 }, 1514 [ALC880_FIXUP_5ST_DIG] = { 1515 .type = HDA_FIXUP_PINS, 1516 .v.pins = (const struct hda_pintbl[]) { 1517 { 0x1e, 0x0144111e }, /* SPDIF */ 1518 { } 1519 }, 1520 .chained = true, 1521 .chain_id = ALC880_FIXUP_5ST_BASE, 1522 }, 1523 [ALC880_FIXUP_6ST_BASE] = { 1524 .type = HDA_FIXUP_PINS, 1525 .v.pins = (const struct hda_pintbl[]) { 1526 { 0x14, 0x01014010 }, /* front */ 1527 { 0x15, 0x01016412 }, /* surr */ 1528 { 0x16, 0x01011411 }, /* CLFE */ 1529 { 0x17, 0x01012414 }, /* side */ 1530 { 0x18, 0x01a19c30 }, /* mic-in */ 1531 { 0x19, 0x02a19c40 }, /* front-mic */ 1532 { 0x1a, 0x01813031 }, /* line-in */ 1533 { 0x1b, 0x0121411f }, /* HP */ 1534 { 0x1c, 0x411111f0 }, /* N/A */ 1535 { 0x1d, 0x411111f0 }, /* N/A */ 1536 /* 0x1e is filled in below */ 1537 { 0x1f, 0x411111f0 }, /* N/A */ 1538 { } 1539 } 1540 }, 1541 [ALC880_FIXUP_6ST] = { 1542 .type = HDA_FIXUP_PINS, 1543 .v.pins = (const struct hda_pintbl[]) { 1544 { 0x1e, 0x411111f0 }, /* N/A */ 1545 { } 1546 }, 1547 .chained = true, 1548 .chain_id = ALC880_FIXUP_6ST_BASE, 1549 }, 1550 [ALC880_FIXUP_6ST_DIG] = { 1551 .type = HDA_FIXUP_PINS, 1552 .v.pins = (const struct hda_pintbl[]) { 1553 { 0x1e, 0x0144111e }, /* SPDIF */ 1554 { } 1555 }, 1556 .chained = true, 1557 .chain_id = ALC880_FIXUP_6ST_BASE, 1558 }, 1559 [ALC880_FIXUP_6ST_AUTOMUTE] = { 1560 .type = HDA_FIXUP_PINS, 1561 .v.pins = (const struct hda_pintbl[]) { 1562 { 0x1b, 0x0121401f }, /* HP with jack detect */ 1563 { } 1564 }, 1565 .chained_before = true, 1566 .chain_id = ALC880_FIXUP_6ST_BASE, 1567 }, 1568 }; 1569 1570 static const struct hda_quirk alc880_fixup_tbl[] = { 1571 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), 1572 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), 1573 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), 1574 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), 1575 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), 1576 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), 1577 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), 1578 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), 1579 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), 1580 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), 1581 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), 1582 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), 1583 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), 1584 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), 1585 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), 1586 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), 1587 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), 1588 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), 1589 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), 1590 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), 1591 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), 1592 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), 1593 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), 1594 1595 /* Below is the copied entries from alc880_quirks.c. 1596 * It's not quite sure whether BIOS sets the correct pin-config table 1597 * on these machines, thus they are kept to be compatible with 1598 * the old static quirks. Once when it's confirmed to work without 1599 * these overrides, it'd be better to remove. 1600 */ 1601 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), 1602 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), 1603 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), 1604 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), 1605 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), 1606 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), 1607 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), 1608 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), 1609 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), 1610 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), 1611 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), 1612 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), 1613 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), 1614 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), 1615 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), 1616 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), 1617 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), 1618 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), 1619 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), 1620 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), 1621 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), 1622 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ 1623 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), 1624 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1625 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1626 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1627 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1628 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1629 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1630 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1631 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1632 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1633 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1634 /* default Intel */ 1635 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), 1636 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), 1637 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), 1638 {} 1639 }; 1640 1641 static const struct hda_model_fixup alc880_fixup_models[] = { 1642 {.id = ALC880_FIXUP_3ST, .name = "3stack"}, 1643 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, 1644 {.id = ALC880_FIXUP_5ST, .name = "5stack"}, 1645 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, 1646 {.id = ALC880_FIXUP_6ST, .name = "6stack"}, 1647 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, 1648 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, 1649 {} 1650 }; 1651 1652 1653 /* 1654 * OK, here we have finally the patch for ALC880 1655 */ 1656 static int patch_alc880(struct hda_codec *codec) 1657 { 1658 struct alc_spec *spec; 1659 int err; 1660 1661 err = alc_alloc_spec(codec, 0x0b); 1662 if (err < 0) 1663 return err; 1664 1665 spec = codec->spec; 1666 spec->gen.need_dac_fix = 1; 1667 spec->gen.beep_nid = 0x01; 1668 1669 codec->patch_ops.unsol_event = alc880_unsol_event; 1670 1671 alc_pre_init(codec); 1672 1673 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, 1674 alc880_fixups); 1675 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 1676 1677 /* automatic parse from the BIOS config */ 1678 err = alc880_parse_auto_config(codec); 1679 if (err < 0) 1680 goto error; 1681 1682 if (!spec->gen.no_analog) { 1683 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 1684 if (err < 0) 1685 goto error; 1686 } 1687 1688 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 1689 1690 return 0; 1691 1692 error: 1693 alc_free(codec); 1694 return err; 1695 } 1696 1697 1698 /* 1699 * ALC260 support 1700 */ 1701 static int alc260_parse_auto_config(struct hda_codec *codec) 1702 { 1703 static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; 1704 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; 1705 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); 1706 } 1707 1708 /* 1709 * Pin config fixes 1710 */ 1711 enum { 1712 ALC260_FIXUP_HP_DC5750, 1713 ALC260_FIXUP_HP_PIN_0F, 1714 ALC260_FIXUP_COEF, 1715 ALC260_FIXUP_GPIO1, 1716 ALC260_FIXUP_GPIO1_TOGGLE, 1717 ALC260_FIXUP_REPLACER, 1718 ALC260_FIXUP_HP_B1900, 1719 ALC260_FIXUP_KN1, 1720 ALC260_FIXUP_FSC_S7020, 1721 ALC260_FIXUP_FSC_S7020_JWSE, 1722 ALC260_FIXUP_VAIO_PINS, 1723 }; 1724 1725 static void alc260_gpio1_automute(struct hda_codec *codec) 1726 { 1727 struct alc_spec *spec = codec->spec; 1728 1729 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); 1730 } 1731 1732 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, 1733 const struct hda_fixup *fix, int action) 1734 { 1735 struct alc_spec *spec = codec->spec; 1736 if (action == HDA_FIXUP_ACT_PROBE) { 1737 /* although the machine has only one output pin, we need to 1738 * toggle GPIO1 according to the jack state 1739 */ 1740 spec->gen.automute_hook = alc260_gpio1_automute; 1741 spec->gen.detect_hp = 1; 1742 spec->gen.automute_speaker = 1; 1743 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ 1744 snd_hda_jack_detect_enable_callback(codec, 0x0f, 1745 snd_hda_gen_hp_automute); 1746 alc_setup_gpio(codec, 0x01); 1747 } 1748 } 1749 1750 static void alc260_fixup_kn1(struct hda_codec *codec, 1751 const struct hda_fixup *fix, int action) 1752 { 1753 struct alc_spec *spec = codec->spec; 1754 static const struct hda_pintbl pincfgs[] = { 1755 { 0x0f, 0x02214000 }, /* HP/speaker */ 1756 { 0x12, 0x90a60160 }, /* int mic */ 1757 { 0x13, 0x02a19000 }, /* ext mic */ 1758 { 0x18, 0x01446000 }, /* SPDIF out */ 1759 /* disable bogus I/O pins */ 1760 { 0x10, 0x411111f0 }, 1761 { 0x11, 0x411111f0 }, 1762 { 0x14, 0x411111f0 }, 1763 { 0x15, 0x411111f0 }, 1764 { 0x16, 0x411111f0 }, 1765 { 0x17, 0x411111f0 }, 1766 { 0x19, 0x411111f0 }, 1767 { } 1768 }; 1769 1770 switch (action) { 1771 case HDA_FIXUP_ACT_PRE_PROBE: 1772 snd_hda_apply_pincfgs(codec, pincfgs); 1773 spec->init_amp = ALC_INIT_NONE; 1774 break; 1775 } 1776 } 1777 1778 static void alc260_fixup_fsc_s7020(struct hda_codec *codec, 1779 const struct hda_fixup *fix, int action) 1780 { 1781 struct alc_spec *spec = codec->spec; 1782 if (action == HDA_FIXUP_ACT_PRE_PROBE) 1783 spec->init_amp = ALC_INIT_NONE; 1784 } 1785 1786 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, 1787 const struct hda_fixup *fix, int action) 1788 { 1789 struct alc_spec *spec = codec->spec; 1790 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 1791 spec->gen.add_jack_modes = 1; 1792 spec->gen.hp_mic = 1; 1793 } 1794 } 1795 1796 static const struct hda_fixup alc260_fixups[] = { 1797 [ALC260_FIXUP_HP_DC5750] = { 1798 .type = HDA_FIXUP_PINS, 1799 .v.pins = (const struct hda_pintbl[]) { 1800 { 0x11, 0x90130110 }, /* speaker */ 1801 { } 1802 } 1803 }, 1804 [ALC260_FIXUP_HP_PIN_0F] = { 1805 .type = HDA_FIXUP_PINS, 1806 .v.pins = (const struct hda_pintbl[]) { 1807 { 0x0f, 0x01214000 }, /* HP */ 1808 { } 1809 } 1810 }, 1811 [ALC260_FIXUP_COEF] = { 1812 .type = HDA_FIXUP_VERBS, 1813 .v.verbs = (const struct hda_verb[]) { 1814 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, 1815 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, 1816 { } 1817 }, 1818 }, 1819 [ALC260_FIXUP_GPIO1] = { 1820 .type = HDA_FIXUP_FUNC, 1821 .v.func = alc_fixup_gpio1, 1822 }, 1823 [ALC260_FIXUP_GPIO1_TOGGLE] = { 1824 .type = HDA_FIXUP_FUNC, 1825 .v.func = alc260_fixup_gpio1_toggle, 1826 .chained = true, 1827 .chain_id = ALC260_FIXUP_HP_PIN_0F, 1828 }, 1829 [ALC260_FIXUP_REPLACER] = { 1830 .type = HDA_FIXUP_VERBS, 1831 .v.verbs = (const struct hda_verb[]) { 1832 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, 1833 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, 1834 { } 1835 }, 1836 .chained = true, 1837 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, 1838 }, 1839 [ALC260_FIXUP_HP_B1900] = { 1840 .type = HDA_FIXUP_FUNC, 1841 .v.func = alc260_fixup_gpio1_toggle, 1842 .chained = true, 1843 .chain_id = ALC260_FIXUP_COEF, 1844 }, 1845 [ALC260_FIXUP_KN1] = { 1846 .type = HDA_FIXUP_FUNC, 1847 .v.func = alc260_fixup_kn1, 1848 }, 1849 [ALC260_FIXUP_FSC_S7020] = { 1850 .type = HDA_FIXUP_FUNC, 1851 .v.func = alc260_fixup_fsc_s7020, 1852 }, 1853 [ALC260_FIXUP_FSC_S7020_JWSE] = { 1854 .type = HDA_FIXUP_FUNC, 1855 .v.func = alc260_fixup_fsc_s7020_jwse, 1856 .chained = true, 1857 .chain_id = ALC260_FIXUP_FSC_S7020, 1858 }, 1859 [ALC260_FIXUP_VAIO_PINS] = { 1860 .type = HDA_FIXUP_PINS, 1861 .v.pins = (const struct hda_pintbl[]) { 1862 /* Pin configs are missing completely on some VAIOs */ 1863 { 0x0f, 0x01211020 }, 1864 { 0x10, 0x0001003f }, 1865 { 0x11, 0x411111f0 }, 1866 { 0x12, 0x01a15930 }, 1867 { 0x13, 0x411111f0 }, 1868 { 0x14, 0x411111f0 }, 1869 { 0x15, 0x411111f0 }, 1870 { 0x16, 0x411111f0 }, 1871 { 0x17, 0x411111f0 }, 1872 { 0x18, 0x411111f0 }, 1873 { 0x19, 0x411111f0 }, 1874 { } 1875 } 1876 }, 1877 }; 1878 1879 static const struct hda_quirk alc260_fixup_tbl[] = { 1880 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), 1881 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), 1882 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), 1883 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), 1884 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), 1885 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), 1886 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), 1887 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), 1888 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), 1889 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), 1890 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), 1891 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), 1892 {} 1893 }; 1894 1895 static const struct hda_model_fixup alc260_fixup_models[] = { 1896 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, 1897 {.id = ALC260_FIXUP_COEF, .name = "coef"}, 1898 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, 1899 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, 1900 {} 1901 }; 1902 1903 /* 1904 */ 1905 static int patch_alc260(struct hda_codec *codec) 1906 { 1907 struct alc_spec *spec; 1908 int err; 1909 1910 err = alc_alloc_spec(codec, 0x07); 1911 if (err < 0) 1912 return err; 1913 1914 spec = codec->spec; 1915 /* as quite a few machines require HP amp for speaker outputs, 1916 * it's easier to enable it unconditionally; even if it's unneeded, 1917 * it's almost harmless. 1918 */ 1919 spec->gen.prefer_hp_amp = 1; 1920 spec->gen.beep_nid = 0x01; 1921 1922 spec->shutup = alc_eapd_shutup; 1923 1924 alc_pre_init(codec); 1925 1926 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, 1927 alc260_fixups); 1928 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 1929 1930 /* automatic parse from the BIOS config */ 1931 err = alc260_parse_auto_config(codec); 1932 if (err < 0) 1933 goto error; 1934 1935 if (!spec->gen.no_analog) { 1936 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); 1937 if (err < 0) 1938 goto error; 1939 } 1940 1941 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 1942 1943 return 0; 1944 1945 error: 1946 alc_free(codec); 1947 return err; 1948 } 1949 1950 1951 /* 1952 * ALC882/883/885/888/889 support 1953 * 1954 * ALC882 is almost identical with ALC880 but has cleaner and more flexible 1955 * configuration. Each pin widget can choose any input DACs and a mixer. 1956 * Each ADC is connected from a mixer of all inputs. This makes possible 1957 * 6-channel independent captures. 1958 * 1959 * In addition, an independent DAC for the multi-playback (not used in this 1960 * driver yet). 1961 */ 1962 1963 /* 1964 * Pin config fixes 1965 */ 1966 enum { 1967 ALC882_FIXUP_ABIT_AW9D_MAX, 1968 ALC882_FIXUP_LENOVO_Y530, 1969 ALC882_FIXUP_PB_M5210, 1970 ALC882_FIXUP_ACER_ASPIRE_7736, 1971 ALC882_FIXUP_ASUS_W90V, 1972 ALC889_FIXUP_CD, 1973 ALC889_FIXUP_FRONT_HP_NO_PRESENCE, 1974 ALC889_FIXUP_VAIO_TT, 1975 ALC888_FIXUP_EEE1601, 1976 ALC886_FIXUP_EAPD, 1977 ALC882_FIXUP_EAPD, 1978 ALC883_FIXUP_EAPD, 1979 ALC883_FIXUP_ACER_EAPD, 1980 ALC882_FIXUP_GPIO1, 1981 ALC882_FIXUP_GPIO2, 1982 ALC882_FIXUP_GPIO3, 1983 ALC889_FIXUP_COEF, 1984 ALC882_FIXUP_ASUS_W2JC, 1985 ALC882_FIXUP_ACER_ASPIRE_4930G, 1986 ALC882_FIXUP_ACER_ASPIRE_8930G, 1987 ALC882_FIXUP_ASPIRE_8930G_VERBS, 1988 ALC885_FIXUP_MACPRO_GPIO, 1989 ALC889_FIXUP_DAC_ROUTE, 1990 ALC889_FIXUP_MBP_VREF, 1991 ALC889_FIXUP_IMAC91_VREF, 1992 ALC889_FIXUP_MBA11_VREF, 1993 ALC889_FIXUP_MBA21_VREF, 1994 ALC889_FIXUP_MP11_VREF, 1995 ALC889_FIXUP_MP41_VREF, 1996 ALC882_FIXUP_INV_DMIC, 1997 ALC882_FIXUP_NO_PRIMARY_HP, 1998 ALC887_FIXUP_ASUS_BASS, 1999 ALC887_FIXUP_BASS_CHMAP, 2000 ALC1220_FIXUP_GB_DUAL_CODECS, 2001 ALC1220_FIXUP_GB_X570, 2002 ALC1220_FIXUP_CLEVO_P950, 2003 ALC1220_FIXUP_CLEVO_PB51ED, 2004 ALC1220_FIXUP_CLEVO_PB51ED_PINS, 2005 ALC887_FIXUP_ASUS_AUDIO, 2006 ALC887_FIXUP_ASUS_HMIC, 2007 ALCS1200A_FIXUP_MIC_VREF, 2008 ALC888VD_FIXUP_MIC_100VREF, 2009 }; 2010 2011 static void alc889_fixup_coef(struct hda_codec *codec, 2012 const struct hda_fixup *fix, int action) 2013 { 2014 if (action != HDA_FIXUP_ACT_INIT) 2015 return; 2016 alc_update_coef_idx(codec, 7, 0, 0x2030); 2017 } 2018 2019 /* set up GPIO at initialization */ 2020 static void alc885_fixup_macpro_gpio(struct hda_codec *codec, 2021 const struct hda_fixup *fix, int action) 2022 { 2023 struct alc_spec *spec = codec->spec; 2024 2025 spec->gpio_write_delay = true; 2026 alc_fixup_gpio3(codec, fix, action); 2027 } 2028 2029 /* Fix the connection of some pins for ALC889: 2030 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't 2031 * work correctly (bko#42740) 2032 */ 2033 static void alc889_fixup_dac_route(struct hda_codec *codec, 2034 const struct hda_fixup *fix, int action) 2035 { 2036 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 2037 /* fake the connections during parsing the tree */ 2038 static const hda_nid_t conn1[] = { 0x0c, 0x0d }; 2039 static const hda_nid_t conn2[] = { 0x0e, 0x0f }; 2040 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2041 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); 2042 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); 2043 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); 2044 } else if (action == HDA_FIXUP_ACT_PROBE) { 2045 /* restore the connections */ 2046 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; 2047 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); 2048 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); 2049 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); 2050 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); 2051 } 2052 } 2053 2054 /* Set VREF on HP pin */ 2055 static void alc889_fixup_mbp_vref(struct hda_codec *codec, 2056 const struct hda_fixup *fix, int action) 2057 { 2058 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; 2059 struct alc_spec *spec = codec->spec; 2060 int i; 2061 2062 if (action != HDA_FIXUP_ACT_INIT) 2063 return; 2064 for (i = 0; i < ARRAY_SIZE(nids); i++) { 2065 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); 2066 if (get_defcfg_device(val) != AC_JACK_HP_OUT) 2067 continue; 2068 val = snd_hda_codec_get_pin_target(codec, nids[i]); 2069 val |= AC_PINCTL_VREF_80; 2070 snd_hda_set_pin_ctl(codec, nids[i], val); 2071 spec->gen.keep_vref_in_automute = 1; 2072 break; 2073 } 2074 } 2075 2076 static void alc889_fixup_mac_pins(struct hda_codec *codec, 2077 const hda_nid_t *nids, int num_nids) 2078 { 2079 struct alc_spec *spec = codec->spec; 2080 int i; 2081 2082 for (i = 0; i < num_nids; i++) { 2083 unsigned int val; 2084 val = snd_hda_codec_get_pin_target(codec, nids[i]); 2085 val |= AC_PINCTL_VREF_50; 2086 snd_hda_set_pin_ctl(codec, nids[i], val); 2087 } 2088 spec->gen.keep_vref_in_automute = 1; 2089 } 2090 2091 /* Set VREF on speaker pins on imac91 */ 2092 static void alc889_fixup_imac91_vref(struct hda_codec *codec, 2093 const struct hda_fixup *fix, int action) 2094 { 2095 static const hda_nid_t nids[] = { 0x18, 0x1a }; 2096 2097 if (action == HDA_FIXUP_ACT_INIT) 2098 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2099 } 2100 2101 /* Set VREF on speaker pins on mba11 */ 2102 static void alc889_fixup_mba11_vref(struct hda_codec *codec, 2103 const struct hda_fixup *fix, int action) 2104 { 2105 static const hda_nid_t nids[] = { 0x18 }; 2106 2107 if (action == HDA_FIXUP_ACT_INIT) 2108 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2109 } 2110 2111 /* Set VREF on speaker pins on mba21 */ 2112 static void alc889_fixup_mba21_vref(struct hda_codec *codec, 2113 const struct hda_fixup *fix, int action) 2114 { 2115 static const hda_nid_t nids[] = { 0x18, 0x19 }; 2116 2117 if (action == HDA_FIXUP_ACT_INIT) 2118 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2119 } 2120 2121 /* Don't take HP output as primary 2122 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio 2123 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 2124 */ 2125 static void alc882_fixup_no_primary_hp(struct hda_codec *codec, 2126 const struct hda_fixup *fix, int action) 2127 { 2128 struct alc_spec *spec = codec->spec; 2129 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 2130 spec->gen.no_primary_hp = 1; 2131 spec->gen.no_multi_io = 1; 2132 } 2133 } 2134 2135 static void alc_fixup_bass_chmap(struct hda_codec *codec, 2136 const struct hda_fixup *fix, int action); 2137 2138 /* For dual-codec configuration, we need to disable some features to avoid 2139 * conflicts of kctls and PCM streams 2140 */ 2141 static void alc_fixup_dual_codecs(struct hda_codec *codec, 2142 const struct hda_fixup *fix, int action) 2143 { 2144 struct alc_spec *spec = codec->spec; 2145 2146 if (action != HDA_FIXUP_ACT_PRE_PROBE) 2147 return; 2148 /* disable vmaster */ 2149 spec->gen.suppress_vmaster = 1; 2150 /* auto-mute and auto-mic switch don't work with multiple codecs */ 2151 spec->gen.suppress_auto_mute = 1; 2152 spec->gen.suppress_auto_mic = 1; 2153 /* disable aamix as well */ 2154 spec->gen.mixer_nid = 0; 2155 /* add location prefix to avoid conflicts */ 2156 codec->force_pin_prefix = 1; 2157 } 2158 2159 static void rename_ctl(struct hda_codec *codec, const char *oldname, 2160 const char *newname) 2161 { 2162 struct snd_kcontrol *kctl; 2163 2164 kctl = snd_hda_find_mixer_ctl(codec, oldname); 2165 if (kctl) 2166 snd_ctl_rename(codec->card, kctl, newname); 2167 } 2168 2169 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, 2170 const struct hda_fixup *fix, 2171 int action) 2172 { 2173 alc_fixup_dual_codecs(codec, fix, action); 2174 switch (action) { 2175 case HDA_FIXUP_ACT_PRE_PROBE: 2176 /* override card longname to provide a unique UCM profile */ 2177 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); 2178 break; 2179 case HDA_FIXUP_ACT_BUILD: 2180 /* rename Capture controls depending on the codec */ 2181 rename_ctl(codec, "Capture Volume", 2182 codec->addr == 0 ? 2183 "Rear-Panel Capture Volume" : 2184 "Front-Panel Capture Volume"); 2185 rename_ctl(codec, "Capture Switch", 2186 codec->addr == 0 ? 2187 "Rear-Panel Capture Switch" : 2188 "Front-Panel Capture Switch"); 2189 break; 2190 } 2191 } 2192 2193 static void alc1220_fixup_gb_x570(struct hda_codec *codec, 2194 const struct hda_fixup *fix, 2195 int action) 2196 { 2197 static const hda_nid_t conn1[] = { 0x0c }; 2198 static const struct coef_fw gb_x570_coefs[] = { 2199 WRITE_COEF(0x07, 0x03c0), 2200 WRITE_COEF(0x1a, 0x01c1), 2201 WRITE_COEF(0x1b, 0x0202), 2202 WRITE_COEF(0x43, 0x3005), 2203 {} 2204 }; 2205 2206 switch (action) { 2207 case HDA_FIXUP_ACT_PRE_PROBE: 2208 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2209 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); 2210 break; 2211 case HDA_FIXUP_ACT_INIT: 2212 alc_process_coef_fw(codec, gb_x570_coefs); 2213 break; 2214 } 2215 } 2216 2217 static void alc1220_fixup_clevo_p950(struct hda_codec *codec, 2218 const struct hda_fixup *fix, 2219 int action) 2220 { 2221 static const hda_nid_t conn1[] = { 0x0c }; 2222 2223 if (action != HDA_FIXUP_ACT_PRE_PROBE) 2224 return; 2225 2226 alc_update_coef_idx(codec, 0x7, 0, 0x3c3); 2227 /* We therefore want to make sure 0x14 (front headphone) and 2228 * 0x1b (speakers) use the stereo DAC 0x02 2229 */ 2230 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2231 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); 2232 } 2233 2234 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, 2235 const struct hda_fixup *fix, int action); 2236 2237 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, 2238 const struct hda_fixup *fix, 2239 int action) 2240 { 2241 alc1220_fixup_clevo_p950(codec, fix, action); 2242 alc_fixup_headset_mode_no_hp_mic(codec, fix, action); 2243 } 2244 2245 static void alc887_asus_hp_automute_hook(struct hda_codec *codec, 2246 struct hda_jack_callback *jack) 2247 { 2248 struct alc_spec *spec = codec->spec; 2249 unsigned int vref; 2250 2251 snd_hda_gen_hp_automute(codec, jack); 2252 2253 if (spec->gen.hp_jack_present) 2254 vref = AC_PINCTL_VREF_80; 2255 else 2256 vref = AC_PINCTL_VREF_HIZ; 2257 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); 2258 } 2259 2260 static void alc887_fixup_asus_jack(struct hda_codec *codec, 2261 const struct hda_fixup *fix, int action) 2262 { 2263 struct alc_spec *spec = codec->spec; 2264 if (action != HDA_FIXUP_ACT_PROBE) 2265 return; 2266 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); 2267 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; 2268 } 2269 2270 static const struct hda_fixup alc882_fixups[] = { 2271 [ALC882_FIXUP_ABIT_AW9D_MAX] = { 2272 .type = HDA_FIXUP_PINS, 2273 .v.pins = (const struct hda_pintbl[]) { 2274 { 0x15, 0x01080104 }, /* side */ 2275 { 0x16, 0x01011012 }, /* rear */ 2276 { 0x17, 0x01016011 }, /* clfe */ 2277 { } 2278 } 2279 }, 2280 [ALC882_FIXUP_LENOVO_Y530] = { 2281 .type = HDA_FIXUP_PINS, 2282 .v.pins = (const struct hda_pintbl[]) { 2283 { 0x15, 0x99130112 }, /* rear int speakers */ 2284 { 0x16, 0x99130111 }, /* subwoofer */ 2285 { } 2286 } 2287 }, 2288 [ALC882_FIXUP_PB_M5210] = { 2289 .type = HDA_FIXUP_PINCTLS, 2290 .v.pins = (const struct hda_pintbl[]) { 2291 { 0x19, PIN_VREF50 }, 2292 {} 2293 } 2294 }, 2295 [ALC882_FIXUP_ACER_ASPIRE_7736] = { 2296 .type = HDA_FIXUP_FUNC, 2297 .v.func = alc_fixup_sku_ignore, 2298 }, 2299 [ALC882_FIXUP_ASUS_W90V] = { 2300 .type = HDA_FIXUP_PINS, 2301 .v.pins = (const struct hda_pintbl[]) { 2302 { 0x16, 0x99130110 }, /* fix sequence for CLFE */ 2303 { } 2304 } 2305 }, 2306 [ALC889_FIXUP_CD] = { 2307 .type = HDA_FIXUP_PINS, 2308 .v.pins = (const struct hda_pintbl[]) { 2309 { 0x1c, 0x993301f0 }, /* CD */ 2310 { } 2311 } 2312 }, 2313 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { 2314 .type = HDA_FIXUP_PINS, 2315 .v.pins = (const struct hda_pintbl[]) { 2316 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ 2317 { } 2318 }, 2319 .chained = true, 2320 .chain_id = ALC889_FIXUP_CD, 2321 }, 2322 [ALC889_FIXUP_VAIO_TT] = { 2323 .type = HDA_FIXUP_PINS, 2324 .v.pins = (const struct hda_pintbl[]) { 2325 { 0x17, 0x90170111 }, /* hidden surround speaker */ 2326 { } 2327 } 2328 }, 2329 [ALC888_FIXUP_EEE1601] = { 2330 .type = HDA_FIXUP_VERBS, 2331 .v.verbs = (const struct hda_verb[]) { 2332 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, 2333 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, 2334 { } 2335 } 2336 }, 2337 [ALC886_FIXUP_EAPD] = { 2338 .type = HDA_FIXUP_VERBS, 2339 .v.verbs = (const struct hda_verb[]) { 2340 /* change to EAPD mode */ 2341 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2342 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 }, 2343 { } 2344 } 2345 }, 2346 [ALC882_FIXUP_EAPD] = { 2347 .type = HDA_FIXUP_VERBS, 2348 .v.verbs = (const struct hda_verb[]) { 2349 /* change to EAPD mode */ 2350 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2351 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 2352 { } 2353 } 2354 }, 2355 [ALC883_FIXUP_EAPD] = { 2356 .type = HDA_FIXUP_VERBS, 2357 .v.verbs = (const struct hda_verb[]) { 2358 /* change to EAPD mode */ 2359 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2360 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 2361 { } 2362 } 2363 }, 2364 [ALC883_FIXUP_ACER_EAPD] = { 2365 .type = HDA_FIXUP_VERBS, 2366 .v.verbs = (const struct hda_verb[]) { 2367 /* eanable EAPD on Acer laptops */ 2368 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2369 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2370 { } 2371 } 2372 }, 2373 [ALC882_FIXUP_GPIO1] = { 2374 .type = HDA_FIXUP_FUNC, 2375 .v.func = alc_fixup_gpio1, 2376 }, 2377 [ALC882_FIXUP_GPIO2] = { 2378 .type = HDA_FIXUP_FUNC, 2379 .v.func = alc_fixup_gpio2, 2380 }, 2381 [ALC882_FIXUP_GPIO3] = { 2382 .type = HDA_FIXUP_FUNC, 2383 .v.func = alc_fixup_gpio3, 2384 }, 2385 [ALC882_FIXUP_ASUS_W2JC] = { 2386 .type = HDA_FIXUP_FUNC, 2387 .v.func = alc_fixup_gpio1, 2388 .chained = true, 2389 .chain_id = ALC882_FIXUP_EAPD, 2390 }, 2391 [ALC889_FIXUP_COEF] = { 2392 .type = HDA_FIXUP_FUNC, 2393 .v.func = alc889_fixup_coef, 2394 }, 2395 [ALC882_FIXUP_ACER_ASPIRE_4930G] = { 2396 .type = HDA_FIXUP_PINS, 2397 .v.pins = (const struct hda_pintbl[]) { 2398 { 0x16, 0x99130111 }, /* CLFE speaker */ 2399 { 0x17, 0x99130112 }, /* surround speaker */ 2400 { } 2401 }, 2402 .chained = true, 2403 .chain_id = ALC882_FIXUP_GPIO1, 2404 }, 2405 [ALC882_FIXUP_ACER_ASPIRE_8930G] = { 2406 .type = HDA_FIXUP_PINS, 2407 .v.pins = (const struct hda_pintbl[]) { 2408 { 0x16, 0x99130111 }, /* CLFE speaker */ 2409 { 0x1b, 0x99130112 }, /* surround speaker */ 2410 { } 2411 }, 2412 .chained = true, 2413 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, 2414 }, 2415 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { 2416 /* additional init verbs for Acer Aspire 8930G */ 2417 .type = HDA_FIXUP_VERBS, 2418 .v.verbs = (const struct hda_verb[]) { 2419 /* Enable all DACs */ 2420 /* DAC DISABLE/MUTE 1? */ 2421 /* setting bits 1-5 disables DAC nids 0x02-0x06 2422 * apparently. Init=0x38 */ 2423 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, 2424 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, 2425 /* DAC DISABLE/MUTE 2? */ 2426 /* some bit here disables the other DACs. 2427 * Init=0x4900 */ 2428 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, 2429 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, 2430 /* DMIC fix 2431 * This laptop has a stereo digital microphone. 2432 * The mics are only 1cm apart which makes the stereo 2433 * useless. However, either the mic or the ALC889 2434 * makes the signal become a difference/sum signal 2435 * instead of standard stereo, which is annoying. 2436 * So instead we flip this bit which makes the 2437 * codec replicate the sum signal to both channels, 2438 * turning it into a normal mono mic. 2439 */ 2440 /* DMIC_CONTROL? Init value = 0x0001 */ 2441 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, 2442 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, 2443 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2444 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2445 { } 2446 }, 2447 .chained = true, 2448 .chain_id = ALC882_FIXUP_GPIO1, 2449 }, 2450 [ALC885_FIXUP_MACPRO_GPIO] = { 2451 .type = HDA_FIXUP_FUNC, 2452 .v.func = alc885_fixup_macpro_gpio, 2453 }, 2454 [ALC889_FIXUP_DAC_ROUTE] = { 2455 .type = HDA_FIXUP_FUNC, 2456 .v.func = alc889_fixup_dac_route, 2457 }, 2458 [ALC889_FIXUP_MBP_VREF] = { 2459 .type = HDA_FIXUP_FUNC, 2460 .v.func = alc889_fixup_mbp_vref, 2461 .chained = true, 2462 .chain_id = ALC882_FIXUP_GPIO1, 2463 }, 2464 [ALC889_FIXUP_IMAC91_VREF] = { 2465 .type = HDA_FIXUP_FUNC, 2466 .v.func = alc889_fixup_imac91_vref, 2467 .chained = true, 2468 .chain_id = ALC882_FIXUP_GPIO1, 2469 }, 2470 [ALC889_FIXUP_MBA11_VREF] = { 2471 .type = HDA_FIXUP_FUNC, 2472 .v.func = alc889_fixup_mba11_vref, 2473 .chained = true, 2474 .chain_id = ALC889_FIXUP_MBP_VREF, 2475 }, 2476 [ALC889_FIXUP_MBA21_VREF] = { 2477 .type = HDA_FIXUP_FUNC, 2478 .v.func = alc889_fixup_mba21_vref, 2479 .chained = true, 2480 .chain_id = ALC889_FIXUP_MBP_VREF, 2481 }, 2482 [ALC889_FIXUP_MP11_VREF] = { 2483 .type = HDA_FIXUP_FUNC, 2484 .v.func = alc889_fixup_mba11_vref, 2485 .chained = true, 2486 .chain_id = ALC885_FIXUP_MACPRO_GPIO, 2487 }, 2488 [ALC889_FIXUP_MP41_VREF] = { 2489 .type = HDA_FIXUP_FUNC, 2490 .v.func = alc889_fixup_mbp_vref, 2491 .chained = true, 2492 .chain_id = ALC885_FIXUP_MACPRO_GPIO, 2493 }, 2494 [ALC882_FIXUP_INV_DMIC] = { 2495 .type = HDA_FIXUP_FUNC, 2496 .v.func = alc_fixup_inv_dmic, 2497 }, 2498 [ALC882_FIXUP_NO_PRIMARY_HP] = { 2499 .type = HDA_FIXUP_FUNC, 2500 .v.func = alc882_fixup_no_primary_hp, 2501 }, 2502 [ALC887_FIXUP_ASUS_BASS] = { 2503 .type = HDA_FIXUP_PINS, 2504 .v.pins = (const struct hda_pintbl[]) { 2505 {0x16, 0x99130130}, /* bass speaker */ 2506 {} 2507 }, 2508 .chained = true, 2509 .chain_id = ALC887_FIXUP_BASS_CHMAP, 2510 }, 2511 [ALC887_FIXUP_BASS_CHMAP] = { 2512 .type = HDA_FIXUP_FUNC, 2513 .v.func = alc_fixup_bass_chmap, 2514 }, 2515 [ALC1220_FIXUP_GB_DUAL_CODECS] = { 2516 .type = HDA_FIXUP_FUNC, 2517 .v.func = alc1220_fixup_gb_dual_codecs, 2518 }, 2519 [ALC1220_FIXUP_GB_X570] = { 2520 .type = HDA_FIXUP_FUNC, 2521 .v.func = alc1220_fixup_gb_x570, 2522 }, 2523 [ALC1220_FIXUP_CLEVO_P950] = { 2524 .type = HDA_FIXUP_FUNC, 2525 .v.func = alc1220_fixup_clevo_p950, 2526 }, 2527 [ALC1220_FIXUP_CLEVO_PB51ED] = { 2528 .type = HDA_FIXUP_FUNC, 2529 .v.func = alc1220_fixup_clevo_pb51ed, 2530 }, 2531 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { 2532 .type = HDA_FIXUP_PINS, 2533 .v.pins = (const struct hda_pintbl[]) { 2534 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 2535 {} 2536 }, 2537 .chained = true, 2538 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, 2539 }, 2540 [ALC887_FIXUP_ASUS_AUDIO] = { 2541 .type = HDA_FIXUP_PINS, 2542 .v.pins = (const struct hda_pintbl[]) { 2543 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ 2544 { 0x19, 0x22219420 }, 2545 {} 2546 }, 2547 }, 2548 [ALC887_FIXUP_ASUS_HMIC] = { 2549 .type = HDA_FIXUP_FUNC, 2550 .v.func = alc887_fixup_asus_jack, 2551 .chained = true, 2552 .chain_id = ALC887_FIXUP_ASUS_AUDIO, 2553 }, 2554 [ALCS1200A_FIXUP_MIC_VREF] = { 2555 .type = HDA_FIXUP_PINCTLS, 2556 .v.pins = (const struct hda_pintbl[]) { 2557 { 0x18, PIN_VREF50 }, /* rear mic */ 2558 { 0x19, PIN_VREF50 }, /* front mic */ 2559 {} 2560 } 2561 }, 2562 [ALC888VD_FIXUP_MIC_100VREF] = { 2563 .type = HDA_FIXUP_PINCTLS, 2564 .v.pins = (const struct hda_pintbl[]) { 2565 { 0x18, PIN_VREF100 }, /* headset mic */ 2566 {} 2567 } 2568 }, 2569 }; 2570 2571 static const struct hda_quirk alc882_fixup_tbl[] = { 2572 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), 2573 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2574 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2575 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), 2576 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2577 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), 2578 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), 2579 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", 2580 ALC882_FIXUP_ACER_ASPIRE_4930G), 2581 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", 2582 ALC882_FIXUP_ACER_ASPIRE_4930G), 2583 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", 2584 ALC882_FIXUP_ACER_ASPIRE_8930G), 2585 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", 2586 ALC882_FIXUP_ACER_ASPIRE_8930G), 2587 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", 2588 ALC882_FIXUP_ACER_ASPIRE_4930G), 2589 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), 2590 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", 2591 ALC882_FIXUP_ACER_ASPIRE_4930G), 2592 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", 2593 ALC882_FIXUP_ACER_ASPIRE_4930G), 2594 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", 2595 ALC882_FIXUP_ACER_ASPIRE_4930G), 2596 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), 2597 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), 2598 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), 2599 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), 2600 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), 2601 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), 2602 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), 2603 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), 2604 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), 2605 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), 2606 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF), 2607 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), 2608 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), 2609 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), 2610 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), 2611 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), 2612 2613 /* All Apple entries are in codec SSIDs */ 2614 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), 2615 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), 2616 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2617 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), 2618 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), 2619 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), 2620 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), 2621 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), 2622 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), 2623 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), 2624 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), 2625 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), 2626 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2627 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), 2628 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), 2629 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), 2630 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), 2631 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), 2632 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), 2633 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), 2634 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), 2635 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), 2636 2637 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 2638 SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF), 2639 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), 2640 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), 2641 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), 2642 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570), 2643 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570), 2644 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570), 2645 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), 2646 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), 2647 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), 2648 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), 2649 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), 2650 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), 2651 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), 2652 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS), 2653 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), 2654 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 2655 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), 2656 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2657 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2658 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2659 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2660 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2661 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2662 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2663 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2664 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2665 SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2666 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2667 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2668 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2669 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2670 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2671 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2672 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2673 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED), 2674 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), 2675 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), 2676 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), 2677 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), 2678 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), 2679 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950), 2680 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950), 2681 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950), 2682 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950), 2683 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), 2684 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), 2685 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950), 2686 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2687 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), 2688 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), 2689 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), 2690 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), 2691 {} 2692 }; 2693 2694 static const struct hda_model_fixup alc882_fixup_models[] = { 2695 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, 2696 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, 2697 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, 2698 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, 2699 {.id = ALC889_FIXUP_CD, .name = "cd"}, 2700 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, 2701 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, 2702 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, 2703 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, 2704 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, 2705 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, 2706 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, 2707 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, 2708 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, 2709 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, 2710 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, 2711 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, 2712 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, 2713 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, 2714 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, 2715 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, 2716 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, 2717 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, 2718 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, 2719 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, 2720 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, 2721 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, 2722 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, 2723 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, 2724 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, 2725 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"}, 2726 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, 2727 {} 2728 }; 2729 2730 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = { 2731 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950, 2732 {0x14, 0x01014010}, 2733 {0x15, 0x01011012}, 2734 {0x16, 0x01016011}, 2735 {0x18, 0x01a19040}, 2736 {0x19, 0x02a19050}, 2737 {0x1a, 0x0181304f}, 2738 {0x1b, 0x0221401f}, 2739 {0x1e, 0x01456130}), 2740 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950, 2741 {0x14, 0x01015010}, 2742 {0x15, 0x01011012}, 2743 {0x16, 0x01011011}, 2744 {0x18, 0x01a11040}, 2745 {0x19, 0x02a19050}, 2746 {0x1a, 0x0181104f}, 2747 {0x1b, 0x0221401f}, 2748 {0x1e, 0x01451130}), 2749 {} 2750 }; 2751 2752 /* 2753 * BIOS auto configuration 2754 */ 2755 /* almost identical with ALC880 parser... */ 2756 static int alc882_parse_auto_config(struct hda_codec *codec) 2757 { 2758 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; 2759 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 2760 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); 2761 } 2762 2763 /* 2764 */ 2765 static int patch_alc882(struct hda_codec *codec) 2766 { 2767 struct alc_spec *spec; 2768 int err; 2769 2770 err = alc_alloc_spec(codec, 0x0b); 2771 if (err < 0) 2772 return err; 2773 2774 spec = codec->spec; 2775 2776 switch (codec->core.vendor_id) { 2777 case 0x10ec0882: 2778 case 0x10ec0885: 2779 case 0x10ec0900: 2780 case 0x10ec0b00: 2781 case 0x10ec1220: 2782 break; 2783 default: 2784 /* ALC883 and variants */ 2785 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 2786 break; 2787 } 2788 2789 alc_pre_init(codec); 2790 2791 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, 2792 alc882_fixups); 2793 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true); 2794 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2795 2796 alc_auto_parse_customize_define(codec); 2797 2798 if (has_cdefine_beep(codec)) 2799 spec->gen.beep_nid = 0x01; 2800 2801 /* automatic parse from the BIOS config */ 2802 err = alc882_parse_auto_config(codec); 2803 if (err < 0) 2804 goto error; 2805 2806 if (!spec->gen.no_analog && spec->gen.beep_nid) { 2807 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 2808 if (err < 0) 2809 goto error; 2810 } 2811 2812 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 2813 2814 return 0; 2815 2816 error: 2817 alc_free(codec); 2818 return err; 2819 } 2820 2821 2822 /* 2823 * ALC262 support 2824 */ 2825 static int alc262_parse_auto_config(struct hda_codec *codec) 2826 { 2827 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; 2828 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 2829 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); 2830 } 2831 2832 /* 2833 * Pin config fixes 2834 */ 2835 enum { 2836 ALC262_FIXUP_FSC_H270, 2837 ALC262_FIXUP_FSC_S7110, 2838 ALC262_FIXUP_HP_Z200, 2839 ALC262_FIXUP_TYAN, 2840 ALC262_FIXUP_LENOVO_3000, 2841 ALC262_FIXUP_BENQ, 2842 ALC262_FIXUP_BENQ_T31, 2843 ALC262_FIXUP_INV_DMIC, 2844 ALC262_FIXUP_INTEL_BAYLEYBAY, 2845 }; 2846 2847 static const struct hda_fixup alc262_fixups[] = { 2848 [ALC262_FIXUP_FSC_H270] = { 2849 .type = HDA_FIXUP_PINS, 2850 .v.pins = (const struct hda_pintbl[]) { 2851 { 0x14, 0x99130110 }, /* speaker */ 2852 { 0x15, 0x0221142f }, /* front HP */ 2853 { 0x1b, 0x0121141f }, /* rear HP */ 2854 { } 2855 } 2856 }, 2857 [ALC262_FIXUP_FSC_S7110] = { 2858 .type = HDA_FIXUP_PINS, 2859 .v.pins = (const struct hda_pintbl[]) { 2860 { 0x15, 0x90170110 }, /* speaker */ 2861 { } 2862 }, 2863 .chained = true, 2864 .chain_id = ALC262_FIXUP_BENQ, 2865 }, 2866 [ALC262_FIXUP_HP_Z200] = { 2867 .type = HDA_FIXUP_PINS, 2868 .v.pins = (const struct hda_pintbl[]) { 2869 { 0x16, 0x99130120 }, /* internal speaker */ 2870 { } 2871 } 2872 }, 2873 [ALC262_FIXUP_TYAN] = { 2874 .type = HDA_FIXUP_PINS, 2875 .v.pins = (const struct hda_pintbl[]) { 2876 { 0x14, 0x1993e1f0 }, /* int AUX */ 2877 { } 2878 } 2879 }, 2880 [ALC262_FIXUP_LENOVO_3000] = { 2881 .type = HDA_FIXUP_PINCTLS, 2882 .v.pins = (const struct hda_pintbl[]) { 2883 { 0x19, PIN_VREF50 }, 2884 {} 2885 }, 2886 .chained = true, 2887 .chain_id = ALC262_FIXUP_BENQ, 2888 }, 2889 [ALC262_FIXUP_BENQ] = { 2890 .type = HDA_FIXUP_VERBS, 2891 .v.verbs = (const struct hda_verb[]) { 2892 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2893 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 2894 {} 2895 } 2896 }, 2897 [ALC262_FIXUP_BENQ_T31] = { 2898 .type = HDA_FIXUP_VERBS, 2899 .v.verbs = (const struct hda_verb[]) { 2900 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2901 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2902 {} 2903 } 2904 }, 2905 [ALC262_FIXUP_INV_DMIC] = { 2906 .type = HDA_FIXUP_FUNC, 2907 .v.func = alc_fixup_inv_dmic, 2908 }, 2909 [ALC262_FIXUP_INTEL_BAYLEYBAY] = { 2910 .type = HDA_FIXUP_FUNC, 2911 .v.func = alc_fixup_no_depop_delay, 2912 }, 2913 }; 2914 2915 static const struct hda_quirk alc262_fixup_tbl[] = { 2916 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), 2917 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), 2918 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), 2919 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), 2920 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), 2921 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), 2922 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), 2923 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), 2924 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), 2925 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), 2926 {} 2927 }; 2928 2929 static const struct hda_model_fixup alc262_fixup_models[] = { 2930 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, 2931 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, 2932 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, 2933 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, 2934 {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, 2935 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, 2936 {.id = ALC262_FIXUP_BENQ, .name = "benq"}, 2937 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, 2938 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, 2939 {} 2940 }; 2941 2942 /* 2943 */ 2944 static int patch_alc262(struct hda_codec *codec) 2945 { 2946 struct alc_spec *spec; 2947 int err; 2948 2949 err = alc_alloc_spec(codec, 0x0b); 2950 if (err < 0) 2951 return err; 2952 2953 spec = codec->spec; 2954 spec->gen.shared_mic_vref_pin = 0x18; 2955 2956 spec->shutup = alc_eapd_shutup; 2957 2958 #if 0 2959 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is 2960 * under-run 2961 */ 2962 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); 2963 #endif 2964 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 2965 2966 alc_pre_init(codec); 2967 2968 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, 2969 alc262_fixups); 2970 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2971 2972 alc_auto_parse_customize_define(codec); 2973 2974 if (has_cdefine_beep(codec)) 2975 spec->gen.beep_nid = 0x01; 2976 2977 /* automatic parse from the BIOS config */ 2978 err = alc262_parse_auto_config(codec); 2979 if (err < 0) 2980 goto error; 2981 2982 if (!spec->gen.no_analog && spec->gen.beep_nid) { 2983 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 2984 if (err < 0) 2985 goto error; 2986 } 2987 2988 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 2989 2990 return 0; 2991 2992 error: 2993 alc_free(codec); 2994 return err; 2995 } 2996 2997 /* 2998 * ALC268 2999 */ 3000 /* bind Beep switches of both NID 0x0f and 0x10 */ 3001 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, 3002 struct snd_ctl_elem_value *ucontrol) 3003 { 3004 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 3005 unsigned long pval; 3006 int err; 3007 3008 mutex_lock(&codec->control_mutex); 3009 pval = kcontrol->private_value; 3010 kcontrol->private_value = (pval & ~0xff) | 0x0f; 3011 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 3012 if (err >= 0) { 3013 kcontrol->private_value = (pval & ~0xff) | 0x10; 3014 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 3015 } 3016 kcontrol->private_value = pval; 3017 mutex_unlock(&codec->control_mutex); 3018 return err; 3019 } 3020 3021 static const struct snd_kcontrol_new alc268_beep_mixer[] = { 3022 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), 3023 { 3024 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3025 .name = "Beep Playback Switch", 3026 .subdevice = HDA_SUBDEV_AMP_FLAG, 3027 .info = snd_hda_mixer_amp_switch_info, 3028 .get = snd_hda_mixer_amp_switch_get, 3029 .put = alc268_beep_switch_put, 3030 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) 3031 }, 3032 }; 3033 3034 /* set PCBEEP vol = 0, mute connections */ 3035 static const struct hda_verb alc268_beep_init_verbs[] = { 3036 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 3037 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 3038 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 3039 { } 3040 }; 3041 3042 enum { 3043 ALC268_FIXUP_INV_DMIC, 3044 ALC268_FIXUP_HP_EAPD, 3045 ALC268_FIXUP_SPDIF, 3046 }; 3047 3048 static const struct hda_fixup alc268_fixups[] = { 3049 [ALC268_FIXUP_INV_DMIC] = { 3050 .type = HDA_FIXUP_FUNC, 3051 .v.func = alc_fixup_inv_dmic, 3052 }, 3053 [ALC268_FIXUP_HP_EAPD] = { 3054 .type = HDA_FIXUP_VERBS, 3055 .v.verbs = (const struct hda_verb[]) { 3056 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, 3057 {} 3058 } 3059 }, 3060 [ALC268_FIXUP_SPDIF] = { 3061 .type = HDA_FIXUP_PINS, 3062 .v.pins = (const struct hda_pintbl[]) { 3063 { 0x1e, 0x014b1180 }, /* enable SPDIF out */ 3064 {} 3065 } 3066 }, 3067 }; 3068 3069 static const struct hda_model_fixup alc268_fixup_models[] = { 3070 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, 3071 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, 3072 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, 3073 {} 3074 }; 3075 3076 static const struct hda_quirk alc268_fixup_tbl[] = { 3077 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), 3078 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), 3079 /* below is codec SSID since multiple Toshiba laptops have the 3080 * same PCI SSID 1179:ff00 3081 */ 3082 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), 3083 {} 3084 }; 3085 3086 /* 3087 * BIOS auto configuration 3088 */ 3089 static int alc268_parse_auto_config(struct hda_codec *codec) 3090 { 3091 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 3092 return alc_parse_auto_config(codec, NULL, alc268_ssids); 3093 } 3094 3095 /* 3096 */ 3097 static int patch_alc268(struct hda_codec *codec) 3098 { 3099 struct alc_spec *spec; 3100 int i, err; 3101 3102 /* ALC268 has no aa-loopback mixer */ 3103 err = alc_alloc_spec(codec, 0); 3104 if (err < 0) 3105 return err; 3106 3107 spec = codec->spec; 3108 if (has_cdefine_beep(codec)) 3109 spec->gen.beep_nid = 0x01; 3110 3111 spec->shutup = alc_eapd_shutup; 3112 3113 alc_pre_init(codec); 3114 3115 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); 3116 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 3117 3118 /* automatic parse from the BIOS config */ 3119 err = alc268_parse_auto_config(codec); 3120 if (err < 0) 3121 goto error; 3122 3123 if (err > 0 && !spec->gen.no_analog && 3124 spec->gen.autocfg.speaker_pins[0] != 0x1d) { 3125 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { 3126 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, 3127 &alc268_beep_mixer[i])) { 3128 err = -ENOMEM; 3129 goto error; 3130 } 3131 } 3132 snd_hda_add_verbs(codec, alc268_beep_init_verbs); 3133 if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) 3134 /* override the amp caps for beep generator */ 3135 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, 3136 (0x0c << AC_AMPCAP_OFFSET_SHIFT) | 3137 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | 3138 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | 3139 (0 << AC_AMPCAP_MUTE_SHIFT)); 3140 } 3141 3142 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 3143 3144 return 0; 3145 3146 error: 3147 alc_free(codec); 3148 return err; 3149 } 3150 3151 /* 3152 * ALC269 3153 */ 3154 3155 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { 3156 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ 3157 }; 3158 3159 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { 3160 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ 3161 }; 3162 3163 /* different alc269-variants */ 3164 enum { 3165 ALC269_TYPE_ALC269VA, 3166 ALC269_TYPE_ALC269VB, 3167 ALC269_TYPE_ALC269VC, 3168 ALC269_TYPE_ALC269VD, 3169 ALC269_TYPE_ALC280, 3170 ALC269_TYPE_ALC282, 3171 ALC269_TYPE_ALC283, 3172 ALC269_TYPE_ALC284, 3173 ALC269_TYPE_ALC293, 3174 ALC269_TYPE_ALC286, 3175 ALC269_TYPE_ALC298, 3176 ALC269_TYPE_ALC255, 3177 ALC269_TYPE_ALC256, 3178 ALC269_TYPE_ALC257, 3179 ALC269_TYPE_ALC215, 3180 ALC269_TYPE_ALC225, 3181 ALC269_TYPE_ALC245, 3182 ALC269_TYPE_ALC287, 3183 ALC269_TYPE_ALC294, 3184 ALC269_TYPE_ALC300, 3185 ALC269_TYPE_ALC623, 3186 ALC269_TYPE_ALC700, 3187 }; 3188 3189 /* 3190 * BIOS auto configuration 3191 */ 3192 static int alc269_parse_auto_config(struct hda_codec *codec) 3193 { 3194 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 3195 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; 3196 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 3197 struct alc_spec *spec = codec->spec; 3198 const hda_nid_t *ssids; 3199 3200 switch (spec->codec_variant) { 3201 case ALC269_TYPE_ALC269VA: 3202 case ALC269_TYPE_ALC269VC: 3203 case ALC269_TYPE_ALC280: 3204 case ALC269_TYPE_ALC284: 3205 case ALC269_TYPE_ALC293: 3206 ssids = alc269va_ssids; 3207 break; 3208 case ALC269_TYPE_ALC269VB: 3209 case ALC269_TYPE_ALC269VD: 3210 case ALC269_TYPE_ALC282: 3211 case ALC269_TYPE_ALC283: 3212 case ALC269_TYPE_ALC286: 3213 case ALC269_TYPE_ALC298: 3214 case ALC269_TYPE_ALC255: 3215 case ALC269_TYPE_ALC256: 3216 case ALC269_TYPE_ALC257: 3217 case ALC269_TYPE_ALC215: 3218 case ALC269_TYPE_ALC225: 3219 case ALC269_TYPE_ALC245: 3220 case ALC269_TYPE_ALC287: 3221 case ALC269_TYPE_ALC294: 3222 case ALC269_TYPE_ALC300: 3223 case ALC269_TYPE_ALC623: 3224 case ALC269_TYPE_ALC700: 3225 ssids = alc269_ssids; 3226 break; 3227 default: 3228 ssids = alc269_ssids; 3229 break; 3230 } 3231 3232 return alc_parse_auto_config(codec, alc269_ignore, ssids); 3233 } 3234 3235 static const struct hda_jack_keymap alc_headset_btn_keymap[] = { 3236 { SND_JACK_BTN_0, KEY_PLAYPAUSE }, 3237 { SND_JACK_BTN_1, KEY_VOICECOMMAND }, 3238 { SND_JACK_BTN_2, KEY_VOLUMEUP }, 3239 { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, 3240 {} 3241 }; 3242 3243 static void alc_headset_btn_callback(struct hda_codec *codec, 3244 struct hda_jack_callback *jack) 3245 { 3246 int report = 0; 3247 3248 if (jack->unsol_res & (7 << 13)) 3249 report |= SND_JACK_BTN_0; 3250 3251 if (jack->unsol_res & (1 << 16 | 3 << 8)) 3252 report |= SND_JACK_BTN_1; 3253 3254 /* Volume up key */ 3255 if (jack->unsol_res & (7 << 23)) 3256 report |= SND_JACK_BTN_2; 3257 3258 /* Volume down key */ 3259 if (jack->unsol_res & (7 << 10)) 3260 report |= SND_JACK_BTN_3; 3261 3262 snd_hda_jack_set_button_state(codec, jack->nid, report); 3263 } 3264 3265 static void alc_disable_headset_jack_key(struct hda_codec *codec) 3266 { 3267 struct alc_spec *spec = codec->spec; 3268 3269 if (!spec->has_hs_key) 3270 return; 3271 3272 switch (codec->core.vendor_id) { 3273 case 0x10ec0215: 3274 case 0x10ec0225: 3275 case 0x10ec0285: 3276 case 0x10ec0287: 3277 case 0x10ec0295: 3278 case 0x10ec0289: 3279 case 0x10ec0299: 3280 alc_write_coef_idx(codec, 0x48, 0x0); 3281 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); 3282 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); 3283 break; 3284 case 0x10ec0230: 3285 case 0x10ec0236: 3286 case 0x10ec0256: 3287 case 0x10ec0257: 3288 case 0x19e58326: 3289 alc_write_coef_idx(codec, 0x48, 0x0); 3290 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); 3291 break; 3292 } 3293 } 3294 3295 static void alc_enable_headset_jack_key(struct hda_codec *codec) 3296 { 3297 struct alc_spec *spec = codec->spec; 3298 3299 if (!spec->has_hs_key) 3300 return; 3301 3302 switch (codec->core.vendor_id) { 3303 case 0x10ec0215: 3304 case 0x10ec0225: 3305 case 0x10ec0285: 3306 case 0x10ec0287: 3307 case 0x10ec0295: 3308 case 0x10ec0289: 3309 case 0x10ec0299: 3310 alc_write_coef_idx(codec, 0x48, 0xd011); 3311 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); 3312 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); 3313 break; 3314 case 0x10ec0230: 3315 case 0x10ec0236: 3316 case 0x10ec0256: 3317 case 0x10ec0257: 3318 case 0x19e58326: 3319 alc_write_coef_idx(codec, 0x48, 0xd011); 3320 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); 3321 break; 3322 } 3323 } 3324 3325 static void alc_fixup_headset_jack(struct hda_codec *codec, 3326 const struct hda_fixup *fix, int action) 3327 { 3328 struct alc_spec *spec = codec->spec; 3329 hda_nid_t hp_pin; 3330 3331 switch (action) { 3332 case HDA_FIXUP_ACT_PRE_PROBE: 3333 spec->has_hs_key = 1; 3334 snd_hda_jack_detect_enable_callback(codec, 0x55, 3335 alc_headset_btn_callback); 3336 break; 3337 case HDA_FIXUP_ACT_BUILD: 3338 hp_pin = alc_get_hp_pin(spec); 3339 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55, 3340 alc_headset_btn_keymap, 3341 hp_pin)) 3342 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", 3343 false, SND_JACK_HEADSET, 3344 alc_headset_btn_keymap); 3345 3346 alc_enable_headset_jack_key(codec); 3347 break; 3348 } 3349 } 3350 3351 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) 3352 { 3353 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); 3354 } 3355 3356 static void alc269_shutup(struct hda_codec *codec) 3357 { 3358 struct alc_spec *spec = codec->spec; 3359 3360 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 3361 alc269vb_toggle_power_output(codec, 0); 3362 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 3363 (alc_get_coef0(codec) & 0x00ff) == 0x018) { 3364 msleep(150); 3365 } 3366 alc_shutup_pins(codec); 3367 } 3368 3369 static const struct coef_fw alc282_coefs[] = { 3370 WRITE_COEF(0x03, 0x0002), /* Power Down Control */ 3371 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ 3372 WRITE_COEF(0x07, 0x0200), /* DMIC control */ 3373 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ 3374 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ 3375 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ 3376 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ 3377 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ 3378 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ 3379 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ 3380 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ 3381 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ 3382 WRITE_COEF(0x34, 0xa0c0), /* ANC */ 3383 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ 3384 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ 3385 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ 3386 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ 3387 WRITE_COEF(0x63, 0x2902), /* PLL */ 3388 WRITE_COEF(0x68, 0xa080), /* capless control 2 */ 3389 WRITE_COEF(0x69, 0x3400), /* capless control 3 */ 3390 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ 3391 WRITE_COEF(0x6b, 0x0), /* capless control 5 */ 3392 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ 3393 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ 3394 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ 3395 WRITE_COEF(0x71, 0x0014), /* class D test 6 */ 3396 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ 3397 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ 3398 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ 3399 {} 3400 }; 3401 3402 static void alc282_restore_default_value(struct hda_codec *codec) 3403 { 3404 alc_process_coef_fw(codec, alc282_coefs); 3405 } 3406 3407 static void alc282_init(struct hda_codec *codec) 3408 { 3409 struct alc_spec *spec = codec->spec; 3410 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3411 bool hp_pin_sense; 3412 int coef78; 3413 3414 alc282_restore_default_value(codec); 3415 3416 if (!hp_pin) 3417 return; 3418 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3419 coef78 = alc_read_coef_idx(codec, 0x78); 3420 3421 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ 3422 /* Headphone capless set to high power mode */ 3423 alc_write_coef_idx(codec, 0x78, 0x9004); 3424 3425 if (hp_pin_sense) 3426 msleep(2); 3427 3428 snd_hda_codec_write(codec, hp_pin, 0, 3429 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3430 3431 if (hp_pin_sense) 3432 msleep(85); 3433 3434 snd_hda_codec_write(codec, hp_pin, 0, 3435 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3436 3437 if (hp_pin_sense) 3438 msleep(100); 3439 3440 /* Headphone capless set to normal mode */ 3441 alc_write_coef_idx(codec, 0x78, coef78); 3442 } 3443 3444 static void alc282_shutup(struct hda_codec *codec) 3445 { 3446 struct alc_spec *spec = codec->spec; 3447 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3448 bool hp_pin_sense; 3449 int coef78; 3450 3451 if (!hp_pin) { 3452 alc269_shutup(codec); 3453 return; 3454 } 3455 3456 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3457 coef78 = alc_read_coef_idx(codec, 0x78); 3458 alc_write_coef_idx(codec, 0x78, 0x9004); 3459 3460 if (hp_pin_sense) 3461 msleep(2); 3462 3463 snd_hda_codec_write(codec, hp_pin, 0, 3464 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3465 3466 if (hp_pin_sense) 3467 msleep(85); 3468 3469 if (!spec->no_shutup_pins) 3470 snd_hda_codec_write(codec, hp_pin, 0, 3471 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3472 3473 if (hp_pin_sense) 3474 msleep(100); 3475 3476 alc_auto_setup_eapd(codec, false); 3477 alc_shutup_pins(codec); 3478 alc_write_coef_idx(codec, 0x78, coef78); 3479 } 3480 3481 static const struct coef_fw alc283_coefs[] = { 3482 WRITE_COEF(0x03, 0x0002), /* Power Down Control */ 3483 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ 3484 WRITE_COEF(0x07, 0x0200), /* DMIC control */ 3485 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ 3486 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ 3487 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ 3488 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ 3489 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ 3490 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ 3491 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ 3492 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ 3493 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ 3494 WRITE_COEF(0x22, 0xa0c0), /* ANC */ 3495 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ 3496 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ 3497 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ 3498 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ 3499 WRITE_COEF(0x2e, 0x2902), /* PLL */ 3500 WRITE_COEF(0x33, 0xa080), /* capless control 2 */ 3501 WRITE_COEF(0x34, 0x3400), /* capless control 3 */ 3502 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ 3503 WRITE_COEF(0x36, 0x0), /* capless control 5 */ 3504 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ 3505 WRITE_COEF(0x39, 0x110a), /* class D test 3 */ 3506 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ 3507 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ 3508 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ 3509 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ 3510 WRITE_COEF(0x49, 0x0), /* test mode */ 3511 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ 3512 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ 3513 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ 3514 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ 3515 {} 3516 }; 3517 3518 static void alc283_restore_default_value(struct hda_codec *codec) 3519 { 3520 alc_process_coef_fw(codec, alc283_coefs); 3521 } 3522 3523 static void alc283_init(struct hda_codec *codec) 3524 { 3525 struct alc_spec *spec = codec->spec; 3526 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3527 bool hp_pin_sense; 3528 3529 alc283_restore_default_value(codec); 3530 3531 if (!hp_pin) 3532 return; 3533 3534 msleep(30); 3535 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3536 3537 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ 3538 /* Headphone capless set to high power mode */ 3539 alc_write_coef_idx(codec, 0x43, 0x9004); 3540 3541 snd_hda_codec_write(codec, hp_pin, 0, 3542 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3543 3544 if (hp_pin_sense) 3545 msleep(85); 3546 3547 snd_hda_codec_write(codec, hp_pin, 0, 3548 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3549 3550 if (hp_pin_sense) 3551 msleep(85); 3552 /* Index 0x46 Combo jack auto switch control 2 */ 3553 /* 3k pull low control for Headset jack. */ 3554 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); 3555 /* Headphone capless set to normal mode */ 3556 alc_write_coef_idx(codec, 0x43, 0x9614); 3557 } 3558 3559 static void alc283_shutup(struct hda_codec *codec) 3560 { 3561 struct alc_spec *spec = codec->spec; 3562 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3563 bool hp_pin_sense; 3564 3565 if (!hp_pin) { 3566 alc269_shutup(codec); 3567 return; 3568 } 3569 3570 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3571 3572 alc_write_coef_idx(codec, 0x43, 0x9004); 3573 3574 /*depop hp during suspend*/ 3575 alc_write_coef_idx(codec, 0x06, 0x2100); 3576 3577 snd_hda_codec_write(codec, hp_pin, 0, 3578 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3579 3580 if (hp_pin_sense) 3581 msleep(100); 3582 3583 if (!spec->no_shutup_pins) 3584 snd_hda_codec_write(codec, hp_pin, 0, 3585 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3586 3587 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3588 3589 if (hp_pin_sense) 3590 msleep(100); 3591 alc_auto_setup_eapd(codec, false); 3592 alc_shutup_pins(codec); 3593 alc_write_coef_idx(codec, 0x43, 0x9614); 3594 } 3595 3596 static void alc256_init(struct hda_codec *codec) 3597 { 3598 struct alc_spec *spec = codec->spec; 3599 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3600 bool hp_pin_sense; 3601 3602 if (spec->ultra_low_power) { 3603 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); 3604 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); 3605 alc_update_coef_idx(codec, 0x08, 7<<4, 0); 3606 alc_update_coef_idx(codec, 0x3b, 1<<15, 0); 3607 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); 3608 msleep(30); 3609 } 3610 3611 if (!hp_pin) 3612 hp_pin = 0x21; 3613 3614 msleep(30); 3615 3616 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3617 3618 if (hp_pin_sense) { 3619 msleep(2); 3620 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3621 3622 snd_hda_codec_write(codec, hp_pin, 0, 3623 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3624 3625 msleep(75); 3626 3627 snd_hda_codec_write(codec, hp_pin, 0, 3628 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3629 3630 msleep(75); 3631 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3632 } 3633 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); 3634 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ 3635 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); 3636 /* 3637 * Expose headphone mic (or possibly Line In on some machines) instead 3638 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See 3639 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of 3640 * this register. 3641 */ 3642 alc_write_coef_idx(codec, 0x36, 0x5757); 3643 } 3644 3645 static void alc256_shutup(struct hda_codec *codec) 3646 { 3647 struct alc_spec *spec = codec->spec; 3648 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3649 bool hp_pin_sense; 3650 3651 if (!hp_pin) 3652 hp_pin = 0x21; 3653 3654 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3655 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3656 3657 if (hp_pin_sense) { 3658 msleep(2); 3659 3660 snd_hda_codec_write(codec, hp_pin, 0, 3661 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3662 3663 msleep(75); 3664 3665 /* 3k pull low control for Headset jack. */ 3666 /* NOTE: call this before clearing the pin, otherwise codec stalls */ 3667 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly 3668 * when booting with headset plugged. So skip setting it for the codec alc257 3669 */ 3670 if (spec->en_3kpull_low) 3671 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3672 3673 if (!spec->no_shutup_pins) 3674 snd_hda_codec_write(codec, hp_pin, 0, 3675 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3676 3677 msleep(75); 3678 } 3679 3680 alc_auto_setup_eapd(codec, false); 3681 alc_shutup_pins(codec); 3682 if (spec->ultra_low_power) { 3683 msleep(50); 3684 alc_update_coef_idx(codec, 0x03, 1<<1, 0); 3685 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); 3686 alc_update_coef_idx(codec, 0x08, 3<<2, 0); 3687 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); 3688 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); 3689 msleep(30); 3690 } 3691 } 3692 3693 static void alc285_hp_init(struct hda_codec *codec) 3694 { 3695 struct alc_spec *spec = codec->spec; 3696 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3697 int i, val; 3698 int coef38, coef0d, coef36; 3699 3700 alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */ 3701 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */ 3702 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */ 3703 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */ 3704 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */ 3705 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0); 3706 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0); 3707 3708 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 3709 3710 if (hp_pin) 3711 snd_hda_codec_write(codec, hp_pin, 0, 3712 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3713 3714 msleep(130); 3715 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14); 3716 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0); 3717 3718 if (hp_pin) 3719 snd_hda_codec_write(codec, hp_pin, 0, 3720 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3721 msleep(10); 3722 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */ 3723 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880); 3724 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049); 3725 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0); 3726 3727 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */ 3728 val = alc_read_coefex_idx(codec, 0x58, 0x00); 3729 for (i = 0; i < 20 && val & 0x8000; i++) { 3730 msleep(50); 3731 val = alc_read_coefex_idx(codec, 0x58, 0x00); 3732 } /* Wait for depop procedure finish */ 3733 3734 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */ 3735 alc_update_coef_idx(codec, 0x38, 1<<4, coef38); 3736 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d); 3737 alc_update_coef_idx(codec, 0x36, 3<<13, coef36); 3738 3739 msleep(50); 3740 alc_update_coef_idx(codec, 0x4a, 1<<15, 0); 3741 } 3742 3743 static void alc225_init(struct hda_codec *codec) 3744 { 3745 struct alc_spec *spec = codec->spec; 3746 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3747 bool hp1_pin_sense, hp2_pin_sense; 3748 3749 if (spec->ultra_low_power) { 3750 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); 3751 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); 3752 alc_update_coef_idx(codec, 0x33, 1<<11, 0); 3753 msleep(30); 3754 } 3755 3756 if (spec->codec_variant != ALC269_TYPE_ALC287 && 3757 spec->codec_variant != ALC269_TYPE_ALC245) 3758 /* required only at boot or S3 and S4 resume time */ 3759 if (!spec->done_hp_init || 3760 is_s3_resume(codec) || 3761 is_s4_resume(codec)) { 3762 alc285_hp_init(codec); 3763 spec->done_hp_init = true; 3764 } 3765 3766 if (!hp_pin) 3767 hp_pin = 0x21; 3768 msleep(30); 3769 3770 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3771 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3772 3773 if (hp1_pin_sense || hp2_pin_sense) { 3774 msleep(2); 3775 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3776 3777 if (hp1_pin_sense) 3778 snd_hda_codec_write(codec, hp_pin, 0, 3779 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3780 if (hp2_pin_sense) 3781 snd_hda_codec_write(codec, 0x16, 0, 3782 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3783 msleep(75); 3784 3785 if (hp1_pin_sense) 3786 snd_hda_codec_write(codec, hp_pin, 0, 3787 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3788 if (hp2_pin_sense) 3789 snd_hda_codec_write(codec, 0x16, 0, 3790 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3791 3792 msleep(75); 3793 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3794 } 3795 } 3796 3797 static void alc225_shutup(struct hda_codec *codec) 3798 { 3799 struct alc_spec *spec = codec->spec; 3800 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3801 bool hp1_pin_sense, hp2_pin_sense; 3802 3803 if (!hp_pin) 3804 hp_pin = 0x21; 3805 3806 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3807 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3808 3809 if (hp1_pin_sense || hp2_pin_sense) { 3810 alc_disable_headset_jack_key(codec); 3811 /* 3k pull low control for Headset jack. */ 3812 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); 3813 msleep(2); 3814 3815 if (hp1_pin_sense) 3816 snd_hda_codec_write(codec, hp_pin, 0, 3817 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3818 if (hp2_pin_sense) 3819 snd_hda_codec_write(codec, 0x16, 0, 3820 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3821 3822 msleep(75); 3823 3824 if (hp1_pin_sense) 3825 snd_hda_codec_write(codec, hp_pin, 0, 3826 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3827 if (hp2_pin_sense) 3828 snd_hda_codec_write(codec, 0x16, 0, 3829 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3830 3831 msleep(75); 3832 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3833 alc_enable_headset_jack_key(codec); 3834 } 3835 alc_auto_setup_eapd(codec, false); 3836 alc_shutup_pins(codec); 3837 if (spec->ultra_low_power) { 3838 msleep(50); 3839 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); 3840 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); 3841 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); 3842 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); 3843 msleep(30); 3844 } 3845 } 3846 3847 static void alc_default_init(struct hda_codec *codec) 3848 { 3849 struct alc_spec *spec = codec->spec; 3850 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3851 bool hp_pin_sense; 3852 3853 if (!hp_pin) 3854 return; 3855 3856 msleep(30); 3857 3858 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3859 3860 if (hp_pin_sense) { 3861 msleep(2); 3862 3863 snd_hda_codec_write(codec, hp_pin, 0, 3864 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3865 3866 msleep(75); 3867 3868 snd_hda_codec_write(codec, hp_pin, 0, 3869 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3870 msleep(75); 3871 } 3872 } 3873 3874 static void alc_default_shutup(struct hda_codec *codec) 3875 { 3876 struct alc_spec *spec = codec->spec; 3877 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3878 bool hp_pin_sense; 3879 3880 if (!hp_pin) { 3881 alc269_shutup(codec); 3882 return; 3883 } 3884 3885 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3886 3887 if (hp_pin_sense) { 3888 msleep(2); 3889 3890 snd_hda_codec_write(codec, hp_pin, 0, 3891 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3892 3893 msleep(75); 3894 3895 if (!spec->no_shutup_pins) 3896 snd_hda_codec_write(codec, hp_pin, 0, 3897 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3898 3899 msleep(75); 3900 } 3901 alc_auto_setup_eapd(codec, false); 3902 alc_shutup_pins(codec); 3903 } 3904 3905 static void alc294_hp_init(struct hda_codec *codec) 3906 { 3907 struct alc_spec *spec = codec->spec; 3908 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3909 int i, val; 3910 3911 if (!hp_pin) 3912 return; 3913 3914 snd_hda_codec_write(codec, hp_pin, 0, 3915 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3916 3917 msleep(100); 3918 3919 if (!spec->no_shutup_pins) 3920 snd_hda_codec_write(codec, hp_pin, 0, 3921 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3922 3923 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ 3924 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ 3925 3926 /* Wait for depop procedure finish */ 3927 val = alc_read_coefex_idx(codec, 0x58, 0x01); 3928 for (i = 0; i < 20 && val & 0x0080; i++) { 3929 msleep(50); 3930 val = alc_read_coefex_idx(codec, 0x58, 0x01); 3931 } 3932 /* Set HP depop to auto mode */ 3933 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); 3934 msleep(50); 3935 } 3936 3937 static void alc294_init(struct hda_codec *codec) 3938 { 3939 struct alc_spec *spec = codec->spec; 3940 3941 /* required only at boot or S4 resume time */ 3942 if (!spec->done_hp_init || 3943 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { 3944 alc294_hp_init(codec); 3945 spec->done_hp_init = true; 3946 } 3947 alc_default_init(codec); 3948 } 3949 3950 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, 3951 unsigned int val) 3952 { 3953 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); 3954 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ 3955 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ 3956 } 3957 3958 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) 3959 { 3960 unsigned int val; 3961 3962 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); 3963 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) 3964 & 0xffff; 3965 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) 3966 << 16; 3967 return val; 3968 } 3969 3970 static void alc5505_dsp_halt(struct hda_codec *codec) 3971 { 3972 unsigned int val; 3973 3974 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ 3975 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ 3976 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ 3977 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ 3978 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ 3979 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ 3980 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ 3981 val = alc5505_coef_get(codec, 0x6220); 3982 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ 3983 } 3984 3985 static void alc5505_dsp_back_from_halt(struct hda_codec *codec) 3986 { 3987 alc5505_coef_set(codec, 0x61b8, 0x04133302); 3988 alc5505_coef_set(codec, 0x61b0, 0x00005b16); 3989 alc5505_coef_set(codec, 0x61b4, 0x040a2b02); 3990 alc5505_coef_set(codec, 0x6230, 0xf80d4011); 3991 alc5505_coef_set(codec, 0x6220, 0x2002010f); 3992 alc5505_coef_set(codec, 0x880c, 0x00000004); 3993 } 3994 3995 static void alc5505_dsp_init(struct hda_codec *codec) 3996 { 3997 unsigned int val; 3998 3999 alc5505_dsp_halt(codec); 4000 alc5505_dsp_back_from_halt(codec); 4001 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ 4002 alc5505_coef_set(codec, 0x61b0, 0x5b16); 4003 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ 4004 alc5505_coef_set(codec, 0x61b4, 0x04132b02); 4005 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ 4006 alc5505_coef_set(codec, 0x61b8, 0x041f3302); 4007 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ 4008 alc5505_coef_set(codec, 0x61b8, 0x041b3302); 4009 alc5505_coef_set(codec, 0x61b8, 0x04173302); 4010 alc5505_coef_set(codec, 0x61b8, 0x04163302); 4011 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ 4012 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ 4013 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ 4014 4015 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ 4016 if (val <= 3) 4017 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ 4018 else 4019 alc5505_coef_set(codec, 0x6220, 0x6002018f); 4020 4021 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ 4022 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ 4023 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ 4024 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ 4025 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ 4026 alc5505_coef_set(codec, 0x880c, 0x00000003); 4027 alc5505_coef_set(codec, 0x880c, 0x00000010); 4028 4029 #ifdef HALT_REALTEK_ALC5505 4030 alc5505_dsp_halt(codec); 4031 #endif 4032 } 4033 4034 #ifdef HALT_REALTEK_ALC5505 4035 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ 4036 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ 4037 #else 4038 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) 4039 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) 4040 #endif 4041 4042 static int alc269_suspend(struct hda_codec *codec) 4043 { 4044 struct alc_spec *spec = codec->spec; 4045 4046 if (spec->has_alc5505_dsp) 4047 alc5505_dsp_suspend(codec); 4048 4049 return alc_suspend(codec); 4050 } 4051 4052 static int alc269_resume(struct hda_codec *codec) 4053 { 4054 struct alc_spec *spec = codec->spec; 4055 4056 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 4057 alc269vb_toggle_power_output(codec, 0); 4058 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 4059 (alc_get_coef0(codec) & 0x00ff) == 0x018) { 4060 msleep(150); 4061 } 4062 4063 codec->patch_ops.init(codec); 4064 4065 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 4066 alc269vb_toggle_power_output(codec, 1); 4067 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 4068 (alc_get_coef0(codec) & 0x00ff) == 0x017) { 4069 msleep(200); 4070 } 4071 4072 snd_hda_regmap_sync(codec); 4073 hda_call_check_power_status(codec, 0x01); 4074 4075 /* on some machine, the BIOS will clear the codec gpio data when enter 4076 * suspend, and won't restore the data after resume, so we restore it 4077 * in the driver. 4078 */ 4079 if (spec->gpio_data) 4080 alc_write_gpio_data(codec); 4081 4082 if (spec->has_alc5505_dsp) 4083 alc5505_dsp_resume(codec); 4084 4085 return 0; 4086 } 4087 4088 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, 4089 const struct hda_fixup *fix, int action) 4090 { 4091 struct alc_spec *spec = codec->spec; 4092 4093 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4094 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 4095 } 4096 4097 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, 4098 const struct hda_fixup *fix, 4099 int action) 4100 { 4101 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); 4102 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); 4103 4104 if (cfg_headphone && cfg_headset_mic == 0x411111f0) 4105 snd_hda_codec_set_pincfg(codec, 0x19, 4106 (cfg_headphone & ~AC_DEFCFG_DEVICE) | 4107 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); 4108 } 4109 4110 static void alc269_fixup_hweq(struct hda_codec *codec, 4111 const struct hda_fixup *fix, int action) 4112 { 4113 if (action == HDA_FIXUP_ACT_INIT) 4114 alc_update_coef_idx(codec, 0x1e, 0, 0x80); 4115 } 4116 4117 static void alc269_fixup_headset_mic(struct hda_codec *codec, 4118 const struct hda_fixup *fix, int action) 4119 { 4120 struct alc_spec *spec = codec->spec; 4121 4122 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4123 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 4124 } 4125 4126 static void alc271_fixup_dmic(struct hda_codec *codec, 4127 const struct hda_fixup *fix, int action) 4128 { 4129 static const struct hda_verb verbs[] = { 4130 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, 4131 {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, 4132 {} 4133 }; 4134 unsigned int cfg; 4135 4136 if (strcmp(codec->core.chip_name, "ALC271X") && 4137 strcmp(codec->core.chip_name, "ALC269VB")) 4138 return; 4139 cfg = snd_hda_codec_get_pincfg(codec, 0x12); 4140 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) 4141 snd_hda_sequence_write(codec, verbs); 4142 } 4143 4144 /* Fix the speaker amp after resume, etc */ 4145 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec, 4146 const struct hda_fixup *fix, 4147 int action) 4148 { 4149 if (action == HDA_FIXUP_ACT_INIT) 4150 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000); 4151 } 4152 4153 static void alc269_fixup_pcm_44k(struct hda_codec *codec, 4154 const struct hda_fixup *fix, int action) 4155 { 4156 struct alc_spec *spec = codec->spec; 4157 4158 if (action != HDA_FIXUP_ACT_PROBE) 4159 return; 4160 4161 /* Due to a hardware problem on Lenovo Ideadpad, we need to 4162 * fix the sample rate of analog I/O to 44.1kHz 4163 */ 4164 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; 4165 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; 4166 } 4167 4168 static void alc269_fixup_stereo_dmic(struct hda_codec *codec, 4169 const struct hda_fixup *fix, int action) 4170 { 4171 /* The digital-mic unit sends PDM (differential signal) instead of 4172 * the standard PCM, thus you can't record a valid mono stream as is. 4173 * Below is a workaround specific to ALC269 to control the dmic 4174 * signal source as mono. 4175 */ 4176 if (action == HDA_FIXUP_ACT_INIT) 4177 alc_update_coef_idx(codec, 0x07, 0, 0x80); 4178 } 4179 4180 static void alc269_quanta_automute(struct hda_codec *codec) 4181 { 4182 snd_hda_gen_update_outputs(codec); 4183 4184 alc_write_coef_idx(codec, 0x0c, 0x680); 4185 alc_write_coef_idx(codec, 0x0c, 0x480); 4186 } 4187 4188 static void alc269_fixup_quanta_mute(struct hda_codec *codec, 4189 const struct hda_fixup *fix, int action) 4190 { 4191 struct alc_spec *spec = codec->spec; 4192 if (action != HDA_FIXUP_ACT_PROBE) 4193 return; 4194 spec->gen.automute_hook = alc269_quanta_automute; 4195 } 4196 4197 static void alc269_x101_hp_automute_hook(struct hda_codec *codec, 4198 struct hda_jack_callback *jack) 4199 { 4200 struct alc_spec *spec = codec->spec; 4201 int vref; 4202 msleep(200); 4203 snd_hda_gen_hp_automute(codec, jack); 4204 4205 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 4206 msleep(100); 4207 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 4208 vref); 4209 msleep(500); 4210 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 4211 vref); 4212 } 4213 4214 /* 4215 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) 4216 */ 4217 struct hda_alc298_mbxinit { 4218 unsigned char value_0x23; 4219 unsigned char value_0x25; 4220 }; 4221 4222 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, 4223 const struct hda_alc298_mbxinit *initval, 4224 bool first) 4225 { 4226 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); 4227 alc_write_coef_idx(codec, 0x26, 0xb000); 4228 4229 if (first) 4230 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); 4231 4232 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); 4233 alc_write_coef_idx(codec, 0x26, 0xf000); 4234 alc_write_coef_idx(codec, 0x23, initval->value_0x23); 4235 4236 if (initval->value_0x23 != 0x1e) 4237 alc_write_coef_idx(codec, 0x25, initval->value_0x25); 4238 4239 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); 4240 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); 4241 } 4242 4243 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, 4244 const struct hda_fixup *fix, 4245 int action) 4246 { 4247 /* Initialization magic */ 4248 static const struct hda_alc298_mbxinit dac_init[] = { 4249 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, 4250 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, 4251 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, 4252 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, 4253 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, 4254 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, 4255 {0x2f, 0x00}, 4256 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, 4257 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, 4258 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, 4259 {} 4260 }; 4261 const struct hda_alc298_mbxinit *seq; 4262 4263 if (action != HDA_FIXUP_ACT_INIT) 4264 return; 4265 4266 /* Start */ 4267 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); 4268 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); 4269 alc_write_coef_idx(codec, 0x26, 0xf000); 4270 alc_write_coef_idx(codec, 0x22, 0x31); 4271 alc_write_coef_idx(codec, 0x23, 0x0b); 4272 alc_write_coef_idx(codec, 0x25, 0x00); 4273 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); 4274 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); 4275 4276 for (seq = dac_init; seq->value_0x23; seq++) 4277 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); 4278 } 4279 4280 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, 4281 const struct hda_fixup *fix, int action) 4282 { 4283 struct alc_spec *spec = codec->spec; 4284 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4285 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 4286 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; 4287 } 4288 } 4289 4290 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, 4291 bool polarity, bool on) 4292 { 4293 unsigned int pinval; 4294 4295 if (!pin) 4296 return; 4297 if (polarity) 4298 on = !on; 4299 pinval = snd_hda_codec_get_pin_target(codec, pin); 4300 pinval &= ~AC_PINCTL_VREFEN; 4301 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; 4302 /* temporarily power up/down for setting VREF */ 4303 snd_hda_power_up_pm(codec); 4304 snd_hda_set_pin_ctl_cache(codec, pin, pinval); 4305 snd_hda_power_down_pm(codec); 4306 } 4307 4308 /* update mute-LED according to the speaker mute state via mic VREF pin */ 4309 static int vref_mute_led_set(struct led_classdev *led_cdev, 4310 enum led_brightness brightness) 4311 { 4312 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4313 struct alc_spec *spec = codec->spec; 4314 4315 alc_update_vref_led(codec, spec->mute_led_nid, 4316 spec->mute_led_polarity, brightness); 4317 return 0; 4318 } 4319 4320 /* Make sure the led works even in runtime suspend */ 4321 static unsigned int led_power_filter(struct hda_codec *codec, 4322 hda_nid_t nid, 4323 unsigned int power_state) 4324 { 4325 struct alc_spec *spec = codec->spec; 4326 4327 if (power_state != AC_PWRST_D3 || nid == 0 || 4328 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) 4329 return power_state; 4330 4331 /* Set pin ctl again, it might have just been set to 0 */ 4332 snd_hda_set_pin_ctl(codec, nid, 4333 snd_hda_codec_get_pin_target(codec, nid)); 4334 4335 return snd_hda_gen_path_power_filter(codec, nid, power_state); 4336 } 4337 4338 static void alc269_fixup_hp_mute_led(struct hda_codec *codec, 4339 const struct hda_fixup *fix, int action) 4340 { 4341 struct alc_spec *spec = codec->spec; 4342 const struct dmi_device *dev = NULL; 4343 4344 if (action != HDA_FIXUP_ACT_PRE_PROBE) 4345 return; 4346 4347 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { 4348 int pol, pin; 4349 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) 4350 continue; 4351 if (pin < 0x0a || pin >= 0x10) 4352 break; 4353 spec->mute_led_polarity = pol; 4354 spec->mute_led_nid = pin - 0x0a + 0x18; 4355 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); 4356 codec->power_filter = led_power_filter; 4357 codec_dbg(codec, 4358 "Detected mute LED for %x:%d\n", spec->mute_led_nid, 4359 spec->mute_led_polarity); 4360 break; 4361 } 4362 } 4363 4364 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, 4365 const struct hda_fixup *fix, 4366 int action, hda_nid_t pin) 4367 { 4368 struct alc_spec *spec = codec->spec; 4369 4370 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4371 spec->mute_led_polarity = 0; 4372 spec->mute_led_nid = pin; 4373 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); 4374 codec->power_filter = led_power_filter; 4375 } 4376 } 4377 4378 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, 4379 const struct hda_fixup *fix, int action) 4380 { 4381 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); 4382 } 4383 4384 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, 4385 const struct hda_fixup *fix, int action) 4386 { 4387 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); 4388 } 4389 4390 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, 4391 const struct hda_fixup *fix, int action) 4392 { 4393 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); 4394 } 4395 4396 /* update LED status via GPIO */ 4397 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, 4398 int polarity, bool enabled) 4399 { 4400 if (polarity) 4401 enabled = !enabled; 4402 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ 4403 } 4404 4405 /* turn on/off mute LED via GPIO per vmaster hook */ 4406 static int gpio_mute_led_set(struct led_classdev *led_cdev, 4407 enum led_brightness brightness) 4408 { 4409 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4410 struct alc_spec *spec = codec->spec; 4411 4412 alc_update_gpio_led(codec, spec->gpio_mute_led_mask, 4413 spec->mute_led_polarity, !brightness); 4414 return 0; 4415 } 4416 4417 /* turn on/off mic-mute LED via GPIO per capture hook */ 4418 static int micmute_led_set(struct led_classdev *led_cdev, 4419 enum led_brightness brightness) 4420 { 4421 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4422 struct alc_spec *spec = codec->spec; 4423 4424 alc_update_gpio_led(codec, spec->gpio_mic_led_mask, 4425 spec->micmute_led_polarity, !brightness); 4426 return 0; 4427 } 4428 4429 /* setup mute and mic-mute GPIO bits, add hooks appropriately */ 4430 static void alc_fixup_hp_gpio_led(struct hda_codec *codec, 4431 int action, 4432 unsigned int mute_mask, 4433 unsigned int micmute_mask) 4434 { 4435 struct alc_spec *spec = codec->spec; 4436 4437 alc_fixup_gpio(codec, action, mute_mask | micmute_mask); 4438 4439 if (action != HDA_FIXUP_ACT_PRE_PROBE) 4440 return; 4441 if (mute_mask) { 4442 spec->gpio_mute_led_mask = mute_mask; 4443 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); 4444 } 4445 if (micmute_mask) { 4446 spec->gpio_mic_led_mask = micmute_mask; 4447 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); 4448 } 4449 } 4450 4451 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, 4452 const struct hda_fixup *fix, int action) 4453 { 4454 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); 4455 } 4456 4457 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, 4458 const struct hda_fixup *fix, int action) 4459 { 4460 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); 4461 } 4462 4463 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, 4464 const struct hda_fixup *fix, int action) 4465 { 4466 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); 4467 } 4468 4469 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, 4470 const struct hda_fixup *fix, int action) 4471 { 4472 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); 4473 } 4474 4475 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, 4476 const struct hda_fixup *fix, int action) 4477 { 4478 alc_fixup_hp_gpio_led(codec, action, 0x10, 0); 4479 } 4480 4481 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec, 4482 const struct hda_fixup *fix, int action) 4483 { 4484 struct alc_spec *spec = codec->spec; 4485 4486 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4487 spec->micmute_led_polarity = 1; 4488 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 4489 } 4490 4491 /* turn on/off mic-mute LED per capture hook via VREF change */ 4492 static int vref_micmute_led_set(struct led_classdev *led_cdev, 4493 enum led_brightness brightness) 4494 { 4495 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4496 struct alc_spec *spec = codec->spec; 4497 4498 alc_update_vref_led(codec, spec->cap_mute_led_nid, 4499 spec->micmute_led_polarity, brightness); 4500 return 0; 4501 } 4502 4503 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, 4504 const struct hda_fixup *fix, int action) 4505 { 4506 struct alc_spec *spec = codec->spec; 4507 4508 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 4509 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4510 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to 4511 * enable headphone amp 4512 */ 4513 spec->gpio_mask |= 0x10; 4514 spec->gpio_dir |= 0x10; 4515 spec->cap_mute_led_nid = 0x18; 4516 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4517 codec->power_filter = led_power_filter; 4518 } 4519 } 4520 4521 static void alc280_fixup_hp_gpio4(struct hda_codec *codec, 4522 const struct hda_fixup *fix, int action) 4523 { 4524 struct alc_spec *spec = codec->spec; 4525 4526 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 4527 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4528 spec->cap_mute_led_nid = 0x18; 4529 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4530 codec->power_filter = led_power_filter; 4531 } 4532 } 4533 4534 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp; 4535 * it needs to toggle the GPIO0 once on and off at each time (bko#210633) 4536 */ 4537 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec, 4538 const struct hda_fixup *fix, int action) 4539 { 4540 struct alc_spec *spec = codec->spec; 4541 4542 switch (action) { 4543 case HDA_FIXUP_ACT_PRE_PROBE: 4544 spec->gpio_mask |= 0x01; 4545 spec->gpio_dir |= 0x01; 4546 break; 4547 case HDA_FIXUP_ACT_INIT: 4548 /* need to toggle GPIO to enable the amp */ 4549 alc_update_gpio_data(codec, 0x01, true); 4550 msleep(100); 4551 alc_update_gpio_data(codec, 0x01, false); 4552 break; 4553 } 4554 } 4555 4556 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */ 4557 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo, 4558 struct hda_codec *codec, 4559 struct snd_pcm_substream *substream, 4560 int action) 4561 { 4562 switch (action) { 4563 case HDA_GEN_PCM_ACT_PREPARE: 4564 alc_update_gpio_data(codec, 0x04, true); 4565 break; 4566 case HDA_GEN_PCM_ACT_CLEANUP: 4567 alc_update_gpio_data(codec, 0x04, false); 4568 break; 4569 } 4570 } 4571 4572 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec, 4573 const struct hda_fixup *fix, 4574 int action) 4575 { 4576 struct alc_spec *spec = codec->spec; 4577 4578 if (action == HDA_FIXUP_ACT_PROBE) { 4579 spec->gpio_mask |= 0x04; 4580 spec->gpio_dir |= 0x04; 4581 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook; 4582 } 4583 } 4584 4585 static void alc_update_coef_led(struct hda_codec *codec, 4586 struct alc_coef_led *led, 4587 bool polarity, bool on) 4588 { 4589 if (polarity) 4590 on = !on; 4591 /* temporarily power up/down for setting COEF bit */ 4592 alc_update_coef_idx(codec, led->idx, led->mask, 4593 on ? led->on : led->off); 4594 } 4595 4596 /* update mute-LED according to the speaker mute state via COEF bit */ 4597 static int coef_mute_led_set(struct led_classdev *led_cdev, 4598 enum led_brightness brightness) 4599 { 4600 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4601 struct alc_spec *spec = codec->spec; 4602 4603 alc_update_coef_led(codec, &spec->mute_led_coef, 4604 spec->mute_led_polarity, brightness); 4605 return 0; 4606 } 4607 4608 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4609 const struct hda_fixup *fix, 4610 int action) 4611 { 4612 struct alc_spec *spec = codec->spec; 4613 4614 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4615 spec->mute_led_polarity = 0; 4616 spec->mute_led_coef.idx = 0x0b; 4617 spec->mute_led_coef.mask = 1 << 3; 4618 spec->mute_led_coef.on = 1 << 3; 4619 spec->mute_led_coef.off = 0; 4620 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4621 } 4622 } 4623 4624 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4625 const struct hda_fixup *fix, 4626 int action) 4627 { 4628 struct alc_spec *spec = codec->spec; 4629 4630 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4631 spec->mute_led_polarity = 0; 4632 spec->mute_led_coef.idx = 0x34; 4633 spec->mute_led_coef.mask = 1 << 5; 4634 spec->mute_led_coef.on = 0; 4635 spec->mute_led_coef.off = 1 << 5; 4636 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4637 } 4638 } 4639 4640 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec, 4641 const struct hda_fixup *fix, int action) 4642 { 4643 struct alc_spec *spec = codec->spec; 4644 4645 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4646 spec->mute_led_polarity = 0; 4647 spec->mute_led_coef.idx = 0x07; 4648 spec->mute_led_coef.mask = 1; 4649 spec->mute_led_coef.on = 1; 4650 spec->mute_led_coef.off = 0; 4651 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4652 } 4653 } 4654 4655 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4656 const struct hda_fixup *fix, 4657 int action) 4658 { 4659 struct alc_spec *spec = codec->spec; 4660 4661 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4662 spec->mute_led_polarity = 0; 4663 spec->mute_led_coef.idx = 0x0b; 4664 spec->mute_led_coef.mask = 3 << 2; 4665 spec->mute_led_coef.on = 2 << 2; 4666 spec->mute_led_coef.off = 1 << 2; 4667 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4668 } 4669 } 4670 4671 /* turn on/off mic-mute LED per capture hook by coef bit */ 4672 static int coef_micmute_led_set(struct led_classdev *led_cdev, 4673 enum led_brightness brightness) 4674 { 4675 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4676 struct alc_spec *spec = codec->spec; 4677 4678 alc_update_coef_led(codec, &spec->mic_led_coef, 4679 spec->micmute_led_polarity, brightness); 4680 return 0; 4681 } 4682 4683 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, 4684 const struct hda_fixup *fix, int action) 4685 { 4686 struct alc_spec *spec = codec->spec; 4687 4688 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4689 spec->mic_led_coef.idx = 0x19; 4690 spec->mic_led_coef.mask = 1 << 13; 4691 spec->mic_led_coef.on = 1 << 13; 4692 spec->mic_led_coef.off = 0; 4693 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); 4694 } 4695 } 4696 4697 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec, 4698 const struct hda_fixup *fix, int action) 4699 { 4700 struct alc_spec *spec = codec->spec; 4701 4702 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4703 spec->micmute_led_polarity = 1; 4704 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 4705 } 4706 4707 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, 4708 const struct hda_fixup *fix, int action) 4709 { 4710 struct alc_spec *spec = codec->spec; 4711 4712 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4713 spec->mic_led_coef.idx = 0x35; 4714 spec->mic_led_coef.mask = 3 << 2; 4715 spec->mic_led_coef.on = 2 << 2; 4716 spec->mic_led_coef.off = 1 << 2; 4717 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); 4718 } 4719 } 4720 4721 static void alc285_fixup_hp_mute_led(struct hda_codec *codec, 4722 const struct hda_fixup *fix, int action) 4723 { 4724 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 4725 alc285_fixup_hp_coef_micmute_led(codec, fix, action); 4726 } 4727 4728 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec, 4729 const struct hda_fixup *fix, int action) 4730 { 4731 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 4732 alc285_fixup_hp_gpio_micmute_led(codec, fix, action); 4733 } 4734 4735 static void alc236_fixup_hp_mute_led(struct hda_codec *codec, 4736 const struct hda_fixup *fix, int action) 4737 { 4738 alc236_fixup_hp_mute_led_coefbit(codec, fix, action); 4739 alc236_fixup_hp_coef_micmute_led(codec, fix, action); 4740 } 4741 4742 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec, 4743 const struct hda_fixup *fix, int action) 4744 { 4745 struct alc_spec *spec = codec->spec; 4746 4747 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4748 spec->cap_mute_led_nid = 0x1a; 4749 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4750 codec->power_filter = led_power_filter; 4751 } 4752 } 4753 4754 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec, 4755 const struct hda_fixup *fix, int action) 4756 { 4757 alc236_fixup_hp_mute_led_coefbit(codec, fix, action); 4758 alc236_fixup_hp_micmute_led_vref(codec, fix, action); 4759 } 4760 4761 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec, 4762 const unsigned short coefs[2]) 4763 { 4764 alc_write_coef_idx(codec, 0x23, coefs[0]); 4765 alc_write_coef_idx(codec, 0x25, coefs[1]); 4766 alc_write_coef_idx(codec, 0x26, 0xb011); 4767 } 4768 4769 struct alc298_samsung_amp_desc { 4770 unsigned char nid; 4771 unsigned short init_seq[2][2]; 4772 }; 4773 4774 static void alc298_fixup_samsung_amp(struct hda_codec *codec, 4775 const struct hda_fixup *fix, int action) 4776 { 4777 int i, j; 4778 static const unsigned short init_seq[][2] = { 4779 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 }, 4780 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 }, 4781 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e }, 4782 { 0x41, 0x07 }, { 0x400, 0x1 } 4783 }; 4784 static const struct alc298_samsung_amp_desc amps[] = { 4785 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } }, 4786 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } } 4787 }; 4788 4789 if (action != HDA_FIXUP_ACT_INIT) 4790 return; 4791 4792 for (i = 0; i < ARRAY_SIZE(amps); i++) { 4793 alc_write_coef_idx(codec, 0x22, amps[i].nid); 4794 4795 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++) 4796 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]); 4797 4798 for (j = 0; j < ARRAY_SIZE(init_seq); j++) 4799 alc298_samsung_write_coef_pack(codec, init_seq[j]); 4800 } 4801 } 4802 4803 struct alc298_samsung_v2_amp_desc { 4804 unsigned short nid; 4805 int init_seq_size; 4806 unsigned short init_seq[18][2]; 4807 }; 4808 4809 static const struct alc298_samsung_v2_amp_desc 4810 alc298_samsung_v2_amp_desc_tbl[] = { 4811 { 0x38, 18, { 4812 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 }, 4813 { 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe }, 4814 { 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 }, 4815 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e }, 4816 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 }, 4817 { 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 } 4818 }}, 4819 { 0x39, 18, { 4820 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 }, 4821 { 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd }, 4822 { 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 }, 4823 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e }, 4824 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 }, 4825 { 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 } 4826 }}, 4827 { 0x3c, 15, { 4828 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 }, 4829 { 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe }, 4830 { 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 }, 4831 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e }, 4832 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d } 4833 }}, 4834 { 0x3d, 15, { 4835 { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 }, 4836 { 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd }, 4837 { 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 }, 4838 { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e }, 4839 { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d } 4840 }} 4841 }; 4842 4843 static void alc298_samsung_v2_enable_amps(struct hda_codec *codec) 4844 { 4845 struct alc_spec *spec = codec->spec; 4846 static const unsigned short enable_seq[][2] = { 4847 { 0x203a, 0x0081 }, { 0x23ff, 0x0001 }, 4848 }; 4849 int i, j; 4850 4851 for (i = 0; i < spec->num_speaker_amps; i++) { 4852 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid); 4853 for (j = 0; j < ARRAY_SIZE(enable_seq); j++) 4854 alc298_samsung_write_coef_pack(codec, enable_seq[j]); 4855 codec_dbg(codec, "alc298_samsung_v2: Enabled speaker amp 0x%02x\n", 4856 alc298_samsung_v2_amp_desc_tbl[i].nid); 4857 } 4858 } 4859 4860 static void alc298_samsung_v2_disable_amps(struct hda_codec *codec) 4861 { 4862 struct alc_spec *spec = codec->spec; 4863 static const unsigned short disable_seq[][2] = { 4864 { 0x23ff, 0x0000 }, { 0x203a, 0x0080 }, 4865 }; 4866 int i, j; 4867 4868 for (i = 0; i < spec->num_speaker_amps; i++) { 4869 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid); 4870 for (j = 0; j < ARRAY_SIZE(disable_seq); j++) 4871 alc298_samsung_write_coef_pack(codec, disable_seq[j]); 4872 codec_dbg(codec, "alc298_samsung_v2: Disabled speaker amp 0x%02x\n", 4873 alc298_samsung_v2_amp_desc_tbl[i].nid); 4874 } 4875 } 4876 4877 static void alc298_samsung_v2_playback_hook(struct hda_pcm_stream *hinfo, 4878 struct hda_codec *codec, 4879 struct snd_pcm_substream *substream, 4880 int action) 4881 { 4882 /* Dynamically enable/disable speaker amps before and after playback */ 4883 if (action == HDA_GEN_PCM_ACT_OPEN) 4884 alc298_samsung_v2_enable_amps(codec); 4885 if (action == HDA_GEN_PCM_ACT_CLOSE) 4886 alc298_samsung_v2_disable_amps(codec); 4887 } 4888 4889 static void alc298_samsung_v2_init_amps(struct hda_codec *codec, 4890 int num_speaker_amps) 4891 { 4892 struct alc_spec *spec = codec->spec; 4893 int i, j; 4894 4895 /* Set spec's num_speaker_amps before doing anything else */ 4896 spec->num_speaker_amps = num_speaker_amps; 4897 4898 /* Disable speaker amps before init to prevent any physical damage */ 4899 alc298_samsung_v2_disable_amps(codec); 4900 4901 /* Initialize the speaker amps */ 4902 for (i = 0; i < spec->num_speaker_amps; i++) { 4903 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid); 4904 for (j = 0; j < alc298_samsung_v2_amp_desc_tbl[i].init_seq_size; j++) { 4905 alc298_samsung_write_coef_pack(codec, 4906 alc298_samsung_v2_amp_desc_tbl[i].init_seq[j]); 4907 } 4908 alc_write_coef_idx(codec, 0x89, 0x0); 4909 codec_dbg(codec, "alc298_samsung_v2: Initialized speaker amp 0x%02x\n", 4910 alc298_samsung_v2_amp_desc_tbl[i].nid); 4911 } 4912 4913 /* register hook to enable speaker amps only when they are needed */ 4914 spec->gen.pcm_playback_hook = alc298_samsung_v2_playback_hook; 4915 } 4916 4917 static void alc298_fixup_samsung_amp_v2_2_amps(struct hda_codec *codec, 4918 const struct hda_fixup *fix, int action) 4919 { 4920 if (action == HDA_FIXUP_ACT_PROBE) 4921 alc298_samsung_v2_init_amps(codec, 2); 4922 } 4923 4924 static void alc298_fixup_samsung_amp_v2_4_amps(struct hda_codec *codec, 4925 const struct hda_fixup *fix, int action) 4926 { 4927 if (action == HDA_FIXUP_ACT_PROBE) 4928 alc298_samsung_v2_init_amps(codec, 4); 4929 } 4930 4931 #if IS_REACHABLE(CONFIG_INPUT) 4932 static void gpio2_mic_hotkey_event(struct hda_codec *codec, 4933 struct hda_jack_callback *event) 4934 { 4935 struct alc_spec *spec = codec->spec; 4936 4937 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore 4938 send both key on and key off event for every interrupt. */ 4939 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); 4940 input_sync(spec->kb_dev); 4941 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); 4942 input_sync(spec->kb_dev); 4943 } 4944 4945 static int alc_register_micmute_input_device(struct hda_codec *codec) 4946 { 4947 struct alc_spec *spec = codec->spec; 4948 int i; 4949 4950 spec->kb_dev = input_allocate_device(); 4951 if (!spec->kb_dev) { 4952 codec_err(codec, "Out of memory (input_allocate_device)\n"); 4953 return -ENOMEM; 4954 } 4955 4956 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; 4957 4958 spec->kb_dev->name = "Microphone Mute Button"; 4959 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); 4960 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); 4961 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); 4962 spec->kb_dev->keycode = spec->alc_mute_keycode_map; 4963 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) 4964 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); 4965 4966 if (input_register_device(spec->kb_dev)) { 4967 codec_err(codec, "input_register_device failed\n"); 4968 input_free_device(spec->kb_dev); 4969 spec->kb_dev = NULL; 4970 return -ENOMEM; 4971 } 4972 4973 return 0; 4974 } 4975 4976 /* GPIO1 = set according to SKU external amp 4977 * GPIO2 = mic mute hotkey 4978 * GPIO3 = mute LED 4979 * GPIO4 = mic mute LED 4980 */ 4981 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, 4982 const struct hda_fixup *fix, int action) 4983 { 4984 struct alc_spec *spec = codec->spec; 4985 4986 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); 4987 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4988 spec->init_amp = ALC_INIT_DEFAULT; 4989 if (alc_register_micmute_input_device(codec) != 0) 4990 return; 4991 4992 spec->gpio_mask |= 0x06; 4993 spec->gpio_dir |= 0x02; 4994 spec->gpio_data |= 0x02; 4995 snd_hda_codec_write_cache(codec, codec->core.afg, 0, 4996 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); 4997 snd_hda_jack_detect_enable_callback(codec, codec->core.afg, 4998 gpio2_mic_hotkey_event); 4999 return; 5000 } 5001 5002 if (!spec->kb_dev) 5003 return; 5004 5005 switch (action) { 5006 case HDA_FIXUP_ACT_FREE: 5007 input_unregister_device(spec->kb_dev); 5008 spec->kb_dev = NULL; 5009 } 5010 } 5011 5012 /* Line2 = mic mute hotkey 5013 * GPIO2 = mic mute LED 5014 */ 5015 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, 5016 const struct hda_fixup *fix, int action) 5017 { 5018 struct alc_spec *spec = codec->spec; 5019 5020 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 5021 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5022 spec->init_amp = ALC_INIT_DEFAULT; 5023 if (alc_register_micmute_input_device(codec) != 0) 5024 return; 5025 5026 snd_hda_jack_detect_enable_callback(codec, 0x1b, 5027 gpio2_mic_hotkey_event); 5028 return; 5029 } 5030 5031 if (!spec->kb_dev) 5032 return; 5033 5034 switch (action) { 5035 case HDA_FIXUP_ACT_FREE: 5036 input_unregister_device(spec->kb_dev); 5037 spec->kb_dev = NULL; 5038 } 5039 } 5040 #else /* INPUT */ 5041 #define alc280_fixup_hp_gpio2_mic_hotkey NULL 5042 #define alc233_fixup_lenovo_line2_mic_hotkey NULL 5043 #endif /* INPUT */ 5044 5045 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, 5046 const struct hda_fixup *fix, int action) 5047 { 5048 struct alc_spec *spec = codec->spec; 5049 5050 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); 5051 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5052 spec->cap_mute_led_nid = 0x18; 5053 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 5054 } 5055 } 5056 5057 static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay) 5058 { 5059 if (delay <= 0) 5060 delay = 75; 5061 snd_hda_codec_write(codec, 0x21, 0, 5062 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 5063 msleep(delay); 5064 snd_hda_codec_write(codec, 0x21, 0, 5065 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 5066 msleep(delay); 5067 } 5068 5069 static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay) 5070 { 5071 if (delay <= 0) 5072 delay = 75; 5073 snd_hda_codec_write(codec, 0x21, 0, 5074 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 5075 msleep(delay); 5076 snd_hda_codec_write(codec, 0x21, 0, 5077 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 5078 msleep(delay); 5079 } 5080 5081 static const struct coef_fw alc225_pre_hsmode[] = { 5082 UPDATE_COEF(0x4a, 1<<8, 0), 5083 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), 5084 UPDATE_COEF(0x63, 3<<14, 3<<14), 5085 UPDATE_COEF(0x4a, 3<<4, 2<<4), 5086 UPDATE_COEF(0x4a, 3<<10, 3<<10), 5087 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), 5088 UPDATE_COEF(0x4a, 3<<10, 0), 5089 {} 5090 }; 5091 5092 static void alc_headset_mode_unplugged(struct hda_codec *codec) 5093 { 5094 struct alc_spec *spec = codec->spec; 5095 static const struct coef_fw coef0255[] = { 5096 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ 5097 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ 5098 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 5099 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ 5100 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ 5101 {} 5102 }; 5103 static const struct coef_fw coef0256[] = { 5104 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ 5105 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ 5106 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ 5107 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ 5108 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 5109 {} 5110 }; 5111 static const struct coef_fw coef0233[] = { 5112 WRITE_COEF(0x1b, 0x0c0b), 5113 WRITE_COEF(0x45, 0xc429), 5114 UPDATE_COEF(0x35, 0x4000, 0), 5115 WRITE_COEF(0x06, 0x2104), 5116 WRITE_COEF(0x1a, 0x0001), 5117 WRITE_COEF(0x26, 0x0004), 5118 WRITE_COEF(0x32, 0x42a3), 5119 {} 5120 }; 5121 static const struct coef_fw coef0288[] = { 5122 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), 5123 UPDATE_COEF(0x50, 0x2000, 0x2000), 5124 UPDATE_COEF(0x56, 0x0006, 0x0006), 5125 UPDATE_COEF(0x66, 0x0008, 0), 5126 UPDATE_COEF(0x67, 0x2000, 0), 5127 {} 5128 }; 5129 static const struct coef_fw coef0298[] = { 5130 UPDATE_COEF(0x19, 0x1300, 0x0300), 5131 {} 5132 }; 5133 static const struct coef_fw coef0292[] = { 5134 WRITE_COEF(0x76, 0x000e), 5135 WRITE_COEF(0x6c, 0x2400), 5136 WRITE_COEF(0x18, 0x7308), 5137 WRITE_COEF(0x6b, 0xc429), 5138 {} 5139 }; 5140 static const struct coef_fw coef0293[] = { 5141 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ 5142 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ 5143 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ 5144 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ 5145 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ 5146 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ 5147 {} 5148 }; 5149 static const struct coef_fw coef0668[] = { 5150 WRITE_COEF(0x15, 0x0d40), 5151 WRITE_COEF(0xb7, 0x802b), 5152 {} 5153 }; 5154 static const struct coef_fw coef0225[] = { 5155 UPDATE_COEF(0x63, 3<<14, 0), 5156 {} 5157 }; 5158 static const struct coef_fw coef0274[] = { 5159 UPDATE_COEF(0x4a, 0x0100, 0), 5160 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), 5161 UPDATE_COEF(0x6b, 0xf000, 0x5000), 5162 UPDATE_COEF(0x4a, 0x0010, 0), 5163 UPDATE_COEF(0x4a, 0x0c00, 0x0c00), 5164 WRITE_COEF(0x45, 0x5289), 5165 UPDATE_COEF(0x4a, 0x0c00, 0), 5166 {} 5167 }; 5168 5169 if (spec->no_internal_mic_pin) { 5170 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 5171 return; 5172 } 5173 5174 switch (codec->core.vendor_id) { 5175 case 0x10ec0255: 5176 alc_process_coef_fw(codec, coef0255); 5177 break; 5178 case 0x10ec0230: 5179 case 0x10ec0236: 5180 case 0x10ec0256: 5181 case 0x19e58326: 5182 alc_hp_mute_disable(codec, 75); 5183 alc_process_coef_fw(codec, coef0256); 5184 break; 5185 case 0x10ec0234: 5186 case 0x10ec0274: 5187 case 0x10ec0294: 5188 alc_process_coef_fw(codec, coef0274); 5189 break; 5190 case 0x10ec0233: 5191 case 0x10ec0283: 5192 alc_process_coef_fw(codec, coef0233); 5193 break; 5194 case 0x10ec0286: 5195 case 0x10ec0288: 5196 alc_process_coef_fw(codec, coef0288); 5197 break; 5198 case 0x10ec0298: 5199 alc_process_coef_fw(codec, coef0298); 5200 alc_process_coef_fw(codec, coef0288); 5201 break; 5202 case 0x10ec0292: 5203 alc_process_coef_fw(codec, coef0292); 5204 break; 5205 case 0x10ec0293: 5206 alc_process_coef_fw(codec, coef0293); 5207 break; 5208 case 0x10ec0668: 5209 alc_process_coef_fw(codec, coef0668); 5210 break; 5211 case 0x10ec0215: 5212 case 0x10ec0225: 5213 case 0x10ec0285: 5214 case 0x10ec0295: 5215 case 0x10ec0289: 5216 case 0x10ec0299: 5217 alc_hp_mute_disable(codec, 75); 5218 alc_process_coef_fw(codec, alc225_pre_hsmode); 5219 alc_process_coef_fw(codec, coef0225); 5220 break; 5221 case 0x10ec0867: 5222 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5223 break; 5224 } 5225 codec_dbg(codec, "Headset jack set to unplugged mode.\n"); 5226 } 5227 5228 5229 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, 5230 hda_nid_t mic_pin) 5231 { 5232 static const struct coef_fw coef0255[] = { 5233 WRITE_COEFEX(0x57, 0x03, 0x8aa6), 5234 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ 5235 {} 5236 }; 5237 static const struct coef_fw coef0256[] = { 5238 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ 5239 WRITE_COEFEX(0x57, 0x03, 0x09a3), 5240 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ 5241 {} 5242 }; 5243 static const struct coef_fw coef0233[] = { 5244 UPDATE_COEF(0x35, 0, 1<<14), 5245 WRITE_COEF(0x06, 0x2100), 5246 WRITE_COEF(0x1a, 0x0021), 5247 WRITE_COEF(0x26, 0x008c), 5248 {} 5249 }; 5250 static const struct coef_fw coef0288[] = { 5251 UPDATE_COEF(0x4f, 0x00c0, 0), 5252 UPDATE_COEF(0x50, 0x2000, 0), 5253 UPDATE_COEF(0x56, 0x0006, 0), 5254 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), 5255 UPDATE_COEF(0x66, 0x0008, 0x0008), 5256 UPDATE_COEF(0x67, 0x2000, 0x2000), 5257 {} 5258 }; 5259 static const struct coef_fw coef0292[] = { 5260 WRITE_COEF(0x19, 0xa208), 5261 WRITE_COEF(0x2e, 0xacf0), 5262 {} 5263 }; 5264 static const struct coef_fw coef0293[] = { 5265 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ 5266 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ 5267 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ 5268 {} 5269 }; 5270 static const struct coef_fw coef0688[] = { 5271 WRITE_COEF(0xb7, 0x802b), 5272 WRITE_COEF(0xb5, 0x1040), 5273 UPDATE_COEF(0xc3, 0, 1<<12), 5274 {} 5275 }; 5276 static const struct coef_fw coef0225[] = { 5277 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), 5278 UPDATE_COEF(0x4a, 3<<4, 2<<4), 5279 UPDATE_COEF(0x63, 3<<14, 0), 5280 {} 5281 }; 5282 static const struct coef_fw coef0274[] = { 5283 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), 5284 UPDATE_COEF(0x4a, 0x0010, 0), 5285 UPDATE_COEF(0x6b, 0xf000, 0), 5286 {} 5287 }; 5288 5289 switch (codec->core.vendor_id) { 5290 case 0x10ec0255: 5291 alc_write_coef_idx(codec, 0x45, 0xc489); 5292 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5293 alc_process_coef_fw(codec, coef0255); 5294 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5295 break; 5296 case 0x10ec0230: 5297 case 0x10ec0236: 5298 case 0x10ec0256: 5299 case 0x19e58326: 5300 alc_write_coef_idx(codec, 0x45, 0xc489); 5301 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5302 alc_process_coef_fw(codec, coef0256); 5303 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5304 break; 5305 case 0x10ec0234: 5306 case 0x10ec0274: 5307 case 0x10ec0294: 5308 alc_write_coef_idx(codec, 0x45, 0x4689); 5309 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5310 alc_process_coef_fw(codec, coef0274); 5311 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5312 break; 5313 case 0x10ec0233: 5314 case 0x10ec0283: 5315 alc_write_coef_idx(codec, 0x45, 0xc429); 5316 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5317 alc_process_coef_fw(codec, coef0233); 5318 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5319 break; 5320 case 0x10ec0286: 5321 case 0x10ec0288: 5322 case 0x10ec0298: 5323 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5324 alc_process_coef_fw(codec, coef0288); 5325 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5326 break; 5327 case 0x10ec0292: 5328 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5329 alc_process_coef_fw(codec, coef0292); 5330 break; 5331 case 0x10ec0293: 5332 /* Set to TRS mode */ 5333 alc_write_coef_idx(codec, 0x45, 0xc429); 5334 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5335 alc_process_coef_fw(codec, coef0293); 5336 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5337 break; 5338 case 0x10ec0867: 5339 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); 5340 fallthrough; 5341 case 0x10ec0221: 5342 case 0x10ec0662: 5343 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5344 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5345 break; 5346 case 0x10ec0668: 5347 alc_write_coef_idx(codec, 0x11, 0x0001); 5348 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5349 alc_process_coef_fw(codec, coef0688); 5350 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5351 break; 5352 case 0x10ec0215: 5353 case 0x10ec0225: 5354 case 0x10ec0285: 5355 case 0x10ec0295: 5356 case 0x10ec0289: 5357 case 0x10ec0299: 5358 alc_process_coef_fw(codec, alc225_pre_hsmode); 5359 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); 5360 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5361 alc_process_coef_fw(codec, coef0225); 5362 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5363 break; 5364 } 5365 codec_dbg(codec, "Headset jack set to mic-in mode.\n"); 5366 } 5367 5368 static void alc_headset_mode_default(struct hda_codec *codec) 5369 { 5370 static const struct coef_fw coef0225[] = { 5371 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), 5372 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), 5373 UPDATE_COEF(0x49, 3<<8, 0<<8), 5374 UPDATE_COEF(0x4a, 3<<4, 3<<4), 5375 UPDATE_COEF(0x63, 3<<14, 0), 5376 UPDATE_COEF(0x67, 0xf000, 0x3000), 5377 {} 5378 }; 5379 static const struct coef_fw coef0255[] = { 5380 WRITE_COEF(0x45, 0xc089), 5381 WRITE_COEF(0x45, 0xc489), 5382 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 5383 WRITE_COEF(0x49, 0x0049), 5384 {} 5385 }; 5386 static const struct coef_fw coef0256[] = { 5387 WRITE_COEF(0x45, 0xc489), 5388 WRITE_COEFEX(0x57, 0x03, 0x0da3), 5389 WRITE_COEF(0x49, 0x0049), 5390 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 5391 WRITE_COEF(0x06, 0x6100), 5392 {} 5393 }; 5394 static const struct coef_fw coef0233[] = { 5395 WRITE_COEF(0x06, 0x2100), 5396 WRITE_COEF(0x32, 0x4ea3), 5397 {} 5398 }; 5399 static const struct coef_fw coef0288[] = { 5400 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ 5401 UPDATE_COEF(0x50, 0x2000, 0x2000), 5402 UPDATE_COEF(0x56, 0x0006, 0x0006), 5403 UPDATE_COEF(0x66, 0x0008, 0), 5404 UPDATE_COEF(0x67, 0x2000, 0), 5405 {} 5406 }; 5407 static const struct coef_fw coef0292[] = { 5408 WRITE_COEF(0x76, 0x000e), 5409 WRITE_COEF(0x6c, 0x2400), 5410 WRITE_COEF(0x6b, 0xc429), 5411 WRITE_COEF(0x18, 0x7308), 5412 {} 5413 }; 5414 static const struct coef_fw coef0293[] = { 5415 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ 5416 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ 5417 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ 5418 {} 5419 }; 5420 static const struct coef_fw coef0688[] = { 5421 WRITE_COEF(0x11, 0x0041), 5422 WRITE_COEF(0x15, 0x0d40), 5423 WRITE_COEF(0xb7, 0x802b), 5424 {} 5425 }; 5426 static const struct coef_fw coef0274[] = { 5427 WRITE_COEF(0x45, 0x4289), 5428 UPDATE_COEF(0x4a, 0x0010, 0x0010), 5429 UPDATE_COEF(0x6b, 0x0f00, 0), 5430 UPDATE_COEF(0x49, 0x0300, 0x0300), 5431 {} 5432 }; 5433 5434 switch (codec->core.vendor_id) { 5435 case 0x10ec0215: 5436 case 0x10ec0225: 5437 case 0x10ec0285: 5438 case 0x10ec0295: 5439 case 0x10ec0289: 5440 case 0x10ec0299: 5441 alc_process_coef_fw(codec, alc225_pre_hsmode); 5442 alc_process_coef_fw(codec, coef0225); 5443 alc_hp_enable_unmute(codec, 75); 5444 break; 5445 case 0x10ec0255: 5446 alc_process_coef_fw(codec, coef0255); 5447 break; 5448 case 0x10ec0230: 5449 case 0x10ec0236: 5450 case 0x10ec0256: 5451 case 0x19e58326: 5452 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 5453 alc_write_coef_idx(codec, 0x45, 0xc089); 5454 msleep(50); 5455 alc_process_coef_fw(codec, coef0256); 5456 alc_hp_enable_unmute(codec, 75); 5457 break; 5458 case 0x10ec0234: 5459 case 0x10ec0274: 5460 case 0x10ec0294: 5461 alc_process_coef_fw(codec, coef0274); 5462 break; 5463 case 0x10ec0233: 5464 case 0x10ec0283: 5465 alc_process_coef_fw(codec, coef0233); 5466 break; 5467 case 0x10ec0286: 5468 case 0x10ec0288: 5469 case 0x10ec0298: 5470 alc_process_coef_fw(codec, coef0288); 5471 break; 5472 case 0x10ec0292: 5473 alc_process_coef_fw(codec, coef0292); 5474 break; 5475 case 0x10ec0293: 5476 alc_process_coef_fw(codec, coef0293); 5477 break; 5478 case 0x10ec0668: 5479 alc_process_coef_fw(codec, coef0688); 5480 break; 5481 case 0x10ec0867: 5482 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5483 break; 5484 } 5485 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); 5486 } 5487 5488 /* Iphone type */ 5489 static void alc_headset_mode_ctia(struct hda_codec *codec) 5490 { 5491 int val; 5492 5493 static const struct coef_fw coef0255[] = { 5494 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ 5495 WRITE_COEF(0x1b, 0x0c2b), 5496 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 5497 {} 5498 }; 5499 static const struct coef_fw coef0256[] = { 5500 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ 5501 WRITE_COEF(0x1b, 0x0e6b), 5502 {} 5503 }; 5504 static const struct coef_fw coef0233[] = { 5505 WRITE_COEF(0x45, 0xd429), 5506 WRITE_COEF(0x1b, 0x0c2b), 5507 WRITE_COEF(0x32, 0x4ea3), 5508 {} 5509 }; 5510 static const struct coef_fw coef0288[] = { 5511 UPDATE_COEF(0x50, 0x2000, 0x2000), 5512 UPDATE_COEF(0x56, 0x0006, 0x0006), 5513 UPDATE_COEF(0x66, 0x0008, 0), 5514 UPDATE_COEF(0x67, 0x2000, 0), 5515 {} 5516 }; 5517 static const struct coef_fw coef0292[] = { 5518 WRITE_COEF(0x6b, 0xd429), 5519 WRITE_COEF(0x76, 0x0008), 5520 WRITE_COEF(0x18, 0x7388), 5521 {} 5522 }; 5523 static const struct coef_fw coef0293[] = { 5524 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ 5525 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ 5526 {} 5527 }; 5528 static const struct coef_fw coef0688[] = { 5529 WRITE_COEF(0x11, 0x0001), 5530 WRITE_COEF(0x15, 0x0d60), 5531 WRITE_COEF(0xc3, 0x0000), 5532 {} 5533 }; 5534 static const struct coef_fw coef0225_1[] = { 5535 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), 5536 UPDATE_COEF(0x63, 3<<14, 2<<14), 5537 {} 5538 }; 5539 static const struct coef_fw coef0225_2[] = { 5540 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), 5541 UPDATE_COEF(0x63, 3<<14, 1<<14), 5542 {} 5543 }; 5544 5545 switch (codec->core.vendor_id) { 5546 case 0x10ec0255: 5547 alc_process_coef_fw(codec, coef0255); 5548 break; 5549 case 0x10ec0230: 5550 case 0x10ec0236: 5551 case 0x10ec0256: 5552 case 0x19e58326: 5553 alc_process_coef_fw(codec, coef0256); 5554 alc_hp_enable_unmute(codec, 75); 5555 break; 5556 case 0x10ec0234: 5557 case 0x10ec0274: 5558 case 0x10ec0294: 5559 alc_write_coef_idx(codec, 0x45, 0xd689); 5560 break; 5561 case 0x10ec0233: 5562 case 0x10ec0283: 5563 alc_process_coef_fw(codec, coef0233); 5564 break; 5565 case 0x10ec0298: 5566 val = alc_read_coef_idx(codec, 0x50); 5567 if (val & (1 << 12)) { 5568 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); 5569 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 5570 msleep(300); 5571 } else { 5572 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); 5573 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 5574 msleep(300); 5575 } 5576 break; 5577 case 0x10ec0286: 5578 case 0x10ec0288: 5579 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 5580 msleep(300); 5581 alc_process_coef_fw(codec, coef0288); 5582 break; 5583 case 0x10ec0292: 5584 alc_process_coef_fw(codec, coef0292); 5585 break; 5586 case 0x10ec0293: 5587 alc_process_coef_fw(codec, coef0293); 5588 break; 5589 case 0x10ec0668: 5590 alc_process_coef_fw(codec, coef0688); 5591 break; 5592 case 0x10ec0215: 5593 case 0x10ec0225: 5594 case 0x10ec0285: 5595 case 0x10ec0295: 5596 case 0x10ec0289: 5597 case 0x10ec0299: 5598 val = alc_read_coef_idx(codec, 0x45); 5599 if (val & (1 << 9)) 5600 alc_process_coef_fw(codec, coef0225_2); 5601 else 5602 alc_process_coef_fw(codec, coef0225_1); 5603 alc_hp_enable_unmute(codec, 75); 5604 break; 5605 case 0x10ec0867: 5606 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5607 break; 5608 } 5609 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); 5610 } 5611 5612 /* Nokia type */ 5613 static void alc_headset_mode_omtp(struct hda_codec *codec) 5614 { 5615 static const struct coef_fw coef0255[] = { 5616 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ 5617 WRITE_COEF(0x1b, 0x0c2b), 5618 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 5619 {} 5620 }; 5621 static const struct coef_fw coef0256[] = { 5622 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ 5623 WRITE_COEF(0x1b, 0x0e6b), 5624 {} 5625 }; 5626 static const struct coef_fw coef0233[] = { 5627 WRITE_COEF(0x45, 0xe429), 5628 WRITE_COEF(0x1b, 0x0c2b), 5629 WRITE_COEF(0x32, 0x4ea3), 5630 {} 5631 }; 5632 static const struct coef_fw coef0288[] = { 5633 UPDATE_COEF(0x50, 0x2000, 0x2000), 5634 UPDATE_COEF(0x56, 0x0006, 0x0006), 5635 UPDATE_COEF(0x66, 0x0008, 0), 5636 UPDATE_COEF(0x67, 0x2000, 0), 5637 {} 5638 }; 5639 static const struct coef_fw coef0292[] = { 5640 WRITE_COEF(0x6b, 0xe429), 5641 WRITE_COEF(0x76, 0x0008), 5642 WRITE_COEF(0x18, 0x7388), 5643 {} 5644 }; 5645 static const struct coef_fw coef0293[] = { 5646 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ 5647 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ 5648 {} 5649 }; 5650 static const struct coef_fw coef0688[] = { 5651 WRITE_COEF(0x11, 0x0001), 5652 WRITE_COEF(0x15, 0x0d50), 5653 WRITE_COEF(0xc3, 0x0000), 5654 {} 5655 }; 5656 static const struct coef_fw coef0225[] = { 5657 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), 5658 UPDATE_COEF(0x63, 3<<14, 2<<14), 5659 {} 5660 }; 5661 5662 switch (codec->core.vendor_id) { 5663 case 0x10ec0255: 5664 alc_process_coef_fw(codec, coef0255); 5665 break; 5666 case 0x10ec0230: 5667 case 0x10ec0236: 5668 case 0x10ec0256: 5669 case 0x19e58326: 5670 alc_process_coef_fw(codec, coef0256); 5671 alc_hp_enable_unmute(codec, 75); 5672 break; 5673 case 0x10ec0234: 5674 case 0x10ec0274: 5675 case 0x10ec0294: 5676 alc_write_coef_idx(codec, 0x45, 0xe689); 5677 break; 5678 case 0x10ec0233: 5679 case 0x10ec0283: 5680 alc_process_coef_fw(codec, coef0233); 5681 break; 5682 case 0x10ec0298: 5683 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ 5684 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); 5685 msleep(300); 5686 break; 5687 case 0x10ec0286: 5688 case 0x10ec0288: 5689 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); 5690 msleep(300); 5691 alc_process_coef_fw(codec, coef0288); 5692 break; 5693 case 0x10ec0292: 5694 alc_process_coef_fw(codec, coef0292); 5695 break; 5696 case 0x10ec0293: 5697 alc_process_coef_fw(codec, coef0293); 5698 break; 5699 case 0x10ec0668: 5700 alc_process_coef_fw(codec, coef0688); 5701 break; 5702 case 0x10ec0215: 5703 case 0x10ec0225: 5704 case 0x10ec0285: 5705 case 0x10ec0295: 5706 case 0x10ec0289: 5707 case 0x10ec0299: 5708 alc_process_coef_fw(codec, coef0225); 5709 alc_hp_enable_unmute(codec, 75); 5710 break; 5711 } 5712 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); 5713 } 5714 5715 static void alc_determine_headset_type(struct hda_codec *codec) 5716 { 5717 int val; 5718 bool is_ctia = false; 5719 struct alc_spec *spec = codec->spec; 5720 static const struct coef_fw coef0255[] = { 5721 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ 5722 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref 5723 conteol) */ 5724 {} 5725 }; 5726 static const struct coef_fw coef0288[] = { 5727 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ 5728 {} 5729 }; 5730 static const struct coef_fw coef0298[] = { 5731 UPDATE_COEF(0x50, 0x2000, 0x2000), 5732 UPDATE_COEF(0x56, 0x0006, 0x0006), 5733 UPDATE_COEF(0x66, 0x0008, 0), 5734 UPDATE_COEF(0x67, 0x2000, 0), 5735 UPDATE_COEF(0x19, 0x1300, 0x1300), 5736 {} 5737 }; 5738 static const struct coef_fw coef0293[] = { 5739 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ 5740 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ 5741 {} 5742 }; 5743 static const struct coef_fw coef0688[] = { 5744 WRITE_COEF(0x11, 0x0001), 5745 WRITE_COEF(0xb7, 0x802b), 5746 WRITE_COEF(0x15, 0x0d60), 5747 WRITE_COEF(0xc3, 0x0c00), 5748 {} 5749 }; 5750 static const struct coef_fw coef0274[] = { 5751 UPDATE_COEF(0x4a, 0x0010, 0), 5752 UPDATE_COEF(0x4a, 0x8000, 0), 5753 WRITE_COEF(0x45, 0xd289), 5754 UPDATE_COEF(0x49, 0x0300, 0x0300), 5755 {} 5756 }; 5757 5758 if (spec->no_internal_mic_pin) { 5759 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 5760 return; 5761 } 5762 5763 switch (codec->core.vendor_id) { 5764 case 0x10ec0255: 5765 alc_process_coef_fw(codec, coef0255); 5766 msleep(300); 5767 val = alc_read_coef_idx(codec, 0x46); 5768 is_ctia = (val & 0x0070) == 0x0070; 5769 break; 5770 case 0x10ec0230: 5771 case 0x10ec0236: 5772 case 0x10ec0256: 5773 case 0x19e58326: 5774 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 5775 alc_write_coef_idx(codec, 0x06, 0x6104); 5776 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); 5777 5778 alc_process_coef_fw(codec, coef0255); 5779 msleep(300); 5780 val = alc_read_coef_idx(codec, 0x46); 5781 is_ctia = (val & 0x0070) == 0x0070; 5782 if (!is_ctia) { 5783 alc_write_coef_idx(codec, 0x45, 0xe089); 5784 msleep(100); 5785 val = alc_read_coef_idx(codec, 0x46); 5786 if ((val & 0x0070) == 0x0070) 5787 is_ctia = false; 5788 else 5789 is_ctia = true; 5790 } 5791 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); 5792 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5793 break; 5794 case 0x10ec0234: 5795 case 0x10ec0274: 5796 case 0x10ec0294: 5797 alc_process_coef_fw(codec, coef0274); 5798 msleep(850); 5799 val = alc_read_coef_idx(codec, 0x46); 5800 is_ctia = (val & 0x00f0) == 0x00f0; 5801 break; 5802 case 0x10ec0233: 5803 case 0x10ec0283: 5804 alc_write_coef_idx(codec, 0x45, 0xd029); 5805 msleep(300); 5806 val = alc_read_coef_idx(codec, 0x46); 5807 is_ctia = (val & 0x0070) == 0x0070; 5808 break; 5809 case 0x10ec0298: 5810 snd_hda_codec_write(codec, 0x21, 0, 5811 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 5812 msleep(100); 5813 snd_hda_codec_write(codec, 0x21, 0, 5814 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 5815 msleep(200); 5816 5817 val = alc_read_coef_idx(codec, 0x50); 5818 if (val & (1 << 12)) { 5819 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); 5820 alc_process_coef_fw(codec, coef0288); 5821 msleep(350); 5822 val = alc_read_coef_idx(codec, 0x50); 5823 is_ctia = (val & 0x0070) == 0x0070; 5824 } else { 5825 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); 5826 alc_process_coef_fw(codec, coef0288); 5827 msleep(350); 5828 val = alc_read_coef_idx(codec, 0x50); 5829 is_ctia = (val & 0x0070) == 0x0070; 5830 } 5831 alc_process_coef_fw(codec, coef0298); 5832 snd_hda_codec_write(codec, 0x21, 0, 5833 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); 5834 msleep(75); 5835 snd_hda_codec_write(codec, 0x21, 0, 5836 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 5837 break; 5838 case 0x10ec0286: 5839 case 0x10ec0288: 5840 alc_process_coef_fw(codec, coef0288); 5841 msleep(350); 5842 val = alc_read_coef_idx(codec, 0x50); 5843 is_ctia = (val & 0x0070) == 0x0070; 5844 break; 5845 case 0x10ec0292: 5846 alc_write_coef_idx(codec, 0x6b, 0xd429); 5847 msleep(300); 5848 val = alc_read_coef_idx(codec, 0x6c); 5849 is_ctia = (val & 0x001c) == 0x001c; 5850 break; 5851 case 0x10ec0293: 5852 alc_process_coef_fw(codec, coef0293); 5853 msleep(300); 5854 val = alc_read_coef_idx(codec, 0x46); 5855 is_ctia = (val & 0x0070) == 0x0070; 5856 break; 5857 case 0x10ec0668: 5858 alc_process_coef_fw(codec, coef0688); 5859 msleep(300); 5860 val = alc_read_coef_idx(codec, 0xbe); 5861 is_ctia = (val & 0x1c02) == 0x1c02; 5862 break; 5863 case 0x10ec0215: 5864 case 0x10ec0225: 5865 case 0x10ec0285: 5866 case 0x10ec0295: 5867 case 0x10ec0289: 5868 case 0x10ec0299: 5869 alc_process_coef_fw(codec, alc225_pre_hsmode); 5870 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); 5871 val = alc_read_coef_idx(codec, 0x45); 5872 if (val & (1 << 9)) { 5873 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); 5874 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); 5875 msleep(800); 5876 val = alc_read_coef_idx(codec, 0x46); 5877 is_ctia = (val & 0x00f0) == 0x00f0; 5878 } else { 5879 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); 5880 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); 5881 msleep(800); 5882 val = alc_read_coef_idx(codec, 0x46); 5883 is_ctia = (val & 0x00f0) == 0x00f0; 5884 } 5885 if (!is_ctia) { 5886 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10); 5887 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); 5888 msleep(100); 5889 val = alc_read_coef_idx(codec, 0x46); 5890 if ((val & 0x00f0) == 0x00f0) 5891 is_ctia = false; 5892 else 5893 is_ctia = true; 5894 } 5895 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); 5896 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); 5897 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 5898 break; 5899 case 0x10ec0867: 5900 is_ctia = true; 5901 break; 5902 } 5903 5904 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", 5905 is_ctia ? "yes" : "no"); 5906 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; 5907 } 5908 5909 static void alc_update_headset_mode(struct hda_codec *codec) 5910 { 5911 struct alc_spec *spec = codec->spec; 5912 5913 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; 5914 hda_nid_t hp_pin = alc_get_hp_pin(spec); 5915 5916 int new_headset_mode; 5917 5918 if (!snd_hda_jack_detect(codec, hp_pin)) 5919 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; 5920 else if (mux_pin == spec->headset_mic_pin) 5921 new_headset_mode = ALC_HEADSET_MODE_HEADSET; 5922 else if (mux_pin == spec->headphone_mic_pin) 5923 new_headset_mode = ALC_HEADSET_MODE_MIC; 5924 else 5925 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; 5926 5927 if (new_headset_mode == spec->current_headset_mode) { 5928 snd_hda_gen_update_outputs(codec); 5929 return; 5930 } 5931 5932 switch (new_headset_mode) { 5933 case ALC_HEADSET_MODE_UNPLUGGED: 5934 alc_headset_mode_unplugged(codec); 5935 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; 5936 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; 5937 spec->gen.hp_jack_present = false; 5938 break; 5939 case ALC_HEADSET_MODE_HEADSET: 5940 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) 5941 alc_determine_headset_type(codec); 5942 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) 5943 alc_headset_mode_ctia(codec); 5944 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) 5945 alc_headset_mode_omtp(codec); 5946 spec->gen.hp_jack_present = true; 5947 break; 5948 case ALC_HEADSET_MODE_MIC: 5949 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); 5950 spec->gen.hp_jack_present = false; 5951 break; 5952 case ALC_HEADSET_MODE_HEADPHONE: 5953 alc_headset_mode_default(codec); 5954 spec->gen.hp_jack_present = true; 5955 break; 5956 } 5957 if (new_headset_mode != ALC_HEADSET_MODE_MIC) { 5958 snd_hda_set_pin_ctl_cache(codec, hp_pin, 5959 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); 5960 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) 5961 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, 5962 PIN_VREFHIZ); 5963 } 5964 spec->current_headset_mode = new_headset_mode; 5965 5966 snd_hda_gen_update_outputs(codec); 5967 } 5968 5969 static void alc_update_headset_mode_hook(struct hda_codec *codec, 5970 struct snd_kcontrol *kcontrol, 5971 struct snd_ctl_elem_value *ucontrol) 5972 { 5973 alc_update_headset_mode(codec); 5974 } 5975 5976 static void alc_update_headset_jack_cb(struct hda_codec *codec, 5977 struct hda_jack_callback *jack) 5978 { 5979 snd_hda_gen_hp_automute(codec, jack); 5980 alc_update_headset_mode(codec); 5981 } 5982 5983 static void alc_probe_headset_mode(struct hda_codec *codec) 5984 { 5985 int i; 5986 struct alc_spec *spec = codec->spec; 5987 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 5988 5989 /* Find mic pins */ 5990 for (i = 0; i < cfg->num_inputs; i++) { 5991 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) 5992 spec->headset_mic_pin = cfg->inputs[i].pin; 5993 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) 5994 spec->headphone_mic_pin = cfg->inputs[i].pin; 5995 } 5996 5997 WARN_ON(spec->gen.cap_sync_hook); 5998 spec->gen.cap_sync_hook = alc_update_headset_mode_hook; 5999 spec->gen.automute_hook = alc_update_headset_mode; 6000 spec->gen.hp_automute_hook = alc_update_headset_jack_cb; 6001 } 6002 6003 static void alc_fixup_headset_mode(struct hda_codec *codec, 6004 const struct hda_fixup *fix, int action) 6005 { 6006 struct alc_spec *spec = codec->spec; 6007 6008 switch (action) { 6009 case HDA_FIXUP_ACT_PRE_PROBE: 6010 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; 6011 break; 6012 case HDA_FIXUP_ACT_PROBE: 6013 alc_probe_headset_mode(codec); 6014 break; 6015 case HDA_FIXUP_ACT_INIT: 6016 if (is_s3_resume(codec) || is_s4_resume(codec)) { 6017 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; 6018 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; 6019 } 6020 alc_update_headset_mode(codec); 6021 break; 6022 } 6023 } 6024 6025 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, 6026 const struct hda_fixup *fix, int action) 6027 { 6028 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6029 struct alc_spec *spec = codec->spec; 6030 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 6031 } 6032 else 6033 alc_fixup_headset_mode(codec, fix, action); 6034 } 6035 6036 static void alc255_set_default_jack_type(struct hda_codec *codec) 6037 { 6038 /* Set to iphone type */ 6039 static const struct coef_fw alc255fw[] = { 6040 WRITE_COEF(0x1b, 0x880b), 6041 WRITE_COEF(0x45, 0xd089), 6042 WRITE_COEF(0x1b, 0x080b), 6043 WRITE_COEF(0x46, 0x0004), 6044 WRITE_COEF(0x1b, 0x0c0b), 6045 {} 6046 }; 6047 static const struct coef_fw alc256fw[] = { 6048 WRITE_COEF(0x1b, 0x884b), 6049 WRITE_COEF(0x45, 0xd089), 6050 WRITE_COEF(0x1b, 0x084b), 6051 WRITE_COEF(0x46, 0x0004), 6052 WRITE_COEF(0x1b, 0x0c4b), 6053 {} 6054 }; 6055 switch (codec->core.vendor_id) { 6056 case 0x10ec0255: 6057 alc_process_coef_fw(codec, alc255fw); 6058 break; 6059 case 0x10ec0230: 6060 case 0x10ec0236: 6061 case 0x10ec0256: 6062 case 0x19e58326: 6063 alc_process_coef_fw(codec, alc256fw); 6064 break; 6065 } 6066 msleep(30); 6067 } 6068 6069 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, 6070 const struct hda_fixup *fix, int action) 6071 { 6072 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6073 alc255_set_default_jack_type(codec); 6074 } 6075 alc_fixup_headset_mode(codec, fix, action); 6076 } 6077 6078 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, 6079 const struct hda_fixup *fix, int action) 6080 { 6081 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6082 struct alc_spec *spec = codec->spec; 6083 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 6084 alc255_set_default_jack_type(codec); 6085 } 6086 else 6087 alc_fixup_headset_mode(codec, fix, action); 6088 } 6089 6090 static void alc288_update_headset_jack_cb(struct hda_codec *codec, 6091 struct hda_jack_callback *jack) 6092 { 6093 struct alc_spec *spec = codec->spec; 6094 6095 alc_update_headset_jack_cb(codec, jack); 6096 /* Headset Mic enable or disable, only for Dell Dino */ 6097 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); 6098 } 6099 6100 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, 6101 const struct hda_fixup *fix, int action) 6102 { 6103 alc_fixup_headset_mode(codec, fix, action); 6104 if (action == HDA_FIXUP_ACT_PROBE) { 6105 struct alc_spec *spec = codec->spec; 6106 /* toggled via hp_automute_hook */ 6107 spec->gpio_mask |= 0x40; 6108 spec->gpio_dir |= 0x40; 6109 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; 6110 } 6111 } 6112 6113 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, 6114 const struct hda_fixup *fix, int action) 6115 { 6116 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6117 struct alc_spec *spec = codec->spec; 6118 spec->gen.auto_mute_via_amp = 1; 6119 } 6120 } 6121 6122 static void alc_fixup_no_shutup(struct hda_codec *codec, 6123 const struct hda_fixup *fix, int action) 6124 { 6125 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6126 struct alc_spec *spec = codec->spec; 6127 spec->no_shutup_pins = 1; 6128 } 6129 } 6130 6131 static void alc_fixup_disable_aamix(struct hda_codec *codec, 6132 const struct hda_fixup *fix, int action) 6133 { 6134 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6135 struct alc_spec *spec = codec->spec; 6136 /* Disable AA-loopback as it causes white noise */ 6137 spec->gen.mixer_nid = 0; 6138 } 6139 } 6140 6141 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ 6142 static void alc_fixup_tpt440_dock(struct hda_codec *codec, 6143 const struct hda_fixup *fix, int action) 6144 { 6145 static const struct hda_pintbl pincfgs[] = { 6146 { 0x16, 0x21211010 }, /* dock headphone */ 6147 { 0x19, 0x21a11010 }, /* dock mic */ 6148 { } 6149 }; 6150 struct alc_spec *spec = codec->spec; 6151 6152 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6153 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 6154 codec->power_save_node = 0; /* avoid click noises */ 6155 snd_hda_apply_pincfgs(codec, pincfgs); 6156 } 6157 } 6158 6159 static void alc_fixup_tpt470_dock(struct hda_codec *codec, 6160 const struct hda_fixup *fix, int action) 6161 { 6162 static const struct hda_pintbl pincfgs[] = { 6163 { 0x17, 0x21211010 }, /* dock headphone */ 6164 { 0x19, 0x21a11010 }, /* dock mic */ 6165 { } 6166 }; 6167 struct alc_spec *spec = codec->spec; 6168 6169 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6170 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 6171 snd_hda_apply_pincfgs(codec, pincfgs); 6172 } else if (action == HDA_FIXUP_ACT_INIT) { 6173 /* Enable DOCK device */ 6174 snd_hda_codec_write(codec, 0x17, 0, 6175 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); 6176 /* Enable DOCK device */ 6177 snd_hda_codec_write(codec, 0x19, 0, 6178 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); 6179 } 6180 } 6181 6182 static void alc_fixup_tpt470_dacs(struct hda_codec *codec, 6183 const struct hda_fixup *fix, int action) 6184 { 6185 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise 6186 * the speaker output becomes too low by some reason on Thinkpads with 6187 * ALC298 codec 6188 */ 6189 static const hda_nid_t preferred_pairs[] = { 6190 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, 6191 0 6192 }; 6193 struct alc_spec *spec = codec->spec; 6194 6195 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6196 spec->gen.preferred_dacs = preferred_pairs; 6197 } 6198 6199 static void alc295_fixup_asus_dacs(struct hda_codec *codec, 6200 const struct hda_fixup *fix, int action) 6201 { 6202 static const hda_nid_t preferred_pairs[] = { 6203 0x17, 0x02, 0x21, 0x03, 0 6204 }; 6205 struct alc_spec *spec = codec->spec; 6206 6207 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6208 spec->gen.preferred_dacs = preferred_pairs; 6209 } 6210 6211 static void alc_shutup_dell_xps13(struct hda_codec *codec) 6212 { 6213 struct alc_spec *spec = codec->spec; 6214 int hp_pin = alc_get_hp_pin(spec); 6215 6216 /* Prevent pop noises when headphones are plugged in */ 6217 snd_hda_codec_write(codec, hp_pin, 0, 6218 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 6219 msleep(20); 6220 } 6221 6222 static void alc_fixup_dell_xps13(struct hda_codec *codec, 6223 const struct hda_fixup *fix, int action) 6224 { 6225 struct alc_spec *spec = codec->spec; 6226 struct hda_input_mux *imux = &spec->gen.input_mux; 6227 int i; 6228 6229 switch (action) { 6230 case HDA_FIXUP_ACT_PRE_PROBE: 6231 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise 6232 * it causes a click noise at start up 6233 */ 6234 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 6235 spec->shutup = alc_shutup_dell_xps13; 6236 break; 6237 case HDA_FIXUP_ACT_PROBE: 6238 /* Make the internal mic the default input source. */ 6239 for (i = 0; i < imux->num_items; i++) { 6240 if (spec->gen.imux_pins[i] == 0x12) { 6241 spec->gen.cur_mux[0] = i; 6242 break; 6243 } 6244 } 6245 break; 6246 } 6247 } 6248 6249 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, 6250 const struct hda_fixup *fix, int action) 6251 { 6252 struct alc_spec *spec = codec->spec; 6253 6254 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6255 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 6256 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ 6257 6258 /* Disable boost for mic-in permanently. (This code is only called 6259 from quirks that guarantee that the headphone is at NID 0x1b.) */ 6260 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); 6261 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); 6262 } else 6263 alc_fixup_headset_mode(codec, fix, action); 6264 } 6265 6266 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, 6267 const struct hda_fixup *fix, int action) 6268 { 6269 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6270 alc_write_coef_idx(codec, 0xc4, 0x8000); 6271 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); 6272 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); 6273 } 6274 alc_fixup_headset_mode(codec, fix, action); 6275 } 6276 6277 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ 6278 static int find_ext_mic_pin(struct hda_codec *codec) 6279 { 6280 struct alc_spec *spec = codec->spec; 6281 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 6282 hda_nid_t nid; 6283 unsigned int defcfg; 6284 int i; 6285 6286 for (i = 0; i < cfg->num_inputs; i++) { 6287 if (cfg->inputs[i].type != AUTO_PIN_MIC) 6288 continue; 6289 nid = cfg->inputs[i].pin; 6290 defcfg = snd_hda_codec_get_pincfg(codec, nid); 6291 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) 6292 continue; 6293 return nid; 6294 } 6295 6296 return 0; 6297 } 6298 6299 static void alc271_hp_gate_mic_jack(struct hda_codec *codec, 6300 const struct hda_fixup *fix, 6301 int action) 6302 { 6303 struct alc_spec *spec = codec->spec; 6304 6305 if (action == HDA_FIXUP_ACT_PROBE) { 6306 int mic_pin = find_ext_mic_pin(codec); 6307 int hp_pin = alc_get_hp_pin(spec); 6308 6309 if (snd_BUG_ON(!mic_pin || !hp_pin)) 6310 return; 6311 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); 6312 } 6313 } 6314 6315 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, 6316 const struct hda_fixup *fix, 6317 int action) 6318 { 6319 struct alc_spec *spec = codec->spec; 6320 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 6321 int i; 6322 6323 /* The mic boosts on level 2 and 3 are too noisy 6324 on the internal mic input. 6325 Therefore limit the boost to 0 or 1. */ 6326 6327 if (action != HDA_FIXUP_ACT_PROBE) 6328 return; 6329 6330 for (i = 0; i < cfg->num_inputs; i++) { 6331 hda_nid_t nid = cfg->inputs[i].pin; 6332 unsigned int defcfg; 6333 if (cfg->inputs[i].type != AUTO_PIN_MIC) 6334 continue; 6335 defcfg = snd_hda_codec_get_pincfg(codec, nid); 6336 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) 6337 continue; 6338 6339 snd_hda_override_amp_caps(codec, nid, HDA_INPUT, 6340 (0x00 << AC_AMPCAP_OFFSET_SHIFT) | 6341 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | 6342 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | 6343 (0 << AC_AMPCAP_MUTE_SHIFT)); 6344 } 6345 } 6346 6347 static void alc283_hp_automute_hook(struct hda_codec *codec, 6348 struct hda_jack_callback *jack) 6349 { 6350 struct alc_spec *spec = codec->spec; 6351 int vref; 6352 6353 msleep(200); 6354 snd_hda_gen_hp_automute(codec, jack); 6355 6356 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 6357 6358 msleep(600); 6359 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 6360 vref); 6361 } 6362 6363 static void alc283_fixup_chromebook(struct hda_codec *codec, 6364 const struct hda_fixup *fix, int action) 6365 { 6366 struct alc_spec *spec = codec->spec; 6367 6368 switch (action) { 6369 case HDA_FIXUP_ACT_PRE_PROBE: 6370 snd_hda_override_wcaps(codec, 0x03, 0); 6371 /* Disable AA-loopback as it causes white noise */ 6372 spec->gen.mixer_nid = 0; 6373 break; 6374 case HDA_FIXUP_ACT_INIT: 6375 /* MIC2-VREF control */ 6376 /* Set to manual mode */ 6377 alc_update_coef_idx(codec, 0x06, 0x000c, 0); 6378 /* Enable Line1 input control by verb */ 6379 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); 6380 break; 6381 } 6382 } 6383 6384 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, 6385 const struct hda_fixup *fix, int action) 6386 { 6387 struct alc_spec *spec = codec->spec; 6388 6389 switch (action) { 6390 case HDA_FIXUP_ACT_PRE_PROBE: 6391 spec->gen.hp_automute_hook = alc283_hp_automute_hook; 6392 break; 6393 case HDA_FIXUP_ACT_INIT: 6394 /* MIC2-VREF control */ 6395 /* Set to manual mode */ 6396 alc_update_coef_idx(codec, 0x06, 0x000c, 0); 6397 break; 6398 } 6399 } 6400 6401 /* mute tablet speaker pin (0x14) via dock plugging in addition */ 6402 static void asus_tx300_automute(struct hda_codec *codec) 6403 { 6404 struct alc_spec *spec = codec->spec; 6405 snd_hda_gen_update_outputs(codec); 6406 if (snd_hda_jack_detect(codec, 0x1b)) 6407 spec->gen.mute_bits |= (1ULL << 0x14); 6408 } 6409 6410 static void alc282_fixup_asus_tx300(struct hda_codec *codec, 6411 const struct hda_fixup *fix, int action) 6412 { 6413 struct alc_spec *spec = codec->spec; 6414 static const struct hda_pintbl dock_pins[] = { 6415 { 0x1b, 0x21114000 }, /* dock speaker pin */ 6416 {} 6417 }; 6418 6419 switch (action) { 6420 case HDA_FIXUP_ACT_PRE_PROBE: 6421 spec->init_amp = ALC_INIT_DEFAULT; 6422 /* TX300 needs to set up GPIO2 for the speaker amp */ 6423 alc_setup_gpio(codec, 0x04); 6424 snd_hda_apply_pincfgs(codec, dock_pins); 6425 spec->gen.auto_mute_via_amp = 1; 6426 spec->gen.automute_hook = asus_tx300_automute; 6427 snd_hda_jack_detect_enable_callback(codec, 0x1b, 6428 snd_hda_gen_hp_automute); 6429 break; 6430 case HDA_FIXUP_ACT_PROBE: 6431 spec->init_amp = ALC_INIT_DEFAULT; 6432 break; 6433 case HDA_FIXUP_ACT_BUILD: 6434 /* this is a bit tricky; give more sane names for the main 6435 * (tablet) speaker and the dock speaker, respectively 6436 */ 6437 rename_ctl(codec, "Speaker Playback Switch", 6438 "Dock Speaker Playback Switch"); 6439 rename_ctl(codec, "Bass Speaker Playback Switch", 6440 "Speaker Playback Switch"); 6441 break; 6442 } 6443 } 6444 6445 static void alc290_fixup_mono_speakers(struct hda_codec *codec, 6446 const struct hda_fixup *fix, int action) 6447 { 6448 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6449 /* DAC node 0x03 is giving mono output. We therefore want to 6450 make sure 0x14 (front speaker) and 0x15 (headphones) use the 6451 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ 6452 static const hda_nid_t conn1[] = { 0x0c }; 6453 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 6454 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); 6455 } 6456 } 6457 6458 static void alc298_fixup_speaker_volume(struct hda_codec *codec, 6459 const struct hda_fixup *fix, int action) 6460 { 6461 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6462 /* The speaker is routed to the Node 0x06 by a mistake, as a result 6463 we can't adjust the speaker's volume since this node does not has 6464 Amp-out capability. we change the speaker's route to: 6465 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( 6466 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust 6467 speaker's volume now. */ 6468 6469 static const hda_nid_t conn1[] = { 0x0c }; 6470 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); 6471 } 6472 } 6473 6474 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ 6475 static void alc295_fixup_disable_dac3(struct hda_codec *codec, 6476 const struct hda_fixup *fix, int action) 6477 { 6478 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6479 static const hda_nid_t conn[] = { 0x02, 0x03 }; 6480 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6481 } 6482 } 6483 6484 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ 6485 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, 6486 const struct hda_fixup *fix, int action) 6487 { 6488 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6489 static const hda_nid_t conn[] = { 0x02 }; 6490 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6491 } 6492 } 6493 6494 /* disable DAC3 (0x06) selection on NID 0x15 - share Speaker/Bass Speaker DAC 0x03 */ 6495 static void alc294_fixup_bass_speaker_15(struct hda_codec *codec, 6496 const struct hda_fixup *fix, int action) 6497 { 6498 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6499 static const hda_nid_t conn[] = { 0x02, 0x03 }; 6500 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); 6501 } 6502 } 6503 6504 /* Hook to update amp GPIO4 for automute */ 6505 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, 6506 struct hda_jack_callback *jack) 6507 { 6508 struct alc_spec *spec = codec->spec; 6509 6510 snd_hda_gen_hp_automute(codec, jack); 6511 /* mute_led_polarity is set to 0, so we pass inverted value here */ 6512 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, 6513 !spec->gen.hp_jack_present); 6514 } 6515 6516 /* Manage GPIOs for HP EliteBook Folio 9480m. 6517 * 6518 * GPIO4 is the headphone amplifier power control 6519 * GPIO3 is the audio output mute indicator LED 6520 */ 6521 6522 static void alc280_fixup_hp_9480m(struct hda_codec *codec, 6523 const struct hda_fixup *fix, 6524 int action) 6525 { 6526 struct alc_spec *spec = codec->spec; 6527 6528 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 6529 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6530 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ 6531 spec->gpio_mask |= 0x10; 6532 spec->gpio_dir |= 0x10; 6533 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; 6534 } 6535 } 6536 6537 static void alc275_fixup_gpio4_off(struct hda_codec *codec, 6538 const struct hda_fixup *fix, 6539 int action) 6540 { 6541 struct alc_spec *spec = codec->spec; 6542 6543 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6544 spec->gpio_mask |= 0x04; 6545 spec->gpio_dir |= 0x04; 6546 /* set data bit low */ 6547 } 6548 } 6549 6550 /* Quirk for Thinkpad X1 7th and 8th Gen 6551 * The following fixed routing needed 6552 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly 6553 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC 6554 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp 6555 */ 6556 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, 6557 const struct hda_fixup *fix, int action) 6558 { 6559 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ 6560 static const hda_nid_t preferred_pairs[] = { 6561 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 6562 }; 6563 struct alc_spec *spec = codec->spec; 6564 6565 switch (action) { 6566 case HDA_FIXUP_ACT_PRE_PROBE: 6567 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6568 spec->gen.preferred_dacs = preferred_pairs; 6569 break; 6570 case HDA_FIXUP_ACT_BUILD: 6571 /* The generic parser creates somewhat unintuitive volume ctls 6572 * with the fixed routing above, and the shared DAC2 may be 6573 * confusing for PA. 6574 * Rename those to unique names so that PA doesn't touch them 6575 * and use only Master volume. 6576 */ 6577 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); 6578 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); 6579 break; 6580 } 6581 } 6582 6583 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, 6584 const struct hda_fixup *fix, 6585 int action) 6586 { 6587 alc_fixup_dual_codecs(codec, fix, action); 6588 switch (action) { 6589 case HDA_FIXUP_ACT_PRE_PROBE: 6590 /* override card longname to provide a unique UCM profile */ 6591 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); 6592 break; 6593 case HDA_FIXUP_ACT_BUILD: 6594 /* rename Capture controls depending on the codec */ 6595 rename_ctl(codec, "Capture Volume", 6596 codec->addr == 0 ? 6597 "Rear-Panel Capture Volume" : 6598 "Front-Panel Capture Volume"); 6599 rename_ctl(codec, "Capture Switch", 6600 codec->addr == 0 ? 6601 "Rear-Panel Capture Switch" : 6602 "Front-Panel Capture Switch"); 6603 break; 6604 } 6605 } 6606 6607 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, 6608 const struct hda_fixup *fix, int action) 6609 { 6610 if (action != HDA_FIXUP_ACT_PRE_PROBE) 6611 return; 6612 6613 codec->power_save_node = 1; 6614 } 6615 6616 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ 6617 static void alc274_fixup_bind_dacs(struct hda_codec *codec, 6618 const struct hda_fixup *fix, int action) 6619 { 6620 struct alc_spec *spec = codec->spec; 6621 static const hda_nid_t preferred_pairs[] = { 6622 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, 6623 0 6624 }; 6625 6626 if (action != HDA_FIXUP_ACT_PRE_PROBE) 6627 return; 6628 6629 spec->gen.preferred_dacs = preferred_pairs; 6630 spec->gen.auto_mute_via_amp = 1; 6631 codec->power_save_node = 0; 6632 } 6633 6634 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */ 6635 static void alc289_fixup_asus_ga401(struct hda_codec *codec, 6636 const struct hda_fixup *fix, int action) 6637 { 6638 static const hda_nid_t preferred_pairs[] = { 6639 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0 6640 }; 6641 struct alc_spec *spec = codec->spec; 6642 6643 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6644 spec->gen.preferred_dacs = preferred_pairs; 6645 } 6646 6647 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ 6648 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, 6649 const struct hda_fixup *fix, int action) 6650 { 6651 if (action != HDA_FIXUP_ACT_PRE_PROBE) 6652 return; 6653 6654 snd_hda_override_wcaps(codec, 0x03, 0); 6655 } 6656 6657 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) 6658 { 6659 switch (codec->core.vendor_id) { 6660 case 0x10ec0274: 6661 case 0x10ec0294: 6662 case 0x10ec0225: 6663 case 0x10ec0295: 6664 case 0x10ec0299: 6665 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ 6666 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); 6667 break; 6668 case 0x10ec0230: 6669 case 0x10ec0235: 6670 case 0x10ec0236: 6671 case 0x10ec0255: 6672 case 0x10ec0256: 6673 case 0x10ec0257: 6674 case 0x19e58326: 6675 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ 6676 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); 6677 break; 6678 } 6679 } 6680 6681 static void alc295_fixup_chromebook(struct hda_codec *codec, 6682 const struct hda_fixup *fix, int action) 6683 { 6684 struct alc_spec *spec = codec->spec; 6685 6686 switch (action) { 6687 case HDA_FIXUP_ACT_PRE_PROBE: 6688 spec->ultra_low_power = true; 6689 break; 6690 case HDA_FIXUP_ACT_INIT: 6691 alc_combo_jack_hp_jd_restart(codec); 6692 break; 6693 } 6694 } 6695 6696 static void alc256_fixup_chromebook(struct hda_codec *codec, 6697 const struct hda_fixup *fix, int action) 6698 { 6699 struct alc_spec *spec = codec->spec; 6700 6701 switch (action) { 6702 case HDA_FIXUP_ACT_PRE_PROBE: 6703 spec->gen.suppress_auto_mute = 1; 6704 spec->gen.suppress_auto_mic = 1; 6705 spec->en_3kpull_low = false; 6706 break; 6707 } 6708 } 6709 6710 static void alc_fixup_disable_mic_vref(struct hda_codec *codec, 6711 const struct hda_fixup *fix, int action) 6712 { 6713 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6714 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 6715 } 6716 6717 6718 static void alc294_gx502_toggle_output(struct hda_codec *codec, 6719 struct hda_jack_callback *cb) 6720 { 6721 /* The Windows driver sets the codec up in a very different way where 6722 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it 6723 */ 6724 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) 6725 alc_write_coef_idx(codec, 0x10, 0x8a20); 6726 else 6727 alc_write_coef_idx(codec, 0x10, 0x0a20); 6728 } 6729 6730 static void alc294_fixup_gx502_hp(struct hda_codec *codec, 6731 const struct hda_fixup *fix, int action) 6732 { 6733 /* Pin 0x21: headphones/headset mic */ 6734 if (!is_jack_detectable(codec, 0x21)) 6735 return; 6736 6737 switch (action) { 6738 case HDA_FIXUP_ACT_PRE_PROBE: 6739 snd_hda_jack_detect_enable_callback(codec, 0x21, 6740 alc294_gx502_toggle_output); 6741 break; 6742 case HDA_FIXUP_ACT_INIT: 6743 /* Make sure to start in a correct state, i.e. if 6744 * headphones have been plugged in before powering up the system 6745 */ 6746 alc294_gx502_toggle_output(codec, NULL); 6747 break; 6748 } 6749 } 6750 6751 static void alc294_gu502_toggle_output(struct hda_codec *codec, 6752 struct hda_jack_callback *cb) 6753 { 6754 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is 6755 * responsible from changes between speakers and headphones 6756 */ 6757 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) 6758 alc_write_coef_idx(codec, 0x10, 0x8420); 6759 else 6760 alc_write_coef_idx(codec, 0x10, 0x0a20); 6761 } 6762 6763 static void alc294_fixup_gu502_hp(struct hda_codec *codec, 6764 const struct hda_fixup *fix, int action) 6765 { 6766 if (!is_jack_detectable(codec, 0x21)) 6767 return; 6768 6769 switch (action) { 6770 case HDA_FIXUP_ACT_PRE_PROBE: 6771 snd_hda_jack_detect_enable_callback(codec, 0x21, 6772 alc294_gu502_toggle_output); 6773 break; 6774 case HDA_FIXUP_ACT_INIT: 6775 alc294_gu502_toggle_output(codec, NULL); 6776 break; 6777 } 6778 } 6779 6780 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, 6781 const struct hda_fixup *fix, int action) 6782 { 6783 if (action != HDA_FIXUP_ACT_INIT) 6784 return; 6785 6786 msleep(100); 6787 alc_write_coef_idx(codec, 0x65, 0x0); 6788 } 6789 6790 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, 6791 const struct hda_fixup *fix, int action) 6792 { 6793 switch (action) { 6794 case HDA_FIXUP_ACT_INIT: 6795 alc_combo_jack_hp_jd_restart(codec); 6796 break; 6797 } 6798 } 6799 6800 static void alc_fixup_no_int_mic(struct hda_codec *codec, 6801 const struct hda_fixup *fix, int action) 6802 { 6803 struct alc_spec *spec = codec->spec; 6804 6805 switch (action) { 6806 case HDA_FIXUP_ACT_PRE_PROBE: 6807 /* Mic RING SLEEVE swap for combo jack */ 6808 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 6809 spec->no_internal_mic_pin = true; 6810 break; 6811 case HDA_FIXUP_ACT_INIT: 6812 alc_combo_jack_hp_jd_restart(codec); 6813 break; 6814 } 6815 } 6816 6817 /* GPIO1 = amplifier on/off 6818 * GPIO3 = mic mute LED 6819 */ 6820 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, 6821 const struct hda_fixup *fix, int action) 6822 { 6823 static const hda_nid_t conn[] = { 0x02 }; 6824 6825 struct alc_spec *spec = codec->spec; 6826 static const struct hda_pintbl pincfgs[] = { 6827 { 0x14, 0x90170110 }, /* front/high speakers */ 6828 { 0x17, 0x90170130 }, /* back/bass speakers */ 6829 { } 6830 }; 6831 6832 //enable micmute led 6833 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04); 6834 6835 switch (action) { 6836 case HDA_FIXUP_ACT_PRE_PROBE: 6837 spec->micmute_led_polarity = 1; 6838 /* needed for amp of back speakers */ 6839 spec->gpio_mask |= 0x01; 6840 spec->gpio_dir |= 0x01; 6841 snd_hda_apply_pincfgs(codec, pincfgs); 6842 /* share DAC to have unified volume control */ 6843 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); 6844 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6845 break; 6846 case HDA_FIXUP_ACT_INIT: 6847 /* need to toggle GPIO to enable the amp of back speakers */ 6848 alc_update_gpio_data(codec, 0x01, true); 6849 msleep(100); 6850 alc_update_gpio_data(codec, 0x01, false); 6851 break; 6852 } 6853 } 6854 6855 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, 6856 const struct hda_fixup *fix, int action) 6857 { 6858 static const hda_nid_t conn[] = { 0x02 }; 6859 static const struct hda_pintbl pincfgs[] = { 6860 { 0x14, 0x90170110 }, /* rear speaker */ 6861 { } 6862 }; 6863 6864 switch (action) { 6865 case HDA_FIXUP_ACT_PRE_PROBE: 6866 snd_hda_apply_pincfgs(codec, pincfgs); 6867 /* force front speaker to DAC1 */ 6868 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6869 break; 6870 } 6871 } 6872 6873 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec, 6874 const struct hda_fixup *fix, 6875 int action) 6876 { 6877 static const struct coef_fw coefs[] = { 6878 WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023), 6879 WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03), 6880 WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a), 6881 WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014), 6882 WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15), 6883 WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489), 6884 WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0), 6885 WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000), 6886 WRITE_COEF(0x6e, 0x1005), { } 6887 }; 6888 6889 static const struct hda_pintbl pincfgs[] = { 6890 { 0x12, 0xb7a60130 }, /* Internal microphone*/ 6891 { 0x14, 0x90170150 }, /* B&O soundbar speakers */ 6892 { 0x17, 0x90170153 }, /* Side speakers */ 6893 { 0x19, 0x03a11040 }, /* Headset microphone */ 6894 { } 6895 }; 6896 6897 switch (action) { 6898 case HDA_FIXUP_ACT_PRE_PROBE: 6899 snd_hda_apply_pincfgs(codec, pincfgs); 6900 6901 /* Fixes volume control problem for side speakers */ 6902 alc295_fixup_disable_dac3(codec, fix, action); 6903 6904 /* Fixes no sound from headset speaker */ 6905 snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0); 6906 6907 /* Auto-enable headset mic when plugged */ 6908 snd_hda_jack_set_gating_jack(codec, 0x19, 0x21); 6909 6910 /* Headset mic volume enhancement */ 6911 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50); 6912 break; 6913 case HDA_FIXUP_ACT_INIT: 6914 alc_process_coef_fw(codec, coefs); 6915 break; 6916 case HDA_FIXUP_ACT_BUILD: 6917 rename_ctl(codec, "Bass Speaker Playback Volume", 6918 "B&O-Tuned Playback Volume"); 6919 rename_ctl(codec, "Front Playback Switch", 6920 "B&O Soundbar Playback Switch"); 6921 rename_ctl(codec, "Bass Speaker Playback Switch", 6922 "Side Speaker Playback Switch"); 6923 break; 6924 } 6925 } 6926 6927 /* for hda_fixup_thinkpad_acpi() */ 6928 #include "thinkpad_helper.c" 6929 6930 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, 6931 const struct hda_fixup *fix, int action) 6932 { 6933 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ 6934 hda_fixup_thinkpad_acpi(codec, fix, action); 6935 } 6936 6937 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */ 6938 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec, 6939 const struct hda_fixup *fix, 6940 int action) 6941 { 6942 struct alc_spec *spec = codec->spec; 6943 6944 switch (action) { 6945 case HDA_FIXUP_ACT_PRE_PROBE: 6946 spec->gen.suppress_auto_mute = 1; 6947 break; 6948 } 6949 } 6950 6951 static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data) 6952 { 6953 struct hda_codec *cdc = data; 6954 struct alc_spec *spec = cdc->spec; 6955 6956 codec_info(cdc, "ACPI Notification %d\n", event); 6957 6958 hda_component_acpi_device_notify(&spec->comps, handle, event, data); 6959 } 6960 6961 static int comp_bind(struct device *dev) 6962 { 6963 struct hda_codec *cdc = dev_to_hda_codec(dev); 6964 struct alc_spec *spec = cdc->spec; 6965 int ret; 6966 6967 ret = hda_component_manager_bind(cdc, &spec->comps); 6968 if (ret) 6969 return ret; 6970 6971 return hda_component_manager_bind_acpi_notifications(cdc, 6972 &spec->comps, 6973 comp_acpi_device_notify, cdc); 6974 } 6975 6976 static void comp_unbind(struct device *dev) 6977 { 6978 struct hda_codec *cdc = dev_to_hda_codec(dev); 6979 struct alc_spec *spec = cdc->spec; 6980 6981 hda_component_manager_unbind_acpi_notifications(cdc, &spec->comps, comp_acpi_device_notify); 6982 hda_component_manager_unbind(cdc, &spec->comps); 6983 } 6984 6985 static const struct component_master_ops comp_master_ops = { 6986 .bind = comp_bind, 6987 .unbind = comp_unbind, 6988 }; 6989 6990 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc, 6991 struct snd_pcm_substream *sub, int action) 6992 { 6993 struct alc_spec *spec = cdc->spec; 6994 6995 hda_component_manager_playback_hook(&spec->comps, action); 6996 } 6997 6998 static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus, 6999 const char *hid, const char *match_str, int count) 7000 { 7001 struct alc_spec *spec = cdc->spec; 7002 int ret; 7003 7004 switch (action) { 7005 case HDA_FIXUP_ACT_PRE_PROBE: 7006 ret = hda_component_manager_init(cdc, &spec->comps, count, bus, hid, 7007 match_str, &comp_master_ops); 7008 if (ret) 7009 return; 7010 7011 spec->gen.pcm_playback_hook = comp_generic_playback_hook; 7012 break; 7013 case HDA_FIXUP_ACT_FREE: 7014 hda_component_manager_free(&spec->comps, &comp_master_ops); 7015 break; 7016 } 7017 } 7018 7019 static void find_cirrus_companion_amps(struct hda_codec *cdc) 7020 { 7021 struct device *dev = hda_codec_dev(cdc); 7022 struct acpi_device *adev; 7023 struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; 7024 const char *bus = NULL; 7025 static const struct { 7026 const char *hid; 7027 const char *name; 7028 } acpi_ids[] = {{ "CSC3554", "cs35l54-hda" }, 7029 { "CSC3556", "cs35l56-hda" }, 7030 { "CSC3557", "cs35l57-hda" }}; 7031 char *match; 7032 int i, count = 0, count_devindex = 0; 7033 7034 for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) { 7035 adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1); 7036 if (adev) 7037 break; 7038 } 7039 if (!adev) { 7040 codec_dbg(cdc, "Did not find ACPI entry for a Cirrus Amp\n"); 7041 return; 7042 } 7043 7044 count = i2c_acpi_client_count(adev); 7045 if (count > 0) { 7046 bus = "i2c"; 7047 } else { 7048 count = acpi_spi_count_resources(adev); 7049 if (count > 0) 7050 bus = "spi"; 7051 } 7052 7053 fwnode = fwnode_handle_get(acpi_fwnode_handle(adev)); 7054 acpi_dev_put(adev); 7055 7056 if (!bus) { 7057 codec_err(cdc, "Did not find any buses for %s\n", acpi_ids[i].hid); 7058 return; 7059 } 7060 7061 if (!fwnode) { 7062 codec_err(cdc, "Could not get fwnode for %s\n", acpi_ids[i].hid); 7063 return; 7064 } 7065 7066 /* 7067 * When available the cirrus,dev-index property is an accurate 7068 * count of the amps in a system and is used in preference to 7069 * the count of bus devices that can contain additional address 7070 * alias entries. 7071 */ 7072 count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index"); 7073 if (count_devindex > 0) 7074 count = count_devindex; 7075 7076 match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name); 7077 if (!match) 7078 return; 7079 codec_info(cdc, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match); 7080 comp_generic_fixup(cdc, HDA_FIXUP_ACT_PRE_PROBE, bus, acpi_ids[i].hid, match, count); 7081 } 7082 7083 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7084 { 7085 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2); 7086 } 7087 7088 static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7089 { 7090 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4); 7091 } 7092 7093 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action) 7094 { 7095 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2); 7096 } 7097 7098 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action) 7099 { 7100 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4); 7101 } 7102 7103 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix, 7104 int action) 7105 { 7106 comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2); 7107 } 7108 7109 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix, 7110 int action) 7111 { 7112 comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2); 7113 } 7114 7115 static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7116 { 7117 /* 7118 * The same SSID has been re-used in different hardware, they have 7119 * different codecs and the newer GA403U has a ALC285. 7120 */ 7121 if (cdc->core.vendor_id != 0x10ec0285) 7122 alc_fixup_inv_dmic(cdc, fix, action); 7123 } 7124 7125 static void tas2781_fixup_i2c(struct hda_codec *cdc, 7126 const struct hda_fixup *fix, int action) 7127 { 7128 comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1); 7129 } 7130 7131 static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc, 7132 const struct hda_fixup *fix, int action) 7133 { 7134 comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1); 7135 } 7136 7137 static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec, 7138 const struct hda_fixup *fix, int action) 7139 { 7140 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 7141 } 7142 7143 7144 /* for alc295_fixup_hp_top_speakers */ 7145 #include "hp_x360_helper.c" 7146 7147 /* for alc285_fixup_ideapad_s740_coef() */ 7148 #include "ideapad_s740_helper.c" 7149 7150 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = { 7151 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000), 7152 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000), 7153 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089), 7154 {} 7155 }; 7156 7157 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec, 7158 const struct hda_fixup *fix, 7159 int action) 7160 { 7161 /* 7162 * A certain other OS sets these coeffs to different values. On at least 7163 * one TongFang barebone these settings might survive even a cold 7164 * reboot. So to restore a clean slate the values are explicitly reset 7165 * to default here. Without this, the external microphone is always in a 7166 * plugged-in state, while the internal microphone is always in an 7167 * unplugged state, breaking the ability to use the internal microphone. 7168 */ 7169 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs); 7170 } 7171 7172 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = { 7173 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06), 7174 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074), 7175 WRITE_COEF(0x49, 0x0149), 7176 {} 7177 }; 7178 7179 static void alc233_fixup_no_audio_jack(struct hda_codec *codec, 7180 const struct hda_fixup *fix, 7181 int action) 7182 { 7183 /* 7184 * The audio jack input and output is not detected on the ASRock NUC Box 7185 * 1100 series when cold booting without this fix. Warm rebooting from a 7186 * certain other OS makes the audio functional, as COEF settings are 7187 * preserved in this case. This fix sets these altered COEF values as 7188 * the default. 7189 */ 7190 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs); 7191 } 7192 7193 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec, 7194 const struct hda_fixup *fix, 7195 int action) 7196 { 7197 /* 7198 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec, 7199 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec 7200 * needs an additional quirk for sound working after suspend and resume. 7201 */ 7202 if (codec->core.vendor_id == 0x10ec0256) { 7203 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 7204 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120); 7205 } else { 7206 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c); 7207 } 7208 } 7209 7210 static void alc256_decrease_headphone_amp_val(struct hda_codec *codec, 7211 const struct hda_fixup *fix, int action) 7212 { 7213 u32 caps; 7214 u8 nsteps, offs; 7215 7216 if (action != HDA_FIXUP_ACT_PRE_PROBE) 7217 return; 7218 7219 caps = query_amp_caps(codec, 0x3, HDA_OUTPUT); 7220 nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10; 7221 offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10; 7222 caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET; 7223 caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT); 7224 7225 if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps)) 7226 codec_warn(codec, "failed to override amp caps for NID 0x3\n"); 7227 } 7228 7229 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec, 7230 const struct hda_fixup *fix, 7231 int action) 7232 { 7233 struct alc_spec *spec = codec->spec; 7234 struct hda_input_mux *imux = &spec->gen.input_mux; 7235 int i; 7236 7237 alc269_fixup_limit_int_mic_boost(codec, fix, action); 7238 7239 switch (action) { 7240 case HDA_FIXUP_ACT_PRE_PROBE: 7241 /** 7242 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic) 7243 * to Hi-Z to avoid pop noises at startup and when plugging and 7244 * unplugging headphones. 7245 */ 7246 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 7247 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ); 7248 break; 7249 case HDA_FIXUP_ACT_PROBE: 7250 /** 7251 * Make the internal mic (0x12) the default input source to 7252 * prevent pop noises on cold boot. 7253 */ 7254 for (i = 0; i < imux->num_items; i++) { 7255 if (spec->gen.imux_pins[i] == 0x12) { 7256 spec->gen.cur_mux[0] = i; 7257 break; 7258 } 7259 } 7260 break; 7261 } 7262 } 7263 7264 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec, 7265 const struct hda_fixup *fix, int action) 7266 { 7267 /* 7268 * The Pin Complex 0x17 for the bass speakers is wrongly reported as 7269 * unconnected. 7270 */ 7271 static const struct hda_pintbl pincfgs[] = { 7272 { 0x17, 0x90170121 }, 7273 { } 7274 }; 7275 /* 7276 * Avoid DAC 0x06 and 0x08, as they have no volume controls. 7277 * DAC 0x02 and 0x03 would be fine. 7278 */ 7279 static const hda_nid_t conn[] = { 0x02, 0x03 }; 7280 /* 7281 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02. 7282 * Headphones (0x21) are connected to DAC 0x03. 7283 */ 7284 static const hda_nid_t preferred_pairs[] = { 7285 0x14, 0x02, 7286 0x17, 0x02, 7287 0x21, 0x03, 7288 0 7289 }; 7290 struct alc_spec *spec = codec->spec; 7291 7292 switch (action) { 7293 case HDA_FIXUP_ACT_PRE_PROBE: 7294 snd_hda_apply_pincfgs(codec, pincfgs); 7295 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7296 spec->gen.preferred_dacs = preferred_pairs; 7297 break; 7298 } 7299 } 7300 7301 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec, 7302 const struct hda_fixup *fix, int action) 7303 { 7304 static const struct hda_pintbl pincfgs[] = { 7305 { 0x14, 0x90170151 }, 7306 { 0x17, 0x90170150 }, 7307 { } 7308 }; 7309 static const hda_nid_t conn[] = { 0x02, 0x03 }; 7310 static const hda_nid_t preferred_pairs[] = { 7311 0x14, 0x02, 7312 0x17, 0x03, 7313 0x21, 0x02, 7314 0 7315 }; 7316 struct alc_spec *spec = codec->spec; 7317 7318 alc_fixup_no_shutup(codec, fix, action); 7319 7320 switch (action) { 7321 case HDA_FIXUP_ACT_PRE_PROBE: 7322 snd_hda_apply_pincfgs(codec, pincfgs); 7323 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7324 spec->gen.preferred_dacs = preferred_pairs; 7325 break; 7326 } 7327 } 7328 7329 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */ 7330 static void alc287_fixup_bind_dacs(struct hda_codec *codec, 7331 const struct hda_fixup *fix, int action) 7332 { 7333 struct alc_spec *spec = codec->spec; 7334 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ 7335 static const hda_nid_t preferred_pairs[] = { 7336 0x17, 0x02, 0x21, 0x03, 0 7337 }; 7338 7339 if (action != HDA_FIXUP_ACT_PRE_PROBE) 7340 return; 7341 7342 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7343 spec->gen.preferred_dacs = preferred_pairs; 7344 spec->gen.auto_mute_via_amp = 1; 7345 if (spec->gen.autocfg.speaker_pins[0] != 0x14) { 7346 snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 7347 0x0); /* Make sure 0x14 was disable */ 7348 } 7349 } 7350 /* Fix none verb table of Headset Mic pin */ 7351 static void alc_fixup_headset_mic(struct hda_codec *codec, 7352 const struct hda_fixup *fix, int action) 7353 { 7354 struct alc_spec *spec = codec->spec; 7355 static const struct hda_pintbl pincfgs[] = { 7356 { 0x19, 0x03a1103c }, 7357 { } 7358 }; 7359 7360 switch (action) { 7361 case HDA_FIXUP_ACT_PRE_PROBE: 7362 snd_hda_apply_pincfgs(codec, pincfgs); 7363 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 7364 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 7365 break; 7366 } 7367 } 7368 7369 static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec, 7370 const struct hda_fixup *fix, int action) 7371 { 7372 /* 7373 * The Pin Complex 0x14 for the treble speakers is wrongly reported as 7374 * unconnected. 7375 * The Pin Complex 0x17 for the bass speakers has the lowest association 7376 * and sequence values so shift it up a bit to squeeze 0x14 in. 7377 */ 7378 static const struct hda_pintbl pincfgs[] = { 7379 { 0x14, 0x90170110 }, // top/treble 7380 { 0x17, 0x90170111 }, // bottom/bass 7381 { } 7382 }; 7383 7384 /* 7385 * Force DAC 0x02 for the bass speakers 0x17. 7386 */ 7387 static const hda_nid_t conn[] = { 0x02 }; 7388 7389 switch (action) { 7390 case HDA_FIXUP_ACT_PRE_PROBE: 7391 snd_hda_apply_pincfgs(codec, pincfgs); 7392 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7393 break; 7394 } 7395 7396 cs35l41_fixup_i2c_two(codec, fix, action); 7397 alc245_fixup_hp_mute_led_coefbit(codec, fix, action); 7398 alc245_fixup_hp_gpio_led(codec, fix, action); 7399 } 7400 7401 /* some changes for Spectre x360 16, 2024 model */ 7402 static void alc245_fixup_hp_spectre_x360_16_aa0xxx(struct hda_codec *codec, 7403 const struct hda_fixup *fix, int action) 7404 { 7405 /* 7406 * The Pin Complex 0x14 for the treble speakers is wrongly reported as 7407 * unconnected. 7408 * The Pin Complex 0x17 for the bass speakers has the lowest association 7409 * and sequence values so shift it up a bit to squeeze 0x14 in. 7410 */ 7411 struct alc_spec *spec = codec->spec; 7412 static const struct hda_pintbl pincfgs[] = { 7413 { 0x14, 0x90170110 }, // top/treble 7414 { 0x17, 0x90170111 }, // bottom/bass 7415 { } 7416 }; 7417 7418 /* 7419 * Force DAC 0x02 for the bass speakers 0x17. 7420 */ 7421 static const hda_nid_t conn[] = { 0x02 }; 7422 7423 switch (action) { 7424 case HDA_FIXUP_ACT_PRE_PROBE: 7425 /* needed for amp of back speakers */ 7426 spec->gpio_mask |= 0x01; 7427 spec->gpio_dir |= 0x01; 7428 snd_hda_apply_pincfgs(codec, pincfgs); 7429 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7430 break; 7431 case HDA_FIXUP_ACT_INIT: 7432 /* need to toggle GPIO to enable the amp of back speakers */ 7433 alc_update_gpio_data(codec, 0x01, true); 7434 msleep(100); 7435 alc_update_gpio_data(codec, 0x01, false); 7436 break; 7437 } 7438 7439 cs35l41_fixup_i2c_two(codec, fix, action); 7440 alc245_fixup_hp_mute_led_coefbit(codec, fix, action); 7441 alc245_fixup_hp_gpio_led(codec, fix, action); 7442 } 7443 7444 /* 7445 * ALC287 PCM hooks 7446 */ 7447 static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo, 7448 struct hda_codec *codec, 7449 struct snd_pcm_substream *substream, 7450 int action) 7451 { 7452 switch (action) { 7453 case HDA_GEN_PCM_ACT_OPEN: 7454 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */ 7455 break; 7456 case HDA_GEN_PCM_ACT_CLOSE: 7457 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */ 7458 break; 7459 } 7460 } 7461 7462 static void alc287_s4_power_gpio3_default(struct hda_codec *codec) 7463 { 7464 if (is_s4_suspend(codec)) { 7465 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */ 7466 } 7467 } 7468 7469 static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec, 7470 const struct hda_fixup *fix, int action) 7471 { 7472 struct alc_spec *spec = codec->spec; 7473 static const struct coef_fw coefs[] = { 7474 WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC300), 7475 WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023), 7476 WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC301), 7477 WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023), 7478 }; 7479 7480 if (action != HDA_FIXUP_ACT_PRE_PROBE) 7481 return; 7482 alc_update_coef_idx(codec, 0x10, 1<<11, 1<<11); 7483 alc_process_coef_fw(codec, coefs); 7484 spec->power_hook = alc287_s4_power_gpio3_default; 7485 spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook; 7486 } 7487 7488 7489 enum { 7490 ALC269_FIXUP_GPIO2, 7491 ALC269_FIXUP_SONY_VAIO, 7492 ALC275_FIXUP_SONY_VAIO_GPIO2, 7493 ALC269_FIXUP_DELL_M101Z, 7494 ALC269_FIXUP_SKU_IGNORE, 7495 ALC269_FIXUP_ASUS_G73JW, 7496 ALC269_FIXUP_ASUS_N7601ZM_PINS, 7497 ALC269_FIXUP_ASUS_N7601ZM, 7498 ALC269_FIXUP_LENOVO_EAPD, 7499 ALC275_FIXUP_SONY_HWEQ, 7500 ALC275_FIXUP_SONY_DISABLE_AAMIX, 7501 ALC271_FIXUP_DMIC, 7502 ALC269_FIXUP_PCM_44K, 7503 ALC269_FIXUP_STEREO_DMIC, 7504 ALC269_FIXUP_HEADSET_MIC, 7505 ALC269_FIXUP_QUANTA_MUTE, 7506 ALC269_FIXUP_LIFEBOOK, 7507 ALC269_FIXUP_LIFEBOOK_EXTMIC, 7508 ALC269_FIXUP_LIFEBOOK_HP_PIN, 7509 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, 7510 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, 7511 ALC269_FIXUP_AMIC, 7512 ALC269_FIXUP_DMIC, 7513 ALC269VB_FIXUP_AMIC, 7514 ALC269VB_FIXUP_DMIC, 7515 ALC269_FIXUP_HP_MUTE_LED, 7516 ALC269_FIXUP_HP_MUTE_LED_MIC1, 7517 ALC269_FIXUP_HP_MUTE_LED_MIC2, 7518 ALC269_FIXUP_HP_MUTE_LED_MIC3, 7519 ALC269_FIXUP_HP_GPIO_LED, 7520 ALC269_FIXUP_HP_GPIO_MIC1_LED, 7521 ALC269_FIXUP_HP_LINE1_MIC1_LED, 7522 ALC269_FIXUP_INV_DMIC, 7523 ALC269_FIXUP_LENOVO_DOCK, 7524 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, 7525 ALC269_FIXUP_NO_SHUTUP, 7526 ALC286_FIXUP_SONY_MIC_NO_PRESENCE, 7527 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, 7528 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 7529 ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST, 7530 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 7531 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 7532 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 7533 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, 7534 ALC269_FIXUP_HEADSET_MODE, 7535 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, 7536 ALC269_FIXUP_ASPIRE_HEADSET_MIC, 7537 ALC269_FIXUP_ASUS_X101_FUNC, 7538 ALC269_FIXUP_ASUS_X101_VERB, 7539 ALC269_FIXUP_ASUS_X101, 7540 ALC271_FIXUP_AMIC_MIC2, 7541 ALC271_FIXUP_HP_GATE_MIC_JACK, 7542 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, 7543 ALC269_FIXUP_ACER_AC700, 7544 ALC269_FIXUP_LIMIT_INT_MIC_BOOST, 7545 ALC269VB_FIXUP_ASUS_ZENBOOK, 7546 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, 7547 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE, 7548 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, 7549 ALC269VB_FIXUP_ORDISSIMO_EVE2, 7550 ALC283_FIXUP_CHROME_BOOK, 7551 ALC283_FIXUP_SENSE_COMBO_JACK, 7552 ALC282_FIXUP_ASUS_TX300, 7553 ALC283_FIXUP_INT_MIC, 7554 ALC290_FIXUP_MONO_SPEAKERS, 7555 ALC290_FIXUP_MONO_SPEAKERS_HSJACK, 7556 ALC290_FIXUP_SUBWOOFER, 7557 ALC290_FIXUP_SUBWOOFER_HSJACK, 7558 ALC269_FIXUP_THINKPAD_ACPI, 7559 ALC269_FIXUP_DMIC_THINKPAD_ACPI, 7560 ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13, 7561 ALC269VC_FIXUP_INFINIX_Y4_MAX, 7562 ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO, 7563 ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 7564 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 7565 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 7566 ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST, 7567 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 7568 ALC255_FIXUP_HEADSET_MODE, 7569 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, 7570 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 7571 ALC292_FIXUP_TPT440_DOCK, 7572 ALC292_FIXUP_TPT440, 7573 ALC283_FIXUP_HEADSET_MIC, 7574 ALC255_FIXUP_MIC_MUTE_LED, 7575 ALC282_FIXUP_ASPIRE_V5_PINS, 7576 ALC269VB_FIXUP_ASPIRE_E1_COEF, 7577 ALC280_FIXUP_HP_GPIO4, 7578 ALC286_FIXUP_HP_GPIO_LED, 7579 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, 7580 ALC280_FIXUP_HP_DOCK_PINS, 7581 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, 7582 ALC280_FIXUP_HP_9480M, 7583 ALC245_FIXUP_HP_X360_AMP, 7584 ALC285_FIXUP_HP_SPECTRE_X360_EB1, 7585 ALC285_FIXUP_HP_ENVY_X360, 7586 ALC288_FIXUP_DELL_HEADSET_MODE, 7587 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, 7588 ALC288_FIXUP_DELL_XPS_13, 7589 ALC288_FIXUP_DISABLE_AAMIX, 7590 ALC292_FIXUP_DELL_E7X_AAMIX, 7591 ALC292_FIXUP_DELL_E7X, 7592 ALC292_FIXUP_DISABLE_AAMIX, 7593 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, 7594 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, 7595 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 7596 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, 7597 ALC275_FIXUP_DELL_XPS, 7598 ALC293_FIXUP_LENOVO_SPK_NOISE, 7599 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 7600 ALC255_FIXUP_DELL_SPK_NOISE, 7601 ALC225_FIXUP_DISABLE_MIC_VREF, 7602 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 7603 ALC295_FIXUP_DISABLE_DAC3, 7604 ALC285_FIXUP_SPEAKER2_TO_DAC1, 7605 ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1, 7606 ALC285_FIXUP_ASUS_HEADSET_MIC, 7607 ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS, 7608 ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1, 7609 ALC285_FIXUP_ASUS_I2C_HEADSET_MIC, 7610 ALC280_FIXUP_HP_HEADSET_MIC, 7611 ALC221_FIXUP_HP_FRONT_MIC, 7612 ALC292_FIXUP_TPT460, 7613 ALC298_FIXUP_SPK_VOLUME, 7614 ALC298_FIXUP_LENOVO_SPK_VOLUME, 7615 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, 7616 ALC269_FIXUP_ATIV_BOOK_8, 7617 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE, 7618 ALC221_FIXUP_HP_MIC_NO_PRESENCE, 7619 ALC256_FIXUP_ASUS_HEADSET_MODE, 7620 ALC256_FIXUP_ASUS_MIC, 7621 ALC256_FIXUP_ASUS_AIO_GPIO2, 7622 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, 7623 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, 7624 ALC233_FIXUP_LENOVO_MULTI_CODECS, 7625 ALC233_FIXUP_ACER_HEADSET_MIC, 7626 ALC294_FIXUP_LENOVO_MIC_LOCATION, 7627 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, 7628 ALC225_FIXUP_S3_POP_NOISE, 7629 ALC700_FIXUP_INTEL_REFERENCE, 7630 ALC274_FIXUP_DELL_BIND_DACS, 7631 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, 7632 ALC298_FIXUP_TPT470_DOCK_FIX, 7633 ALC298_FIXUP_TPT470_DOCK, 7634 ALC255_FIXUP_DUMMY_LINEOUT_VERB, 7635 ALC255_FIXUP_DELL_HEADSET_MIC, 7636 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, 7637 ALC298_FIXUP_HUAWEI_MBX_STEREO, 7638 ALC295_FIXUP_HP_X360, 7639 ALC221_FIXUP_HP_HEADSET_MIC, 7640 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, 7641 ALC295_FIXUP_HP_AUTO_MUTE, 7642 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, 7643 ALC294_FIXUP_ASUS_MIC, 7644 ALC294_FIXUP_ASUS_HEADSET_MIC, 7645 ALC294_FIXUP_ASUS_SPK, 7646 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 7647 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 7648 ALC255_FIXUP_ACER_HEADSET_MIC, 7649 ALC295_FIXUP_CHROME_BOOK, 7650 ALC225_FIXUP_HEADSET_JACK, 7651 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, 7652 ALC225_FIXUP_WYSE_AUTO_MUTE, 7653 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, 7654 ALC286_FIXUP_ACER_AIO_HEADSET_MIC, 7655 ALC256_FIXUP_ASUS_HEADSET_MIC, 7656 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 7657 ALC255_FIXUP_PREDATOR_SUBWOOFER, 7658 ALC299_FIXUP_PREDATOR_SPK, 7659 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, 7660 ALC289_FIXUP_DELL_SPK1, 7661 ALC289_FIXUP_DELL_SPK2, 7662 ALC289_FIXUP_DUAL_SPK, 7663 ALC289_FIXUP_RTK_AMP_DUAL_SPK, 7664 ALC294_FIXUP_SPK2_TO_DAC1, 7665 ALC294_FIXUP_ASUS_DUAL_SPK, 7666 ALC285_FIXUP_THINKPAD_X1_GEN7, 7667 ALC285_FIXUP_THINKPAD_HEADSET_JACK, 7668 ALC294_FIXUP_ASUS_ALLY, 7669 ALC294_FIXUP_ASUS_ALLY_X, 7670 ALC294_FIXUP_ASUS_ALLY_PINS, 7671 ALC294_FIXUP_ASUS_ALLY_VERBS, 7672 ALC294_FIXUP_ASUS_ALLY_SPEAKER, 7673 ALC294_FIXUP_ASUS_HPE, 7674 ALC294_FIXUP_ASUS_COEF_1B, 7675 ALC294_FIXUP_ASUS_GX502_HP, 7676 ALC294_FIXUP_ASUS_GX502_PINS, 7677 ALC294_FIXUP_ASUS_GX502_VERBS, 7678 ALC294_FIXUP_ASUS_GU502_HP, 7679 ALC294_FIXUP_ASUS_GU502_PINS, 7680 ALC294_FIXUP_ASUS_GU502_VERBS, 7681 ALC294_FIXUP_ASUS_G513_PINS, 7682 ALC285_FIXUP_ASUS_G533Z_PINS, 7683 ALC285_FIXUP_HP_GPIO_LED, 7684 ALC285_FIXUP_HP_MUTE_LED, 7685 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED, 7686 ALC236_FIXUP_HP_MUTE_LED_COEFBIT2, 7687 ALC236_FIXUP_HP_GPIO_LED, 7688 ALC236_FIXUP_HP_MUTE_LED, 7689 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, 7690 ALC236_FIXUP_LENOVO_INV_DMIC, 7691 ALC298_FIXUP_SAMSUNG_AMP, 7692 ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS, 7693 ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS, 7694 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 7695 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 7696 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 7697 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, 7698 ALC269VC_FIXUP_ACER_HEADSET_MIC, 7699 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, 7700 ALC289_FIXUP_ASUS_GA401, 7701 ALC289_FIXUP_ASUS_GA502, 7702 ALC256_FIXUP_ACER_MIC_NO_PRESENCE, 7703 ALC285_FIXUP_HP_GPIO_AMP_INIT, 7704 ALC269_FIXUP_CZC_B20, 7705 ALC269_FIXUP_CZC_TMI, 7706 ALC269_FIXUP_CZC_L101, 7707 ALC269_FIXUP_LEMOTE_A1802, 7708 ALC269_FIXUP_LEMOTE_A190X, 7709 ALC256_FIXUP_INTEL_NUC8_RUGGED, 7710 ALC233_FIXUP_INTEL_NUC8_DMIC, 7711 ALC233_FIXUP_INTEL_NUC8_BOOST, 7712 ALC256_FIXUP_INTEL_NUC10, 7713 ALC255_FIXUP_XIAOMI_HEADSET_MIC, 7714 ALC274_FIXUP_HP_MIC, 7715 ALC274_FIXUP_HP_HEADSET_MIC, 7716 ALC274_FIXUP_HP_ENVY_GPIO, 7717 ALC256_FIXUP_ASUS_HPE, 7718 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 7719 ALC287_FIXUP_HP_GPIO_LED, 7720 ALC256_FIXUP_HP_HEADSET_MIC, 7721 ALC245_FIXUP_HP_GPIO_LED, 7722 ALC236_FIXUP_DELL_AIO_HEADSET_MIC, 7723 ALC282_FIXUP_ACER_DISABLE_LINEOUT, 7724 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST, 7725 ALC256_FIXUP_ACER_HEADSET_MIC, 7726 ALC285_FIXUP_IDEAPAD_S740_COEF, 7727 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST, 7728 ALC295_FIXUP_ASUS_DACS, 7729 ALC295_FIXUP_HP_OMEN, 7730 ALC285_FIXUP_HP_SPECTRE_X360, 7731 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, 7732 ALC623_FIXUP_LENOVO_THINKSTATION_P340, 7733 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, 7734 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST, 7735 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS, 7736 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, 7737 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, 7738 ALC298_FIXUP_LENOVO_C940_DUET7, 7739 ALC287_FIXUP_13S_GEN2_SPEAKERS, 7740 ALC256_FIXUP_SET_COEF_DEFAULTS, 7741 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 7742 ALC233_FIXUP_NO_AUDIO_JACK, 7743 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME, 7744 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS, 7745 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, 7746 ALC287_FIXUP_LEGION_16ACHG6, 7747 ALC287_FIXUP_CS35L41_I2C_2, 7748 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED, 7749 ALC287_FIXUP_CS35L41_I2C_4, 7750 ALC245_FIXUP_CS35L41_SPI_2, 7751 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED, 7752 ALC245_FIXUP_CS35L41_SPI_4, 7753 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED, 7754 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED, 7755 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE, 7756 ALC287_FIXUP_LEGION_16ITHG6, 7757 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK, 7758 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, 7759 ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN, 7760 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS, 7761 ALC236_FIXUP_DELL_DUAL_CODECS, 7762 ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, 7763 ALC287_FIXUP_TAS2781_I2C, 7764 ALC287_FIXUP_YOGA7_14ARB7_I2C, 7765 ALC245_FIXUP_HP_MUTE_LED_COEFBIT, 7766 ALC245_FIXUP_HP_X360_MUTE_LEDS, 7767 ALC287_FIXUP_THINKPAD_I2S_SPK, 7768 ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD, 7769 ALC2XX_FIXUP_HEADSET_MIC, 7770 ALC289_FIXUP_DELL_CS35L41_SPI_2, 7771 ALC294_FIXUP_CS35L41_I2C_2, 7772 ALC256_FIXUP_ACER_SFG16_MICMUTE_LED, 7773 ALC256_FIXUP_HEADPHONE_AMP_VOL, 7774 ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX, 7775 ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX, 7776 ALC285_FIXUP_ASUS_GA403U, 7777 ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC, 7778 ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1, 7779 ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC, 7780 ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1, 7781 ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318, 7782 ALC256_FIXUP_CHROME_BOOK, 7783 ALC245_FIXUP_CLEVO_NOISY_MIC, 7784 ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE, 7785 ALC233_FIXUP_MEDION_MTL_SPK, 7786 ALC294_FIXUP_BASS_SPEAKER_15, 7787 }; 7788 7789 /* A special fixup for Lenovo C940 and Yoga Duet 7; 7790 * both have the very same PCI SSID, and we need to apply different fixups 7791 * depending on the codec ID 7792 */ 7793 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec, 7794 const struct hda_fixup *fix, 7795 int action) 7796 { 7797 int id; 7798 7799 if (codec->core.vendor_id == 0x10ec0298) 7800 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */ 7801 else 7802 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */ 7803 __snd_hda_apply_fixup(codec, id, action, 0); 7804 } 7805 7806 static const struct hda_fixup alc269_fixups[] = { 7807 [ALC269_FIXUP_GPIO2] = { 7808 .type = HDA_FIXUP_FUNC, 7809 .v.func = alc_fixup_gpio2, 7810 }, 7811 [ALC269_FIXUP_SONY_VAIO] = { 7812 .type = HDA_FIXUP_PINCTLS, 7813 .v.pins = (const struct hda_pintbl[]) { 7814 {0x19, PIN_VREFGRD}, 7815 {} 7816 } 7817 }, 7818 [ALC275_FIXUP_SONY_VAIO_GPIO2] = { 7819 .type = HDA_FIXUP_FUNC, 7820 .v.func = alc275_fixup_gpio4_off, 7821 .chained = true, 7822 .chain_id = ALC269_FIXUP_SONY_VAIO 7823 }, 7824 [ALC269_FIXUP_DELL_M101Z] = { 7825 .type = HDA_FIXUP_VERBS, 7826 .v.verbs = (const struct hda_verb[]) { 7827 /* Enables internal speaker */ 7828 {0x20, AC_VERB_SET_COEF_INDEX, 13}, 7829 {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, 7830 {} 7831 } 7832 }, 7833 [ALC269_FIXUP_SKU_IGNORE] = { 7834 .type = HDA_FIXUP_FUNC, 7835 .v.func = alc_fixup_sku_ignore, 7836 }, 7837 [ALC269_FIXUP_ASUS_G73JW] = { 7838 .type = HDA_FIXUP_PINS, 7839 .v.pins = (const struct hda_pintbl[]) { 7840 { 0x17, 0x99130111 }, /* subwoofer */ 7841 { } 7842 } 7843 }, 7844 [ALC269_FIXUP_ASUS_N7601ZM_PINS] = { 7845 .type = HDA_FIXUP_PINS, 7846 .v.pins = (const struct hda_pintbl[]) { 7847 { 0x19, 0x03A11050 }, 7848 { 0x1a, 0x03A11C30 }, 7849 { 0x21, 0x03211420 }, 7850 { } 7851 } 7852 }, 7853 [ALC269_FIXUP_ASUS_N7601ZM] = { 7854 .type = HDA_FIXUP_VERBS, 7855 .v.verbs = (const struct hda_verb[]) { 7856 {0x20, AC_VERB_SET_COEF_INDEX, 0x62}, 7857 {0x20, AC_VERB_SET_PROC_COEF, 0xa007}, 7858 {0x20, AC_VERB_SET_COEF_INDEX, 0x10}, 7859 {0x20, AC_VERB_SET_PROC_COEF, 0x8420}, 7860 {0x20, AC_VERB_SET_COEF_INDEX, 0x0f}, 7861 {0x20, AC_VERB_SET_PROC_COEF, 0x7774}, 7862 { } 7863 }, 7864 .chained = true, 7865 .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS, 7866 }, 7867 [ALC269_FIXUP_LENOVO_EAPD] = { 7868 .type = HDA_FIXUP_VERBS, 7869 .v.verbs = (const struct hda_verb[]) { 7870 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, 7871 {} 7872 } 7873 }, 7874 [ALC275_FIXUP_SONY_HWEQ] = { 7875 .type = HDA_FIXUP_FUNC, 7876 .v.func = alc269_fixup_hweq, 7877 .chained = true, 7878 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 7879 }, 7880 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { 7881 .type = HDA_FIXUP_FUNC, 7882 .v.func = alc_fixup_disable_aamix, 7883 .chained = true, 7884 .chain_id = ALC269_FIXUP_SONY_VAIO 7885 }, 7886 [ALC271_FIXUP_DMIC] = { 7887 .type = HDA_FIXUP_FUNC, 7888 .v.func = alc271_fixup_dmic, 7889 }, 7890 [ALC269_FIXUP_PCM_44K] = { 7891 .type = HDA_FIXUP_FUNC, 7892 .v.func = alc269_fixup_pcm_44k, 7893 .chained = true, 7894 .chain_id = ALC269_FIXUP_QUANTA_MUTE 7895 }, 7896 [ALC269_FIXUP_STEREO_DMIC] = { 7897 .type = HDA_FIXUP_FUNC, 7898 .v.func = alc269_fixup_stereo_dmic, 7899 }, 7900 [ALC269_FIXUP_HEADSET_MIC] = { 7901 .type = HDA_FIXUP_FUNC, 7902 .v.func = alc269_fixup_headset_mic, 7903 }, 7904 [ALC269_FIXUP_QUANTA_MUTE] = { 7905 .type = HDA_FIXUP_FUNC, 7906 .v.func = alc269_fixup_quanta_mute, 7907 }, 7908 [ALC269_FIXUP_LIFEBOOK] = { 7909 .type = HDA_FIXUP_PINS, 7910 .v.pins = (const struct hda_pintbl[]) { 7911 { 0x1a, 0x2101103f }, /* dock line-out */ 7912 { 0x1b, 0x23a11040 }, /* dock mic-in */ 7913 { } 7914 }, 7915 .chained = true, 7916 .chain_id = ALC269_FIXUP_QUANTA_MUTE 7917 }, 7918 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { 7919 .type = HDA_FIXUP_PINS, 7920 .v.pins = (const struct hda_pintbl[]) { 7921 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ 7922 { } 7923 }, 7924 }, 7925 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { 7926 .type = HDA_FIXUP_PINS, 7927 .v.pins = (const struct hda_pintbl[]) { 7928 { 0x21, 0x0221102f }, /* HP out */ 7929 { } 7930 }, 7931 }, 7932 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { 7933 .type = HDA_FIXUP_FUNC, 7934 .v.func = alc269_fixup_pincfg_no_hp_to_lineout, 7935 }, 7936 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { 7937 .type = HDA_FIXUP_FUNC, 7938 .v.func = alc269_fixup_pincfg_U7x7_headset_mic, 7939 }, 7940 [ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13] = { 7941 .type = HDA_FIXUP_PINS, 7942 .v.pins = (const struct hda_pintbl[]) { 7943 { 0x14, 0x90170151 }, /* use as internal speaker (LFE) */ 7944 { 0x1b, 0x90170152 }, /* use as internal speaker (back) */ 7945 { } 7946 }, 7947 .chained = true, 7948 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 7949 }, 7950 [ALC269VC_FIXUP_INFINIX_Y4_MAX] = { 7951 .type = HDA_FIXUP_PINS, 7952 .v.pins = (const struct hda_pintbl[]) { 7953 { 0x1b, 0x90170150 }, /* use as internal speaker */ 7954 { } 7955 }, 7956 .chained = true, 7957 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 7958 }, 7959 [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = { 7960 .type = HDA_FIXUP_PINS, 7961 .v.pins = (const struct hda_pintbl[]) { 7962 { 0x18, 0x03a19020 }, /* headset mic */ 7963 { 0x1b, 0x90170150 }, /* speaker */ 7964 { } 7965 }, 7966 }, 7967 [ALC269_FIXUP_AMIC] = { 7968 .type = HDA_FIXUP_PINS, 7969 .v.pins = (const struct hda_pintbl[]) { 7970 { 0x14, 0x99130110 }, /* speaker */ 7971 { 0x15, 0x0121401f }, /* HP out */ 7972 { 0x18, 0x01a19c20 }, /* mic */ 7973 { 0x19, 0x99a3092f }, /* int-mic */ 7974 { } 7975 }, 7976 }, 7977 [ALC269_FIXUP_DMIC] = { 7978 .type = HDA_FIXUP_PINS, 7979 .v.pins = (const struct hda_pintbl[]) { 7980 { 0x12, 0x99a3092f }, /* int-mic */ 7981 { 0x14, 0x99130110 }, /* speaker */ 7982 { 0x15, 0x0121401f }, /* HP out */ 7983 { 0x18, 0x01a19c20 }, /* mic */ 7984 { } 7985 }, 7986 }, 7987 [ALC269VB_FIXUP_AMIC] = { 7988 .type = HDA_FIXUP_PINS, 7989 .v.pins = (const struct hda_pintbl[]) { 7990 { 0x14, 0x99130110 }, /* speaker */ 7991 { 0x18, 0x01a19c20 }, /* mic */ 7992 { 0x19, 0x99a3092f }, /* int-mic */ 7993 { 0x21, 0x0121401f }, /* HP out */ 7994 { } 7995 }, 7996 }, 7997 [ALC269VB_FIXUP_DMIC] = { 7998 .type = HDA_FIXUP_PINS, 7999 .v.pins = (const struct hda_pintbl[]) { 8000 { 0x12, 0x99a3092f }, /* int-mic */ 8001 { 0x14, 0x99130110 }, /* speaker */ 8002 { 0x18, 0x01a19c20 }, /* mic */ 8003 { 0x21, 0x0121401f }, /* HP out */ 8004 { } 8005 }, 8006 }, 8007 [ALC269_FIXUP_HP_MUTE_LED] = { 8008 .type = HDA_FIXUP_FUNC, 8009 .v.func = alc269_fixup_hp_mute_led, 8010 }, 8011 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { 8012 .type = HDA_FIXUP_FUNC, 8013 .v.func = alc269_fixup_hp_mute_led_mic1, 8014 }, 8015 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { 8016 .type = HDA_FIXUP_FUNC, 8017 .v.func = alc269_fixup_hp_mute_led_mic2, 8018 }, 8019 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { 8020 .type = HDA_FIXUP_FUNC, 8021 .v.func = alc269_fixup_hp_mute_led_mic3, 8022 .chained = true, 8023 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE 8024 }, 8025 [ALC269_FIXUP_HP_GPIO_LED] = { 8026 .type = HDA_FIXUP_FUNC, 8027 .v.func = alc269_fixup_hp_gpio_led, 8028 }, 8029 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { 8030 .type = HDA_FIXUP_FUNC, 8031 .v.func = alc269_fixup_hp_gpio_mic1_led, 8032 }, 8033 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { 8034 .type = HDA_FIXUP_FUNC, 8035 .v.func = alc269_fixup_hp_line1_mic1_led, 8036 }, 8037 [ALC269_FIXUP_INV_DMIC] = { 8038 .type = HDA_FIXUP_FUNC, 8039 .v.func = alc_fixup_inv_dmic, 8040 }, 8041 [ALC269_FIXUP_NO_SHUTUP] = { 8042 .type = HDA_FIXUP_FUNC, 8043 .v.func = alc_fixup_no_shutup, 8044 }, 8045 [ALC269_FIXUP_LENOVO_DOCK] = { 8046 .type = HDA_FIXUP_PINS, 8047 .v.pins = (const struct hda_pintbl[]) { 8048 { 0x19, 0x23a11040 }, /* dock mic */ 8049 { 0x1b, 0x2121103f }, /* dock headphone */ 8050 { } 8051 }, 8052 .chained = true, 8053 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT 8054 }, 8055 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { 8056 .type = HDA_FIXUP_FUNC, 8057 .v.func = alc269_fixup_limit_int_mic_boost, 8058 .chained = true, 8059 .chain_id = ALC269_FIXUP_LENOVO_DOCK, 8060 }, 8061 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { 8062 .type = HDA_FIXUP_FUNC, 8063 .v.func = alc269_fixup_pincfg_no_hp_to_lineout, 8064 .chained = true, 8065 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 8066 }, 8067 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8068 .type = HDA_FIXUP_PINS, 8069 .v.pins = (const struct hda_pintbl[]) { 8070 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8071 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8072 { } 8073 }, 8074 .chained = true, 8075 .chain_id = ALC269_FIXUP_HEADSET_MODE 8076 }, 8077 [ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = { 8078 .type = HDA_FIXUP_FUNC, 8079 .v.func = alc269_fixup_limit_int_mic_boost, 8080 .chained = true, 8081 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE 8082 }, 8083 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { 8084 .type = HDA_FIXUP_PINS, 8085 .v.pins = (const struct hda_pintbl[]) { 8086 { 0x16, 0x21014020 }, /* dock line out */ 8087 { 0x19, 0x21a19030 }, /* dock mic */ 8088 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8089 { } 8090 }, 8091 .chained = true, 8092 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8093 }, 8094 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { 8095 .type = HDA_FIXUP_PINS, 8096 .v.pins = (const struct hda_pintbl[]) { 8097 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8098 { } 8099 }, 8100 .chained = true, 8101 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8102 }, 8103 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { 8104 .type = HDA_FIXUP_PINS, 8105 .v.pins = (const struct hda_pintbl[]) { 8106 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8107 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8108 { } 8109 }, 8110 .chained = true, 8111 .chain_id = ALC269_FIXUP_HEADSET_MODE 8112 }, 8113 [ALC269_FIXUP_HEADSET_MODE] = { 8114 .type = HDA_FIXUP_FUNC, 8115 .v.func = alc_fixup_headset_mode, 8116 .chained = true, 8117 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8118 }, 8119 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { 8120 .type = HDA_FIXUP_FUNC, 8121 .v.func = alc_fixup_headset_mode_no_hp_mic, 8122 }, 8123 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { 8124 .type = HDA_FIXUP_PINS, 8125 .v.pins = (const struct hda_pintbl[]) { 8126 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ 8127 { } 8128 }, 8129 .chained = true, 8130 .chain_id = ALC269_FIXUP_HEADSET_MODE, 8131 }, 8132 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { 8133 .type = HDA_FIXUP_PINS, 8134 .v.pins = (const struct hda_pintbl[]) { 8135 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8136 { } 8137 }, 8138 .chained = true, 8139 .chain_id = ALC269_FIXUP_HEADSET_MIC 8140 }, 8141 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { 8142 .type = HDA_FIXUP_PINS, 8143 .v.pins = (const struct hda_pintbl[]) { 8144 {0x12, 0x90a60130}, 8145 {0x13, 0x40000000}, 8146 {0x14, 0x90170110}, 8147 {0x18, 0x411111f0}, 8148 {0x19, 0x04a11040}, 8149 {0x1a, 0x411111f0}, 8150 {0x1b, 0x90170112}, 8151 {0x1d, 0x40759a05}, 8152 {0x1e, 0x411111f0}, 8153 {0x21, 0x04211020}, 8154 { } 8155 }, 8156 .chained = true, 8157 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8158 }, 8159 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { 8160 .type = HDA_FIXUP_FUNC, 8161 .v.func = alc298_fixup_huawei_mbx_stereo, 8162 .chained = true, 8163 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8164 }, 8165 [ALC269_FIXUP_ASUS_X101_FUNC] = { 8166 .type = HDA_FIXUP_FUNC, 8167 .v.func = alc269_fixup_x101_headset_mic, 8168 }, 8169 [ALC269_FIXUP_ASUS_X101_VERB] = { 8170 .type = HDA_FIXUP_VERBS, 8171 .v.verbs = (const struct hda_verb[]) { 8172 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, 8173 {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, 8174 {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, 8175 { } 8176 }, 8177 .chained = true, 8178 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC 8179 }, 8180 [ALC269_FIXUP_ASUS_X101] = { 8181 .type = HDA_FIXUP_PINS, 8182 .v.pins = (const struct hda_pintbl[]) { 8183 { 0x18, 0x04a1182c }, /* Headset mic */ 8184 { } 8185 }, 8186 .chained = true, 8187 .chain_id = ALC269_FIXUP_ASUS_X101_VERB 8188 }, 8189 [ALC271_FIXUP_AMIC_MIC2] = { 8190 .type = HDA_FIXUP_PINS, 8191 .v.pins = (const struct hda_pintbl[]) { 8192 { 0x14, 0x99130110 }, /* speaker */ 8193 { 0x19, 0x01a19c20 }, /* mic */ 8194 { 0x1b, 0x99a7012f }, /* int-mic */ 8195 { 0x21, 0x0121401f }, /* HP out */ 8196 { } 8197 }, 8198 }, 8199 [ALC271_FIXUP_HP_GATE_MIC_JACK] = { 8200 .type = HDA_FIXUP_FUNC, 8201 .v.func = alc271_hp_gate_mic_jack, 8202 .chained = true, 8203 .chain_id = ALC271_FIXUP_AMIC_MIC2, 8204 }, 8205 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { 8206 .type = HDA_FIXUP_FUNC, 8207 .v.func = alc269_fixup_limit_int_mic_boost, 8208 .chained = true, 8209 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, 8210 }, 8211 [ALC269_FIXUP_ACER_AC700] = { 8212 .type = HDA_FIXUP_PINS, 8213 .v.pins = (const struct hda_pintbl[]) { 8214 { 0x12, 0x99a3092f }, /* int-mic */ 8215 { 0x14, 0x99130110 }, /* speaker */ 8216 { 0x18, 0x03a11c20 }, /* mic */ 8217 { 0x1e, 0x0346101e }, /* SPDIF1 */ 8218 { 0x21, 0x0321101f }, /* HP out */ 8219 { } 8220 }, 8221 .chained = true, 8222 .chain_id = ALC271_FIXUP_DMIC, 8223 }, 8224 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { 8225 .type = HDA_FIXUP_FUNC, 8226 .v.func = alc269_fixup_limit_int_mic_boost, 8227 .chained = true, 8228 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 8229 }, 8230 [ALC269VB_FIXUP_ASUS_ZENBOOK] = { 8231 .type = HDA_FIXUP_FUNC, 8232 .v.func = alc269_fixup_limit_int_mic_boost, 8233 .chained = true, 8234 .chain_id = ALC269VB_FIXUP_DMIC, 8235 }, 8236 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { 8237 .type = HDA_FIXUP_VERBS, 8238 .v.verbs = (const struct hda_verb[]) { 8239 /* class-D output amp +5dB */ 8240 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, 8241 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, 8242 {} 8243 }, 8244 .chained = true, 8245 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, 8246 }, 8247 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = { 8248 .type = HDA_FIXUP_PINS, 8249 .v.pins = (const struct hda_pintbl[]) { 8250 { 0x18, 0x01a110f0 }, /* use as headset mic */ 8251 { } 8252 }, 8253 .chained = true, 8254 .chain_id = ALC269_FIXUP_HEADSET_MIC 8255 }, 8256 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { 8257 .type = HDA_FIXUP_FUNC, 8258 .v.func = alc269_fixup_limit_int_mic_boost, 8259 .chained = true, 8260 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, 8261 }, 8262 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { 8263 .type = HDA_FIXUP_PINS, 8264 .v.pins = (const struct hda_pintbl[]) { 8265 { 0x12, 0x99a3092f }, /* int-mic */ 8266 { 0x18, 0x03a11d20 }, /* mic */ 8267 { 0x19, 0x411111f0 }, /* Unused bogus pin */ 8268 { } 8269 }, 8270 }, 8271 [ALC283_FIXUP_CHROME_BOOK] = { 8272 .type = HDA_FIXUP_FUNC, 8273 .v.func = alc283_fixup_chromebook, 8274 }, 8275 [ALC283_FIXUP_SENSE_COMBO_JACK] = { 8276 .type = HDA_FIXUP_FUNC, 8277 .v.func = alc283_fixup_sense_combo_jack, 8278 .chained = true, 8279 .chain_id = ALC283_FIXUP_CHROME_BOOK, 8280 }, 8281 [ALC282_FIXUP_ASUS_TX300] = { 8282 .type = HDA_FIXUP_FUNC, 8283 .v.func = alc282_fixup_asus_tx300, 8284 }, 8285 [ALC283_FIXUP_INT_MIC] = { 8286 .type = HDA_FIXUP_VERBS, 8287 .v.verbs = (const struct hda_verb[]) { 8288 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, 8289 {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, 8290 { } 8291 }, 8292 .chained = true, 8293 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 8294 }, 8295 [ALC290_FIXUP_SUBWOOFER_HSJACK] = { 8296 .type = HDA_FIXUP_PINS, 8297 .v.pins = (const struct hda_pintbl[]) { 8298 { 0x17, 0x90170112 }, /* subwoofer */ 8299 { } 8300 }, 8301 .chained = true, 8302 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, 8303 }, 8304 [ALC290_FIXUP_SUBWOOFER] = { 8305 .type = HDA_FIXUP_PINS, 8306 .v.pins = (const struct hda_pintbl[]) { 8307 { 0x17, 0x90170112 }, /* subwoofer */ 8308 { } 8309 }, 8310 .chained = true, 8311 .chain_id = ALC290_FIXUP_MONO_SPEAKERS, 8312 }, 8313 [ALC290_FIXUP_MONO_SPEAKERS] = { 8314 .type = HDA_FIXUP_FUNC, 8315 .v.func = alc290_fixup_mono_speakers, 8316 }, 8317 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { 8318 .type = HDA_FIXUP_FUNC, 8319 .v.func = alc290_fixup_mono_speakers, 8320 .chained = true, 8321 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 8322 }, 8323 [ALC269_FIXUP_THINKPAD_ACPI] = { 8324 .type = HDA_FIXUP_FUNC, 8325 .v.func = alc_fixup_thinkpad_acpi, 8326 .chained = true, 8327 .chain_id = ALC269_FIXUP_SKU_IGNORE, 8328 }, 8329 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { 8330 .type = HDA_FIXUP_FUNC, 8331 .v.func = alc_fixup_inv_dmic, 8332 .chained = true, 8333 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 8334 }, 8335 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { 8336 .type = HDA_FIXUP_PINS, 8337 .v.pins = (const struct hda_pintbl[]) { 8338 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8339 { } 8340 }, 8341 .chained = true, 8342 .chain_id = ALC255_FIXUP_HEADSET_MODE 8343 }, 8344 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { 8345 .type = HDA_FIXUP_PINS, 8346 .v.pins = (const struct hda_pintbl[]) { 8347 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8348 { } 8349 }, 8350 .chained = true, 8351 .chain_id = ALC255_FIXUP_HEADSET_MODE 8352 }, 8353 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8354 .type = HDA_FIXUP_PINS, 8355 .v.pins = (const struct hda_pintbl[]) { 8356 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8357 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8358 { } 8359 }, 8360 .chained = true, 8361 .chain_id = ALC255_FIXUP_HEADSET_MODE 8362 }, 8363 [ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = { 8364 .type = HDA_FIXUP_FUNC, 8365 .v.func = alc269_fixup_limit_int_mic_boost, 8366 .chained = true, 8367 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 8368 }, 8369 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { 8370 .type = HDA_FIXUP_PINS, 8371 .v.pins = (const struct hda_pintbl[]) { 8372 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8373 { } 8374 }, 8375 .chained = true, 8376 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC 8377 }, 8378 [ALC255_FIXUP_HEADSET_MODE] = { 8379 .type = HDA_FIXUP_FUNC, 8380 .v.func = alc_fixup_headset_mode_alc255, 8381 .chained = true, 8382 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8383 }, 8384 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { 8385 .type = HDA_FIXUP_FUNC, 8386 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, 8387 }, 8388 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8389 .type = HDA_FIXUP_PINS, 8390 .v.pins = (const struct hda_pintbl[]) { 8391 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8392 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8393 { } 8394 }, 8395 .chained = true, 8396 .chain_id = ALC269_FIXUP_HEADSET_MODE 8397 }, 8398 [ALC292_FIXUP_TPT440_DOCK] = { 8399 .type = HDA_FIXUP_FUNC, 8400 .v.func = alc_fixup_tpt440_dock, 8401 .chained = true, 8402 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 8403 }, 8404 [ALC292_FIXUP_TPT440] = { 8405 .type = HDA_FIXUP_FUNC, 8406 .v.func = alc_fixup_disable_aamix, 8407 .chained = true, 8408 .chain_id = ALC292_FIXUP_TPT440_DOCK, 8409 }, 8410 [ALC283_FIXUP_HEADSET_MIC] = { 8411 .type = HDA_FIXUP_PINS, 8412 .v.pins = (const struct hda_pintbl[]) { 8413 { 0x19, 0x04a110f0 }, 8414 { }, 8415 }, 8416 }, 8417 [ALC255_FIXUP_MIC_MUTE_LED] = { 8418 .type = HDA_FIXUP_FUNC, 8419 .v.func = alc_fixup_micmute_led, 8420 }, 8421 [ALC282_FIXUP_ASPIRE_V5_PINS] = { 8422 .type = HDA_FIXUP_PINS, 8423 .v.pins = (const struct hda_pintbl[]) { 8424 { 0x12, 0x90a60130 }, 8425 { 0x14, 0x90170110 }, 8426 { 0x17, 0x40000008 }, 8427 { 0x18, 0x411111f0 }, 8428 { 0x19, 0x01a1913c }, 8429 { 0x1a, 0x411111f0 }, 8430 { 0x1b, 0x411111f0 }, 8431 { 0x1d, 0x40f89b2d }, 8432 { 0x1e, 0x411111f0 }, 8433 { 0x21, 0x0321101f }, 8434 { }, 8435 }, 8436 }, 8437 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = { 8438 .type = HDA_FIXUP_FUNC, 8439 .v.func = alc269vb_fixup_aspire_e1_coef, 8440 }, 8441 [ALC280_FIXUP_HP_GPIO4] = { 8442 .type = HDA_FIXUP_FUNC, 8443 .v.func = alc280_fixup_hp_gpio4, 8444 }, 8445 [ALC286_FIXUP_HP_GPIO_LED] = { 8446 .type = HDA_FIXUP_FUNC, 8447 .v.func = alc286_fixup_hp_gpio_led, 8448 }, 8449 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { 8450 .type = HDA_FIXUP_FUNC, 8451 .v.func = alc280_fixup_hp_gpio2_mic_hotkey, 8452 }, 8453 [ALC280_FIXUP_HP_DOCK_PINS] = { 8454 .type = HDA_FIXUP_PINS, 8455 .v.pins = (const struct hda_pintbl[]) { 8456 { 0x1b, 0x21011020 }, /* line-out */ 8457 { 0x1a, 0x01a1903c }, /* headset mic */ 8458 { 0x18, 0x2181103f }, /* line-in */ 8459 { }, 8460 }, 8461 .chained = true, 8462 .chain_id = ALC280_FIXUP_HP_GPIO4 8463 }, 8464 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { 8465 .type = HDA_FIXUP_PINS, 8466 .v.pins = (const struct hda_pintbl[]) { 8467 { 0x1b, 0x21011020 }, /* line-out */ 8468 { 0x18, 0x2181103f }, /* line-in */ 8469 { }, 8470 }, 8471 .chained = true, 8472 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED 8473 }, 8474 [ALC280_FIXUP_HP_9480M] = { 8475 .type = HDA_FIXUP_FUNC, 8476 .v.func = alc280_fixup_hp_9480m, 8477 }, 8478 [ALC245_FIXUP_HP_X360_AMP] = { 8479 .type = HDA_FIXUP_FUNC, 8480 .v.func = alc245_fixup_hp_x360_amp, 8481 .chained = true, 8482 .chain_id = ALC245_FIXUP_HP_GPIO_LED 8483 }, 8484 [ALC288_FIXUP_DELL_HEADSET_MODE] = { 8485 .type = HDA_FIXUP_FUNC, 8486 .v.func = alc_fixup_headset_mode_dell_alc288, 8487 .chained = true, 8488 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8489 }, 8490 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8491 .type = HDA_FIXUP_PINS, 8492 .v.pins = (const struct hda_pintbl[]) { 8493 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8494 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8495 { } 8496 }, 8497 .chained = true, 8498 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE 8499 }, 8500 [ALC288_FIXUP_DISABLE_AAMIX] = { 8501 .type = HDA_FIXUP_FUNC, 8502 .v.func = alc_fixup_disable_aamix, 8503 .chained = true, 8504 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE 8505 }, 8506 [ALC288_FIXUP_DELL_XPS_13] = { 8507 .type = HDA_FIXUP_FUNC, 8508 .v.func = alc_fixup_dell_xps13, 8509 .chained = true, 8510 .chain_id = ALC288_FIXUP_DISABLE_AAMIX 8511 }, 8512 [ALC292_FIXUP_DISABLE_AAMIX] = { 8513 .type = HDA_FIXUP_FUNC, 8514 .v.func = alc_fixup_disable_aamix, 8515 .chained = true, 8516 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE 8517 }, 8518 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { 8519 .type = HDA_FIXUP_FUNC, 8520 .v.func = alc_fixup_disable_aamix, 8521 .chained = true, 8522 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE 8523 }, 8524 [ALC292_FIXUP_DELL_E7X_AAMIX] = { 8525 .type = HDA_FIXUP_FUNC, 8526 .v.func = alc_fixup_dell_xps13, 8527 .chained = true, 8528 .chain_id = ALC292_FIXUP_DISABLE_AAMIX 8529 }, 8530 [ALC292_FIXUP_DELL_E7X] = { 8531 .type = HDA_FIXUP_FUNC, 8532 .v.func = alc_fixup_micmute_led, 8533 /* micmute fixup must be applied at last */ 8534 .chained_before = true, 8535 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, 8536 }, 8537 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { 8538 .type = HDA_FIXUP_PINS, 8539 .v.pins = (const struct hda_pintbl[]) { 8540 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ 8541 { } 8542 }, 8543 .chained_before = true, 8544 .chain_id = ALC269_FIXUP_HEADSET_MODE, 8545 }, 8546 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8547 .type = HDA_FIXUP_PINS, 8548 .v.pins = (const struct hda_pintbl[]) { 8549 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8550 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8551 { } 8552 }, 8553 .chained = true, 8554 .chain_id = ALC269_FIXUP_HEADSET_MODE 8555 }, 8556 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { 8557 .type = HDA_FIXUP_PINS, 8558 .v.pins = (const struct hda_pintbl[]) { 8559 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8560 { } 8561 }, 8562 .chained = true, 8563 .chain_id = ALC269_FIXUP_HEADSET_MODE 8564 }, 8565 [ALC275_FIXUP_DELL_XPS] = { 8566 .type = HDA_FIXUP_VERBS, 8567 .v.verbs = (const struct hda_verb[]) { 8568 /* Enables internal speaker */ 8569 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, 8570 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, 8571 {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, 8572 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, 8573 {} 8574 } 8575 }, 8576 [ALC293_FIXUP_LENOVO_SPK_NOISE] = { 8577 .type = HDA_FIXUP_FUNC, 8578 .v.func = alc_fixup_disable_aamix, 8579 .chained = true, 8580 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 8581 }, 8582 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { 8583 .type = HDA_FIXUP_FUNC, 8584 .v.func = alc233_fixup_lenovo_line2_mic_hotkey, 8585 }, 8586 [ALC233_FIXUP_INTEL_NUC8_DMIC] = { 8587 .type = HDA_FIXUP_FUNC, 8588 .v.func = alc_fixup_inv_dmic, 8589 .chained = true, 8590 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST, 8591 }, 8592 [ALC233_FIXUP_INTEL_NUC8_BOOST] = { 8593 .type = HDA_FIXUP_FUNC, 8594 .v.func = alc269_fixup_limit_int_mic_boost 8595 }, 8596 [ALC255_FIXUP_DELL_SPK_NOISE] = { 8597 .type = HDA_FIXUP_FUNC, 8598 .v.func = alc_fixup_disable_aamix, 8599 .chained = true, 8600 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 8601 }, 8602 [ALC225_FIXUP_DISABLE_MIC_VREF] = { 8603 .type = HDA_FIXUP_FUNC, 8604 .v.func = alc_fixup_disable_mic_vref, 8605 .chained = true, 8606 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE 8607 }, 8608 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8609 .type = HDA_FIXUP_VERBS, 8610 .v.verbs = (const struct hda_verb[]) { 8611 /* Disable pass-through path for FRONT 14h */ 8612 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, 8613 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, 8614 {} 8615 }, 8616 .chained = true, 8617 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF 8618 }, 8619 [ALC280_FIXUP_HP_HEADSET_MIC] = { 8620 .type = HDA_FIXUP_FUNC, 8621 .v.func = alc_fixup_disable_aamix, 8622 .chained = true, 8623 .chain_id = ALC269_FIXUP_HEADSET_MIC, 8624 }, 8625 [ALC221_FIXUP_HP_FRONT_MIC] = { 8626 .type = HDA_FIXUP_PINS, 8627 .v.pins = (const struct hda_pintbl[]) { 8628 { 0x19, 0x02a19020 }, /* Front Mic */ 8629 { } 8630 }, 8631 }, 8632 [ALC292_FIXUP_TPT460] = { 8633 .type = HDA_FIXUP_FUNC, 8634 .v.func = alc_fixup_tpt440_dock, 8635 .chained = true, 8636 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, 8637 }, 8638 [ALC298_FIXUP_SPK_VOLUME] = { 8639 .type = HDA_FIXUP_FUNC, 8640 .v.func = alc298_fixup_speaker_volume, 8641 .chained = true, 8642 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, 8643 }, 8644 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = { 8645 .type = HDA_FIXUP_FUNC, 8646 .v.func = alc298_fixup_speaker_volume, 8647 }, 8648 [ALC295_FIXUP_DISABLE_DAC3] = { 8649 .type = HDA_FIXUP_FUNC, 8650 .v.func = alc295_fixup_disable_dac3, 8651 }, 8652 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { 8653 .type = HDA_FIXUP_FUNC, 8654 .v.func = alc285_fixup_speaker2_to_dac1, 8655 .chained = true, 8656 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 8657 }, 8658 [ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = { 8659 .type = HDA_FIXUP_FUNC, 8660 .v.func = alc285_fixup_speaker2_to_dac1, 8661 .chained = true, 8662 .chain_id = ALC245_FIXUP_CS35L41_SPI_2 8663 }, 8664 [ALC285_FIXUP_ASUS_HEADSET_MIC] = { 8665 .type = HDA_FIXUP_PINS, 8666 .v.pins = (const struct hda_pintbl[]) { 8667 { 0x19, 0x03a11050 }, 8668 { 0x1b, 0x03a11c30 }, 8669 { } 8670 }, 8671 .chained = true, 8672 .chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1 8673 }, 8674 [ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = { 8675 .type = HDA_FIXUP_PINS, 8676 .v.pins = (const struct hda_pintbl[]) { 8677 { 0x14, 0x90170120 }, 8678 { } 8679 }, 8680 .chained = true, 8681 .chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC 8682 }, 8683 [ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = { 8684 .type = HDA_FIXUP_FUNC, 8685 .v.func = alc285_fixup_speaker2_to_dac1, 8686 .chained = true, 8687 .chain_id = ALC287_FIXUP_CS35L41_I2C_2 8688 }, 8689 [ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = { 8690 .type = HDA_FIXUP_PINS, 8691 .v.pins = (const struct hda_pintbl[]) { 8692 { 0x19, 0x03a11050 }, 8693 { 0x1b, 0x03a11c30 }, 8694 { } 8695 }, 8696 .chained = true, 8697 .chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1 8698 }, 8699 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { 8700 .type = HDA_FIXUP_PINS, 8701 .v.pins = (const struct hda_pintbl[]) { 8702 { 0x1b, 0x90170151 }, 8703 { } 8704 }, 8705 .chained = true, 8706 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 8707 }, 8708 [ALC269_FIXUP_ATIV_BOOK_8] = { 8709 .type = HDA_FIXUP_FUNC, 8710 .v.func = alc_fixup_auto_mute_via_amp, 8711 .chained = true, 8712 .chain_id = ALC269_FIXUP_NO_SHUTUP 8713 }, 8714 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = { 8715 .type = HDA_FIXUP_PINS, 8716 .v.pins = (const struct hda_pintbl[]) { 8717 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8718 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */ 8719 { } 8720 }, 8721 .chained = true, 8722 .chain_id = ALC269_FIXUP_HEADSET_MODE 8723 }, 8724 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { 8725 .type = HDA_FIXUP_PINS, 8726 .v.pins = (const struct hda_pintbl[]) { 8727 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8728 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8729 { } 8730 }, 8731 .chained = true, 8732 .chain_id = ALC269_FIXUP_HEADSET_MODE 8733 }, 8734 [ALC256_FIXUP_ASUS_HEADSET_MODE] = { 8735 .type = HDA_FIXUP_FUNC, 8736 .v.func = alc_fixup_headset_mode, 8737 }, 8738 [ALC256_FIXUP_ASUS_MIC] = { 8739 .type = HDA_FIXUP_PINS, 8740 .v.pins = (const struct hda_pintbl[]) { 8741 { 0x13, 0x90a60160 }, /* use as internal mic */ 8742 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 8743 { } 8744 }, 8745 .chained = true, 8746 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 8747 }, 8748 [ALC256_FIXUP_ASUS_AIO_GPIO2] = { 8749 .type = HDA_FIXUP_FUNC, 8750 /* Set up GPIO2 for the speaker amp */ 8751 .v.func = alc_fixup_gpio4, 8752 }, 8753 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { 8754 .type = HDA_FIXUP_PINS, 8755 .v.pins = (const struct hda_pintbl[]) { 8756 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8757 { } 8758 }, 8759 .chained = true, 8760 .chain_id = ALC269_FIXUP_HEADSET_MIC 8761 }, 8762 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { 8763 .type = HDA_FIXUP_VERBS, 8764 .v.verbs = (const struct hda_verb[]) { 8765 /* Enables internal speaker */ 8766 {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, 8767 {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, 8768 {} 8769 }, 8770 .chained = true, 8771 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE 8772 }, 8773 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { 8774 .type = HDA_FIXUP_FUNC, 8775 .v.func = alc233_alc662_fixup_lenovo_dual_codecs, 8776 .chained = true, 8777 .chain_id = ALC269_FIXUP_GPIO2 8778 }, 8779 [ALC233_FIXUP_ACER_HEADSET_MIC] = { 8780 .type = HDA_FIXUP_VERBS, 8781 .v.verbs = (const struct hda_verb[]) { 8782 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 8783 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 8784 { } 8785 }, 8786 .chained = true, 8787 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE 8788 }, 8789 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { 8790 .type = HDA_FIXUP_PINS, 8791 .v.pins = (const struct hda_pintbl[]) { 8792 /* Change the mic location from front to right, otherwise there are 8793 two front mics with the same name, pulseaudio can't handle them. 8794 This is just a temporary workaround, after applying this fixup, 8795 there will be one "Front Mic" and one "Mic" in this machine. 8796 */ 8797 { 0x1a, 0x04a19040 }, 8798 { } 8799 }, 8800 }, 8801 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { 8802 .type = HDA_FIXUP_PINS, 8803 .v.pins = (const struct hda_pintbl[]) { 8804 { 0x16, 0x0101102f }, /* Rear Headset HP */ 8805 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ 8806 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ 8807 { 0x1b, 0x02011020 }, 8808 { } 8809 }, 8810 .chained = true, 8811 .chain_id = ALC225_FIXUP_S3_POP_NOISE 8812 }, 8813 [ALC225_FIXUP_S3_POP_NOISE] = { 8814 .type = HDA_FIXUP_FUNC, 8815 .v.func = alc225_fixup_s3_pop_noise, 8816 .chained = true, 8817 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8818 }, 8819 [ALC700_FIXUP_INTEL_REFERENCE] = { 8820 .type = HDA_FIXUP_VERBS, 8821 .v.verbs = (const struct hda_verb[]) { 8822 /* Enables internal speaker */ 8823 {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, 8824 {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, 8825 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, 8826 {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, 8827 {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, 8828 {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, 8829 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, 8830 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, 8831 {} 8832 } 8833 }, 8834 [ALC274_FIXUP_DELL_BIND_DACS] = { 8835 .type = HDA_FIXUP_FUNC, 8836 .v.func = alc274_fixup_bind_dacs, 8837 .chained = true, 8838 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE 8839 }, 8840 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { 8841 .type = HDA_FIXUP_PINS, 8842 .v.pins = (const struct hda_pintbl[]) { 8843 { 0x1b, 0x0401102f }, 8844 { } 8845 }, 8846 .chained = true, 8847 .chain_id = ALC274_FIXUP_DELL_BIND_DACS 8848 }, 8849 [ALC298_FIXUP_TPT470_DOCK_FIX] = { 8850 .type = HDA_FIXUP_FUNC, 8851 .v.func = alc_fixup_tpt470_dock, 8852 .chained = true, 8853 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE 8854 }, 8855 [ALC298_FIXUP_TPT470_DOCK] = { 8856 .type = HDA_FIXUP_FUNC, 8857 .v.func = alc_fixup_tpt470_dacs, 8858 .chained = true, 8859 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX 8860 }, 8861 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { 8862 .type = HDA_FIXUP_PINS, 8863 .v.pins = (const struct hda_pintbl[]) { 8864 { 0x14, 0x0201101f }, 8865 { } 8866 }, 8867 .chained = true, 8868 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 8869 }, 8870 [ALC255_FIXUP_DELL_HEADSET_MIC] = { 8871 .type = HDA_FIXUP_PINS, 8872 .v.pins = (const struct hda_pintbl[]) { 8873 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8874 { } 8875 }, 8876 .chained = true, 8877 .chain_id = ALC269_FIXUP_HEADSET_MIC 8878 }, 8879 [ALC295_FIXUP_HP_X360] = { 8880 .type = HDA_FIXUP_FUNC, 8881 .v.func = alc295_fixup_hp_top_speakers, 8882 .chained = true, 8883 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 8884 }, 8885 [ALC221_FIXUP_HP_HEADSET_MIC] = { 8886 .type = HDA_FIXUP_PINS, 8887 .v.pins = (const struct hda_pintbl[]) { 8888 { 0x19, 0x0181313f}, 8889 { } 8890 }, 8891 .chained = true, 8892 .chain_id = ALC269_FIXUP_HEADSET_MIC 8893 }, 8894 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { 8895 .type = HDA_FIXUP_FUNC, 8896 .v.func = alc285_fixup_invalidate_dacs, 8897 .chained = true, 8898 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 8899 }, 8900 [ALC295_FIXUP_HP_AUTO_MUTE] = { 8901 .type = HDA_FIXUP_FUNC, 8902 .v.func = alc_fixup_auto_mute_via_amp, 8903 }, 8904 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { 8905 .type = HDA_FIXUP_PINS, 8906 .v.pins = (const struct hda_pintbl[]) { 8907 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8908 { } 8909 }, 8910 .chained = true, 8911 .chain_id = ALC269_FIXUP_HEADSET_MIC 8912 }, 8913 [ALC294_FIXUP_ASUS_MIC] = { 8914 .type = HDA_FIXUP_PINS, 8915 .v.pins = (const struct hda_pintbl[]) { 8916 { 0x13, 0x90a60160 }, /* use as internal mic */ 8917 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 8918 { } 8919 }, 8920 .chained = true, 8921 .chain_id = ALC269_FIXUP_HEADSET_MIC 8922 }, 8923 [ALC294_FIXUP_ASUS_HEADSET_MIC] = { 8924 .type = HDA_FIXUP_PINS, 8925 .v.pins = (const struct hda_pintbl[]) { 8926 { 0x19, 0x01a1103c }, /* use as headset mic */ 8927 { } 8928 }, 8929 .chained = true, 8930 .chain_id = ALC269_FIXUP_HEADSET_MIC 8931 }, 8932 [ALC294_FIXUP_ASUS_SPK] = { 8933 .type = HDA_FIXUP_VERBS, 8934 .v.verbs = (const struct hda_verb[]) { 8935 /* Set EAPD high */ 8936 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, 8937 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, 8938 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 8939 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, 8940 { } 8941 }, 8942 .chained = true, 8943 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 8944 }, 8945 [ALC295_FIXUP_CHROME_BOOK] = { 8946 .type = HDA_FIXUP_FUNC, 8947 .v.func = alc295_fixup_chromebook, 8948 .chained = true, 8949 .chain_id = ALC225_FIXUP_HEADSET_JACK 8950 }, 8951 [ALC225_FIXUP_HEADSET_JACK] = { 8952 .type = HDA_FIXUP_FUNC, 8953 .v.func = alc_fixup_headset_jack, 8954 }, 8955 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { 8956 .type = HDA_FIXUP_PINS, 8957 .v.pins = (const struct hda_pintbl[]) { 8958 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8959 { } 8960 }, 8961 .chained = true, 8962 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8963 }, 8964 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { 8965 .type = HDA_FIXUP_VERBS, 8966 .v.verbs = (const struct hda_verb[]) { 8967 /* Disable PCBEEP-IN passthrough */ 8968 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, 8969 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, 8970 { } 8971 }, 8972 .chained = true, 8973 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE 8974 }, 8975 [ALC255_FIXUP_ACER_HEADSET_MIC] = { 8976 .type = HDA_FIXUP_PINS, 8977 .v.pins = (const struct hda_pintbl[]) { 8978 { 0x19, 0x03a11130 }, 8979 { 0x1a, 0x90a60140 }, /* use as internal mic */ 8980 { } 8981 }, 8982 .chained = true, 8983 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC 8984 }, 8985 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { 8986 .type = HDA_FIXUP_PINS, 8987 .v.pins = (const struct hda_pintbl[]) { 8988 { 0x16, 0x01011020 }, /* Rear Line out */ 8989 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ 8990 { } 8991 }, 8992 .chained = true, 8993 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE 8994 }, 8995 [ALC225_FIXUP_WYSE_AUTO_MUTE] = { 8996 .type = HDA_FIXUP_FUNC, 8997 .v.func = alc_fixup_auto_mute_via_amp, 8998 .chained = true, 8999 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF 9000 }, 9001 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { 9002 .type = HDA_FIXUP_FUNC, 9003 .v.func = alc_fixup_disable_mic_vref, 9004 .chained = true, 9005 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9006 }, 9007 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { 9008 .type = HDA_FIXUP_VERBS, 9009 .v.verbs = (const struct hda_verb[]) { 9010 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, 9011 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, 9012 { } 9013 }, 9014 .chained = true, 9015 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE 9016 }, 9017 [ALC256_FIXUP_ASUS_HEADSET_MIC] = { 9018 .type = HDA_FIXUP_PINS, 9019 .v.pins = (const struct hda_pintbl[]) { 9020 { 0x19, 0x03a11020 }, /* headset mic with jack detect */ 9021 { } 9022 }, 9023 .chained = true, 9024 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 9025 }, 9026 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { 9027 .type = HDA_FIXUP_PINS, 9028 .v.pins = (const struct hda_pintbl[]) { 9029 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 9030 { } 9031 }, 9032 .chained = true, 9033 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 9034 }, 9035 [ALC255_FIXUP_PREDATOR_SUBWOOFER] = { 9036 .type = HDA_FIXUP_PINS, 9037 .v.pins = (const struct hda_pintbl[]) { 9038 { 0x17, 0x90170151 }, /* use as internal speaker (LFE) */ 9039 { 0x1b, 0x90170152 } /* use as internal speaker (back) */ 9040 } 9041 }, 9042 [ALC299_FIXUP_PREDATOR_SPK] = { 9043 .type = HDA_FIXUP_PINS, 9044 .v.pins = (const struct hda_pintbl[]) { 9045 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ 9046 { } 9047 } 9048 }, 9049 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { 9050 .type = HDA_FIXUP_PINS, 9051 .v.pins = (const struct hda_pintbl[]) { 9052 { 0x19, 0x04a11040 }, 9053 { 0x21, 0x04211020 }, 9054 { } 9055 }, 9056 .chained = true, 9057 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 9058 }, 9059 [ALC289_FIXUP_DELL_SPK1] = { 9060 .type = HDA_FIXUP_PINS, 9061 .v.pins = (const struct hda_pintbl[]) { 9062 { 0x14, 0x90170140 }, 9063 { } 9064 }, 9065 .chained = true, 9066 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE 9067 }, 9068 [ALC289_FIXUP_DELL_SPK2] = { 9069 .type = HDA_FIXUP_PINS, 9070 .v.pins = (const struct hda_pintbl[]) { 9071 { 0x17, 0x90170130 }, /* bass spk */ 9072 { } 9073 }, 9074 .chained = true, 9075 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE 9076 }, 9077 [ALC289_FIXUP_DUAL_SPK] = { 9078 .type = HDA_FIXUP_FUNC, 9079 .v.func = alc285_fixup_speaker2_to_dac1, 9080 .chained = true, 9081 .chain_id = ALC289_FIXUP_DELL_SPK2 9082 }, 9083 [ALC289_FIXUP_RTK_AMP_DUAL_SPK] = { 9084 .type = HDA_FIXUP_FUNC, 9085 .v.func = alc285_fixup_speaker2_to_dac1, 9086 .chained = true, 9087 .chain_id = ALC289_FIXUP_DELL_SPK1 9088 }, 9089 [ALC294_FIXUP_SPK2_TO_DAC1] = { 9090 .type = HDA_FIXUP_FUNC, 9091 .v.func = alc285_fixup_speaker2_to_dac1, 9092 .chained = true, 9093 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 9094 }, 9095 [ALC294_FIXUP_ASUS_DUAL_SPK] = { 9096 .type = HDA_FIXUP_FUNC, 9097 /* The GPIO must be pulled to initialize the AMP */ 9098 .v.func = alc_fixup_gpio4, 9099 .chained = true, 9100 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 9101 }, 9102 [ALC294_FIXUP_ASUS_ALLY] = { 9103 .type = HDA_FIXUP_FUNC, 9104 .v.func = cs35l41_fixup_i2c_two, 9105 .chained = true, 9106 .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS 9107 }, 9108 [ALC294_FIXUP_ASUS_ALLY_X] = { 9109 .type = HDA_FIXUP_FUNC, 9110 .v.func = tas2781_fixup_i2c, 9111 .chained = true, 9112 .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS 9113 }, 9114 [ALC294_FIXUP_ASUS_ALLY_PINS] = { 9115 .type = HDA_FIXUP_PINS, 9116 .v.pins = (const struct hda_pintbl[]) { 9117 { 0x19, 0x03a11050 }, 9118 { 0x1a, 0x03a11c30 }, 9119 { 0x21, 0x03211420 }, 9120 { } 9121 }, 9122 .chained = true, 9123 .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS 9124 }, 9125 [ALC294_FIXUP_ASUS_ALLY_VERBS] = { 9126 .type = HDA_FIXUP_VERBS, 9127 .v.verbs = (const struct hda_verb[]) { 9128 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 9129 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 9130 { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 }, 9131 { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 }, 9132 { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 }, 9133 { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a }, 9134 { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 }, 9135 { 0x20, AC_VERB_SET_PROC_COEF, 0x0049}, 9136 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a }, 9137 { 0x20, AC_VERB_SET_PROC_COEF, 0x201b }, 9138 { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b }, 9139 { 0x20, AC_VERB_SET_PROC_COEF, 0x4278}, 9140 { } 9141 }, 9142 .chained = true, 9143 .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER 9144 }, 9145 [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = { 9146 .type = HDA_FIXUP_FUNC, 9147 .v.func = alc285_fixup_speaker2_to_dac1, 9148 }, 9149 [ALC285_FIXUP_THINKPAD_X1_GEN7] = { 9150 .type = HDA_FIXUP_FUNC, 9151 .v.func = alc285_fixup_thinkpad_x1_gen7, 9152 .chained = true, 9153 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 9154 }, 9155 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { 9156 .type = HDA_FIXUP_FUNC, 9157 .v.func = alc_fixup_headset_jack, 9158 .chained = true, 9159 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 9160 }, 9161 [ALC294_FIXUP_ASUS_HPE] = { 9162 .type = HDA_FIXUP_VERBS, 9163 .v.verbs = (const struct hda_verb[]) { 9164 /* Set EAPD high */ 9165 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 9166 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, 9167 { } 9168 }, 9169 .chained = true, 9170 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 9171 }, 9172 [ALC294_FIXUP_ASUS_GX502_PINS] = { 9173 .type = HDA_FIXUP_PINS, 9174 .v.pins = (const struct hda_pintbl[]) { 9175 { 0x19, 0x03a11050 }, /* front HP mic */ 9176 { 0x1a, 0x01a11830 }, /* rear external mic */ 9177 { 0x21, 0x03211020 }, /* front HP out */ 9178 { } 9179 }, 9180 .chained = true, 9181 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS 9182 }, 9183 [ALC294_FIXUP_ASUS_GX502_VERBS] = { 9184 .type = HDA_FIXUP_VERBS, 9185 .v.verbs = (const struct hda_verb[]) { 9186 /* set 0x15 to HP-OUT ctrl */ 9187 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, 9188 /* unmute the 0x15 amp */ 9189 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, 9190 { } 9191 }, 9192 .chained = true, 9193 .chain_id = ALC294_FIXUP_ASUS_GX502_HP 9194 }, 9195 [ALC294_FIXUP_ASUS_GX502_HP] = { 9196 .type = HDA_FIXUP_FUNC, 9197 .v.func = alc294_fixup_gx502_hp, 9198 }, 9199 [ALC294_FIXUP_ASUS_GU502_PINS] = { 9200 .type = HDA_FIXUP_PINS, 9201 .v.pins = (const struct hda_pintbl[]) { 9202 { 0x19, 0x01a11050 }, /* rear HP mic */ 9203 { 0x1a, 0x01a11830 }, /* rear external mic */ 9204 { 0x21, 0x012110f0 }, /* rear HP out */ 9205 { } 9206 }, 9207 .chained = true, 9208 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS 9209 }, 9210 [ALC294_FIXUP_ASUS_GU502_VERBS] = { 9211 .type = HDA_FIXUP_VERBS, 9212 .v.verbs = (const struct hda_verb[]) { 9213 /* set 0x15 to HP-OUT ctrl */ 9214 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, 9215 /* unmute the 0x15 amp */ 9216 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, 9217 /* set 0x1b to HP-OUT */ 9218 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, 9219 { } 9220 }, 9221 .chained = true, 9222 .chain_id = ALC294_FIXUP_ASUS_GU502_HP 9223 }, 9224 [ALC294_FIXUP_ASUS_GU502_HP] = { 9225 .type = HDA_FIXUP_FUNC, 9226 .v.func = alc294_fixup_gu502_hp, 9227 }, 9228 [ALC294_FIXUP_ASUS_G513_PINS] = { 9229 .type = HDA_FIXUP_PINS, 9230 .v.pins = (const struct hda_pintbl[]) { 9231 { 0x19, 0x03a11050 }, /* front HP mic */ 9232 { 0x1a, 0x03a11c30 }, /* rear external mic */ 9233 { 0x21, 0x03211420 }, /* front HP out */ 9234 { } 9235 }, 9236 }, 9237 [ALC285_FIXUP_ASUS_G533Z_PINS] = { 9238 .type = HDA_FIXUP_PINS, 9239 .v.pins = (const struct hda_pintbl[]) { 9240 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */ 9241 { 0x19, 0x03a19020 }, /* Mic Boost Volume */ 9242 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */ 9243 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */ 9244 { 0x21, 0x03211420 }, 9245 { } 9246 }, 9247 }, 9248 [ALC294_FIXUP_ASUS_COEF_1B] = { 9249 .type = HDA_FIXUP_VERBS, 9250 .v.verbs = (const struct hda_verb[]) { 9251 /* Set bit 10 to correct noisy output after reboot from 9252 * Windows 10 (due to pop noise reduction?) 9253 */ 9254 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, 9255 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, 9256 { } 9257 }, 9258 .chained = true, 9259 .chain_id = ALC289_FIXUP_ASUS_GA401, 9260 }, 9261 [ALC285_FIXUP_HP_GPIO_LED] = { 9262 .type = HDA_FIXUP_FUNC, 9263 .v.func = alc285_fixup_hp_gpio_led, 9264 }, 9265 [ALC285_FIXUP_HP_MUTE_LED] = { 9266 .type = HDA_FIXUP_FUNC, 9267 .v.func = alc285_fixup_hp_mute_led, 9268 }, 9269 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = { 9270 .type = HDA_FIXUP_FUNC, 9271 .v.func = alc285_fixup_hp_spectre_x360_mute_led, 9272 }, 9273 [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = { 9274 .type = HDA_FIXUP_FUNC, 9275 .v.func = alc236_fixup_hp_mute_led_coefbit2, 9276 }, 9277 [ALC236_FIXUP_HP_GPIO_LED] = { 9278 .type = HDA_FIXUP_FUNC, 9279 .v.func = alc236_fixup_hp_gpio_led, 9280 }, 9281 [ALC236_FIXUP_HP_MUTE_LED] = { 9282 .type = HDA_FIXUP_FUNC, 9283 .v.func = alc236_fixup_hp_mute_led, 9284 }, 9285 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = { 9286 .type = HDA_FIXUP_FUNC, 9287 .v.func = alc236_fixup_hp_mute_led_micmute_vref, 9288 }, 9289 [ALC236_FIXUP_LENOVO_INV_DMIC] = { 9290 .type = HDA_FIXUP_FUNC, 9291 .v.func = alc_fixup_inv_dmic, 9292 .chained = true, 9293 .chain_id = ALC283_FIXUP_INT_MIC, 9294 }, 9295 [ALC298_FIXUP_SAMSUNG_AMP] = { 9296 .type = HDA_FIXUP_FUNC, 9297 .v.func = alc298_fixup_samsung_amp, 9298 .chained = true, 9299 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET 9300 }, 9301 [ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS] = { 9302 .type = HDA_FIXUP_FUNC, 9303 .v.func = alc298_fixup_samsung_amp_v2_2_amps 9304 }, 9305 [ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS] = { 9306 .type = HDA_FIXUP_FUNC, 9307 .v.func = alc298_fixup_samsung_amp_v2_4_amps 9308 }, 9309 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { 9310 .type = HDA_FIXUP_VERBS, 9311 .v.verbs = (const struct hda_verb[]) { 9312 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, 9313 { } 9314 }, 9315 }, 9316 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { 9317 .type = HDA_FIXUP_VERBS, 9318 .v.verbs = (const struct hda_verb[]) { 9319 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08}, 9320 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf}, 9321 { } 9322 }, 9323 }, 9324 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { 9325 .type = HDA_FIXUP_PINS, 9326 .v.pins = (const struct hda_pintbl[]) { 9327 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9328 { } 9329 }, 9330 .chained = true, 9331 .chain_id = ALC269_FIXUP_HEADSET_MODE 9332 }, 9333 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { 9334 .type = HDA_FIXUP_PINS, 9335 .v.pins = (const struct hda_pintbl[]) { 9336 { 0x14, 0x90100120 }, /* use as internal speaker */ 9337 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ 9338 { 0x1a, 0x01011020 }, /* use as line out */ 9339 { }, 9340 }, 9341 .chained = true, 9342 .chain_id = ALC269_FIXUP_HEADSET_MIC 9343 }, 9344 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { 9345 .type = HDA_FIXUP_PINS, 9346 .v.pins = (const struct hda_pintbl[]) { 9347 { 0x18, 0x02a11030 }, /* use as headset mic */ 9348 { } 9349 }, 9350 .chained = true, 9351 .chain_id = ALC269_FIXUP_HEADSET_MIC 9352 }, 9353 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { 9354 .type = HDA_FIXUP_PINS, 9355 .v.pins = (const struct hda_pintbl[]) { 9356 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ 9357 { } 9358 }, 9359 .chained = true, 9360 .chain_id = ALC269_FIXUP_HEADSET_MIC 9361 }, 9362 [ALC289_FIXUP_ASUS_GA401] = { 9363 .type = HDA_FIXUP_FUNC, 9364 .v.func = alc289_fixup_asus_ga401, 9365 .chained = true, 9366 .chain_id = ALC289_FIXUP_ASUS_GA502, 9367 }, 9368 [ALC289_FIXUP_ASUS_GA502] = { 9369 .type = HDA_FIXUP_PINS, 9370 .v.pins = (const struct hda_pintbl[]) { 9371 { 0x19, 0x03a11020 }, /* headset mic with jack detect */ 9372 { } 9373 }, 9374 }, 9375 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { 9376 .type = HDA_FIXUP_PINS, 9377 .v.pins = (const struct hda_pintbl[]) { 9378 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ 9379 { } 9380 }, 9381 .chained = true, 9382 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 9383 }, 9384 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { 9385 .type = HDA_FIXUP_FUNC, 9386 .v.func = alc285_fixup_hp_gpio_amp_init, 9387 .chained = true, 9388 .chain_id = ALC285_FIXUP_HP_GPIO_LED 9389 }, 9390 [ALC269_FIXUP_CZC_B20] = { 9391 .type = HDA_FIXUP_PINS, 9392 .v.pins = (const struct hda_pintbl[]) { 9393 { 0x12, 0x411111f0 }, 9394 { 0x14, 0x90170110 }, /* speaker */ 9395 { 0x15, 0x032f1020 }, /* HP out */ 9396 { 0x17, 0x411111f0 }, 9397 { 0x18, 0x03ab1040 }, /* mic */ 9398 { 0x19, 0xb7a7013f }, 9399 { 0x1a, 0x0181305f }, 9400 { 0x1b, 0x411111f0 }, 9401 { 0x1d, 0x411111f0 }, 9402 { 0x1e, 0x411111f0 }, 9403 { } 9404 }, 9405 .chain_id = ALC269_FIXUP_DMIC, 9406 }, 9407 [ALC269_FIXUP_CZC_TMI] = { 9408 .type = HDA_FIXUP_PINS, 9409 .v.pins = (const struct hda_pintbl[]) { 9410 { 0x12, 0x4000c000 }, 9411 { 0x14, 0x90170110 }, /* speaker */ 9412 { 0x15, 0x0421401f }, /* HP out */ 9413 { 0x17, 0x411111f0 }, 9414 { 0x18, 0x04a19020 }, /* mic */ 9415 { 0x19, 0x411111f0 }, 9416 { 0x1a, 0x411111f0 }, 9417 { 0x1b, 0x411111f0 }, 9418 { 0x1d, 0x40448505 }, 9419 { 0x1e, 0x411111f0 }, 9420 { 0x20, 0x8000ffff }, 9421 { } 9422 }, 9423 .chain_id = ALC269_FIXUP_DMIC, 9424 }, 9425 [ALC269_FIXUP_CZC_L101] = { 9426 .type = HDA_FIXUP_PINS, 9427 .v.pins = (const struct hda_pintbl[]) { 9428 { 0x12, 0x40000000 }, 9429 { 0x14, 0x01014010 }, /* speaker */ 9430 { 0x15, 0x411111f0 }, /* HP out */ 9431 { 0x16, 0x411111f0 }, 9432 { 0x18, 0x01a19020 }, /* mic */ 9433 { 0x19, 0x02a19021 }, 9434 { 0x1a, 0x0181302f }, 9435 { 0x1b, 0x0221401f }, 9436 { 0x1c, 0x411111f0 }, 9437 { 0x1d, 0x4044c601 }, 9438 { 0x1e, 0x411111f0 }, 9439 { } 9440 }, 9441 .chain_id = ALC269_FIXUP_DMIC, 9442 }, 9443 [ALC269_FIXUP_LEMOTE_A1802] = { 9444 .type = HDA_FIXUP_PINS, 9445 .v.pins = (const struct hda_pintbl[]) { 9446 { 0x12, 0x40000000 }, 9447 { 0x14, 0x90170110 }, /* speaker */ 9448 { 0x17, 0x411111f0 }, 9449 { 0x18, 0x03a19040 }, /* mic1 */ 9450 { 0x19, 0x90a70130 }, /* mic2 */ 9451 { 0x1a, 0x411111f0 }, 9452 { 0x1b, 0x411111f0 }, 9453 { 0x1d, 0x40489d2d }, 9454 { 0x1e, 0x411111f0 }, 9455 { 0x20, 0x0003ffff }, 9456 { 0x21, 0x03214020 }, 9457 { } 9458 }, 9459 .chain_id = ALC269_FIXUP_DMIC, 9460 }, 9461 [ALC269_FIXUP_LEMOTE_A190X] = { 9462 .type = HDA_FIXUP_PINS, 9463 .v.pins = (const struct hda_pintbl[]) { 9464 { 0x14, 0x99130110 }, /* speaker */ 9465 { 0x15, 0x0121401f }, /* HP out */ 9466 { 0x18, 0x01a19c20 }, /* rear mic */ 9467 { 0x19, 0x99a3092f }, /* front mic */ 9468 { 0x1b, 0x0201401f }, /* front lineout */ 9469 { } 9470 }, 9471 .chain_id = ALC269_FIXUP_DMIC, 9472 }, 9473 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { 9474 .type = HDA_FIXUP_PINS, 9475 .v.pins = (const struct hda_pintbl[]) { 9476 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9477 { } 9478 }, 9479 .chained = true, 9480 .chain_id = ALC269_FIXUP_HEADSET_MODE 9481 }, 9482 [ALC256_FIXUP_INTEL_NUC10] = { 9483 .type = HDA_FIXUP_PINS, 9484 .v.pins = (const struct hda_pintbl[]) { 9485 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9486 { } 9487 }, 9488 .chained = true, 9489 .chain_id = ALC269_FIXUP_HEADSET_MODE 9490 }, 9491 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { 9492 .type = HDA_FIXUP_VERBS, 9493 .v.verbs = (const struct hda_verb[]) { 9494 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 9495 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 9496 { } 9497 }, 9498 .chained = true, 9499 .chain_id = ALC289_FIXUP_ASUS_GA502 9500 }, 9501 [ALC274_FIXUP_HP_MIC] = { 9502 .type = HDA_FIXUP_VERBS, 9503 .v.verbs = (const struct hda_verb[]) { 9504 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 9505 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 9506 { } 9507 }, 9508 }, 9509 [ALC274_FIXUP_HP_HEADSET_MIC] = { 9510 .type = HDA_FIXUP_FUNC, 9511 .v.func = alc274_fixup_hp_headset_mic, 9512 .chained = true, 9513 .chain_id = ALC274_FIXUP_HP_MIC 9514 }, 9515 [ALC274_FIXUP_HP_ENVY_GPIO] = { 9516 .type = HDA_FIXUP_FUNC, 9517 .v.func = alc274_fixup_hp_envy_gpio, 9518 }, 9519 [ALC256_FIXUP_ASUS_HPE] = { 9520 .type = HDA_FIXUP_VERBS, 9521 .v.verbs = (const struct hda_verb[]) { 9522 /* Set EAPD high */ 9523 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 9524 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, 9525 { } 9526 }, 9527 .chained = true, 9528 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 9529 }, 9530 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = { 9531 .type = HDA_FIXUP_FUNC, 9532 .v.func = alc_fixup_headset_jack, 9533 .chained = true, 9534 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 9535 }, 9536 [ALC287_FIXUP_HP_GPIO_LED] = { 9537 .type = HDA_FIXUP_FUNC, 9538 .v.func = alc287_fixup_hp_gpio_led, 9539 }, 9540 [ALC256_FIXUP_HP_HEADSET_MIC] = { 9541 .type = HDA_FIXUP_FUNC, 9542 .v.func = alc274_fixup_hp_headset_mic, 9543 }, 9544 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = { 9545 .type = HDA_FIXUP_FUNC, 9546 .v.func = alc_fixup_no_int_mic, 9547 .chained = true, 9548 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 9549 }, 9550 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = { 9551 .type = HDA_FIXUP_PINS, 9552 .v.pins = (const struct hda_pintbl[]) { 9553 { 0x1b, 0x411111f0 }, 9554 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9555 { }, 9556 }, 9557 .chained = true, 9558 .chain_id = ALC269_FIXUP_HEADSET_MODE 9559 }, 9560 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = { 9561 .type = HDA_FIXUP_FUNC, 9562 .v.func = alc269_fixup_limit_int_mic_boost, 9563 .chained = true, 9564 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 9565 }, 9566 [ALC256_FIXUP_ACER_HEADSET_MIC] = { 9567 .type = HDA_FIXUP_PINS, 9568 .v.pins = (const struct hda_pintbl[]) { 9569 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */ 9570 { 0x1a, 0x90a1092f }, /* use as internal mic */ 9571 { } 9572 }, 9573 .chained = true, 9574 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9575 }, 9576 [ALC285_FIXUP_IDEAPAD_S740_COEF] = { 9577 .type = HDA_FIXUP_FUNC, 9578 .v.func = alc285_fixup_ideapad_s740_coef, 9579 .chained = true, 9580 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 9581 }, 9582 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { 9583 .type = HDA_FIXUP_FUNC, 9584 .v.func = alc269_fixup_limit_int_mic_boost, 9585 .chained = true, 9586 .chain_id = ALC285_FIXUP_HP_MUTE_LED, 9587 }, 9588 [ALC295_FIXUP_ASUS_DACS] = { 9589 .type = HDA_FIXUP_FUNC, 9590 .v.func = alc295_fixup_asus_dacs, 9591 }, 9592 [ALC295_FIXUP_HP_OMEN] = { 9593 .type = HDA_FIXUP_PINS, 9594 .v.pins = (const struct hda_pintbl[]) { 9595 { 0x12, 0xb7a60130 }, 9596 { 0x13, 0x40000000 }, 9597 { 0x14, 0x411111f0 }, 9598 { 0x16, 0x411111f0 }, 9599 { 0x17, 0x90170110 }, 9600 { 0x18, 0x411111f0 }, 9601 { 0x19, 0x02a11030 }, 9602 { 0x1a, 0x411111f0 }, 9603 { 0x1b, 0x04a19030 }, 9604 { 0x1d, 0x40600001 }, 9605 { 0x1e, 0x411111f0 }, 9606 { 0x21, 0x03211020 }, 9607 {} 9608 }, 9609 .chained = true, 9610 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED, 9611 }, 9612 [ALC285_FIXUP_HP_SPECTRE_X360] = { 9613 .type = HDA_FIXUP_FUNC, 9614 .v.func = alc285_fixup_hp_spectre_x360, 9615 }, 9616 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = { 9617 .type = HDA_FIXUP_FUNC, 9618 .v.func = alc285_fixup_hp_spectre_x360_eb1 9619 }, 9620 [ALC285_FIXUP_HP_ENVY_X360] = { 9621 .type = HDA_FIXUP_FUNC, 9622 .v.func = alc285_fixup_hp_envy_x360, 9623 .chained = true, 9624 .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT, 9625 }, 9626 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { 9627 .type = HDA_FIXUP_FUNC, 9628 .v.func = alc285_fixup_ideapad_s740_coef, 9629 .chained = true, 9630 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 9631 }, 9632 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = { 9633 .type = HDA_FIXUP_FUNC, 9634 .v.func = alc_fixup_no_shutup, 9635 .chained = true, 9636 .chain_id = ALC283_FIXUP_HEADSET_MIC, 9637 }, 9638 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = { 9639 .type = HDA_FIXUP_PINS, 9640 .v.pins = (const struct hda_pintbl[]) { 9641 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */ 9642 { } 9643 }, 9644 .chained = true, 9645 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC 9646 }, 9647 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { 9648 .type = HDA_FIXUP_FUNC, 9649 .v.func = alc269_fixup_limit_int_mic_boost, 9650 .chained = true, 9651 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, 9652 }, 9653 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = { 9654 .type = HDA_FIXUP_FUNC, 9655 .v.func = alc285_fixup_ideapad_s740_coef, 9656 .chained = true, 9657 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, 9658 }, 9659 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = { 9660 .type = HDA_FIXUP_FUNC, 9661 .v.func = alc287_fixup_legion_15imhg05_speakers, 9662 .chained = true, 9663 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 9664 }, 9665 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = { 9666 .type = HDA_FIXUP_VERBS, 9667 //.v.verbs = legion_15imhg05_coefs, 9668 .v.verbs = (const struct hda_verb[]) { 9669 // set left speaker Legion 7i. 9670 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9671 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9672 9673 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9674 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9675 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9676 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, 9677 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9678 9679 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9680 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9681 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9682 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9683 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9684 9685 // set right speaker Legion 7i. 9686 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9687 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, 9688 9689 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9690 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9691 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9692 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, 9693 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9694 9695 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9696 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9697 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9698 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9699 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9700 {} 9701 }, 9702 .chained = true, 9703 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, 9704 }, 9705 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = { 9706 .type = HDA_FIXUP_FUNC, 9707 .v.func = alc287_fixup_legion_15imhg05_speakers, 9708 .chained = true, 9709 .chain_id = ALC269_FIXUP_HEADSET_MODE, 9710 }, 9711 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = { 9712 .type = HDA_FIXUP_VERBS, 9713 .v.verbs = (const struct hda_verb[]) { 9714 // set left speaker Yoga 7i. 9715 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9716 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9717 9718 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9719 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9720 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9721 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, 9722 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9723 9724 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9725 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9726 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9727 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9728 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9729 9730 // set right speaker Yoga 7i. 9731 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9732 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, 9733 9734 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9735 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9736 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9737 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, 9738 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9739 9740 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9741 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9742 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9743 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9744 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9745 {} 9746 }, 9747 .chained = true, 9748 .chain_id = ALC269_FIXUP_HEADSET_MODE, 9749 }, 9750 [ALC298_FIXUP_LENOVO_C940_DUET7] = { 9751 .type = HDA_FIXUP_FUNC, 9752 .v.func = alc298_fixup_lenovo_c940_duet7, 9753 }, 9754 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = { 9755 .type = HDA_FIXUP_VERBS, 9756 .v.verbs = (const struct hda_verb[]) { 9757 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9758 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9759 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9760 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9761 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9762 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9763 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9764 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9765 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, 9766 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9767 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9768 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9769 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9770 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9771 {} 9772 }, 9773 .chained = true, 9774 .chain_id = ALC269_FIXUP_HEADSET_MODE, 9775 }, 9776 [ALC256_FIXUP_SET_COEF_DEFAULTS] = { 9777 .type = HDA_FIXUP_FUNC, 9778 .v.func = alc256_fixup_set_coef_defaults, 9779 }, 9780 [ALC245_FIXUP_HP_GPIO_LED] = { 9781 .type = HDA_FIXUP_FUNC, 9782 .v.func = alc245_fixup_hp_gpio_led, 9783 }, 9784 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { 9785 .type = HDA_FIXUP_PINS, 9786 .v.pins = (const struct hda_pintbl[]) { 9787 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */ 9788 { } 9789 }, 9790 .chained = true, 9791 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, 9792 }, 9793 [ALC233_FIXUP_NO_AUDIO_JACK] = { 9794 .type = HDA_FIXUP_FUNC, 9795 .v.func = alc233_fixup_no_audio_jack, 9796 }, 9797 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = { 9798 .type = HDA_FIXUP_FUNC, 9799 .v.func = alc256_fixup_mic_no_presence_and_resume, 9800 .chained = true, 9801 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9802 }, 9803 [ALC287_FIXUP_LEGION_16ACHG6] = { 9804 .type = HDA_FIXUP_FUNC, 9805 .v.func = alc287_fixup_legion_16achg6_speakers, 9806 }, 9807 [ALC287_FIXUP_CS35L41_I2C_2] = { 9808 .type = HDA_FIXUP_FUNC, 9809 .v.func = cs35l41_fixup_i2c_two, 9810 }, 9811 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = { 9812 .type = HDA_FIXUP_FUNC, 9813 .v.func = cs35l41_fixup_i2c_two, 9814 .chained = true, 9815 .chain_id = ALC285_FIXUP_HP_MUTE_LED, 9816 }, 9817 [ALC287_FIXUP_CS35L41_I2C_4] = { 9818 .type = HDA_FIXUP_FUNC, 9819 .v.func = cs35l41_fixup_i2c_four, 9820 }, 9821 [ALC245_FIXUP_CS35L41_SPI_2] = { 9822 .type = HDA_FIXUP_FUNC, 9823 .v.func = cs35l41_fixup_spi_two, 9824 }, 9825 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = { 9826 .type = HDA_FIXUP_FUNC, 9827 .v.func = cs35l41_fixup_spi_two, 9828 .chained = true, 9829 .chain_id = ALC285_FIXUP_HP_GPIO_LED, 9830 }, 9831 [ALC245_FIXUP_CS35L41_SPI_4] = { 9832 .type = HDA_FIXUP_FUNC, 9833 .v.func = cs35l41_fixup_spi_four, 9834 }, 9835 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = { 9836 .type = HDA_FIXUP_FUNC, 9837 .v.func = cs35l41_fixup_spi_four, 9838 .chained = true, 9839 .chain_id = ALC285_FIXUP_HP_GPIO_LED, 9840 }, 9841 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = { 9842 .type = HDA_FIXUP_VERBS, 9843 .v.verbs = (const struct hda_verb[]) { 9844 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 }, 9845 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 }, 9846 { } 9847 }, 9848 .chained = true, 9849 .chain_id = ALC285_FIXUP_HP_MUTE_LED, 9850 }, 9851 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = { 9852 .type = HDA_FIXUP_FUNC, 9853 .v.func = alc_fixup_dell4_mic_no_presence_quiet, 9854 .chained = true, 9855 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 9856 }, 9857 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = { 9858 .type = HDA_FIXUP_PINS, 9859 .v.pins = (const struct hda_pintbl[]) { 9860 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */ 9861 { } 9862 }, 9863 .chained = true, 9864 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9865 }, 9866 [ALC287_FIXUP_LEGION_16ITHG6] = { 9867 .type = HDA_FIXUP_FUNC, 9868 .v.func = alc287_fixup_legion_16ithg6_speakers, 9869 }, 9870 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = { 9871 .type = HDA_FIXUP_VERBS, 9872 .v.verbs = (const struct hda_verb[]) { 9873 // enable left speaker 9874 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9875 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9876 9877 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9878 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9879 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9880 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, 9881 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9882 9883 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9884 { 0x20, AC_VERB_SET_PROC_COEF, 0xf }, 9885 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9886 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, 9887 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9888 9889 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9890 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 }, 9891 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9892 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 }, 9893 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9894 9895 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9896 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9897 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9898 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9899 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9900 9901 // enable right speaker 9902 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9903 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, 9904 9905 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9906 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9907 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9908 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, 9909 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9910 9911 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9912 { 0x20, AC_VERB_SET_PROC_COEF, 0xf }, 9913 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9914 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, 9915 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9916 9917 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9918 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 }, 9919 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9920 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 }, 9921 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9922 9923 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9924 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9925 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9926 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9927 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9928 9929 { }, 9930 }, 9931 }, 9932 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = { 9933 .type = HDA_FIXUP_FUNC, 9934 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin, 9935 .chained = true, 9936 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK, 9937 }, 9938 [ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = { 9939 .type = HDA_FIXUP_FUNC, 9940 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin, 9941 .chained = true, 9942 .chain_id = ALC287_FIXUP_CS35L41_I2C_2, 9943 }, 9944 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = { 9945 .type = HDA_FIXUP_FUNC, 9946 .v.func = alc295_fixup_dell_inspiron_top_speakers, 9947 .chained = true, 9948 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 9949 }, 9950 [ALC236_FIXUP_DELL_DUAL_CODECS] = { 9951 .type = HDA_FIXUP_PINS, 9952 .v.func = alc1220_fixup_gb_dual_codecs, 9953 .chained = true, 9954 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 9955 }, 9956 [ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = { 9957 .type = HDA_FIXUP_FUNC, 9958 .v.func = cs35l41_fixup_i2c_two, 9959 .chained = true, 9960 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 9961 }, 9962 [ALC287_FIXUP_TAS2781_I2C] = { 9963 .type = HDA_FIXUP_FUNC, 9964 .v.func = tas2781_fixup_i2c, 9965 .chained = true, 9966 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 9967 }, 9968 [ALC287_FIXUP_YOGA7_14ARB7_I2C] = { 9969 .type = HDA_FIXUP_FUNC, 9970 .v.func = yoga7_14arb7_fixup_i2c, 9971 .chained = true, 9972 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 9973 }, 9974 [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = { 9975 .type = HDA_FIXUP_FUNC, 9976 .v.func = alc245_fixup_hp_mute_led_coefbit, 9977 }, 9978 [ALC245_FIXUP_HP_X360_MUTE_LEDS] = { 9979 .type = HDA_FIXUP_FUNC, 9980 .v.func = alc245_fixup_hp_mute_led_coefbit, 9981 .chained = true, 9982 .chain_id = ALC245_FIXUP_HP_GPIO_LED 9983 }, 9984 [ALC287_FIXUP_THINKPAD_I2S_SPK] = { 9985 .type = HDA_FIXUP_FUNC, 9986 .v.func = alc287_fixup_bind_dacs, 9987 .chained = true, 9988 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 9989 }, 9990 [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = { 9991 .type = HDA_FIXUP_FUNC, 9992 .v.func = alc287_fixup_bind_dacs, 9993 .chained = true, 9994 .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, 9995 }, 9996 [ALC2XX_FIXUP_HEADSET_MIC] = { 9997 .type = HDA_FIXUP_FUNC, 9998 .v.func = alc_fixup_headset_mic, 9999 }, 10000 [ALC289_FIXUP_DELL_CS35L41_SPI_2] = { 10001 .type = HDA_FIXUP_FUNC, 10002 .v.func = cs35l41_fixup_spi_two, 10003 .chained = true, 10004 .chain_id = ALC289_FIXUP_DUAL_SPK 10005 }, 10006 [ALC294_FIXUP_CS35L41_I2C_2] = { 10007 .type = HDA_FIXUP_FUNC, 10008 .v.func = cs35l41_fixup_i2c_two, 10009 }, 10010 [ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = { 10011 .type = HDA_FIXUP_FUNC, 10012 .v.func = alc256_fixup_acer_sfg16_micmute_led, 10013 }, 10014 [ALC256_FIXUP_HEADPHONE_AMP_VOL] = { 10015 .type = HDA_FIXUP_FUNC, 10016 .v.func = alc256_decrease_headphone_amp_val, 10017 }, 10018 [ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = { 10019 .type = HDA_FIXUP_FUNC, 10020 .v.func = alc245_fixup_hp_spectre_x360_eu0xxx, 10021 }, 10022 [ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX] = { 10023 .type = HDA_FIXUP_FUNC, 10024 .v.func = alc245_fixup_hp_spectre_x360_16_aa0xxx, 10025 }, 10026 [ALC285_FIXUP_ASUS_GA403U] = { 10027 .type = HDA_FIXUP_FUNC, 10028 .v.func = alc285_fixup_asus_ga403u, 10029 }, 10030 [ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = { 10031 .type = HDA_FIXUP_PINS, 10032 .v.pins = (const struct hda_pintbl[]) { 10033 { 0x19, 0x03a11050 }, 10034 { 0x1b, 0x03a11c30 }, 10035 { } 10036 }, 10037 .chained = true, 10038 .chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1 10039 }, 10040 [ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = { 10041 .type = HDA_FIXUP_FUNC, 10042 .v.func = alc285_fixup_speaker2_to_dac1, 10043 .chained = true, 10044 .chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC, 10045 }, 10046 [ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = { 10047 .type = HDA_FIXUP_PINS, 10048 .v.pins = (const struct hda_pintbl[]) { 10049 { 0x19, 0x03a11050 }, 10050 { 0x1b, 0x03a11c30 }, 10051 { } 10052 }, 10053 }, 10054 [ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = { 10055 .type = HDA_FIXUP_FUNC, 10056 .v.func = alc285_fixup_speaker2_to_dac1, 10057 .chained = true, 10058 .chain_id = ALC285_FIXUP_ASUS_GA403U, 10059 }, 10060 [ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = { 10061 .type = HDA_FIXUP_FUNC, 10062 .v.func = alc287_fixup_lenovo_thinkpad_with_alc1318, 10063 .chained = true, 10064 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 10065 }, 10066 [ALC256_FIXUP_CHROME_BOOK] = { 10067 .type = HDA_FIXUP_FUNC, 10068 .v.func = alc256_fixup_chromebook, 10069 .chained = true, 10070 .chain_id = ALC225_FIXUP_HEADSET_JACK 10071 }, 10072 [ALC245_FIXUP_CLEVO_NOISY_MIC] = { 10073 .type = HDA_FIXUP_FUNC, 10074 .v.func = alc269_fixup_limit_int_mic_boost, 10075 .chained = true, 10076 .chain_id = ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 10077 }, 10078 [ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE] = { 10079 .type = HDA_FIXUP_PINS, 10080 .v.pins = (const struct hda_pintbl[]) { 10081 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 10082 { 0x1b, 0x20a11040 }, /* dock mic */ 10083 { } 10084 }, 10085 .chained = true, 10086 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 10087 }, 10088 [ALC233_FIXUP_MEDION_MTL_SPK] = { 10089 .type = HDA_FIXUP_PINS, 10090 .v.pins = (const struct hda_pintbl[]) { 10091 { 0x1b, 0x90170110 }, 10092 { } 10093 }, 10094 }, 10095 [ALC294_FIXUP_BASS_SPEAKER_15] = { 10096 .type = HDA_FIXUP_FUNC, 10097 .v.func = alc294_fixup_bass_speaker_15, 10098 }, 10099 }; 10100 10101 static const struct hda_quirk alc269_fixup_tbl[] = { 10102 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), 10103 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 10104 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 10105 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), 10106 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10107 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), 10108 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), 10109 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 10110 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 10111 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), 10112 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10113 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF), 10114 SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), 10115 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK), 10116 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), 10117 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), 10118 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), 10119 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), 10120 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10121 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10122 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK), 10123 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK), 10124 SND_PCI_QUIRK(0x1025, 0x1177, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER), 10125 SND_PCI_QUIRK(0x1025, 0x1178, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER), 10126 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), 10127 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), 10128 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), 10129 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC), 10130 SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10131 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10132 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10133 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10134 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC), 10135 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10136 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10137 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10138 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), 10139 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), 10140 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10141 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10142 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10143 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), 10144 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10145 SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED), 10146 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 10147 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X), 10148 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), 10149 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), 10150 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), 10151 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), 10152 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), 10153 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), 10154 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 10155 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 10156 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 10157 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), 10158 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), 10159 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), 10160 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), 10161 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), 10162 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10163 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10164 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), 10165 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 10166 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), 10167 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 10168 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10169 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10170 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10171 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10172 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10173 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10174 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10175 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), 10176 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), 10177 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), 10178 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), 10179 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), 10180 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), 10181 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), 10182 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), 10183 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 10184 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 10185 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), 10186 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), 10187 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), 10188 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), 10189 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), 10190 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 10191 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), 10192 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), 10193 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 10194 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 10195 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 10196 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 10197 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET), 10198 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), 10199 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK), 10200 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK), 10201 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 10202 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 10203 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK), 10204 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK), 10205 SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2), 10206 SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2), 10207 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10208 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10209 SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10210 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 10211 SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10212 SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10213 SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10214 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 10215 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 10216 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 10217 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 10218 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 10219 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 10220 SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10221 SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4), 10222 SND_PCI_QUIRK(0x1028, 0x0c94, "Dell Polaris 3 metal", ALC287_FIXUP_TAS2781_I2C), 10223 SND_PCI_QUIRK(0x1028, 0x0c96, "Dell Polaris 2in1", ALC287_FIXUP_TAS2781_I2C), 10224 SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10225 SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10226 SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10227 SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10228 SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10229 SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10230 SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10231 SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10232 SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10233 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10234 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10235 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 10236 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), 10237 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), 10238 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10239 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10240 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10241 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10242 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), 10243 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10244 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10245 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10246 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10247 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10248 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10249 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10250 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10251 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10252 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10253 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10254 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10255 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10256 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), 10257 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), 10258 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10259 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10260 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10261 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10262 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10263 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10264 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10265 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10266 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), 10267 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10268 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), 10269 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10270 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), 10271 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10272 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10273 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10274 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10275 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10276 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10277 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10278 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10279 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10280 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10281 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10282 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10283 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10284 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10285 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), 10286 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10287 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10288 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10289 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10290 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10291 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10292 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE), 10293 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10294 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10295 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC), 10296 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC), 10297 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360), 10298 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), 10299 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), 10300 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10301 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10302 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10303 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10304 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10305 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10306 SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10307 SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10308 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), 10309 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10310 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), 10311 SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10312 SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360), 10313 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10314 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10315 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), 10316 SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10317 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), 10318 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10319 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10320 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED), 10321 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10322 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10323 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), 10324 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED), 10325 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), 10326 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10327 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10328 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10329 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), 10330 SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10331 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), 10332 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), 10333 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation", 10334 ALC285_FIXUP_HP_GPIO_AMP_INIT), 10335 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", 10336 ALC285_FIXUP_HP_GPIO_AMP_INIT), 10337 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 10338 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 10339 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 10340 SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10341 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), 10342 SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10343 SND_PCI_QUIRK(0x103c, 0x87df, "HP ProBook 430 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10344 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10345 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10346 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10347 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10348 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), 10349 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), 10350 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 10351 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 10352 SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10353 SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10354 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10355 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10356 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10357 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10358 SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10359 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10360 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10361 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10362 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10363 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10364 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10365 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10366 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10367 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10368 SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10369 SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10370 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), 10371 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED), 10372 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), 10373 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10374 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), 10375 SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED), 10376 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED), 10377 SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10378 SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED), 10379 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10380 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10381 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10382 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10383 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10384 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10385 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10386 SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED), 10387 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4), 10388 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), 10389 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), 10390 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10391 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2), 10392 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10393 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2), 10394 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED), 10395 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED), 10396 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED), 10397 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED), 10398 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED), 10399 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10400 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10401 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10402 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10403 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10404 SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10405 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED), 10406 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10407 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 10408 SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2), 10409 SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10410 SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10411 SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10412 SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10413 SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10414 SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10415 SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10416 SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10417 SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4), 10418 SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10419 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10420 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), 10421 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED), 10422 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED), 10423 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED), 10424 SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED), 10425 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10426 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10427 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10428 SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10429 SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10430 SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10431 SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10432 SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED), 10433 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10434 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10435 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10436 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10437 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10438 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10439 SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10440 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10441 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10442 SND_PCI_QUIRK(0x103c, 0x8b5f, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10443 SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10444 SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10445 SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10446 SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10447 SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10448 SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10449 SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2), 10450 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED), 10451 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED), 10452 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED), 10453 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED), 10454 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED), 10455 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED), 10456 SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10457 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10458 SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10459 SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10460 SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2), 10461 SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2), 10462 SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10463 SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10464 SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10465 SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10466 SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10467 SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10468 SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10469 SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10470 SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10471 SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10472 SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10473 SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10474 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED), 10475 SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX), 10476 SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre x360 2-in-1 Laptop 16-aa0xxx", ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX), 10477 SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2), 10478 SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10479 SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 10480 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10481 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10482 SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10483 SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10484 SND_PCI_QUIRK(0x103c, 0x8c4d, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2), 10485 SND_PCI_QUIRK(0x103c, 0x8c4e, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2), 10486 SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10487 SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10488 SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10489 SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC285_FIXUP_HP_GPIO_LED), 10490 SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC285_FIXUP_HP_GPIO_LED), 10491 SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10492 SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10493 SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10494 SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10495 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10496 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10497 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10498 SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10499 SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10500 SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10501 SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10502 SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10503 SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10504 SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10505 SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED), 10506 SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED), 10507 SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), 10508 SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED), 10509 SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED), 10510 SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED), 10511 SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), 10512 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10513 SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10514 SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED), 10515 SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED), 10516 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10517 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10518 SND_PCI_QUIRK(0x103c, 0x8caf, "HP Elite mt645 G8 Mobile Thin Client", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10519 SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10520 SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2), 10521 SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2), 10522 SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10523 SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10524 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10525 SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED), 10526 SND_PCI_QUIRK(0x103c, 0x8d84, "HP EliteBook X G1i", ALC285_FIXUP_HP_GPIO_LED), 10527 SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALC285_FIXUP_HP_GPIO_LED), 10528 SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALC285_FIXUP_HP_GPIO_LED), 10529 SND_PCI_QUIRK(0x103c, 0x8e18, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED), 10530 SND_PCI_QUIRK(0x103c, 0x8e19, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED), 10531 SND_PCI_QUIRK(0x103c, 0x8e1a, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED), 10532 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 10533 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 10534 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10535 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), 10536 SND_PCI_QUIRK(0x1043, 0x10a4, "ASUS TP3407SA", ALC287_FIXUP_TAS2781_I2C), 10537 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 10538 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10539 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK), 10540 SND_PCI_QUIRK(0x1043, 0x1154, "ASUS TP3607SH", ALC287_FIXUP_TAS2781_I2C), 10541 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10542 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10543 SND_PCI_QUIRK(0x1043, 0x1204, "ASUS Strix G615JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C), 10544 SND_PCI_QUIRK(0x1043, 0x1214, "ASUS Strix G615LH_LM_LP", ALC287_FIXUP_TAS2781_I2C), 10545 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10546 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10547 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), 10548 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), 10549 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM), 10550 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), 10551 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), 10552 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), 10553 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE), 10554 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), 10555 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), 10556 SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC), 10557 SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC), 10558 SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC), 10559 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10560 SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10561 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2), 10562 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2), 10563 SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2), 10564 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), 10565 SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2), 10566 SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC), 10567 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), 10568 SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC), 10569 SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2), 10570 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2), 10571 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 10572 SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2), 10573 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), 10574 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2), 10575 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), 10576 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), 10577 SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY), 10578 SND_PCI_QUIRK(0x1043, 0x1eb3, "ROG Ally X RC72LA", ALC294_FIXUP_ASUS_ALLY_X), 10579 SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2), 10580 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), 10581 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), 10582 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2), 10583 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), 10584 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), 10585 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401), 10586 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), 10587 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), 10588 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), 10589 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 10590 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), 10591 SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2), 10592 SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2), 10593 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), 10594 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), 10595 SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC), 10596 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2), 10597 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10598 SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2), 10599 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10600 SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2), 10601 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2), 10602 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 10603 SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1), 10604 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS), 10605 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10606 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10607 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), 10608 SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2), 10609 SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2), 10610 SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC), 10611 SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2), 10612 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), 10613 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), 10614 SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2), 10615 SND_PCI_QUIRK(0x1043, 0x1df3, "ASUS UM5606WA", ALC294_FIXUP_BASS_SPEAKER_15), 10616 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2), 10617 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 10618 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), 10619 SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC), 10620 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 10621 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), 10622 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), 10623 SND_PCI_QUIRK(0x1043, 0x1eb3, "ASUS Ally RCLA72", ALC287_FIXUP_TAS2781_I2C), 10624 SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2), 10625 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2), 10626 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401), 10627 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), 10628 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2), 10629 SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2), 10630 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2), 10631 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401), 10632 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), 10633 SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10634 SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10635 SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10636 SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10637 SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10638 SND_PCI_QUIRK(0x1043, 0x3e30, "ASUS TP3607SA", ALC287_FIXUP_TAS2781_I2C), 10639 SND_PCI_QUIRK(0x1043, 0x3ee0, "ASUS Strix G815_JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C), 10640 SND_PCI_QUIRK(0x1043, 0x3ef0, "ASUS Strix G635LR_LW_LX", ALC287_FIXUP_TAS2781_I2C), 10641 SND_PCI_QUIRK(0x1043, 0x3f00, "ASUS Strix G815LH_LM_LP", ALC287_FIXUP_TAS2781_I2C), 10642 SND_PCI_QUIRK(0x1043, 0x3f10, "ASUS Strix G835LR_LW_LX", ALC287_FIXUP_TAS2781_I2C), 10643 SND_PCI_QUIRK(0x1043, 0x3f20, "ASUS Strix G615LR_LW", ALC287_FIXUP_TAS2781_I2C), 10644 SND_PCI_QUIRK(0x1043, 0x3f30, "ASUS Strix G815LR_LW", ALC287_FIXUP_TAS2781_I2C), 10645 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), 10646 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), 10647 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 10648 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 10649 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), 10650 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), 10651 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 10652 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 10653 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), 10654 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 10655 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 10656 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), 10657 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), 10658 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), 10659 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), 10660 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), 10661 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), 10662 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), 10663 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), 10664 SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10665 SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10666 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10667 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10668 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10669 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10670 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10671 SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10672 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10673 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 10674 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP), 10675 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP), 10676 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP), 10677 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP), 10678 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP), 10679 SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP), 10680 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP), 10681 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), 10682 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP), 10683 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), 10684 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 10685 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP), 10686 SND_PCI_QUIRK(0x144d, 0xca06, "Samsung Galaxy Book3 360 (NP730QFG)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 10687 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP), 10688 SND_PCI_QUIRK(0x144d, 0xc870, "Samsung Galaxy Book2 Pro (NP950XED)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS), 10689 SND_PCI_QUIRK(0x144d, 0xc872, "Samsung Galaxy Book2 Pro (NP950XEE)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS), 10690 SND_PCI_QUIRK(0x144d, 0xc886, "Samsung Galaxy Book3 Pro (NP964XFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS), 10691 SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS), 10692 SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS), 10693 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 10694 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), 10695 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), 10696 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), 10697 SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC), 10698 SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10699 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10700 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10701 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10702 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10703 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10704 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10705 SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10706 SND_PCI_QUIRK(0x1558, 0x28c1, "Clevo V370VND", ALC2XX_FIXUP_HEADSET_MIC), 10707 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10708 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10709 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10710 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10711 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10712 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10713 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10714 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10715 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10716 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10717 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10718 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10719 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10720 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10721 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10722 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10723 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10724 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10725 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10726 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10727 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10728 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10729 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10730 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10731 SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10732 SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10733 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10734 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10735 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10736 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10737 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10738 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10739 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10740 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10741 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10742 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10743 SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10744 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10745 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10746 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10747 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10748 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10749 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10750 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10751 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), 10752 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), 10753 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), 10754 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10755 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10756 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10757 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10758 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10759 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME), 10760 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10761 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10762 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10763 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10764 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10765 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10766 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10767 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10768 SND_PCI_QUIRK(0x1558, 0xa554, "VAIO VJFH52", ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE), 10769 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10770 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10771 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10772 SND_PCI_QUIRK(0x1558, 0xa741, "Clevo V54x_6x_TNE", ALC245_FIXUP_CLEVO_NOISY_MIC), 10773 SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC), 10774 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10775 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10776 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10777 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10778 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10779 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10780 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), 10781 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 10782 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), 10783 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), 10784 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), 10785 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), 10786 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), 10787 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), 10788 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), 10789 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), 10790 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), 10791 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), 10792 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), 10793 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), 10794 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), 10795 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), 10796 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), 10797 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), 10798 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), 10799 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10800 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), 10801 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), 10802 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), 10803 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10804 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10805 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), 10806 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), 10807 SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C), 10808 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), 10809 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10810 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10811 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), 10812 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10813 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10814 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10815 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10816 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 10817 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 10818 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), 10819 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), 10820 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10821 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10822 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10823 SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10824 SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10825 SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10826 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10827 SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10828 SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318), 10829 SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318), 10830 SND_PCI_QUIRK(0x17aa, 0x2326, "Hera2", ALC287_FIXUP_TAS2781_I2C), 10831 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 10832 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 10833 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10834 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10835 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10836 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10837 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10838 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10839 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10840 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10841 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 10842 SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC), 10843 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10844 HDA_CODEC_QUIRK(0x17aa, 0x3802, "DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10845 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8", ALC287_FIXUP_TAS2781_I2C), 10846 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 10847 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7), 10848 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), 10849 HDA_CODEC_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10850 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10851 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 10852 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), 10853 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10854 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 10855 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), 10856 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6), 10857 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10858 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10859 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10860 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6), 10861 SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2), 10862 SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2), 10863 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10864 HDA_CODEC_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7", ALC287_FIXUP_CS35L41_I2C_2), 10865 SND_PCI_QUIRK(0x17aa, 0x386e, "Yoga Pro 7 14ARP8", ALC285_FIXUP_SPEAKER2_TO_DAC1), 10866 HDA_CODEC_QUIRK(0x17aa, 0x386f, "Legion Pro 7 16ARX8H", ALC287_FIXUP_TAS2781_I2C), 10867 SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2), 10868 SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C), 10869 SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2), 10870 SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2), 10871 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C), 10872 SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C), 10873 SND_PCI_QUIRK(0x17aa, 0x387f, "Yoga S780-16 pro dual LX", ALC287_FIXUP_TAS2781_I2C), 10874 SND_PCI_QUIRK(0x17aa, 0x3880, "Yoga S780-16 pro dual YC", ALC287_FIXUP_TAS2781_I2C), 10875 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C), 10876 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10877 SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C), 10878 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C), 10879 SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10880 SND_PCI_QUIRK(0x17aa, 0x38a5, "Y580P AMD dual", ALC287_FIXUP_TAS2781_I2C), 10881 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C), 10882 SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C), 10883 SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10884 SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10885 SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2), 10886 SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2), 10887 SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2), 10888 SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2), 10889 SND_PCI_QUIRK(0x17aa, 0x38b8, "Yoga S780-14.5 proX AMD YC Dual", ALC287_FIXUP_TAS2781_I2C), 10890 SND_PCI_QUIRK(0x17aa, 0x38b9, "Yoga S780-14.5 proX AMD LX Dual", ALC287_FIXUP_TAS2781_I2C), 10891 SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C), 10892 SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C), 10893 SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C), 10894 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C), 10895 SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C), 10896 SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4), 10897 SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4), 10898 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C), 10899 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C), 10900 SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN), 10901 SND_PCI_QUIRK(0x17aa, 0x38d3, "Yoga S990-16 Pro IMH YC Dual", ALC287_FIXUP_TAS2781_I2C), 10902 SND_PCI_QUIRK(0x17aa, 0x38d4, "Yoga S990-16 Pro IMH VECO Dual", ALC287_FIXUP_TAS2781_I2C), 10903 SND_PCI_QUIRK(0x17aa, 0x38d5, "Yoga S990-16 Pro IMH YC Quad", ALC287_FIXUP_TAS2781_I2C), 10904 SND_PCI_QUIRK(0x17aa, 0x38d6, "Yoga S990-16 Pro IMH VECO Quad", ALC287_FIXUP_TAS2781_I2C), 10905 SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN), 10906 SND_PCI_QUIRK(0x17aa, 0x38df, "Yoga Y990 Intel YC Dual", ALC287_FIXUP_TAS2781_I2C), 10907 SND_PCI_QUIRK(0x17aa, 0x38e0, "Yoga Y990 Intel VECO Dual", ALC287_FIXUP_TAS2781_I2C), 10908 SND_PCI_QUIRK(0x17aa, 0x38f8, "Yoga Book 9i", ALC287_FIXUP_TAS2781_I2C), 10909 SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C), 10910 SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), 10911 SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), 10912 SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C), 10913 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 10914 SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC), 10915 SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C), 10916 SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C), 10917 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), 10918 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 10919 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), 10920 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10921 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), 10922 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), 10923 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10924 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), 10925 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), 10926 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), 10927 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), 10928 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), 10929 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), 10930 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), 10931 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), 10932 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10933 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10934 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10935 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 10936 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10937 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10938 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10939 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 10940 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 10941 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), 10942 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC), 10943 SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL), 10944 SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL), 10945 SND_PCI_QUIRK(0x1854, 0x0488, "LG gram 16 (16Z90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS), 10946 SND_PCI_QUIRK(0x1854, 0x048a, "LG gram 17 (17ZD90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS), 10947 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), 10948 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10949 SND_PCI_QUIRK(0x19e5, 0x3212, "Huawei KLV-WX9 ", ALC256_FIXUP_ACER_HEADSET_MIC), 10950 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), 10951 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), 10952 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), 10953 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ 10954 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), 10955 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), 10956 SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10957 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE), 10958 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), 10959 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), 10960 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP), 10961 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10962 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10963 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10964 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10965 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10966 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP), 10967 SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC), 10968 SND_PCI_QUIRK(0x1d05, 0x1409, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC), 10969 SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), 10970 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 10971 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), 10972 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), 10973 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), 10974 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 10975 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10976 SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13), 10977 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO), 10978 SND_PCI_QUIRK(0x2782, 0x1701, "Infinix Y4 Max", ALC269VC_FIXUP_INFINIX_Y4_MAX), 10979 SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX), 10980 SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME), 10981 SND_PCI_QUIRK(0x2782, 0x4900, "MEDION E15443", ALC233_FIXUP_MEDION_MTL_SPK), 10982 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), 10983 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), 10984 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), 10985 SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK), 10986 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 10987 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 10988 SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 10989 10990 #if 0 10991 /* Below is a quirk table taken from the old code. 10992 * Basically the device should work as is without the fixup table. 10993 * If BIOS doesn't give a proper info, enable the corresponding 10994 * fixup entry. 10995 */ 10996 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 10997 ALC269_FIXUP_AMIC), 10998 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), 10999 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), 11000 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), 11001 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), 11002 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), 11003 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), 11004 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), 11005 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), 11006 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), 11007 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), 11008 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), 11009 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), 11010 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), 11011 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), 11012 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), 11013 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), 11014 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), 11015 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), 11016 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), 11017 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), 11018 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), 11019 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), 11020 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), 11021 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), 11022 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), 11023 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), 11024 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), 11025 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), 11026 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), 11027 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), 11028 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), 11029 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), 11030 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), 11031 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), 11032 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), 11033 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), 11034 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), 11035 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), 11036 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), 11037 #endif 11038 {} 11039 }; 11040 11041 static const struct hda_quirk alc269_fixup_vendor_tbl[] = { 11042 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), 11043 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), 11044 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), 11045 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), 11046 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), 11047 {} 11048 }; 11049 11050 static const struct hda_model_fixup alc269_fixup_models[] = { 11051 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, 11052 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, 11053 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, 11054 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, 11055 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, 11056 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, 11057 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, 11058 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, 11059 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, 11060 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, 11061 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 11062 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, 11063 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 11064 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, 11065 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, 11066 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, 11067 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, .name = "dell-headset4-quiet"}, 11068 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, 11069 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, 11070 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, 11071 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, 11072 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, 11073 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, 11074 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, 11075 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, 11076 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, 11077 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, 11078 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, 11079 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, 11080 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, 11081 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, 11082 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, 11083 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, 11084 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, 11085 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, 11086 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, 11087 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, 11088 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, 11089 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, 11090 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, 11091 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, 11092 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, 11093 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, 11094 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, 11095 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, 11096 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, 11097 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, 11098 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, 11099 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, 11100 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, 11101 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, 11102 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, 11103 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, 11104 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, 11105 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, 11106 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, 11107 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, 11108 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, 11109 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, 11110 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, 11111 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, 11112 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, 11113 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, 11114 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, 11115 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, 11116 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, 11117 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, 11118 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, 11119 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"}, 11120 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, 11121 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 11122 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, 11123 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, 11124 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, 11125 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, 11126 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, 11127 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, 11128 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, 11129 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, 11130 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, 11131 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, 11132 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, 11133 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, 11134 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, 11135 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, 11136 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, 11137 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, 11138 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, 11139 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, 11140 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, 11141 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, 11142 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, 11143 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, 11144 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, 11145 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, 11146 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, 11147 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, 11148 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, 11149 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, 11150 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, 11151 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, 11152 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, 11153 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, 11154 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, 11155 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, 11156 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, 11157 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, 11158 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, 11159 {.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"}, 11160 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, 11161 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, 11162 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, 11163 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"}, 11164 {.id = ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS, .name = "alc298-samsung-amp-v2-2-amps"}, 11165 {.id = ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS, .name = "alc298-samsung-amp-v2-4-amps"}, 11166 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"}, 11167 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, 11168 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, 11169 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, 11170 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, 11171 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, 11172 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, 11173 {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"}, 11174 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, 11175 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"}, 11176 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, 11177 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, 11178 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"}, 11179 {.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"}, 11180 {} 11181 }; 11182 #define ALC225_STANDARD_PINS \ 11183 {0x21, 0x04211020} 11184 11185 #define ALC256_STANDARD_PINS \ 11186 {0x12, 0x90a60140}, \ 11187 {0x14, 0x90170110}, \ 11188 {0x21, 0x02211020} 11189 11190 #define ALC282_STANDARD_PINS \ 11191 {0x14, 0x90170110} 11192 11193 #define ALC290_STANDARD_PINS \ 11194 {0x12, 0x99a30130} 11195 11196 #define ALC292_STANDARD_PINS \ 11197 {0x14, 0x90170110}, \ 11198 {0x15, 0x0221401f} 11199 11200 #define ALC295_STANDARD_PINS \ 11201 {0x12, 0xb7a60130}, \ 11202 {0x14, 0x90170110}, \ 11203 {0x21, 0x04211020} 11204 11205 #define ALC298_STANDARD_PINS \ 11206 {0x12, 0x90a60130}, \ 11207 {0x21, 0x03211020} 11208 11209 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { 11210 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, 11211 {0x14, 0x01014020}, 11212 {0x17, 0x90170110}, 11213 {0x18, 0x02a11030}, 11214 {0x19, 0x0181303F}, 11215 {0x21, 0x0221102f}), 11216 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 11217 {0x12, 0x90a601c0}, 11218 {0x14, 0x90171120}, 11219 {0x21, 0x02211030}), 11220 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 11221 {0x14, 0x90170110}, 11222 {0x1b, 0x90a70130}, 11223 {0x21, 0x03211020}), 11224 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 11225 {0x1a, 0x90a70130}, 11226 {0x1b, 0x90170110}, 11227 {0x21, 0x03211020}), 11228 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11229 ALC225_STANDARD_PINS, 11230 {0x12, 0xb7a60130}, 11231 {0x14, 0x901701a0}), 11232 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11233 ALC225_STANDARD_PINS, 11234 {0x12, 0xb7a60130}, 11235 {0x14, 0x901701b0}), 11236 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11237 ALC225_STANDARD_PINS, 11238 {0x12, 0xb7a60150}, 11239 {0x14, 0x901701a0}), 11240 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11241 ALC225_STANDARD_PINS, 11242 {0x12, 0xb7a60150}, 11243 {0x14, 0x901701b0}), 11244 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11245 ALC225_STANDARD_PINS, 11246 {0x12, 0xb7a60130}, 11247 {0x1b, 0x90170110}), 11248 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11249 {0x1b, 0x01111010}, 11250 {0x1e, 0x01451130}, 11251 {0x21, 0x02211020}), 11252 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 11253 {0x12, 0x90a60140}, 11254 {0x14, 0x90170110}, 11255 {0x19, 0x02a11030}, 11256 {0x21, 0x02211020}), 11257 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 11258 {0x14, 0x90170110}, 11259 {0x19, 0x02a11030}, 11260 {0x1a, 0x02a11040}, 11261 {0x1b, 0x01014020}, 11262 {0x21, 0x0221101f}), 11263 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 11264 {0x14, 0x90170110}, 11265 {0x19, 0x02a11030}, 11266 {0x1a, 0x02a11040}, 11267 {0x1b, 0x01011020}, 11268 {0x21, 0x0221101f}), 11269 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 11270 {0x14, 0x90170110}, 11271 {0x19, 0x02a11020}, 11272 {0x1a, 0x02a11030}, 11273 {0x21, 0x0221101f}), 11274 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC, 11275 {0x21, 0x02211010}), 11276 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, 11277 {0x14, 0x90170110}, 11278 {0x19, 0x02a11020}, 11279 {0x21, 0x02211030}), 11280 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 11281 {0x14, 0x90170110}, 11282 {0x21, 0x02211020}), 11283 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11284 {0x14, 0x90170130}, 11285 {0x21, 0x02211040}), 11286 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11287 {0x12, 0x90a60140}, 11288 {0x14, 0x90170110}, 11289 {0x21, 0x02211020}), 11290 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11291 {0x12, 0x90a60160}, 11292 {0x14, 0x90170120}, 11293 {0x21, 0x02211030}), 11294 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11295 {0x14, 0x90170110}, 11296 {0x1b, 0x02011020}, 11297 {0x21, 0x0221101f}), 11298 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11299 {0x14, 0x90170110}, 11300 {0x1b, 0x01011020}, 11301 {0x21, 0x0221101f}), 11302 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11303 {0x14, 0x90170130}, 11304 {0x1b, 0x01014020}, 11305 {0x21, 0x0221103f}), 11306 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11307 {0x14, 0x90170130}, 11308 {0x1b, 0x01011020}, 11309 {0x21, 0x0221103f}), 11310 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11311 {0x14, 0x90170130}, 11312 {0x1b, 0x02011020}, 11313 {0x21, 0x0221103f}), 11314 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11315 {0x14, 0x90170150}, 11316 {0x1b, 0x02011020}, 11317 {0x21, 0x0221105f}), 11318 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11319 {0x14, 0x90170110}, 11320 {0x1b, 0x01014020}, 11321 {0x21, 0x0221101f}), 11322 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11323 {0x12, 0x90a60160}, 11324 {0x14, 0x90170120}, 11325 {0x17, 0x90170140}, 11326 {0x21, 0x0321102f}), 11327 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11328 {0x12, 0x90a60160}, 11329 {0x14, 0x90170130}, 11330 {0x21, 0x02211040}), 11331 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11332 {0x12, 0x90a60160}, 11333 {0x14, 0x90170140}, 11334 {0x21, 0x02211050}), 11335 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11336 {0x12, 0x90a60170}, 11337 {0x14, 0x90170120}, 11338 {0x21, 0x02211030}), 11339 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11340 {0x12, 0x90a60170}, 11341 {0x14, 0x90170130}, 11342 {0x21, 0x02211040}), 11343 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11344 {0x12, 0x90a60170}, 11345 {0x14, 0x90171130}, 11346 {0x21, 0x02211040}), 11347 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11348 {0x12, 0x90a60170}, 11349 {0x14, 0x90170140}, 11350 {0x21, 0x02211050}), 11351 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11352 {0x12, 0x90a60180}, 11353 {0x14, 0x90170130}, 11354 {0x21, 0x02211040}), 11355 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11356 {0x12, 0x90a60180}, 11357 {0x14, 0x90170120}, 11358 {0x21, 0x02211030}), 11359 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11360 {0x1b, 0x01011020}, 11361 {0x21, 0x02211010}), 11362 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 11363 {0x14, 0x90170110}, 11364 {0x1b, 0x90a70130}, 11365 {0x21, 0x04211020}), 11366 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 11367 {0x14, 0x90170110}, 11368 {0x1b, 0x90a70130}, 11369 {0x21, 0x03211020}), 11370 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 11371 {0x12, 0x90a60130}, 11372 {0x14, 0x90170110}, 11373 {0x21, 0x03211020}), 11374 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 11375 {0x12, 0x90a60130}, 11376 {0x14, 0x90170110}, 11377 {0x21, 0x04211020}), 11378 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 11379 {0x1a, 0x90a70130}, 11380 {0x1b, 0x90170110}, 11381 {0x21, 0x03211020}), 11382 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, 11383 {0x14, 0x90170110}, 11384 {0x19, 0x02a11020}, 11385 {0x21, 0x0221101f}), 11386 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, 11387 {0x17, 0x90170110}, 11388 {0x19, 0x03a11030}, 11389 {0x21, 0x03211020}), 11390 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, 11391 {0x12, 0x90a60130}, 11392 {0x14, 0x90170110}, 11393 {0x15, 0x0421101f}, 11394 {0x1a, 0x04a11020}), 11395 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, 11396 {0x12, 0x90a60140}, 11397 {0x14, 0x90170110}, 11398 {0x15, 0x0421101f}, 11399 {0x18, 0x02811030}, 11400 {0x1a, 0x04a1103f}, 11401 {0x1b, 0x02011020}), 11402 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11403 ALC282_STANDARD_PINS, 11404 {0x12, 0x99a30130}, 11405 {0x19, 0x03a11020}, 11406 {0x21, 0x0321101f}), 11407 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11408 ALC282_STANDARD_PINS, 11409 {0x12, 0x99a30130}, 11410 {0x19, 0x03a11020}, 11411 {0x21, 0x03211040}), 11412 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11413 ALC282_STANDARD_PINS, 11414 {0x12, 0x99a30130}, 11415 {0x19, 0x03a11030}, 11416 {0x21, 0x03211020}), 11417 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11418 ALC282_STANDARD_PINS, 11419 {0x12, 0x99a30130}, 11420 {0x19, 0x04a11020}, 11421 {0x21, 0x0421101f}), 11422 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, 11423 ALC282_STANDARD_PINS, 11424 {0x12, 0x90a60140}, 11425 {0x19, 0x04a11030}, 11426 {0x21, 0x04211020}), 11427 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, 11428 ALC282_STANDARD_PINS, 11429 {0x12, 0x90a609c0}, 11430 {0x18, 0x03a11830}, 11431 {0x19, 0x04a19831}, 11432 {0x1a, 0x0481303f}, 11433 {0x1b, 0x04211020}, 11434 {0x21, 0x0321101f}), 11435 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, 11436 ALC282_STANDARD_PINS, 11437 {0x12, 0x90a60940}, 11438 {0x18, 0x03a11830}, 11439 {0x19, 0x04a19831}, 11440 {0x1a, 0x0481303f}, 11441 {0x1b, 0x04211020}, 11442 {0x21, 0x0321101f}), 11443 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11444 ALC282_STANDARD_PINS, 11445 {0x12, 0x90a60130}, 11446 {0x21, 0x0321101f}), 11447 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11448 {0x12, 0x90a60160}, 11449 {0x14, 0x90170120}, 11450 {0x21, 0x02211030}), 11451 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11452 ALC282_STANDARD_PINS, 11453 {0x12, 0x90a60130}, 11454 {0x19, 0x03a11020}, 11455 {0x21, 0x0321101f}), 11456 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 11457 {0x12, 0x90a60130}, 11458 {0x14, 0x90170110}, 11459 {0x19, 0x04a11040}, 11460 {0x21, 0x04211020}), 11461 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 11462 {0x14, 0x90170110}, 11463 {0x19, 0x04a11040}, 11464 {0x1d, 0x40600001}, 11465 {0x21, 0x04211020}), 11466 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 11467 {0x14, 0x90170110}, 11468 {0x19, 0x04a11040}, 11469 {0x21, 0x04211020}), 11470 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK, 11471 {0x14, 0x90170110}, 11472 {0x17, 0x90170111}, 11473 {0x19, 0x03a11030}, 11474 {0x21, 0x03211020}), 11475 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK, 11476 {0x17, 0x90170110}, 11477 {0x19, 0x03a11030}, 11478 {0x21, 0x03211020}), 11479 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK, 11480 {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */ 11481 {0x19, 0x04a11040}, 11482 {0x21, 0x04211020}), 11483 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, 11484 {0x12, 0x90a60130}, 11485 {0x17, 0x90170110}, 11486 {0x21, 0x02211020}), 11487 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, 11488 {0x12, 0x90a60120}, 11489 {0x14, 0x90170110}, 11490 {0x21, 0x0321101f}), 11491 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11492 ALC290_STANDARD_PINS, 11493 {0x15, 0x04211040}, 11494 {0x18, 0x90170112}, 11495 {0x1a, 0x04a11020}), 11496 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11497 ALC290_STANDARD_PINS, 11498 {0x15, 0x04211040}, 11499 {0x18, 0x90170110}, 11500 {0x1a, 0x04a11020}), 11501 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11502 ALC290_STANDARD_PINS, 11503 {0x15, 0x0421101f}, 11504 {0x1a, 0x04a11020}), 11505 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11506 ALC290_STANDARD_PINS, 11507 {0x15, 0x04211020}, 11508 {0x1a, 0x04a11040}), 11509 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11510 ALC290_STANDARD_PINS, 11511 {0x14, 0x90170110}, 11512 {0x15, 0x04211020}, 11513 {0x1a, 0x04a11040}), 11514 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11515 ALC290_STANDARD_PINS, 11516 {0x14, 0x90170110}, 11517 {0x15, 0x04211020}, 11518 {0x1a, 0x04a11020}), 11519 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11520 ALC290_STANDARD_PINS, 11521 {0x14, 0x90170110}, 11522 {0x15, 0x0421101f}, 11523 {0x1a, 0x04a11020}), 11524 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 11525 ALC292_STANDARD_PINS, 11526 {0x12, 0x90a60140}, 11527 {0x16, 0x01014020}, 11528 {0x19, 0x01a19030}), 11529 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 11530 ALC292_STANDARD_PINS, 11531 {0x12, 0x90a60140}, 11532 {0x16, 0x01014020}, 11533 {0x18, 0x02a19031}, 11534 {0x19, 0x01a1903e}), 11535 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 11536 ALC292_STANDARD_PINS, 11537 {0x12, 0x90a60140}), 11538 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 11539 ALC292_STANDARD_PINS, 11540 {0x13, 0x90a60140}, 11541 {0x16, 0x21014020}, 11542 {0x19, 0x21a19030}), 11543 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 11544 ALC292_STANDARD_PINS, 11545 {0x13, 0x90a60140}), 11546 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE, 11547 {0x17, 0x90170110}, 11548 {0x21, 0x04211020}), 11549 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, 11550 {0x14, 0x90170110}, 11551 {0x1b, 0x90a70130}, 11552 {0x21, 0x04211020}), 11553 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 11554 {0x12, 0x90a60130}, 11555 {0x17, 0x90170110}, 11556 {0x21, 0x03211020}), 11557 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 11558 {0x12, 0x90a60130}, 11559 {0x17, 0x90170110}, 11560 {0x21, 0x04211020}), 11561 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 11562 {0x12, 0x90a60130}, 11563 {0x17, 0x90170110}, 11564 {0x21, 0x03211020}), 11565 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 11566 {0x12, 0x90a60120}, 11567 {0x17, 0x90170110}, 11568 {0x21, 0x04211030}), 11569 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 11570 {0x12, 0x90a60130}, 11571 {0x17, 0x90170110}, 11572 {0x21, 0x03211020}), 11573 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 11574 {0x12, 0x90a60130}, 11575 {0x17, 0x90170110}, 11576 {0x21, 0x03211020}), 11577 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 11578 ALC298_STANDARD_PINS, 11579 {0x17, 0x90170110}), 11580 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 11581 ALC298_STANDARD_PINS, 11582 {0x17, 0x90170140}), 11583 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 11584 ALC298_STANDARD_PINS, 11585 {0x17, 0x90170150}), 11586 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, 11587 {0x12, 0xb7a60140}, 11588 {0x13, 0xb7a60150}, 11589 {0x17, 0x90170110}, 11590 {0x1a, 0x03011020}, 11591 {0x21, 0x03211030}), 11592 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, 11593 {0x12, 0xb7a60140}, 11594 {0x17, 0x90170110}, 11595 {0x1a, 0x03a11030}, 11596 {0x21, 0x03211020}), 11597 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 11598 ALC225_STANDARD_PINS, 11599 {0x12, 0xb7a60130}, 11600 {0x17, 0x90170110}), 11601 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, 11602 {0x14, 0x01014010}, 11603 {0x17, 0x90170120}, 11604 {0x18, 0x02a11030}, 11605 {0x19, 0x02a1103f}, 11606 {0x21, 0x0221101f}), 11607 {} 11608 }; 11609 11610 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match 11611 * more machines, don't need to match all valid pins, just need to match 11612 * all the pins defined in the tbl. Just because of this reason, it is possible 11613 * that a single machine matches multiple tbls, so there is one limitation: 11614 * at most one tbl is allowed to define for the same vendor and same codec 11615 */ 11616 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { 11617 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC, 11618 {0x19, 0x40000000}), 11619 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 11620 {0x19, 0x40000000}, 11621 {0x1b, 0x40000000}), 11622 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, 11623 {0x19, 0x40000000}, 11624 {0x1b, 0x40000000}), 11625 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11626 {0x19, 0x40000000}, 11627 {0x1a, 0x40000000}), 11628 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST, 11629 {0x19, 0x40000000}, 11630 {0x1a, 0x40000000}), 11631 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST, 11632 {0x19, 0x40000000}, 11633 {0x1a, 0x40000000}), 11634 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC, 11635 {0x19, 0x40000000}), 11636 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1558, "Clevo", ALC2XX_FIXUP_HEADSET_MIC, 11637 {0x19, 0x40000000}), 11638 {} 11639 }; 11640 11641 static void alc269_fill_coef(struct hda_codec *codec) 11642 { 11643 struct alc_spec *spec = codec->spec; 11644 int val; 11645 11646 if (spec->codec_variant != ALC269_TYPE_ALC269VB) 11647 return; 11648 11649 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { 11650 alc_write_coef_idx(codec, 0xf, 0x960b); 11651 alc_write_coef_idx(codec, 0xe, 0x8817); 11652 } 11653 11654 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { 11655 alc_write_coef_idx(codec, 0xf, 0x960b); 11656 alc_write_coef_idx(codec, 0xe, 0x8814); 11657 } 11658 11659 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { 11660 /* Power up output pin */ 11661 alc_update_coef_idx(codec, 0x04, 0, 1<<11); 11662 } 11663 11664 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { 11665 val = alc_read_coef_idx(codec, 0xd); 11666 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { 11667 /* Capless ramp up clock control */ 11668 alc_write_coef_idx(codec, 0xd, val | (1<<10)); 11669 } 11670 val = alc_read_coef_idx(codec, 0x17); 11671 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { 11672 /* Class D power on reset */ 11673 alc_write_coef_idx(codec, 0x17, val | (1<<7)); 11674 } 11675 } 11676 11677 /* HP */ 11678 alc_update_coef_idx(codec, 0x4, 0, 1<<11); 11679 } 11680 11681 /* 11682 */ 11683 static int patch_alc269(struct hda_codec *codec) 11684 { 11685 struct alc_spec *spec; 11686 int err; 11687 11688 err = alc_alloc_spec(codec, 0x0b); 11689 if (err < 0) 11690 return err; 11691 11692 spec = codec->spec; 11693 spec->gen.shared_mic_vref_pin = 0x18; 11694 codec->power_save_node = 0; 11695 spec->en_3kpull_low = true; 11696 11697 codec->patch_ops.suspend = alc269_suspend; 11698 codec->patch_ops.resume = alc269_resume; 11699 spec->shutup = alc_default_shutup; 11700 spec->init_hook = alc_default_init; 11701 11702 switch (codec->core.vendor_id) { 11703 case 0x10ec0269: 11704 spec->codec_variant = ALC269_TYPE_ALC269VA; 11705 switch (alc_get_coef0(codec) & 0x00f0) { 11706 case 0x0010: 11707 if (codec->bus->pci && 11708 codec->bus->pci->subsystem_vendor == 0x1025 && 11709 spec->cdefine.platform_type == 1) 11710 err = alc_codec_rename(codec, "ALC271X"); 11711 spec->codec_variant = ALC269_TYPE_ALC269VB; 11712 break; 11713 case 0x0020: 11714 if (codec->bus->pci && 11715 codec->bus->pci->subsystem_vendor == 0x17aa && 11716 codec->bus->pci->subsystem_device == 0x21f3) 11717 err = alc_codec_rename(codec, "ALC3202"); 11718 spec->codec_variant = ALC269_TYPE_ALC269VC; 11719 break; 11720 case 0x0030: 11721 spec->codec_variant = ALC269_TYPE_ALC269VD; 11722 break; 11723 default: 11724 alc_fix_pll_init(codec, 0x20, 0x04, 15); 11725 } 11726 if (err < 0) 11727 goto error; 11728 spec->shutup = alc269_shutup; 11729 spec->init_hook = alc269_fill_coef; 11730 alc269_fill_coef(codec); 11731 break; 11732 11733 case 0x10ec0280: 11734 case 0x10ec0290: 11735 spec->codec_variant = ALC269_TYPE_ALC280; 11736 break; 11737 case 0x10ec0282: 11738 spec->codec_variant = ALC269_TYPE_ALC282; 11739 spec->shutup = alc282_shutup; 11740 spec->init_hook = alc282_init; 11741 break; 11742 case 0x10ec0233: 11743 case 0x10ec0283: 11744 spec->codec_variant = ALC269_TYPE_ALC283; 11745 spec->shutup = alc283_shutup; 11746 spec->init_hook = alc283_init; 11747 break; 11748 case 0x10ec0284: 11749 case 0x10ec0292: 11750 spec->codec_variant = ALC269_TYPE_ALC284; 11751 break; 11752 case 0x10ec0293: 11753 spec->codec_variant = ALC269_TYPE_ALC293; 11754 break; 11755 case 0x10ec0286: 11756 case 0x10ec0288: 11757 spec->codec_variant = ALC269_TYPE_ALC286; 11758 break; 11759 case 0x10ec0298: 11760 spec->codec_variant = ALC269_TYPE_ALC298; 11761 break; 11762 case 0x10ec0235: 11763 case 0x10ec0255: 11764 spec->codec_variant = ALC269_TYPE_ALC255; 11765 spec->shutup = alc256_shutup; 11766 spec->init_hook = alc256_init; 11767 break; 11768 case 0x10ec0230: 11769 case 0x10ec0236: 11770 case 0x10ec0256: 11771 case 0x19e58326: 11772 spec->codec_variant = ALC269_TYPE_ALC256; 11773 spec->shutup = alc256_shutup; 11774 spec->init_hook = alc256_init; 11775 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ 11776 if (codec->core.vendor_id == 0x10ec0236 && 11777 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD) 11778 spec->en_3kpull_low = false; 11779 break; 11780 case 0x10ec0257: 11781 spec->codec_variant = ALC269_TYPE_ALC257; 11782 spec->shutup = alc256_shutup; 11783 spec->init_hook = alc256_init; 11784 spec->gen.mixer_nid = 0; 11785 spec->en_3kpull_low = false; 11786 break; 11787 case 0x10ec0215: 11788 case 0x10ec0245: 11789 case 0x10ec0285: 11790 case 0x10ec0289: 11791 if (alc_get_coef0(codec) & 0x0010) 11792 spec->codec_variant = ALC269_TYPE_ALC245; 11793 else 11794 spec->codec_variant = ALC269_TYPE_ALC215; 11795 spec->shutup = alc225_shutup; 11796 spec->init_hook = alc225_init; 11797 spec->gen.mixer_nid = 0; 11798 break; 11799 case 0x10ec0225: 11800 case 0x10ec0295: 11801 case 0x10ec0299: 11802 spec->codec_variant = ALC269_TYPE_ALC225; 11803 spec->shutup = alc225_shutup; 11804 spec->init_hook = alc225_init; 11805 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ 11806 break; 11807 case 0x10ec0287: 11808 spec->codec_variant = ALC269_TYPE_ALC287; 11809 spec->shutup = alc225_shutup; 11810 spec->init_hook = alc225_init; 11811 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */ 11812 break; 11813 case 0x10ec0234: 11814 case 0x10ec0274: 11815 case 0x10ec0294: 11816 spec->codec_variant = ALC269_TYPE_ALC294; 11817 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ 11818 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ 11819 spec->init_hook = alc294_init; 11820 break; 11821 case 0x10ec0300: 11822 spec->codec_variant = ALC269_TYPE_ALC300; 11823 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ 11824 break; 11825 case 0x10ec0623: 11826 spec->codec_variant = ALC269_TYPE_ALC623; 11827 break; 11828 case 0x10ec0700: 11829 case 0x10ec0701: 11830 case 0x10ec0703: 11831 case 0x10ec0711: 11832 spec->codec_variant = ALC269_TYPE_ALC700; 11833 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ 11834 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ 11835 spec->init_hook = alc294_init; 11836 break; 11837 11838 } 11839 11840 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { 11841 spec->has_alc5505_dsp = 1; 11842 spec->init_hook = alc5505_dsp_init; 11843 } 11844 11845 alc_pre_init(codec); 11846 11847 snd_hda_pick_fixup(codec, alc269_fixup_models, 11848 alc269_fixup_tbl, alc269_fixups); 11849 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and 11850 * the quirk breaks the latter (bko#214101). 11851 * Clear the wrong entry. 11852 */ 11853 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 && 11854 codec->core.vendor_id == 0x10ec0294) { 11855 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n"); 11856 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; 11857 } 11858 11859 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); 11860 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); 11861 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, 11862 alc269_fixups); 11863 11864 /* 11865 * Check whether ACPI describes companion amplifiers that require 11866 * component binding 11867 */ 11868 find_cirrus_companion_amps(codec); 11869 11870 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 11871 11872 alc_auto_parse_customize_define(codec); 11873 11874 if (has_cdefine_beep(codec)) 11875 spec->gen.beep_nid = 0x01; 11876 11877 /* automatic parse from the BIOS config */ 11878 err = alc269_parse_auto_config(codec); 11879 if (err < 0) 11880 goto error; 11881 11882 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { 11883 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); 11884 if (err < 0) 11885 goto error; 11886 } 11887 11888 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 11889 11890 return 0; 11891 11892 error: 11893 alc_free(codec); 11894 return err; 11895 } 11896 11897 /* 11898 * ALC861 11899 */ 11900 11901 static int alc861_parse_auto_config(struct hda_codec *codec) 11902 { 11903 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; 11904 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; 11905 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); 11906 } 11907 11908 /* Pin config fixes */ 11909 enum { 11910 ALC861_FIXUP_FSC_AMILO_PI1505, 11911 ALC861_FIXUP_AMP_VREF_0F, 11912 ALC861_FIXUP_NO_JACK_DETECT, 11913 ALC861_FIXUP_ASUS_A6RP, 11914 ALC660_FIXUP_ASUS_W7J, 11915 }; 11916 11917 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ 11918 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, 11919 const struct hda_fixup *fix, int action) 11920 { 11921 struct alc_spec *spec = codec->spec; 11922 unsigned int val; 11923 11924 if (action != HDA_FIXUP_ACT_INIT) 11925 return; 11926 val = snd_hda_codec_get_pin_target(codec, 0x0f); 11927 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) 11928 val |= AC_PINCTL_IN_EN; 11929 val |= AC_PINCTL_VREF_50; 11930 snd_hda_set_pin_ctl(codec, 0x0f, val); 11931 spec->gen.keep_vref_in_automute = 1; 11932 } 11933 11934 /* suppress the jack-detection */ 11935 static void alc_fixup_no_jack_detect(struct hda_codec *codec, 11936 const struct hda_fixup *fix, int action) 11937 { 11938 if (action == HDA_FIXUP_ACT_PRE_PROBE) 11939 codec->no_jack_detect = 1; 11940 } 11941 11942 static const struct hda_fixup alc861_fixups[] = { 11943 [ALC861_FIXUP_FSC_AMILO_PI1505] = { 11944 .type = HDA_FIXUP_PINS, 11945 .v.pins = (const struct hda_pintbl[]) { 11946 { 0x0b, 0x0221101f }, /* HP */ 11947 { 0x0f, 0x90170310 }, /* speaker */ 11948 { } 11949 } 11950 }, 11951 [ALC861_FIXUP_AMP_VREF_0F] = { 11952 .type = HDA_FIXUP_FUNC, 11953 .v.func = alc861_fixup_asus_amp_vref_0f, 11954 }, 11955 [ALC861_FIXUP_NO_JACK_DETECT] = { 11956 .type = HDA_FIXUP_FUNC, 11957 .v.func = alc_fixup_no_jack_detect, 11958 }, 11959 [ALC861_FIXUP_ASUS_A6RP] = { 11960 .type = HDA_FIXUP_FUNC, 11961 .v.func = alc861_fixup_asus_amp_vref_0f, 11962 .chained = true, 11963 .chain_id = ALC861_FIXUP_NO_JACK_DETECT, 11964 }, 11965 [ALC660_FIXUP_ASUS_W7J] = { 11966 .type = HDA_FIXUP_VERBS, 11967 .v.verbs = (const struct hda_verb[]) { 11968 /* ASUS W7J needs a magic pin setup on unused NID 0x10 11969 * for enabling outputs 11970 */ 11971 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, 11972 { } 11973 }, 11974 } 11975 }; 11976 11977 static const struct hda_quirk alc861_fixup_tbl[] = { 11978 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), 11979 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), 11980 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), 11981 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), 11982 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), 11983 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F), 11984 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), 11985 {} 11986 }; 11987 11988 /* 11989 */ 11990 static int patch_alc861(struct hda_codec *codec) 11991 { 11992 struct alc_spec *spec; 11993 int err; 11994 11995 err = alc_alloc_spec(codec, 0x15); 11996 if (err < 0) 11997 return err; 11998 11999 spec = codec->spec; 12000 if (has_cdefine_beep(codec)) 12001 spec->gen.beep_nid = 0x23; 12002 12003 spec->power_hook = alc_power_eapd; 12004 12005 alc_pre_init(codec); 12006 12007 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); 12008 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 12009 12010 /* automatic parse from the BIOS config */ 12011 err = alc861_parse_auto_config(codec); 12012 if (err < 0) 12013 goto error; 12014 12015 if (!spec->gen.no_analog) { 12016 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); 12017 if (err < 0) 12018 goto error; 12019 } 12020 12021 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 12022 12023 return 0; 12024 12025 error: 12026 alc_free(codec); 12027 return err; 12028 } 12029 12030 /* 12031 * ALC861-VD support 12032 * 12033 * Based on ALC882 12034 * 12035 * In addition, an independent DAC 12036 */ 12037 static int alc861vd_parse_auto_config(struct hda_codec *codec) 12038 { 12039 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; 12040 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 12041 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); 12042 } 12043 12044 enum { 12045 ALC660VD_FIX_ASUS_GPIO1, 12046 ALC861VD_FIX_DALLAS, 12047 }; 12048 12049 /* exclude VREF80 */ 12050 static void alc861vd_fixup_dallas(struct hda_codec *codec, 12051 const struct hda_fixup *fix, int action) 12052 { 12053 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12054 snd_hda_override_pin_caps(codec, 0x18, 0x00000734); 12055 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); 12056 } 12057 } 12058 12059 /* reset GPIO1 */ 12060 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, 12061 const struct hda_fixup *fix, int action) 12062 { 12063 struct alc_spec *spec = codec->spec; 12064 12065 if (action == HDA_FIXUP_ACT_PRE_PROBE) 12066 spec->gpio_mask |= 0x02; 12067 alc_fixup_gpio(codec, action, 0x01); 12068 } 12069 12070 static const struct hda_fixup alc861vd_fixups[] = { 12071 [ALC660VD_FIX_ASUS_GPIO1] = { 12072 .type = HDA_FIXUP_FUNC, 12073 .v.func = alc660vd_fixup_asus_gpio1, 12074 }, 12075 [ALC861VD_FIX_DALLAS] = { 12076 .type = HDA_FIXUP_FUNC, 12077 .v.func = alc861vd_fixup_dallas, 12078 }, 12079 }; 12080 12081 static const struct hda_quirk alc861vd_fixup_tbl[] = { 12082 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), 12083 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), 12084 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), 12085 {} 12086 }; 12087 12088 /* 12089 */ 12090 static int patch_alc861vd(struct hda_codec *codec) 12091 { 12092 struct alc_spec *spec; 12093 int err; 12094 12095 err = alc_alloc_spec(codec, 0x0b); 12096 if (err < 0) 12097 return err; 12098 12099 spec = codec->spec; 12100 if (has_cdefine_beep(codec)) 12101 spec->gen.beep_nid = 0x23; 12102 12103 spec->shutup = alc_eapd_shutup; 12104 12105 alc_pre_init(codec); 12106 12107 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); 12108 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 12109 12110 /* automatic parse from the BIOS config */ 12111 err = alc861vd_parse_auto_config(codec); 12112 if (err < 0) 12113 goto error; 12114 12115 if (!spec->gen.no_analog) { 12116 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 12117 if (err < 0) 12118 goto error; 12119 } 12120 12121 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 12122 12123 return 0; 12124 12125 error: 12126 alc_free(codec); 12127 return err; 12128 } 12129 12130 /* 12131 * ALC662 support 12132 * 12133 * ALC662 is almost identical with ALC880 but has cleaner and more flexible 12134 * configuration. Each pin widget can choose any input DACs and a mixer. 12135 * Each ADC is connected from a mixer of all inputs. This makes possible 12136 * 6-channel independent captures. 12137 * 12138 * In addition, an independent DAC for the multi-playback (not used in this 12139 * driver yet). 12140 */ 12141 12142 /* 12143 * BIOS auto configuration 12144 */ 12145 12146 static int alc662_parse_auto_config(struct hda_codec *codec) 12147 { 12148 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; 12149 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; 12150 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 12151 const hda_nid_t *ssids; 12152 12153 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || 12154 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || 12155 codec->core.vendor_id == 0x10ec0671) 12156 ssids = alc663_ssids; 12157 else 12158 ssids = alc662_ssids; 12159 return alc_parse_auto_config(codec, alc662_ignore, ssids); 12160 } 12161 12162 static void alc272_fixup_mario(struct hda_codec *codec, 12163 const struct hda_fixup *fix, int action) 12164 { 12165 if (action != HDA_FIXUP_ACT_PRE_PROBE) 12166 return; 12167 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, 12168 (0x3b << AC_AMPCAP_OFFSET_SHIFT) | 12169 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | 12170 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | 12171 (0 << AC_AMPCAP_MUTE_SHIFT))) 12172 codec_warn(codec, "failed to override amp caps for NID 0x2\n"); 12173 } 12174 12175 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { 12176 { .channels = 2, 12177 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, 12178 { .channels = 4, 12179 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, 12180 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ 12181 { } 12182 }; 12183 12184 /* override the 2.1 chmap */ 12185 static void alc_fixup_bass_chmap(struct hda_codec *codec, 12186 const struct hda_fixup *fix, int action) 12187 { 12188 if (action == HDA_FIXUP_ACT_BUILD) { 12189 struct alc_spec *spec = codec->spec; 12190 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; 12191 } 12192 } 12193 12194 /* avoid D3 for keeping GPIO up */ 12195 static unsigned int gpio_led_power_filter(struct hda_codec *codec, 12196 hda_nid_t nid, 12197 unsigned int power_state) 12198 { 12199 struct alc_spec *spec = codec->spec; 12200 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) 12201 return AC_PWRST_D0; 12202 return power_state; 12203 } 12204 12205 static void alc662_fixup_led_gpio1(struct hda_codec *codec, 12206 const struct hda_fixup *fix, int action) 12207 { 12208 struct alc_spec *spec = codec->spec; 12209 12210 alc_fixup_hp_gpio_led(codec, action, 0x01, 0); 12211 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12212 spec->mute_led_polarity = 1; 12213 codec->power_filter = gpio_led_power_filter; 12214 } 12215 } 12216 12217 static void alc662_usi_automute_hook(struct hda_codec *codec, 12218 struct hda_jack_callback *jack) 12219 { 12220 struct alc_spec *spec = codec->spec; 12221 int vref; 12222 msleep(200); 12223 snd_hda_gen_hp_automute(codec, jack); 12224 12225 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 12226 msleep(100); 12227 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 12228 vref); 12229 } 12230 12231 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, 12232 const struct hda_fixup *fix, int action) 12233 { 12234 struct alc_spec *spec = codec->spec; 12235 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12236 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 12237 spec->gen.hp_automute_hook = alc662_usi_automute_hook; 12238 } 12239 } 12240 12241 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, 12242 struct hda_jack_callback *cb) 12243 { 12244 /* surround speakers at 0x1b already get muted automatically when 12245 * headphones are plugged in, but we have to mute/unmute the remaining 12246 * channels manually: 12247 * 0x15 - front left/front right 12248 * 0x18 - front center/ LFE 12249 */ 12250 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { 12251 snd_hda_set_pin_ctl_cache(codec, 0x15, 0); 12252 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); 12253 } else { 12254 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); 12255 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); 12256 } 12257 } 12258 12259 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, 12260 const struct hda_fixup *fix, int action) 12261 { 12262 /* Pin 0x1b: shared headphones jack and surround speakers */ 12263 if (!is_jack_detectable(codec, 0x1b)) 12264 return; 12265 12266 switch (action) { 12267 case HDA_FIXUP_ACT_PRE_PROBE: 12268 snd_hda_jack_detect_enable_callback(codec, 0x1b, 12269 alc662_aspire_ethos_mute_speakers); 12270 /* subwoofer needs an extra GPIO setting to become audible */ 12271 alc_setup_gpio(codec, 0x02); 12272 break; 12273 case HDA_FIXUP_ACT_INIT: 12274 /* Make sure to start in a correct state, i.e. if 12275 * headphones have been plugged in before powering up the system 12276 */ 12277 alc662_aspire_ethos_mute_speakers(codec, NULL); 12278 break; 12279 } 12280 } 12281 12282 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, 12283 const struct hda_fixup *fix, int action) 12284 { 12285 struct alc_spec *spec = codec->spec; 12286 12287 static const struct hda_pintbl pincfgs[] = { 12288 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ 12289 { 0x1b, 0x0181304f }, 12290 { } 12291 }; 12292 12293 switch (action) { 12294 case HDA_FIXUP_ACT_PRE_PROBE: 12295 spec->gen.mixer_nid = 0; 12296 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 12297 snd_hda_apply_pincfgs(codec, pincfgs); 12298 break; 12299 case HDA_FIXUP_ACT_INIT: 12300 alc_write_coef_idx(codec, 0x19, 0xa054); 12301 break; 12302 } 12303 } 12304 12305 static void alc897_hp_automute_hook(struct hda_codec *codec, 12306 struct hda_jack_callback *jack) 12307 { 12308 struct alc_spec *spec = codec->spec; 12309 int vref; 12310 12311 snd_hda_gen_hp_automute(codec, jack); 12312 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP; 12313 snd_hda_set_pin_ctl(codec, 0x1b, vref); 12314 } 12315 12316 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec, 12317 const struct hda_fixup *fix, int action) 12318 { 12319 struct alc_spec *spec = codec->spec; 12320 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12321 spec->gen.hp_automute_hook = alc897_hp_automute_hook; 12322 spec->no_shutup_pins = 1; 12323 } 12324 if (action == HDA_FIXUP_ACT_PROBE) { 12325 snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100); 12326 } 12327 } 12328 12329 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec, 12330 const struct hda_fixup *fix, int action) 12331 { 12332 struct alc_spec *spec = codec->spec; 12333 12334 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12335 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 12336 spec->gen.hp_automute_hook = alc897_hp_automute_hook; 12337 } 12338 } 12339 12340 static const struct coef_fw alc668_coefs[] = { 12341 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), 12342 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), 12343 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), 12344 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), 12345 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), 12346 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), 12347 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), 12348 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), 12349 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), 12350 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), 12351 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), 12352 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), 12353 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), 12354 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), 12355 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), 12356 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), 12357 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), 12358 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), 12359 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), 12360 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), 12361 {} 12362 }; 12363 12364 static void alc668_restore_default_value(struct hda_codec *codec) 12365 { 12366 alc_process_coef_fw(codec, alc668_coefs); 12367 } 12368 12369 enum { 12370 ALC662_FIXUP_ASPIRE, 12371 ALC662_FIXUP_LED_GPIO1, 12372 ALC662_FIXUP_IDEAPAD, 12373 ALC272_FIXUP_MARIO, 12374 ALC662_FIXUP_CZC_ET26, 12375 ALC662_FIXUP_CZC_P10T, 12376 ALC662_FIXUP_SKU_IGNORE, 12377 ALC662_FIXUP_HP_RP5800, 12378 ALC662_FIXUP_ASUS_MODE1, 12379 ALC662_FIXUP_ASUS_MODE2, 12380 ALC662_FIXUP_ASUS_MODE3, 12381 ALC662_FIXUP_ASUS_MODE4, 12382 ALC662_FIXUP_ASUS_MODE5, 12383 ALC662_FIXUP_ASUS_MODE6, 12384 ALC662_FIXUP_ASUS_MODE7, 12385 ALC662_FIXUP_ASUS_MODE8, 12386 ALC662_FIXUP_NO_JACK_DETECT, 12387 ALC662_FIXUP_ZOTAC_Z68, 12388 ALC662_FIXUP_INV_DMIC, 12389 ALC662_FIXUP_DELL_MIC_NO_PRESENCE, 12390 ALC668_FIXUP_DELL_MIC_NO_PRESENCE, 12391 ALC662_FIXUP_HEADSET_MODE, 12392 ALC668_FIXUP_HEADSET_MODE, 12393 ALC662_FIXUP_BASS_MODE4_CHMAP, 12394 ALC662_FIXUP_BASS_16, 12395 ALC662_FIXUP_BASS_1A, 12396 ALC662_FIXUP_BASS_CHMAP, 12397 ALC668_FIXUP_AUTO_MUTE, 12398 ALC668_FIXUP_DELL_DISABLE_AAMIX, 12399 ALC668_FIXUP_DELL_XPS13, 12400 ALC662_FIXUP_ASUS_Nx50, 12401 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, 12402 ALC668_FIXUP_ASUS_Nx51, 12403 ALC668_FIXUP_MIC_COEF, 12404 ALC668_FIXUP_ASUS_G751, 12405 ALC891_FIXUP_HEADSET_MODE, 12406 ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 12407 ALC662_FIXUP_ACER_VERITON, 12408 ALC892_FIXUP_ASROCK_MOBO, 12409 ALC662_FIXUP_USI_FUNC, 12410 ALC662_FIXUP_USI_HEADSET_MODE, 12411 ALC662_FIXUP_LENOVO_MULTI_CODECS, 12412 ALC669_FIXUP_ACER_ASPIRE_ETHOS, 12413 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, 12414 ALC671_FIXUP_HP_HEADSET_MIC2, 12415 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, 12416 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, 12417 ALC668_FIXUP_ASUS_NO_HEADSET_MIC, 12418 ALC668_FIXUP_HEADSET_MIC, 12419 ALC668_FIXUP_MIC_DET_COEF, 12420 ALC897_FIXUP_LENOVO_HEADSET_MIC, 12421 ALC897_FIXUP_HEADSET_MIC_PIN, 12422 ALC897_FIXUP_HP_HSMIC_VERB, 12423 ALC897_FIXUP_LENOVO_HEADSET_MODE, 12424 ALC897_FIXUP_HEADSET_MIC_PIN2, 12425 ALC897_FIXUP_UNIS_H3C_X500S, 12426 ALC897_FIXUP_HEADSET_MIC_PIN3, 12427 }; 12428 12429 static const struct hda_fixup alc662_fixups[] = { 12430 [ALC662_FIXUP_ASPIRE] = { 12431 .type = HDA_FIXUP_PINS, 12432 .v.pins = (const struct hda_pintbl[]) { 12433 { 0x15, 0x99130112 }, /* subwoofer */ 12434 { } 12435 } 12436 }, 12437 [ALC662_FIXUP_LED_GPIO1] = { 12438 .type = HDA_FIXUP_FUNC, 12439 .v.func = alc662_fixup_led_gpio1, 12440 }, 12441 [ALC662_FIXUP_IDEAPAD] = { 12442 .type = HDA_FIXUP_PINS, 12443 .v.pins = (const struct hda_pintbl[]) { 12444 { 0x17, 0x99130112 }, /* subwoofer */ 12445 { } 12446 }, 12447 .chained = true, 12448 .chain_id = ALC662_FIXUP_LED_GPIO1, 12449 }, 12450 [ALC272_FIXUP_MARIO] = { 12451 .type = HDA_FIXUP_FUNC, 12452 .v.func = alc272_fixup_mario, 12453 }, 12454 [ALC662_FIXUP_CZC_ET26] = { 12455 .type = HDA_FIXUP_PINS, 12456 .v.pins = (const struct hda_pintbl[]) { 12457 {0x12, 0x403cc000}, 12458 {0x14, 0x90170110}, /* speaker */ 12459 {0x15, 0x411111f0}, 12460 {0x16, 0x411111f0}, 12461 {0x18, 0x01a19030}, /* mic */ 12462 {0x19, 0x90a7013f}, /* int-mic */ 12463 {0x1a, 0x01014020}, 12464 {0x1b, 0x0121401f}, 12465 {0x1c, 0x411111f0}, 12466 {0x1d, 0x411111f0}, 12467 {0x1e, 0x40478e35}, 12468 {} 12469 }, 12470 .chained = true, 12471 .chain_id = ALC662_FIXUP_SKU_IGNORE 12472 }, 12473 [ALC662_FIXUP_CZC_P10T] = { 12474 .type = HDA_FIXUP_VERBS, 12475 .v.verbs = (const struct hda_verb[]) { 12476 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, 12477 {} 12478 } 12479 }, 12480 [ALC662_FIXUP_SKU_IGNORE] = { 12481 .type = HDA_FIXUP_FUNC, 12482 .v.func = alc_fixup_sku_ignore, 12483 }, 12484 [ALC662_FIXUP_HP_RP5800] = { 12485 .type = HDA_FIXUP_PINS, 12486 .v.pins = (const struct hda_pintbl[]) { 12487 { 0x14, 0x0221201f }, /* HP out */ 12488 { } 12489 }, 12490 .chained = true, 12491 .chain_id = ALC662_FIXUP_SKU_IGNORE 12492 }, 12493 [ALC662_FIXUP_ASUS_MODE1] = { 12494 .type = HDA_FIXUP_PINS, 12495 .v.pins = (const struct hda_pintbl[]) { 12496 { 0x14, 0x99130110 }, /* speaker */ 12497 { 0x18, 0x01a19c20 }, /* mic */ 12498 { 0x19, 0x99a3092f }, /* int-mic */ 12499 { 0x21, 0x0121401f }, /* HP out */ 12500 { } 12501 }, 12502 .chained = true, 12503 .chain_id = ALC662_FIXUP_SKU_IGNORE 12504 }, 12505 [ALC662_FIXUP_ASUS_MODE2] = { 12506 .type = HDA_FIXUP_PINS, 12507 .v.pins = (const struct hda_pintbl[]) { 12508 { 0x14, 0x99130110 }, /* speaker */ 12509 { 0x18, 0x01a19820 }, /* mic */ 12510 { 0x19, 0x99a3092f }, /* int-mic */ 12511 { 0x1b, 0x0121401f }, /* HP out */ 12512 { } 12513 }, 12514 .chained = true, 12515 .chain_id = ALC662_FIXUP_SKU_IGNORE 12516 }, 12517 [ALC662_FIXUP_ASUS_MODE3] = { 12518 .type = HDA_FIXUP_PINS, 12519 .v.pins = (const struct hda_pintbl[]) { 12520 { 0x14, 0x99130110 }, /* speaker */ 12521 { 0x15, 0x0121441f }, /* HP */ 12522 { 0x18, 0x01a19840 }, /* mic */ 12523 { 0x19, 0x99a3094f }, /* int-mic */ 12524 { 0x21, 0x01211420 }, /* HP2 */ 12525 { } 12526 }, 12527 .chained = true, 12528 .chain_id = ALC662_FIXUP_SKU_IGNORE 12529 }, 12530 [ALC662_FIXUP_ASUS_MODE4] = { 12531 .type = HDA_FIXUP_PINS, 12532 .v.pins = (const struct hda_pintbl[]) { 12533 { 0x14, 0x99130110 }, /* speaker */ 12534 { 0x16, 0x99130111 }, /* speaker */ 12535 { 0x18, 0x01a19840 }, /* mic */ 12536 { 0x19, 0x99a3094f }, /* int-mic */ 12537 { 0x21, 0x0121441f }, /* HP */ 12538 { } 12539 }, 12540 .chained = true, 12541 .chain_id = ALC662_FIXUP_SKU_IGNORE 12542 }, 12543 [ALC662_FIXUP_ASUS_MODE5] = { 12544 .type = HDA_FIXUP_PINS, 12545 .v.pins = (const struct hda_pintbl[]) { 12546 { 0x14, 0x99130110 }, /* speaker */ 12547 { 0x15, 0x0121441f }, /* HP */ 12548 { 0x16, 0x99130111 }, /* speaker */ 12549 { 0x18, 0x01a19840 }, /* mic */ 12550 { 0x19, 0x99a3094f }, /* int-mic */ 12551 { } 12552 }, 12553 .chained = true, 12554 .chain_id = ALC662_FIXUP_SKU_IGNORE 12555 }, 12556 [ALC662_FIXUP_ASUS_MODE6] = { 12557 .type = HDA_FIXUP_PINS, 12558 .v.pins = (const struct hda_pintbl[]) { 12559 { 0x14, 0x99130110 }, /* speaker */ 12560 { 0x15, 0x01211420 }, /* HP2 */ 12561 { 0x18, 0x01a19840 }, /* mic */ 12562 { 0x19, 0x99a3094f }, /* int-mic */ 12563 { 0x1b, 0x0121441f }, /* HP */ 12564 { } 12565 }, 12566 .chained = true, 12567 .chain_id = ALC662_FIXUP_SKU_IGNORE 12568 }, 12569 [ALC662_FIXUP_ASUS_MODE7] = { 12570 .type = HDA_FIXUP_PINS, 12571 .v.pins = (const struct hda_pintbl[]) { 12572 { 0x14, 0x99130110 }, /* speaker */ 12573 { 0x17, 0x99130111 }, /* speaker */ 12574 { 0x18, 0x01a19840 }, /* mic */ 12575 { 0x19, 0x99a3094f }, /* int-mic */ 12576 { 0x1b, 0x01214020 }, /* HP */ 12577 { 0x21, 0x0121401f }, /* HP */ 12578 { } 12579 }, 12580 .chained = true, 12581 .chain_id = ALC662_FIXUP_SKU_IGNORE 12582 }, 12583 [ALC662_FIXUP_ASUS_MODE8] = { 12584 .type = HDA_FIXUP_PINS, 12585 .v.pins = (const struct hda_pintbl[]) { 12586 { 0x14, 0x99130110 }, /* speaker */ 12587 { 0x12, 0x99a30970 }, /* int-mic */ 12588 { 0x15, 0x01214020 }, /* HP */ 12589 { 0x17, 0x99130111 }, /* speaker */ 12590 { 0x18, 0x01a19840 }, /* mic */ 12591 { 0x21, 0x0121401f }, /* HP */ 12592 { } 12593 }, 12594 .chained = true, 12595 .chain_id = ALC662_FIXUP_SKU_IGNORE 12596 }, 12597 [ALC662_FIXUP_NO_JACK_DETECT] = { 12598 .type = HDA_FIXUP_FUNC, 12599 .v.func = alc_fixup_no_jack_detect, 12600 }, 12601 [ALC662_FIXUP_ZOTAC_Z68] = { 12602 .type = HDA_FIXUP_PINS, 12603 .v.pins = (const struct hda_pintbl[]) { 12604 { 0x1b, 0x02214020 }, /* Front HP */ 12605 { } 12606 } 12607 }, 12608 [ALC662_FIXUP_INV_DMIC] = { 12609 .type = HDA_FIXUP_FUNC, 12610 .v.func = alc_fixup_inv_dmic, 12611 }, 12612 [ALC668_FIXUP_DELL_XPS13] = { 12613 .type = HDA_FIXUP_FUNC, 12614 .v.func = alc_fixup_dell_xps13, 12615 .chained = true, 12616 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX 12617 }, 12618 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { 12619 .type = HDA_FIXUP_FUNC, 12620 .v.func = alc_fixup_disable_aamix, 12621 .chained = true, 12622 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE 12623 }, 12624 [ALC668_FIXUP_AUTO_MUTE] = { 12625 .type = HDA_FIXUP_FUNC, 12626 .v.func = alc_fixup_auto_mute_via_amp, 12627 .chained = true, 12628 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE 12629 }, 12630 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { 12631 .type = HDA_FIXUP_PINS, 12632 .v.pins = (const struct hda_pintbl[]) { 12633 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12634 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ 12635 { } 12636 }, 12637 .chained = true, 12638 .chain_id = ALC662_FIXUP_HEADSET_MODE 12639 }, 12640 [ALC662_FIXUP_HEADSET_MODE] = { 12641 .type = HDA_FIXUP_FUNC, 12642 .v.func = alc_fixup_headset_mode_alc662, 12643 }, 12644 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { 12645 .type = HDA_FIXUP_PINS, 12646 .v.pins = (const struct hda_pintbl[]) { 12647 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 12648 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12649 { } 12650 }, 12651 .chained = true, 12652 .chain_id = ALC668_FIXUP_HEADSET_MODE 12653 }, 12654 [ALC668_FIXUP_HEADSET_MODE] = { 12655 .type = HDA_FIXUP_FUNC, 12656 .v.func = alc_fixup_headset_mode_alc668, 12657 }, 12658 [ALC662_FIXUP_BASS_MODE4_CHMAP] = { 12659 .type = HDA_FIXUP_FUNC, 12660 .v.func = alc_fixup_bass_chmap, 12661 .chained = true, 12662 .chain_id = ALC662_FIXUP_ASUS_MODE4 12663 }, 12664 [ALC662_FIXUP_BASS_16] = { 12665 .type = HDA_FIXUP_PINS, 12666 .v.pins = (const struct hda_pintbl[]) { 12667 {0x16, 0x80106111}, /* bass speaker */ 12668 {} 12669 }, 12670 .chained = true, 12671 .chain_id = ALC662_FIXUP_BASS_CHMAP, 12672 }, 12673 [ALC662_FIXUP_BASS_1A] = { 12674 .type = HDA_FIXUP_PINS, 12675 .v.pins = (const struct hda_pintbl[]) { 12676 {0x1a, 0x80106111}, /* bass speaker */ 12677 {} 12678 }, 12679 .chained = true, 12680 .chain_id = ALC662_FIXUP_BASS_CHMAP, 12681 }, 12682 [ALC662_FIXUP_BASS_CHMAP] = { 12683 .type = HDA_FIXUP_FUNC, 12684 .v.func = alc_fixup_bass_chmap, 12685 }, 12686 [ALC662_FIXUP_ASUS_Nx50] = { 12687 .type = HDA_FIXUP_FUNC, 12688 .v.func = alc_fixup_auto_mute_via_amp, 12689 .chained = true, 12690 .chain_id = ALC662_FIXUP_BASS_1A 12691 }, 12692 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { 12693 .type = HDA_FIXUP_FUNC, 12694 .v.func = alc_fixup_headset_mode_alc668, 12695 .chain_id = ALC662_FIXUP_BASS_CHMAP 12696 }, 12697 [ALC668_FIXUP_ASUS_Nx51] = { 12698 .type = HDA_FIXUP_PINS, 12699 .v.pins = (const struct hda_pintbl[]) { 12700 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 12701 { 0x1a, 0x90170151 }, /* bass speaker */ 12702 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12703 {} 12704 }, 12705 .chained = true, 12706 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, 12707 }, 12708 [ALC668_FIXUP_MIC_COEF] = { 12709 .type = HDA_FIXUP_VERBS, 12710 .v.verbs = (const struct hda_verb[]) { 12711 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, 12712 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, 12713 {} 12714 }, 12715 }, 12716 [ALC668_FIXUP_ASUS_G751] = { 12717 .type = HDA_FIXUP_PINS, 12718 .v.pins = (const struct hda_pintbl[]) { 12719 { 0x16, 0x0421101f }, /* HP */ 12720 {} 12721 }, 12722 .chained = true, 12723 .chain_id = ALC668_FIXUP_MIC_COEF 12724 }, 12725 [ALC891_FIXUP_HEADSET_MODE] = { 12726 .type = HDA_FIXUP_FUNC, 12727 .v.func = alc_fixup_headset_mode, 12728 }, 12729 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { 12730 .type = HDA_FIXUP_PINS, 12731 .v.pins = (const struct hda_pintbl[]) { 12732 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 12733 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12734 { } 12735 }, 12736 .chained = true, 12737 .chain_id = ALC891_FIXUP_HEADSET_MODE 12738 }, 12739 [ALC662_FIXUP_ACER_VERITON] = { 12740 .type = HDA_FIXUP_PINS, 12741 .v.pins = (const struct hda_pintbl[]) { 12742 { 0x15, 0x50170120 }, /* no internal speaker */ 12743 { } 12744 } 12745 }, 12746 [ALC892_FIXUP_ASROCK_MOBO] = { 12747 .type = HDA_FIXUP_PINS, 12748 .v.pins = (const struct hda_pintbl[]) { 12749 { 0x15, 0x40f000f0 }, /* disabled */ 12750 { 0x16, 0x40f000f0 }, /* disabled */ 12751 { } 12752 } 12753 }, 12754 [ALC662_FIXUP_USI_FUNC] = { 12755 .type = HDA_FIXUP_FUNC, 12756 .v.func = alc662_fixup_usi_headset_mic, 12757 }, 12758 [ALC662_FIXUP_USI_HEADSET_MODE] = { 12759 .type = HDA_FIXUP_PINS, 12760 .v.pins = (const struct hda_pintbl[]) { 12761 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ 12762 { 0x18, 0x01a1903d }, 12763 { } 12764 }, 12765 .chained = true, 12766 .chain_id = ALC662_FIXUP_USI_FUNC 12767 }, 12768 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { 12769 .type = HDA_FIXUP_FUNC, 12770 .v.func = alc233_alc662_fixup_lenovo_dual_codecs, 12771 }, 12772 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { 12773 .type = HDA_FIXUP_FUNC, 12774 .v.func = alc662_fixup_aspire_ethos_hp, 12775 }, 12776 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { 12777 .type = HDA_FIXUP_PINS, 12778 .v.pins = (const struct hda_pintbl[]) { 12779 { 0x15, 0x92130110 }, /* front speakers */ 12780 { 0x18, 0x99130111 }, /* center/subwoofer */ 12781 { 0x1b, 0x11130012 }, /* surround plus jack for HP */ 12782 { } 12783 }, 12784 .chained = true, 12785 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET 12786 }, 12787 [ALC671_FIXUP_HP_HEADSET_MIC2] = { 12788 .type = HDA_FIXUP_FUNC, 12789 .v.func = alc671_fixup_hp_headset_mic2, 12790 }, 12791 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { 12792 .type = HDA_FIXUP_PINS, 12793 .v.pins = (const struct hda_pintbl[]) { 12794 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ 12795 { } 12796 }, 12797 .chained = true, 12798 .chain_id = ALC662_FIXUP_USI_FUNC 12799 }, 12800 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { 12801 .type = HDA_FIXUP_PINS, 12802 .v.pins = (const struct hda_pintbl[]) { 12803 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ 12804 { 0x1b, 0x0221144f }, 12805 { } 12806 }, 12807 .chained = true, 12808 .chain_id = ALC662_FIXUP_USI_FUNC 12809 }, 12810 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = { 12811 .type = HDA_FIXUP_PINS, 12812 .v.pins = (const struct hda_pintbl[]) { 12813 { 0x1b, 0x04a1112c }, 12814 { } 12815 }, 12816 .chained = true, 12817 .chain_id = ALC668_FIXUP_HEADSET_MIC 12818 }, 12819 [ALC668_FIXUP_HEADSET_MIC] = { 12820 .type = HDA_FIXUP_FUNC, 12821 .v.func = alc269_fixup_headset_mic, 12822 .chained = true, 12823 .chain_id = ALC668_FIXUP_MIC_DET_COEF 12824 }, 12825 [ALC668_FIXUP_MIC_DET_COEF] = { 12826 .type = HDA_FIXUP_VERBS, 12827 .v.verbs = (const struct hda_verb[]) { 12828 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 }, 12829 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 }, 12830 {} 12831 }, 12832 }, 12833 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = { 12834 .type = HDA_FIXUP_FUNC, 12835 .v.func = alc897_fixup_lenovo_headset_mic, 12836 }, 12837 [ALC897_FIXUP_HEADSET_MIC_PIN] = { 12838 .type = HDA_FIXUP_PINS, 12839 .v.pins = (const struct hda_pintbl[]) { 12840 { 0x1a, 0x03a11050 }, 12841 { } 12842 }, 12843 .chained = true, 12844 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC 12845 }, 12846 [ALC897_FIXUP_HP_HSMIC_VERB] = { 12847 .type = HDA_FIXUP_PINS, 12848 .v.pins = (const struct hda_pintbl[]) { 12849 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 12850 { } 12851 }, 12852 }, 12853 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = { 12854 .type = HDA_FIXUP_FUNC, 12855 .v.func = alc897_fixup_lenovo_headset_mode, 12856 }, 12857 [ALC897_FIXUP_HEADSET_MIC_PIN2] = { 12858 .type = HDA_FIXUP_PINS, 12859 .v.pins = (const struct hda_pintbl[]) { 12860 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ 12861 { } 12862 }, 12863 .chained = true, 12864 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE 12865 }, 12866 [ALC897_FIXUP_UNIS_H3C_X500S] = { 12867 .type = HDA_FIXUP_VERBS, 12868 .v.verbs = (const struct hda_verb[]) { 12869 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 }, 12870 {} 12871 }, 12872 }, 12873 [ALC897_FIXUP_HEADSET_MIC_PIN3] = { 12874 .type = HDA_FIXUP_PINS, 12875 .v.pins = (const struct hda_pintbl[]) { 12876 { 0x19, 0x03a11050 }, /* use as headset mic */ 12877 { } 12878 }, 12879 }, 12880 }; 12881 12882 static const struct hda_quirk alc662_fixup_tbl[] = { 12883 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), 12884 SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3), 12885 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), 12886 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), 12887 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), 12888 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), 12889 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), 12890 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), 12891 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 12892 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), 12893 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), 12894 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), 12895 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12896 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12897 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), 12898 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), 12899 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), 12900 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12901 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12902 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12903 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12904 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12905 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 12906 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12907 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12908 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12909 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), 12910 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2), 12911 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2), 12912 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2), 12913 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), 12914 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), 12915 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), 12916 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), 12917 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), 12918 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), 12919 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), 12920 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), 12921 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), 12922 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC), 12923 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), 12924 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), 12925 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), 12926 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), 12927 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), 12928 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 12929 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), 12930 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), 12931 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN), 12932 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN), 12933 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN), 12934 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN), 12935 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN), 12936 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN), 12937 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN), 12938 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN), 12939 SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN), 12940 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2), 12941 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 12942 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 12943 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), 12944 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), 12945 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), 12946 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), 12947 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), 12948 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB), 12949 12950 #if 0 12951 /* Below is a quirk table taken from the old code. 12952 * Basically the device should work as is without the fixup table. 12953 * If BIOS doesn't give a proper info, enable the corresponding 12954 * fixup entry. 12955 */ 12956 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), 12957 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), 12958 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), 12959 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), 12960 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 12961 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12962 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 12963 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), 12964 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), 12965 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12966 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), 12967 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), 12968 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), 12969 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), 12970 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), 12971 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12972 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), 12973 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), 12974 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12975 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 12976 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 12977 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12978 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), 12979 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), 12980 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), 12981 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12982 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), 12983 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 12984 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12985 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), 12986 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12987 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12988 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), 12989 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), 12990 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), 12991 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), 12992 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), 12993 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), 12994 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), 12995 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12996 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), 12997 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), 12998 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 12999 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), 13000 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), 13001 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), 13002 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), 13003 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), 13004 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 13005 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), 13006 #endif 13007 {} 13008 }; 13009 13010 static const struct hda_model_fixup alc662_fixup_models[] = { 13011 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, 13012 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, 13013 {.id = ALC272_FIXUP_MARIO, .name = "mario"}, 13014 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, 13015 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, 13016 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, 13017 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, 13018 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, 13019 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, 13020 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, 13021 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, 13022 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, 13023 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, 13024 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, 13025 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, 13026 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 13027 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, 13028 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, 13029 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, 13030 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, 13031 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, 13032 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, 13033 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, 13034 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, 13035 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, 13036 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, 13037 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, 13038 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, 13039 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, 13040 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, 13041 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, 13042 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, 13043 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"}, 13044 {} 13045 }; 13046 13047 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 13048 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 13049 {0x17, 0x02211010}, 13050 {0x18, 0x01a19030}, 13051 {0x1a, 0x01813040}, 13052 {0x21, 0x01014020}), 13053 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 13054 {0x16, 0x01813030}, 13055 {0x17, 0x02211010}, 13056 {0x18, 0x01a19040}, 13057 {0x21, 0x01014020}), 13058 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, 13059 {0x14, 0x01014010}, 13060 {0x18, 0x01a19020}, 13061 {0x1a, 0x0181302f}, 13062 {0x1b, 0x0221401f}), 13063 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 13064 {0x12, 0x99a30130}, 13065 {0x14, 0x90170110}, 13066 {0x15, 0x0321101f}, 13067 {0x16, 0x03011020}), 13068 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 13069 {0x12, 0x99a30140}, 13070 {0x14, 0x90170110}, 13071 {0x15, 0x0321101f}, 13072 {0x16, 0x03011020}), 13073 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 13074 {0x12, 0x99a30150}, 13075 {0x14, 0x90170110}, 13076 {0x15, 0x0321101f}, 13077 {0x16, 0x03011020}), 13078 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 13079 {0x14, 0x90170110}, 13080 {0x15, 0x0321101f}, 13081 {0x16, 0x03011020}), 13082 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, 13083 {0x12, 0x90a60130}, 13084 {0x14, 0x90170110}, 13085 {0x15, 0x0321101f}), 13086 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 13087 {0x14, 0x01014010}, 13088 {0x17, 0x90170150}, 13089 {0x19, 0x02a11060}, 13090 {0x1b, 0x01813030}, 13091 {0x21, 0x02211020}), 13092 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 13093 {0x14, 0x01014010}, 13094 {0x18, 0x01a19040}, 13095 {0x1b, 0x01813030}, 13096 {0x21, 0x02211020}), 13097 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 13098 {0x14, 0x01014020}, 13099 {0x17, 0x90170110}, 13100 {0x18, 0x01a19050}, 13101 {0x1b, 0x01813040}, 13102 {0x21, 0x02211030}), 13103 {} 13104 }; 13105 13106 /* 13107 */ 13108 static int patch_alc662(struct hda_codec *codec) 13109 { 13110 struct alc_spec *spec; 13111 int err; 13112 13113 err = alc_alloc_spec(codec, 0x0b); 13114 if (err < 0) 13115 return err; 13116 13117 spec = codec->spec; 13118 13119 spec->shutup = alc_eapd_shutup; 13120 13121 /* handle multiple HPs as is */ 13122 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 13123 13124 alc_fix_pll_init(codec, 0x20, 0x04, 15); 13125 13126 switch (codec->core.vendor_id) { 13127 case 0x10ec0668: 13128 spec->init_hook = alc668_restore_default_value; 13129 break; 13130 } 13131 13132 alc_pre_init(codec); 13133 13134 snd_hda_pick_fixup(codec, alc662_fixup_models, 13135 alc662_fixup_tbl, alc662_fixups); 13136 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); 13137 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 13138 13139 alc_auto_parse_customize_define(codec); 13140 13141 if (has_cdefine_beep(codec)) 13142 spec->gen.beep_nid = 0x01; 13143 13144 if ((alc_get_coef0(codec) & (1 << 14)) && 13145 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && 13146 spec->cdefine.platform_type == 1) { 13147 err = alc_codec_rename(codec, "ALC272X"); 13148 if (err < 0) 13149 goto error; 13150 } 13151 13152 /* automatic parse from the BIOS config */ 13153 err = alc662_parse_auto_config(codec); 13154 if (err < 0) 13155 goto error; 13156 13157 if (!spec->gen.no_analog && spec->gen.beep_nid) { 13158 switch (codec->core.vendor_id) { 13159 case 0x10ec0662: 13160 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 13161 break; 13162 case 0x10ec0272: 13163 case 0x10ec0663: 13164 case 0x10ec0665: 13165 case 0x10ec0668: 13166 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 13167 break; 13168 case 0x10ec0273: 13169 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); 13170 break; 13171 } 13172 if (err < 0) 13173 goto error; 13174 } 13175 13176 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 13177 13178 return 0; 13179 13180 error: 13181 alc_free(codec); 13182 return err; 13183 } 13184 13185 /* 13186 * ALC680 support 13187 */ 13188 13189 static int alc680_parse_auto_config(struct hda_codec *codec) 13190 { 13191 return alc_parse_auto_config(codec, NULL, NULL); 13192 } 13193 13194 /* 13195 */ 13196 static int patch_alc680(struct hda_codec *codec) 13197 { 13198 int err; 13199 13200 /* ALC680 has no aa-loopback mixer */ 13201 err = alc_alloc_spec(codec, 0); 13202 if (err < 0) 13203 return err; 13204 13205 /* automatic parse from the BIOS config */ 13206 err = alc680_parse_auto_config(codec); 13207 if (err < 0) { 13208 alc_free(codec); 13209 return err; 13210 } 13211 13212 return 0; 13213 } 13214 13215 /* 13216 * patch entries 13217 */ 13218 static const struct hda_device_id snd_hda_id_realtek[] = { 13219 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), 13220 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), 13221 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), 13222 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), 13223 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269), 13224 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), 13225 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), 13226 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), 13227 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), 13228 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), 13229 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), 13230 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), 13231 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), 13232 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), 13233 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), 13234 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), 13235 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), 13236 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), 13237 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), 13238 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), 13239 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), 13240 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), 13241 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), 13242 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), 13243 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), 13244 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), 13245 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), 13246 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), 13247 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), 13248 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), 13249 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), 13250 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), 13251 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), 13252 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), 13253 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), 13254 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), 13255 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), 13256 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), 13257 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), 13258 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), 13259 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), 13260 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), 13261 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), 13262 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), 13263 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), 13264 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), 13265 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), 13266 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), 13267 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), 13268 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), 13269 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), 13270 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), 13271 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), 13272 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), 13273 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), 13274 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), 13275 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), 13276 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), 13277 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), 13278 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), 13279 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), 13280 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), 13281 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), 13282 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), 13283 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), 13284 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), 13285 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), 13286 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), 13287 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), 13288 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), 13289 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), 13290 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), 13291 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662), 13292 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), 13293 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), 13294 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), 13295 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), 13296 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), 13297 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269), 13298 {} /* terminator */ 13299 }; 13300 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); 13301 13302 MODULE_LICENSE("GPL"); 13303 MODULE_DESCRIPTION("Realtek HD-audio codec"); 13304 MODULE_IMPORT_NS("SND_HDA_SCODEC_COMPONENT"); 13305 13306 static struct hda_codec_driver realtek_driver = { 13307 .id = snd_hda_id_realtek, 13308 }; 13309 13310 module_hda_codec_driver(realtek_driver); 13311