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 129 /* for PLL fix */ 130 hda_nid_t pll_nid; 131 unsigned int pll_coef_idx, pll_coef_bit; 132 unsigned int coef0; 133 struct input_dev *kb_dev; 134 u8 alc_mute_keycode_map[1]; 135 136 /* component binding */ 137 struct hda_component_parent comps; 138 }; 139 140 /* 141 * COEF access helper functions 142 */ 143 144 static void coef_mutex_lock(struct hda_codec *codec) 145 { 146 struct alc_spec *spec = codec->spec; 147 148 snd_hda_power_up_pm(codec); 149 mutex_lock(&spec->coef_mutex); 150 } 151 152 static void coef_mutex_unlock(struct hda_codec *codec) 153 { 154 struct alc_spec *spec = codec->spec; 155 156 mutex_unlock(&spec->coef_mutex); 157 snd_hda_power_down_pm(codec); 158 } 159 160 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 161 unsigned int coef_idx) 162 { 163 unsigned int val; 164 165 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 166 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); 167 return val; 168 } 169 170 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 171 unsigned int coef_idx) 172 { 173 unsigned int val; 174 175 coef_mutex_lock(codec); 176 val = __alc_read_coefex_idx(codec, nid, coef_idx); 177 coef_mutex_unlock(codec); 178 return val; 179 } 180 181 #define alc_read_coef_idx(codec, coef_idx) \ 182 alc_read_coefex_idx(codec, 0x20, coef_idx) 183 184 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 185 unsigned int coef_idx, unsigned int coef_val) 186 { 187 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 188 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); 189 } 190 191 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 192 unsigned int coef_idx, unsigned int coef_val) 193 { 194 coef_mutex_lock(codec); 195 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val); 196 coef_mutex_unlock(codec); 197 } 198 199 #define alc_write_coef_idx(codec, coef_idx, coef_val) \ 200 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) 201 202 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 203 unsigned int coef_idx, unsigned int mask, 204 unsigned int bits_set) 205 { 206 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx); 207 208 if (val != -1) 209 __alc_write_coefex_idx(codec, nid, coef_idx, 210 (val & ~mask) | bits_set); 211 } 212 213 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 214 unsigned int coef_idx, unsigned int mask, 215 unsigned int bits_set) 216 { 217 coef_mutex_lock(codec); 218 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set); 219 coef_mutex_unlock(codec); 220 } 221 222 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ 223 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) 224 225 /* a special bypass for COEF 0; read the cached value at the second time */ 226 static unsigned int alc_get_coef0(struct hda_codec *codec) 227 { 228 struct alc_spec *spec = codec->spec; 229 230 if (!spec->coef0) 231 spec->coef0 = alc_read_coef_idx(codec, 0); 232 return spec->coef0; 233 } 234 235 /* coef writes/updates batch */ 236 struct coef_fw { 237 unsigned char nid; 238 unsigned char idx; 239 unsigned short mask; 240 unsigned short val; 241 }; 242 243 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ 244 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } 245 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) 246 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) 247 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) 248 249 static void alc_process_coef_fw(struct hda_codec *codec, 250 const struct coef_fw *fw) 251 { 252 coef_mutex_lock(codec); 253 for (; fw->nid; fw++) { 254 if (fw->mask == (unsigned short)-1) 255 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); 256 else 257 __alc_update_coefex_idx(codec, fw->nid, fw->idx, 258 fw->mask, fw->val); 259 } 260 coef_mutex_unlock(codec); 261 } 262 263 /* 264 * GPIO setup tables, used in initialization 265 */ 266 267 /* Enable GPIO mask and set output */ 268 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) 269 { 270 struct alc_spec *spec = codec->spec; 271 272 spec->gpio_mask |= mask; 273 spec->gpio_dir |= mask; 274 spec->gpio_data |= mask; 275 } 276 277 static void alc_write_gpio_data(struct hda_codec *codec) 278 { 279 struct alc_spec *spec = codec->spec; 280 281 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 282 spec->gpio_data); 283 } 284 285 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, 286 bool on) 287 { 288 struct alc_spec *spec = codec->spec; 289 unsigned int oldval = spec->gpio_data; 290 291 if (on) 292 spec->gpio_data |= mask; 293 else 294 spec->gpio_data &= ~mask; 295 if (oldval != spec->gpio_data) 296 alc_write_gpio_data(codec); 297 } 298 299 static void alc_write_gpio(struct hda_codec *codec) 300 { 301 struct alc_spec *spec = codec->spec; 302 303 if (!spec->gpio_mask) 304 return; 305 306 snd_hda_codec_write(codec, codec->core.afg, 0, 307 AC_VERB_SET_GPIO_MASK, spec->gpio_mask); 308 snd_hda_codec_write(codec, codec->core.afg, 0, 309 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); 310 if (spec->gpio_write_delay) 311 msleep(1); 312 alc_write_gpio_data(codec); 313 } 314 315 static void alc_fixup_gpio(struct hda_codec *codec, int action, 316 unsigned int mask) 317 { 318 if (action == HDA_FIXUP_ACT_PRE_PROBE) 319 alc_setup_gpio(codec, mask); 320 } 321 322 static void alc_fixup_gpio1(struct hda_codec *codec, 323 const struct hda_fixup *fix, int action) 324 { 325 alc_fixup_gpio(codec, action, 0x01); 326 } 327 328 static void alc_fixup_gpio2(struct hda_codec *codec, 329 const struct hda_fixup *fix, int action) 330 { 331 alc_fixup_gpio(codec, action, 0x02); 332 } 333 334 static void alc_fixup_gpio3(struct hda_codec *codec, 335 const struct hda_fixup *fix, int action) 336 { 337 alc_fixup_gpio(codec, action, 0x03); 338 } 339 340 static void alc_fixup_gpio4(struct hda_codec *codec, 341 const struct hda_fixup *fix, int action) 342 { 343 alc_fixup_gpio(codec, action, 0x04); 344 } 345 346 static void alc_fixup_micmute_led(struct hda_codec *codec, 347 const struct hda_fixup *fix, int action) 348 { 349 if (action == HDA_FIXUP_ACT_PRE_PROBE) 350 snd_hda_gen_add_micmute_led_cdev(codec, NULL); 351 } 352 353 /* 354 * Fix hardware PLL issue 355 * On some codecs, the analog PLL gating control must be off while 356 * the default value is 1. 357 */ 358 static void alc_fix_pll(struct hda_codec *codec) 359 { 360 struct alc_spec *spec = codec->spec; 361 362 if (spec->pll_nid) 363 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, 364 1 << spec->pll_coef_bit, 0); 365 } 366 367 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, 368 unsigned int coef_idx, unsigned int coef_bit) 369 { 370 struct alc_spec *spec = codec->spec; 371 spec->pll_nid = nid; 372 spec->pll_coef_idx = coef_idx; 373 spec->pll_coef_bit = coef_bit; 374 alc_fix_pll(codec); 375 } 376 377 /* update the master volume per volume-knob's unsol event */ 378 static void alc_update_knob_master(struct hda_codec *codec, 379 struct hda_jack_callback *jack) 380 { 381 unsigned int val; 382 struct snd_kcontrol *kctl; 383 struct snd_ctl_elem_value *uctl; 384 385 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); 386 if (!kctl) 387 return; 388 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); 389 if (!uctl) 390 return; 391 val = snd_hda_codec_read(codec, jack->nid, 0, 392 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); 393 val &= HDA_AMP_VOLMASK; 394 uctl->value.integer.value[0] = val; 395 uctl->value.integer.value[1] = val; 396 kctl->put(kctl, uctl); 397 kfree(uctl); 398 } 399 400 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) 401 { 402 /* For some reason, the res given from ALC880 is broken. 403 Here we adjust it properly. */ 404 snd_hda_jack_unsol_event(codec, res >> 2); 405 } 406 407 /* Change EAPD to verb control */ 408 static void alc_fill_eapd_coef(struct hda_codec *codec) 409 { 410 int coef; 411 412 coef = alc_get_coef0(codec); 413 414 switch (codec->core.vendor_id) { 415 case 0x10ec0262: 416 alc_update_coef_idx(codec, 0x7, 0, 1<<5); 417 break; 418 case 0x10ec0267: 419 case 0x10ec0268: 420 alc_update_coef_idx(codec, 0x7, 0, 1<<13); 421 break; 422 case 0x10ec0269: 423 if ((coef & 0x00f0) == 0x0010) 424 alc_update_coef_idx(codec, 0xd, 0, 1<<14); 425 if ((coef & 0x00f0) == 0x0020) 426 alc_update_coef_idx(codec, 0x4, 1<<15, 0); 427 if ((coef & 0x00f0) == 0x0030) 428 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 429 break; 430 case 0x10ec0280: 431 case 0x10ec0284: 432 case 0x10ec0290: 433 case 0x10ec0292: 434 alc_update_coef_idx(codec, 0x4, 1<<15, 0); 435 break; 436 case 0x10ec0225: 437 case 0x10ec0295: 438 case 0x10ec0299: 439 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 440 fallthrough; 441 case 0x10ec0215: 442 case 0x10ec0285: 443 case 0x10ec0289: 444 alc_update_coef_idx(codec, 0x36, 1<<13, 0); 445 fallthrough; 446 case 0x10ec0230: 447 case 0x10ec0233: 448 case 0x10ec0235: 449 case 0x10ec0236: 450 case 0x10ec0245: 451 case 0x10ec0255: 452 case 0x10ec0256: 453 case 0x19e58326: 454 case 0x10ec0257: 455 case 0x10ec0282: 456 case 0x10ec0283: 457 case 0x10ec0286: 458 case 0x10ec0288: 459 case 0x10ec0298: 460 case 0x10ec0300: 461 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 462 break; 463 case 0x10ec0275: 464 alc_update_coef_idx(codec, 0xe, 0, 1<<0); 465 break; 466 case 0x10ec0287: 467 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 468 alc_write_coef_idx(codec, 0x8, 0x4ab7); 469 break; 470 case 0x10ec0293: 471 alc_update_coef_idx(codec, 0xa, 1<<13, 0); 472 break; 473 case 0x10ec0234: 474 case 0x10ec0274: 475 case 0x10ec0294: 476 case 0x10ec0700: 477 case 0x10ec0701: 478 case 0x10ec0703: 479 case 0x10ec0711: 480 alc_update_coef_idx(codec, 0x10, 1<<15, 0); 481 break; 482 case 0x10ec0662: 483 if ((coef & 0x00f0) == 0x0030) 484 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ 485 break; 486 case 0x10ec0272: 487 case 0x10ec0273: 488 case 0x10ec0663: 489 case 0x10ec0665: 490 case 0x10ec0670: 491 case 0x10ec0671: 492 case 0x10ec0672: 493 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ 494 break; 495 case 0x10ec0222: 496 case 0x10ec0623: 497 alc_update_coef_idx(codec, 0x19, 1<<13, 0); 498 break; 499 case 0x10ec0668: 500 alc_update_coef_idx(codec, 0x7, 3<<13, 0); 501 break; 502 case 0x10ec0867: 503 alc_update_coef_idx(codec, 0x4, 1<<10, 0); 504 break; 505 case 0x10ec0888: 506 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) 507 alc_update_coef_idx(codec, 0x7, 1<<5, 0); 508 break; 509 case 0x10ec0892: 510 case 0x10ec0897: 511 alc_update_coef_idx(codec, 0x7, 1<<5, 0); 512 break; 513 case 0x10ec0899: 514 case 0x10ec0900: 515 case 0x10ec0b00: 516 case 0x10ec1168: 517 case 0x10ec1220: 518 alc_update_coef_idx(codec, 0x7, 1<<1, 0); 519 break; 520 } 521 } 522 523 /* additional initialization for ALC888 variants */ 524 static void alc888_coef_init(struct hda_codec *codec) 525 { 526 switch (alc_get_coef0(codec) & 0x00f0) { 527 /* alc888-VA */ 528 case 0x00: 529 /* alc888-VB */ 530 case 0x10: 531 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ 532 break; 533 } 534 } 535 536 /* turn on/off EAPD control (only if available) */ 537 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) 538 { 539 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) 540 return; 541 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) 542 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, 543 on ? 2 : 0); 544 } 545 546 /* turn on/off EAPD controls of the codec */ 547 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) 548 { 549 /* We currently only handle front, HP */ 550 static const hda_nid_t pins[] = { 551 0x0f, 0x10, 0x14, 0x15, 0x17, 0 552 }; 553 const hda_nid_t *p; 554 for (p = pins; *p; p++) 555 set_eapd(codec, *p, on); 556 } 557 558 static int find_ext_mic_pin(struct hda_codec *codec); 559 560 static void alc_headset_mic_no_shutup(struct hda_codec *codec) 561 { 562 const struct hda_pincfg *pin; 563 int mic_pin = find_ext_mic_pin(codec); 564 int i; 565 566 /* don't shut up pins when unloading the driver; otherwise it breaks 567 * the default pin setup at the next load of the driver 568 */ 569 if (codec->bus->shutdown) 570 return; 571 572 snd_array_for_each(&codec->init_pins, i, pin) { 573 /* use read here for syncing after issuing each verb */ 574 if (pin->nid != mic_pin) 575 snd_hda_codec_read(codec, pin->nid, 0, 576 AC_VERB_SET_PIN_WIDGET_CONTROL, 0); 577 } 578 579 codec->pins_shutup = 1; 580 } 581 582 static void alc_shutup_pins(struct hda_codec *codec) 583 { 584 struct alc_spec *spec = codec->spec; 585 586 switch (codec->core.vendor_id) { 587 case 0x10ec0236: 588 case 0x10ec0256: 589 case 0x19e58326: 590 case 0x10ec0283: 591 case 0x10ec0285: 592 case 0x10ec0286: 593 case 0x10ec0287: 594 case 0x10ec0288: 595 case 0x10ec0295: 596 case 0x10ec0298: 597 alc_headset_mic_no_shutup(codec); 598 break; 599 default: 600 if (!spec->no_shutup_pins) 601 snd_hda_shutup_pins(codec); 602 break; 603 } 604 } 605 606 /* generic shutup callback; 607 * just turning off EAPD and a little pause for avoiding pop-noise 608 */ 609 static void alc_eapd_shutup(struct hda_codec *codec) 610 { 611 struct alc_spec *spec = codec->spec; 612 613 alc_auto_setup_eapd(codec, false); 614 if (!spec->no_depop_delay) 615 msleep(200); 616 alc_shutup_pins(codec); 617 } 618 619 /* generic EAPD initialization */ 620 static void alc_auto_init_amp(struct hda_codec *codec, int type) 621 { 622 alc_auto_setup_eapd(codec, true); 623 alc_write_gpio(codec); 624 switch (type) { 625 case ALC_INIT_DEFAULT: 626 switch (codec->core.vendor_id) { 627 case 0x10ec0260: 628 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); 629 break; 630 case 0x10ec0880: 631 case 0x10ec0882: 632 case 0x10ec0883: 633 case 0x10ec0885: 634 alc_update_coef_idx(codec, 7, 0, 0x2030); 635 break; 636 case 0x10ec0888: 637 alc888_coef_init(codec); 638 break; 639 } 640 break; 641 } 642 } 643 644 /* get a primary headphone pin if available */ 645 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) 646 { 647 if (spec->gen.autocfg.hp_pins[0]) 648 return spec->gen.autocfg.hp_pins[0]; 649 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) 650 return spec->gen.autocfg.line_out_pins[0]; 651 return 0; 652 } 653 654 /* 655 * Realtek SSID verification 656 */ 657 658 /* Could be any non-zero and even value. When used as fixup, tells 659 * the driver to ignore any present sku defines. 660 */ 661 #define ALC_FIXUP_SKU_IGNORE (2) 662 663 static void alc_fixup_sku_ignore(struct hda_codec *codec, 664 const struct hda_fixup *fix, int action) 665 { 666 struct alc_spec *spec = codec->spec; 667 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 668 spec->cdefine.fixup = 1; 669 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; 670 } 671 } 672 673 static void alc_fixup_no_depop_delay(struct hda_codec *codec, 674 const struct hda_fixup *fix, int action) 675 { 676 struct alc_spec *spec = codec->spec; 677 678 if (action == HDA_FIXUP_ACT_PROBE) { 679 spec->no_depop_delay = 1; 680 codec->depop_delay = 0; 681 } 682 } 683 684 static int alc_auto_parse_customize_define(struct hda_codec *codec) 685 { 686 unsigned int ass, tmp, i; 687 unsigned nid = 0; 688 struct alc_spec *spec = codec->spec; 689 690 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ 691 692 if (spec->cdefine.fixup) { 693 ass = spec->cdefine.sku_cfg; 694 if (ass == ALC_FIXUP_SKU_IGNORE) 695 return -1; 696 goto do_sku; 697 } 698 699 if (!codec->bus->pci) 700 return -1; 701 ass = codec->core.subsystem_id & 0xffff; 702 if (ass != codec->bus->pci->subsystem_device && (ass & 1)) 703 goto do_sku; 704 705 nid = 0x1d; 706 if (codec->core.vendor_id == 0x10ec0260) 707 nid = 0x17; 708 ass = snd_hda_codec_get_pincfg(codec, nid); 709 710 if (!(ass & 1)) { 711 codec_info(codec, "%s: SKU not ready 0x%08x\n", 712 codec->core.chip_name, ass); 713 return -1; 714 } 715 716 /* check sum */ 717 tmp = 0; 718 for (i = 1; i < 16; i++) { 719 if ((ass >> i) & 1) 720 tmp++; 721 } 722 if (((ass >> 16) & 0xf) != tmp) 723 return -1; 724 725 spec->cdefine.port_connectivity = ass >> 30; 726 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; 727 spec->cdefine.check_sum = (ass >> 16) & 0xf; 728 spec->cdefine.customization = ass >> 8; 729 do_sku: 730 spec->cdefine.sku_cfg = ass; 731 spec->cdefine.external_amp = (ass & 0x38) >> 3; 732 spec->cdefine.platform_type = (ass & 0x4) >> 2; 733 spec->cdefine.swap = (ass & 0x2) >> 1; 734 spec->cdefine.override = ass & 0x1; 735 736 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", 737 nid, spec->cdefine.sku_cfg); 738 codec_dbg(codec, "SKU: port_connectivity=0x%x\n", 739 spec->cdefine.port_connectivity); 740 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); 741 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); 742 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); 743 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); 744 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); 745 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); 746 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); 747 748 return 0; 749 } 750 751 /* return the position of NID in the list, or -1 if not found */ 752 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) 753 { 754 int i; 755 for (i = 0; i < nums; i++) 756 if (list[i] == nid) 757 return i; 758 return -1; 759 } 760 /* return true if the given NID is found in the list */ 761 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) 762 { 763 return find_idx_in_nid_list(nid, list, nums) >= 0; 764 } 765 766 /* check subsystem ID and set up device-specific initialization; 767 * return 1 if initialized, 0 if invalid SSID 768 */ 769 /* 32-bit subsystem ID for BIOS loading in HD Audio codec. 770 * 31 ~ 16 : Manufacture ID 771 * 15 ~ 8 : SKU ID 772 * 7 ~ 0 : Assembly ID 773 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 774 */ 775 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) 776 { 777 unsigned int ass, tmp, i; 778 unsigned nid; 779 struct alc_spec *spec = codec->spec; 780 781 if (spec->cdefine.fixup) { 782 ass = spec->cdefine.sku_cfg; 783 if (ass == ALC_FIXUP_SKU_IGNORE) 784 return 0; 785 goto do_sku; 786 } 787 788 ass = codec->core.subsystem_id & 0xffff; 789 if (codec->bus->pci && 790 ass != codec->bus->pci->subsystem_device && (ass & 1)) 791 goto do_sku; 792 793 /* invalid SSID, check the special NID pin defcfg instead */ 794 /* 795 * 31~30 : port connectivity 796 * 29~21 : reserve 797 * 20 : PCBEEP input 798 * 19~16 : Check sum (15:1) 799 * 15~1 : Custom 800 * 0 : override 801 */ 802 nid = 0x1d; 803 if (codec->core.vendor_id == 0x10ec0260) 804 nid = 0x17; 805 ass = snd_hda_codec_get_pincfg(codec, nid); 806 codec_dbg(codec, 807 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", 808 ass, nid); 809 if (!(ass & 1)) 810 return 0; 811 if ((ass >> 30) != 1) /* no physical connection */ 812 return 0; 813 814 /* check sum */ 815 tmp = 0; 816 for (i = 1; i < 16; i++) { 817 if ((ass >> i) & 1) 818 tmp++; 819 } 820 if (((ass >> 16) & 0xf) != tmp) 821 return 0; 822 do_sku: 823 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", 824 ass & 0xffff, codec->core.vendor_id); 825 /* 826 * 0 : override 827 * 1 : Swap Jack 828 * 2 : 0 --> Desktop, 1 --> Laptop 829 * 3~5 : External Amplifier control 830 * 7~6 : Reserved 831 */ 832 tmp = (ass & 0x38) >> 3; /* external Amp control */ 833 if (spec->init_amp == ALC_INIT_UNDEFINED) { 834 switch (tmp) { 835 case 1: 836 alc_setup_gpio(codec, 0x01); 837 break; 838 case 3: 839 alc_setup_gpio(codec, 0x02); 840 break; 841 case 7: 842 alc_setup_gpio(codec, 0x04); 843 break; 844 case 5: 845 default: 846 spec->init_amp = ALC_INIT_DEFAULT; 847 break; 848 } 849 } 850 851 /* is laptop or Desktop and enable the function "Mute internal speaker 852 * when the external headphone out jack is plugged" 853 */ 854 if (!(ass & 0x8000)) 855 return 1; 856 /* 857 * 10~8 : Jack location 858 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered 859 * 14~13: Resvered 860 * 15 : 1 --> enable the function "Mute internal speaker 861 * when the external headphone out jack is plugged" 862 */ 863 if (!alc_get_hp_pin(spec)) { 864 hda_nid_t nid; 865 tmp = (ass >> 11) & 0x3; /* HP to chassis */ 866 nid = ports[tmp]; 867 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, 868 spec->gen.autocfg.line_outs)) 869 return 1; 870 spec->gen.autocfg.hp_pins[0] = nid; 871 } 872 return 1; 873 } 874 875 /* Check the validity of ALC subsystem-id 876 * ports contains an array of 4 pin NIDs for port-A, E, D and I */ 877 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) 878 { 879 if (!alc_subsystem_id(codec, ports)) { 880 struct alc_spec *spec = codec->spec; 881 if (spec->init_amp == ALC_INIT_UNDEFINED) { 882 codec_dbg(codec, 883 "realtek: Enable default setup for auto mode as fallback\n"); 884 spec->init_amp = ALC_INIT_DEFAULT; 885 } 886 } 887 } 888 889 /* 890 */ 891 892 static void alc_fixup_inv_dmic(struct hda_codec *codec, 893 const struct hda_fixup *fix, int action) 894 { 895 struct alc_spec *spec = codec->spec; 896 897 spec->gen.inv_dmic_split = 1; 898 } 899 900 901 static int alc_build_controls(struct hda_codec *codec) 902 { 903 int err; 904 905 err = snd_hda_gen_build_controls(codec); 906 if (err < 0) 907 return err; 908 909 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); 910 return 0; 911 } 912 913 914 /* 915 * Common callbacks 916 */ 917 918 static void alc_pre_init(struct hda_codec *codec) 919 { 920 alc_fill_eapd_coef(codec); 921 } 922 923 #define is_s3_resume(codec) \ 924 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) 925 #define is_s4_resume(codec) \ 926 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) 927 #define is_s4_suspend(codec) \ 928 ((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE) 929 930 static int alc_init(struct hda_codec *codec) 931 { 932 struct alc_spec *spec = codec->spec; 933 934 /* hibernation resume needs the full chip initialization */ 935 if (is_s4_resume(codec)) 936 alc_pre_init(codec); 937 938 if (spec->init_hook) 939 spec->init_hook(codec); 940 941 spec->gen.skip_verbs = 1; /* applied in below */ 942 snd_hda_gen_init(codec); 943 alc_fix_pll(codec); 944 alc_auto_init_amp(codec, spec->init_amp); 945 snd_hda_apply_verbs(codec); /* apply verbs here after own init */ 946 947 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); 948 949 return 0; 950 } 951 952 #define alc_free snd_hda_gen_free 953 954 static inline void alc_shutup(struct hda_codec *codec) 955 { 956 struct alc_spec *spec = codec->spec; 957 958 if (!snd_hda_get_bool_hint(codec, "shutup")) 959 return; /* disabled explicitly by hints */ 960 961 if (spec && spec->shutup) 962 spec->shutup(codec); 963 else 964 alc_shutup_pins(codec); 965 } 966 967 static void alc_power_eapd(struct hda_codec *codec) 968 { 969 alc_auto_setup_eapd(codec, false); 970 } 971 972 static int alc_suspend(struct hda_codec *codec) 973 { 974 struct alc_spec *spec = codec->spec; 975 alc_shutup(codec); 976 if (spec && spec->power_hook) 977 spec->power_hook(codec); 978 return 0; 979 } 980 981 static int alc_resume(struct hda_codec *codec) 982 { 983 struct alc_spec *spec = codec->spec; 984 985 if (!spec->no_depop_delay) 986 msleep(150); /* to avoid pop noise */ 987 codec->patch_ops.init(codec); 988 snd_hda_regmap_sync(codec); 989 hda_call_check_power_status(codec, 0x01); 990 return 0; 991 } 992 993 /* 994 */ 995 static const struct hda_codec_ops alc_patch_ops = { 996 .build_controls = alc_build_controls, 997 .build_pcms = snd_hda_gen_build_pcms, 998 .init = alc_init, 999 .free = alc_free, 1000 .unsol_event = snd_hda_jack_unsol_event, 1001 .resume = alc_resume, 1002 .suspend = alc_suspend, 1003 .check_power_status = snd_hda_gen_check_power_status, 1004 }; 1005 1006 1007 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) 1008 1009 /* 1010 * Rename codecs appropriately from COEF value or subvendor id 1011 */ 1012 struct alc_codec_rename_table { 1013 unsigned int vendor_id; 1014 unsigned short coef_mask; 1015 unsigned short coef_bits; 1016 const char *name; 1017 }; 1018 1019 struct alc_codec_rename_pci_table { 1020 unsigned int codec_vendor_id; 1021 unsigned short pci_subvendor; 1022 unsigned short pci_subdevice; 1023 const char *name; 1024 }; 1025 1026 static const struct alc_codec_rename_table rename_tbl[] = { 1027 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, 1028 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, 1029 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, 1030 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, 1031 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, 1032 { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, 1033 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, 1034 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, 1035 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, 1036 { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, 1037 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, 1038 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, 1039 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, 1040 { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, 1041 { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, 1042 { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, 1043 { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, 1044 { } /* terminator */ 1045 }; 1046 1047 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { 1048 { 0x10ec0280, 0x1028, 0, "ALC3220" }, 1049 { 0x10ec0282, 0x1028, 0, "ALC3221" }, 1050 { 0x10ec0283, 0x1028, 0, "ALC3223" }, 1051 { 0x10ec0288, 0x1028, 0, "ALC3263" }, 1052 { 0x10ec0292, 0x1028, 0, "ALC3226" }, 1053 { 0x10ec0293, 0x1028, 0, "ALC3235" }, 1054 { 0x10ec0255, 0x1028, 0, "ALC3234" }, 1055 { 0x10ec0668, 0x1028, 0, "ALC3661" }, 1056 { 0x10ec0275, 0x1028, 0, "ALC3260" }, 1057 { 0x10ec0899, 0x1028, 0, "ALC3861" }, 1058 { 0x10ec0298, 0x1028, 0, "ALC3266" }, 1059 { 0x10ec0236, 0x1028, 0, "ALC3204" }, 1060 { 0x10ec0256, 0x1028, 0, "ALC3246" }, 1061 { 0x10ec0225, 0x1028, 0, "ALC3253" }, 1062 { 0x10ec0295, 0x1028, 0, "ALC3254" }, 1063 { 0x10ec0299, 0x1028, 0, "ALC3271" }, 1064 { 0x10ec0670, 0x1025, 0, "ALC669X" }, 1065 { 0x10ec0676, 0x1025, 0, "ALC679X" }, 1066 { 0x10ec0282, 0x1043, 0, "ALC3229" }, 1067 { 0x10ec0233, 0x1043, 0, "ALC3236" }, 1068 { 0x10ec0280, 0x103c, 0, "ALC3228" }, 1069 { 0x10ec0282, 0x103c, 0, "ALC3227" }, 1070 { 0x10ec0286, 0x103c, 0, "ALC3242" }, 1071 { 0x10ec0290, 0x103c, 0, "ALC3241" }, 1072 { 0x10ec0668, 0x103c, 0, "ALC3662" }, 1073 { 0x10ec0283, 0x17aa, 0, "ALC3239" }, 1074 { 0x10ec0292, 0x17aa, 0, "ALC3232" }, 1075 { } /* terminator */ 1076 }; 1077 1078 static int alc_codec_rename_from_preset(struct hda_codec *codec) 1079 { 1080 const struct alc_codec_rename_table *p; 1081 const struct alc_codec_rename_pci_table *q; 1082 1083 for (p = rename_tbl; p->vendor_id; p++) { 1084 if (p->vendor_id != codec->core.vendor_id) 1085 continue; 1086 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) 1087 return alc_codec_rename(codec, p->name); 1088 } 1089 1090 if (!codec->bus->pci) 1091 return 0; 1092 for (q = rename_pci_tbl; q->codec_vendor_id; q++) { 1093 if (q->codec_vendor_id != codec->core.vendor_id) 1094 continue; 1095 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) 1096 continue; 1097 if (!q->pci_subdevice || 1098 q->pci_subdevice == codec->bus->pci->subsystem_device) 1099 return alc_codec_rename(codec, q->name); 1100 } 1101 1102 return 0; 1103 } 1104 1105 1106 /* 1107 * Digital-beep handlers 1108 */ 1109 #ifdef CONFIG_SND_HDA_INPUT_BEEP 1110 1111 /* additional beep mixers; private_value will be overwritten */ 1112 static const struct snd_kcontrol_new alc_beep_mixer[] = { 1113 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), 1114 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), 1115 }; 1116 1117 /* set up and create beep controls */ 1118 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, 1119 int idx, int dir) 1120 { 1121 struct snd_kcontrol_new *knew; 1122 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); 1123 int i; 1124 1125 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { 1126 knew = snd_hda_gen_add_kctl(&spec->gen, NULL, 1127 &alc_beep_mixer[i]); 1128 if (!knew) 1129 return -ENOMEM; 1130 knew->private_value = beep_amp; 1131 } 1132 return 0; 1133 } 1134 1135 static const struct snd_pci_quirk beep_allow_list[] = { 1136 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), 1137 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), 1138 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), 1139 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), 1140 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), 1141 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), 1142 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), 1143 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), 1144 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), 1145 /* denylist -- no beep available */ 1146 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), 1147 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), 1148 {} 1149 }; 1150 1151 static inline int has_cdefine_beep(struct hda_codec *codec) 1152 { 1153 struct alc_spec *spec = codec->spec; 1154 const struct snd_pci_quirk *q; 1155 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); 1156 if (q) 1157 return q->value; 1158 return spec->cdefine.enable_pcbeep; 1159 } 1160 #else 1161 #define set_beep_amp(spec, nid, idx, dir) 0 1162 #define has_cdefine_beep(codec) 0 1163 #endif 1164 1165 /* parse the BIOS configuration and set up the alc_spec */ 1166 /* return 1 if successful, 0 if the proper config is not found, 1167 * or a negative error code 1168 */ 1169 static int alc_parse_auto_config(struct hda_codec *codec, 1170 const hda_nid_t *ignore_nids, 1171 const hda_nid_t *ssid_nids) 1172 { 1173 struct alc_spec *spec = codec->spec; 1174 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 1175 int err; 1176 1177 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, 1178 spec->parse_flags); 1179 if (err < 0) 1180 return err; 1181 1182 if (ssid_nids) 1183 alc_ssid_check(codec, ssid_nids); 1184 1185 err = snd_hda_gen_parse_auto_config(codec, cfg); 1186 if (err < 0) 1187 return err; 1188 1189 return 1; 1190 } 1191 1192 /* common preparation job for alc_spec */ 1193 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) 1194 { 1195 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); 1196 int err; 1197 1198 if (!spec) 1199 return -ENOMEM; 1200 codec->spec = spec; 1201 snd_hda_gen_spec_init(&spec->gen); 1202 spec->gen.mixer_nid = mixer_nid; 1203 spec->gen.own_eapd_ctl = 1; 1204 codec->single_adc_amp = 1; 1205 /* FIXME: do we need this for all Realtek codec models? */ 1206 codec->spdif_status_reset = 1; 1207 codec->forced_resume = 1; 1208 codec->patch_ops = alc_patch_ops; 1209 mutex_init(&spec->coef_mutex); 1210 1211 err = alc_codec_rename_from_preset(codec); 1212 if (err < 0) { 1213 kfree(spec); 1214 return err; 1215 } 1216 return 0; 1217 } 1218 1219 static int alc880_parse_auto_config(struct hda_codec *codec) 1220 { 1221 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; 1222 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 1223 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); 1224 } 1225 1226 /* 1227 * ALC880 fix-ups 1228 */ 1229 enum { 1230 ALC880_FIXUP_GPIO1, 1231 ALC880_FIXUP_GPIO2, 1232 ALC880_FIXUP_MEDION_RIM, 1233 ALC880_FIXUP_LG, 1234 ALC880_FIXUP_LG_LW25, 1235 ALC880_FIXUP_W810, 1236 ALC880_FIXUP_EAPD_COEF, 1237 ALC880_FIXUP_TCL_S700, 1238 ALC880_FIXUP_VOL_KNOB, 1239 ALC880_FIXUP_FUJITSU, 1240 ALC880_FIXUP_F1734, 1241 ALC880_FIXUP_UNIWILL, 1242 ALC880_FIXUP_UNIWILL_DIG, 1243 ALC880_FIXUP_Z71V, 1244 ALC880_FIXUP_ASUS_W5A, 1245 ALC880_FIXUP_3ST_BASE, 1246 ALC880_FIXUP_3ST, 1247 ALC880_FIXUP_3ST_DIG, 1248 ALC880_FIXUP_5ST_BASE, 1249 ALC880_FIXUP_5ST, 1250 ALC880_FIXUP_5ST_DIG, 1251 ALC880_FIXUP_6ST_BASE, 1252 ALC880_FIXUP_6ST, 1253 ALC880_FIXUP_6ST_DIG, 1254 ALC880_FIXUP_6ST_AUTOMUTE, 1255 }; 1256 1257 /* enable the volume-knob widget support on NID 0x21 */ 1258 static void alc880_fixup_vol_knob(struct hda_codec *codec, 1259 const struct hda_fixup *fix, int action) 1260 { 1261 if (action == HDA_FIXUP_ACT_PROBE) 1262 snd_hda_jack_detect_enable_callback(codec, 0x21, 1263 alc_update_knob_master); 1264 } 1265 1266 static const struct hda_fixup alc880_fixups[] = { 1267 [ALC880_FIXUP_GPIO1] = { 1268 .type = HDA_FIXUP_FUNC, 1269 .v.func = alc_fixup_gpio1, 1270 }, 1271 [ALC880_FIXUP_GPIO2] = { 1272 .type = HDA_FIXUP_FUNC, 1273 .v.func = alc_fixup_gpio2, 1274 }, 1275 [ALC880_FIXUP_MEDION_RIM] = { 1276 .type = HDA_FIXUP_VERBS, 1277 .v.verbs = (const struct hda_verb[]) { 1278 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1279 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 1280 { } 1281 }, 1282 .chained = true, 1283 .chain_id = ALC880_FIXUP_GPIO2, 1284 }, 1285 [ALC880_FIXUP_LG] = { 1286 .type = HDA_FIXUP_PINS, 1287 .v.pins = (const struct hda_pintbl[]) { 1288 /* disable bogus unused pins */ 1289 { 0x16, 0x411111f0 }, 1290 { 0x18, 0x411111f0 }, 1291 { 0x1a, 0x411111f0 }, 1292 { } 1293 } 1294 }, 1295 [ALC880_FIXUP_LG_LW25] = { 1296 .type = HDA_FIXUP_PINS, 1297 .v.pins = (const struct hda_pintbl[]) { 1298 { 0x1a, 0x0181344f }, /* line-in */ 1299 { 0x1b, 0x0321403f }, /* headphone */ 1300 { } 1301 } 1302 }, 1303 [ALC880_FIXUP_W810] = { 1304 .type = HDA_FIXUP_PINS, 1305 .v.pins = (const struct hda_pintbl[]) { 1306 /* disable bogus unused pins */ 1307 { 0x17, 0x411111f0 }, 1308 { } 1309 }, 1310 .chained = true, 1311 .chain_id = ALC880_FIXUP_GPIO2, 1312 }, 1313 [ALC880_FIXUP_EAPD_COEF] = { 1314 .type = HDA_FIXUP_VERBS, 1315 .v.verbs = (const struct hda_verb[]) { 1316 /* change to EAPD mode */ 1317 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1318 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 1319 {} 1320 }, 1321 }, 1322 [ALC880_FIXUP_TCL_S700] = { 1323 .type = HDA_FIXUP_VERBS, 1324 .v.verbs = (const struct hda_verb[]) { 1325 /* change to EAPD mode */ 1326 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1327 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 1328 {} 1329 }, 1330 .chained = true, 1331 .chain_id = ALC880_FIXUP_GPIO2, 1332 }, 1333 [ALC880_FIXUP_VOL_KNOB] = { 1334 .type = HDA_FIXUP_FUNC, 1335 .v.func = alc880_fixup_vol_knob, 1336 }, 1337 [ALC880_FIXUP_FUJITSU] = { 1338 /* override all pins as BIOS on old Amilo is broken */ 1339 .type = HDA_FIXUP_PINS, 1340 .v.pins = (const struct hda_pintbl[]) { 1341 { 0x14, 0x0121401f }, /* HP */ 1342 { 0x15, 0x99030120 }, /* speaker */ 1343 { 0x16, 0x99030130 }, /* bass speaker */ 1344 { 0x17, 0x411111f0 }, /* N/A */ 1345 { 0x18, 0x411111f0 }, /* N/A */ 1346 { 0x19, 0x01a19950 }, /* mic-in */ 1347 { 0x1a, 0x411111f0 }, /* N/A */ 1348 { 0x1b, 0x411111f0 }, /* N/A */ 1349 { 0x1c, 0x411111f0 }, /* N/A */ 1350 { 0x1d, 0x411111f0 }, /* N/A */ 1351 { 0x1e, 0x01454140 }, /* SPDIF out */ 1352 { } 1353 }, 1354 .chained = true, 1355 .chain_id = ALC880_FIXUP_VOL_KNOB, 1356 }, 1357 [ALC880_FIXUP_F1734] = { 1358 /* almost compatible with FUJITSU, but no bass and SPDIF */ 1359 .type = HDA_FIXUP_PINS, 1360 .v.pins = (const struct hda_pintbl[]) { 1361 { 0x14, 0x0121401f }, /* HP */ 1362 { 0x15, 0x99030120 }, /* speaker */ 1363 { 0x16, 0x411111f0 }, /* N/A */ 1364 { 0x17, 0x411111f0 }, /* N/A */ 1365 { 0x18, 0x411111f0 }, /* N/A */ 1366 { 0x19, 0x01a19950 }, /* mic-in */ 1367 { 0x1a, 0x411111f0 }, /* N/A */ 1368 { 0x1b, 0x411111f0 }, /* N/A */ 1369 { 0x1c, 0x411111f0 }, /* N/A */ 1370 { 0x1d, 0x411111f0 }, /* N/A */ 1371 { 0x1e, 0x411111f0 }, /* N/A */ 1372 { } 1373 }, 1374 .chained = true, 1375 .chain_id = ALC880_FIXUP_VOL_KNOB, 1376 }, 1377 [ALC880_FIXUP_UNIWILL] = { 1378 /* need to fix HP and speaker pins to be parsed correctly */ 1379 .type = HDA_FIXUP_PINS, 1380 .v.pins = (const struct hda_pintbl[]) { 1381 { 0x14, 0x0121411f }, /* HP */ 1382 { 0x15, 0x99030120 }, /* speaker */ 1383 { 0x16, 0x99030130 }, /* bass speaker */ 1384 { } 1385 }, 1386 }, 1387 [ALC880_FIXUP_UNIWILL_DIG] = { 1388 .type = HDA_FIXUP_PINS, 1389 .v.pins = (const struct hda_pintbl[]) { 1390 /* disable bogus unused pins */ 1391 { 0x17, 0x411111f0 }, 1392 { 0x19, 0x411111f0 }, 1393 { 0x1b, 0x411111f0 }, 1394 { 0x1f, 0x411111f0 }, 1395 { } 1396 } 1397 }, 1398 [ALC880_FIXUP_Z71V] = { 1399 .type = HDA_FIXUP_PINS, 1400 .v.pins = (const struct hda_pintbl[]) { 1401 /* set up the whole pins as BIOS is utterly broken */ 1402 { 0x14, 0x99030120 }, /* speaker */ 1403 { 0x15, 0x0121411f }, /* HP */ 1404 { 0x16, 0x411111f0 }, /* N/A */ 1405 { 0x17, 0x411111f0 }, /* N/A */ 1406 { 0x18, 0x01a19950 }, /* mic-in */ 1407 { 0x19, 0x411111f0 }, /* N/A */ 1408 { 0x1a, 0x01813031 }, /* line-in */ 1409 { 0x1b, 0x411111f0 }, /* N/A */ 1410 { 0x1c, 0x411111f0 }, /* N/A */ 1411 { 0x1d, 0x411111f0 }, /* N/A */ 1412 { 0x1e, 0x0144111e }, /* SPDIF */ 1413 { } 1414 } 1415 }, 1416 [ALC880_FIXUP_ASUS_W5A] = { 1417 .type = HDA_FIXUP_PINS, 1418 .v.pins = (const struct hda_pintbl[]) { 1419 /* set up the whole pins as BIOS is utterly broken */ 1420 { 0x14, 0x0121411f }, /* HP */ 1421 { 0x15, 0x411111f0 }, /* N/A */ 1422 { 0x16, 0x411111f0 }, /* N/A */ 1423 { 0x17, 0x411111f0 }, /* N/A */ 1424 { 0x18, 0x90a60160 }, /* mic */ 1425 { 0x19, 0x411111f0 }, /* N/A */ 1426 { 0x1a, 0x411111f0 }, /* N/A */ 1427 { 0x1b, 0x411111f0 }, /* N/A */ 1428 { 0x1c, 0x411111f0 }, /* N/A */ 1429 { 0x1d, 0x411111f0 }, /* N/A */ 1430 { 0x1e, 0xb743111e }, /* SPDIF out */ 1431 { } 1432 }, 1433 .chained = true, 1434 .chain_id = ALC880_FIXUP_GPIO1, 1435 }, 1436 [ALC880_FIXUP_3ST_BASE] = { 1437 .type = HDA_FIXUP_PINS, 1438 .v.pins = (const struct hda_pintbl[]) { 1439 { 0x14, 0x01014010 }, /* line-out */ 1440 { 0x15, 0x411111f0 }, /* N/A */ 1441 { 0x16, 0x411111f0 }, /* N/A */ 1442 { 0x17, 0x411111f0 }, /* N/A */ 1443 { 0x18, 0x01a19c30 }, /* mic-in */ 1444 { 0x19, 0x0121411f }, /* HP */ 1445 { 0x1a, 0x01813031 }, /* line-in */ 1446 { 0x1b, 0x02a19c40 }, /* front-mic */ 1447 { 0x1c, 0x411111f0 }, /* N/A */ 1448 { 0x1d, 0x411111f0 }, /* N/A */ 1449 /* 0x1e is filled in below */ 1450 { 0x1f, 0x411111f0 }, /* N/A */ 1451 { } 1452 } 1453 }, 1454 [ALC880_FIXUP_3ST] = { 1455 .type = HDA_FIXUP_PINS, 1456 .v.pins = (const struct hda_pintbl[]) { 1457 { 0x1e, 0x411111f0 }, /* N/A */ 1458 { } 1459 }, 1460 .chained = true, 1461 .chain_id = ALC880_FIXUP_3ST_BASE, 1462 }, 1463 [ALC880_FIXUP_3ST_DIG] = { 1464 .type = HDA_FIXUP_PINS, 1465 .v.pins = (const struct hda_pintbl[]) { 1466 { 0x1e, 0x0144111e }, /* SPDIF */ 1467 { } 1468 }, 1469 .chained = true, 1470 .chain_id = ALC880_FIXUP_3ST_BASE, 1471 }, 1472 [ALC880_FIXUP_5ST_BASE] = { 1473 .type = HDA_FIXUP_PINS, 1474 .v.pins = (const struct hda_pintbl[]) { 1475 { 0x14, 0x01014010 }, /* front */ 1476 { 0x15, 0x411111f0 }, /* N/A */ 1477 { 0x16, 0x01011411 }, /* CLFE */ 1478 { 0x17, 0x01016412 }, /* surr */ 1479 { 0x18, 0x01a19c30 }, /* mic-in */ 1480 { 0x19, 0x0121411f }, /* HP */ 1481 { 0x1a, 0x01813031 }, /* line-in */ 1482 { 0x1b, 0x02a19c40 }, /* front-mic */ 1483 { 0x1c, 0x411111f0 }, /* N/A */ 1484 { 0x1d, 0x411111f0 }, /* N/A */ 1485 /* 0x1e is filled in below */ 1486 { 0x1f, 0x411111f0 }, /* N/A */ 1487 { } 1488 } 1489 }, 1490 [ALC880_FIXUP_5ST] = { 1491 .type = HDA_FIXUP_PINS, 1492 .v.pins = (const struct hda_pintbl[]) { 1493 { 0x1e, 0x411111f0 }, /* N/A */ 1494 { } 1495 }, 1496 .chained = true, 1497 .chain_id = ALC880_FIXUP_5ST_BASE, 1498 }, 1499 [ALC880_FIXUP_5ST_DIG] = { 1500 .type = HDA_FIXUP_PINS, 1501 .v.pins = (const struct hda_pintbl[]) { 1502 { 0x1e, 0x0144111e }, /* SPDIF */ 1503 { } 1504 }, 1505 .chained = true, 1506 .chain_id = ALC880_FIXUP_5ST_BASE, 1507 }, 1508 [ALC880_FIXUP_6ST_BASE] = { 1509 .type = HDA_FIXUP_PINS, 1510 .v.pins = (const struct hda_pintbl[]) { 1511 { 0x14, 0x01014010 }, /* front */ 1512 { 0x15, 0x01016412 }, /* surr */ 1513 { 0x16, 0x01011411 }, /* CLFE */ 1514 { 0x17, 0x01012414 }, /* side */ 1515 { 0x18, 0x01a19c30 }, /* mic-in */ 1516 { 0x19, 0x02a19c40 }, /* front-mic */ 1517 { 0x1a, 0x01813031 }, /* line-in */ 1518 { 0x1b, 0x0121411f }, /* HP */ 1519 { 0x1c, 0x411111f0 }, /* N/A */ 1520 { 0x1d, 0x411111f0 }, /* N/A */ 1521 /* 0x1e is filled in below */ 1522 { 0x1f, 0x411111f0 }, /* N/A */ 1523 { } 1524 } 1525 }, 1526 [ALC880_FIXUP_6ST] = { 1527 .type = HDA_FIXUP_PINS, 1528 .v.pins = (const struct hda_pintbl[]) { 1529 { 0x1e, 0x411111f0 }, /* N/A */ 1530 { } 1531 }, 1532 .chained = true, 1533 .chain_id = ALC880_FIXUP_6ST_BASE, 1534 }, 1535 [ALC880_FIXUP_6ST_DIG] = { 1536 .type = HDA_FIXUP_PINS, 1537 .v.pins = (const struct hda_pintbl[]) { 1538 { 0x1e, 0x0144111e }, /* SPDIF */ 1539 { } 1540 }, 1541 .chained = true, 1542 .chain_id = ALC880_FIXUP_6ST_BASE, 1543 }, 1544 [ALC880_FIXUP_6ST_AUTOMUTE] = { 1545 .type = HDA_FIXUP_PINS, 1546 .v.pins = (const struct hda_pintbl[]) { 1547 { 0x1b, 0x0121401f }, /* HP with jack detect */ 1548 { } 1549 }, 1550 .chained_before = true, 1551 .chain_id = ALC880_FIXUP_6ST_BASE, 1552 }, 1553 }; 1554 1555 static const struct snd_pci_quirk alc880_fixup_tbl[] = { 1556 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), 1557 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), 1558 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), 1559 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), 1560 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), 1561 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), 1562 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), 1563 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), 1564 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), 1565 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), 1566 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), 1567 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), 1568 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), 1569 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), 1570 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), 1571 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), 1572 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), 1573 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), 1574 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), 1575 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), 1576 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), 1577 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), 1578 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), 1579 1580 /* Below is the copied entries from alc880_quirks.c. 1581 * It's not quite sure whether BIOS sets the correct pin-config table 1582 * on these machines, thus they are kept to be compatible with 1583 * the old static quirks. Once when it's confirmed to work without 1584 * these overrides, it'd be better to remove. 1585 */ 1586 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), 1587 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), 1588 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), 1589 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), 1590 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), 1591 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), 1592 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), 1593 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), 1594 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), 1595 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), 1596 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), 1597 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), 1598 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), 1599 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), 1600 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), 1601 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), 1602 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), 1603 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), 1604 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), 1605 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), 1606 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), 1607 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ 1608 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), 1609 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1610 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1611 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1612 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1613 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1614 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1615 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1616 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1617 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1618 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1619 /* default Intel */ 1620 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), 1621 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), 1622 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), 1623 {} 1624 }; 1625 1626 static const struct hda_model_fixup alc880_fixup_models[] = { 1627 {.id = ALC880_FIXUP_3ST, .name = "3stack"}, 1628 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, 1629 {.id = ALC880_FIXUP_5ST, .name = "5stack"}, 1630 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, 1631 {.id = ALC880_FIXUP_6ST, .name = "6stack"}, 1632 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, 1633 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, 1634 {} 1635 }; 1636 1637 1638 /* 1639 * OK, here we have finally the patch for ALC880 1640 */ 1641 static int patch_alc880(struct hda_codec *codec) 1642 { 1643 struct alc_spec *spec; 1644 int err; 1645 1646 err = alc_alloc_spec(codec, 0x0b); 1647 if (err < 0) 1648 return err; 1649 1650 spec = codec->spec; 1651 spec->gen.need_dac_fix = 1; 1652 spec->gen.beep_nid = 0x01; 1653 1654 codec->patch_ops.unsol_event = alc880_unsol_event; 1655 1656 alc_pre_init(codec); 1657 1658 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, 1659 alc880_fixups); 1660 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 1661 1662 /* automatic parse from the BIOS config */ 1663 err = alc880_parse_auto_config(codec); 1664 if (err < 0) 1665 goto error; 1666 1667 if (!spec->gen.no_analog) { 1668 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 1669 if (err < 0) 1670 goto error; 1671 } 1672 1673 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 1674 1675 return 0; 1676 1677 error: 1678 alc_free(codec); 1679 return err; 1680 } 1681 1682 1683 /* 1684 * ALC260 support 1685 */ 1686 static int alc260_parse_auto_config(struct hda_codec *codec) 1687 { 1688 static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; 1689 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; 1690 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); 1691 } 1692 1693 /* 1694 * Pin config fixes 1695 */ 1696 enum { 1697 ALC260_FIXUP_HP_DC5750, 1698 ALC260_FIXUP_HP_PIN_0F, 1699 ALC260_FIXUP_COEF, 1700 ALC260_FIXUP_GPIO1, 1701 ALC260_FIXUP_GPIO1_TOGGLE, 1702 ALC260_FIXUP_REPLACER, 1703 ALC260_FIXUP_HP_B1900, 1704 ALC260_FIXUP_KN1, 1705 ALC260_FIXUP_FSC_S7020, 1706 ALC260_FIXUP_FSC_S7020_JWSE, 1707 ALC260_FIXUP_VAIO_PINS, 1708 }; 1709 1710 static void alc260_gpio1_automute(struct hda_codec *codec) 1711 { 1712 struct alc_spec *spec = codec->spec; 1713 1714 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); 1715 } 1716 1717 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, 1718 const struct hda_fixup *fix, int action) 1719 { 1720 struct alc_spec *spec = codec->spec; 1721 if (action == HDA_FIXUP_ACT_PROBE) { 1722 /* although the machine has only one output pin, we need to 1723 * toggle GPIO1 according to the jack state 1724 */ 1725 spec->gen.automute_hook = alc260_gpio1_automute; 1726 spec->gen.detect_hp = 1; 1727 spec->gen.automute_speaker = 1; 1728 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ 1729 snd_hda_jack_detect_enable_callback(codec, 0x0f, 1730 snd_hda_gen_hp_automute); 1731 alc_setup_gpio(codec, 0x01); 1732 } 1733 } 1734 1735 static void alc260_fixup_kn1(struct hda_codec *codec, 1736 const struct hda_fixup *fix, int action) 1737 { 1738 struct alc_spec *spec = codec->spec; 1739 static const struct hda_pintbl pincfgs[] = { 1740 { 0x0f, 0x02214000 }, /* HP/speaker */ 1741 { 0x12, 0x90a60160 }, /* int mic */ 1742 { 0x13, 0x02a19000 }, /* ext mic */ 1743 { 0x18, 0x01446000 }, /* SPDIF out */ 1744 /* disable bogus I/O pins */ 1745 { 0x10, 0x411111f0 }, 1746 { 0x11, 0x411111f0 }, 1747 { 0x14, 0x411111f0 }, 1748 { 0x15, 0x411111f0 }, 1749 { 0x16, 0x411111f0 }, 1750 { 0x17, 0x411111f0 }, 1751 { 0x19, 0x411111f0 }, 1752 { } 1753 }; 1754 1755 switch (action) { 1756 case HDA_FIXUP_ACT_PRE_PROBE: 1757 snd_hda_apply_pincfgs(codec, pincfgs); 1758 spec->init_amp = ALC_INIT_NONE; 1759 break; 1760 } 1761 } 1762 1763 static void alc260_fixup_fsc_s7020(struct hda_codec *codec, 1764 const struct hda_fixup *fix, int action) 1765 { 1766 struct alc_spec *spec = codec->spec; 1767 if (action == HDA_FIXUP_ACT_PRE_PROBE) 1768 spec->init_amp = ALC_INIT_NONE; 1769 } 1770 1771 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, 1772 const struct hda_fixup *fix, int action) 1773 { 1774 struct alc_spec *spec = codec->spec; 1775 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 1776 spec->gen.add_jack_modes = 1; 1777 spec->gen.hp_mic = 1; 1778 } 1779 } 1780 1781 static const struct hda_fixup alc260_fixups[] = { 1782 [ALC260_FIXUP_HP_DC5750] = { 1783 .type = HDA_FIXUP_PINS, 1784 .v.pins = (const struct hda_pintbl[]) { 1785 { 0x11, 0x90130110 }, /* speaker */ 1786 { } 1787 } 1788 }, 1789 [ALC260_FIXUP_HP_PIN_0F] = { 1790 .type = HDA_FIXUP_PINS, 1791 .v.pins = (const struct hda_pintbl[]) { 1792 { 0x0f, 0x01214000 }, /* HP */ 1793 { } 1794 } 1795 }, 1796 [ALC260_FIXUP_COEF] = { 1797 .type = HDA_FIXUP_VERBS, 1798 .v.verbs = (const struct hda_verb[]) { 1799 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, 1800 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, 1801 { } 1802 }, 1803 }, 1804 [ALC260_FIXUP_GPIO1] = { 1805 .type = HDA_FIXUP_FUNC, 1806 .v.func = alc_fixup_gpio1, 1807 }, 1808 [ALC260_FIXUP_GPIO1_TOGGLE] = { 1809 .type = HDA_FIXUP_FUNC, 1810 .v.func = alc260_fixup_gpio1_toggle, 1811 .chained = true, 1812 .chain_id = ALC260_FIXUP_HP_PIN_0F, 1813 }, 1814 [ALC260_FIXUP_REPLACER] = { 1815 .type = HDA_FIXUP_VERBS, 1816 .v.verbs = (const struct hda_verb[]) { 1817 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, 1818 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, 1819 { } 1820 }, 1821 .chained = true, 1822 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, 1823 }, 1824 [ALC260_FIXUP_HP_B1900] = { 1825 .type = HDA_FIXUP_FUNC, 1826 .v.func = alc260_fixup_gpio1_toggle, 1827 .chained = true, 1828 .chain_id = ALC260_FIXUP_COEF, 1829 }, 1830 [ALC260_FIXUP_KN1] = { 1831 .type = HDA_FIXUP_FUNC, 1832 .v.func = alc260_fixup_kn1, 1833 }, 1834 [ALC260_FIXUP_FSC_S7020] = { 1835 .type = HDA_FIXUP_FUNC, 1836 .v.func = alc260_fixup_fsc_s7020, 1837 }, 1838 [ALC260_FIXUP_FSC_S7020_JWSE] = { 1839 .type = HDA_FIXUP_FUNC, 1840 .v.func = alc260_fixup_fsc_s7020_jwse, 1841 .chained = true, 1842 .chain_id = ALC260_FIXUP_FSC_S7020, 1843 }, 1844 [ALC260_FIXUP_VAIO_PINS] = { 1845 .type = HDA_FIXUP_PINS, 1846 .v.pins = (const struct hda_pintbl[]) { 1847 /* Pin configs are missing completely on some VAIOs */ 1848 { 0x0f, 0x01211020 }, 1849 { 0x10, 0x0001003f }, 1850 { 0x11, 0x411111f0 }, 1851 { 0x12, 0x01a15930 }, 1852 { 0x13, 0x411111f0 }, 1853 { 0x14, 0x411111f0 }, 1854 { 0x15, 0x411111f0 }, 1855 { 0x16, 0x411111f0 }, 1856 { 0x17, 0x411111f0 }, 1857 { 0x18, 0x411111f0 }, 1858 { 0x19, 0x411111f0 }, 1859 { } 1860 } 1861 }, 1862 }; 1863 1864 static const struct snd_pci_quirk alc260_fixup_tbl[] = { 1865 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), 1866 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), 1867 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), 1868 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), 1869 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), 1870 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), 1871 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), 1872 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), 1873 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), 1874 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), 1875 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), 1876 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), 1877 {} 1878 }; 1879 1880 static const struct hda_model_fixup alc260_fixup_models[] = { 1881 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, 1882 {.id = ALC260_FIXUP_COEF, .name = "coef"}, 1883 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, 1884 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, 1885 {} 1886 }; 1887 1888 /* 1889 */ 1890 static int patch_alc260(struct hda_codec *codec) 1891 { 1892 struct alc_spec *spec; 1893 int err; 1894 1895 err = alc_alloc_spec(codec, 0x07); 1896 if (err < 0) 1897 return err; 1898 1899 spec = codec->spec; 1900 /* as quite a few machines require HP amp for speaker outputs, 1901 * it's easier to enable it unconditionally; even if it's unneeded, 1902 * it's almost harmless. 1903 */ 1904 spec->gen.prefer_hp_amp = 1; 1905 spec->gen.beep_nid = 0x01; 1906 1907 spec->shutup = alc_eapd_shutup; 1908 1909 alc_pre_init(codec); 1910 1911 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, 1912 alc260_fixups); 1913 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 1914 1915 /* automatic parse from the BIOS config */ 1916 err = alc260_parse_auto_config(codec); 1917 if (err < 0) 1918 goto error; 1919 1920 if (!spec->gen.no_analog) { 1921 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); 1922 if (err < 0) 1923 goto error; 1924 } 1925 1926 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 1927 1928 return 0; 1929 1930 error: 1931 alc_free(codec); 1932 return err; 1933 } 1934 1935 1936 /* 1937 * ALC882/883/885/888/889 support 1938 * 1939 * ALC882 is almost identical with ALC880 but has cleaner and more flexible 1940 * configuration. Each pin widget can choose any input DACs and a mixer. 1941 * Each ADC is connected from a mixer of all inputs. This makes possible 1942 * 6-channel independent captures. 1943 * 1944 * In addition, an independent DAC for the multi-playback (not used in this 1945 * driver yet). 1946 */ 1947 1948 /* 1949 * Pin config fixes 1950 */ 1951 enum { 1952 ALC882_FIXUP_ABIT_AW9D_MAX, 1953 ALC882_FIXUP_LENOVO_Y530, 1954 ALC882_FIXUP_PB_M5210, 1955 ALC882_FIXUP_ACER_ASPIRE_7736, 1956 ALC882_FIXUP_ASUS_W90V, 1957 ALC889_FIXUP_CD, 1958 ALC889_FIXUP_FRONT_HP_NO_PRESENCE, 1959 ALC889_FIXUP_VAIO_TT, 1960 ALC888_FIXUP_EEE1601, 1961 ALC886_FIXUP_EAPD, 1962 ALC882_FIXUP_EAPD, 1963 ALC883_FIXUP_EAPD, 1964 ALC883_FIXUP_ACER_EAPD, 1965 ALC882_FIXUP_GPIO1, 1966 ALC882_FIXUP_GPIO2, 1967 ALC882_FIXUP_GPIO3, 1968 ALC889_FIXUP_COEF, 1969 ALC882_FIXUP_ASUS_W2JC, 1970 ALC882_FIXUP_ACER_ASPIRE_4930G, 1971 ALC882_FIXUP_ACER_ASPIRE_8930G, 1972 ALC882_FIXUP_ASPIRE_8930G_VERBS, 1973 ALC885_FIXUP_MACPRO_GPIO, 1974 ALC889_FIXUP_DAC_ROUTE, 1975 ALC889_FIXUP_MBP_VREF, 1976 ALC889_FIXUP_IMAC91_VREF, 1977 ALC889_FIXUP_MBA11_VREF, 1978 ALC889_FIXUP_MBA21_VREF, 1979 ALC889_FIXUP_MP11_VREF, 1980 ALC889_FIXUP_MP41_VREF, 1981 ALC882_FIXUP_INV_DMIC, 1982 ALC882_FIXUP_NO_PRIMARY_HP, 1983 ALC887_FIXUP_ASUS_BASS, 1984 ALC887_FIXUP_BASS_CHMAP, 1985 ALC1220_FIXUP_GB_DUAL_CODECS, 1986 ALC1220_FIXUP_GB_X570, 1987 ALC1220_FIXUP_CLEVO_P950, 1988 ALC1220_FIXUP_CLEVO_PB51ED, 1989 ALC1220_FIXUP_CLEVO_PB51ED_PINS, 1990 ALC887_FIXUP_ASUS_AUDIO, 1991 ALC887_FIXUP_ASUS_HMIC, 1992 ALCS1200A_FIXUP_MIC_VREF, 1993 ALC888VD_FIXUP_MIC_100VREF, 1994 }; 1995 1996 static void alc889_fixup_coef(struct hda_codec *codec, 1997 const struct hda_fixup *fix, int action) 1998 { 1999 if (action != HDA_FIXUP_ACT_INIT) 2000 return; 2001 alc_update_coef_idx(codec, 7, 0, 0x2030); 2002 } 2003 2004 /* set up GPIO at initialization */ 2005 static void alc885_fixup_macpro_gpio(struct hda_codec *codec, 2006 const struct hda_fixup *fix, int action) 2007 { 2008 struct alc_spec *spec = codec->spec; 2009 2010 spec->gpio_write_delay = true; 2011 alc_fixup_gpio3(codec, fix, action); 2012 } 2013 2014 /* Fix the connection of some pins for ALC889: 2015 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't 2016 * work correctly (bko#42740) 2017 */ 2018 static void alc889_fixup_dac_route(struct hda_codec *codec, 2019 const struct hda_fixup *fix, int action) 2020 { 2021 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 2022 /* fake the connections during parsing the tree */ 2023 static const hda_nid_t conn1[] = { 0x0c, 0x0d }; 2024 static const hda_nid_t conn2[] = { 0x0e, 0x0f }; 2025 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2026 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); 2027 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); 2028 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); 2029 } else if (action == HDA_FIXUP_ACT_PROBE) { 2030 /* restore the connections */ 2031 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; 2032 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); 2033 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); 2034 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); 2035 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); 2036 } 2037 } 2038 2039 /* Set VREF on HP pin */ 2040 static void alc889_fixup_mbp_vref(struct hda_codec *codec, 2041 const struct hda_fixup *fix, int action) 2042 { 2043 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; 2044 struct alc_spec *spec = codec->spec; 2045 int i; 2046 2047 if (action != HDA_FIXUP_ACT_INIT) 2048 return; 2049 for (i = 0; i < ARRAY_SIZE(nids); i++) { 2050 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); 2051 if (get_defcfg_device(val) != AC_JACK_HP_OUT) 2052 continue; 2053 val = snd_hda_codec_get_pin_target(codec, nids[i]); 2054 val |= AC_PINCTL_VREF_80; 2055 snd_hda_set_pin_ctl(codec, nids[i], val); 2056 spec->gen.keep_vref_in_automute = 1; 2057 break; 2058 } 2059 } 2060 2061 static void alc889_fixup_mac_pins(struct hda_codec *codec, 2062 const hda_nid_t *nids, int num_nids) 2063 { 2064 struct alc_spec *spec = codec->spec; 2065 int i; 2066 2067 for (i = 0; i < num_nids; i++) { 2068 unsigned int val; 2069 val = snd_hda_codec_get_pin_target(codec, nids[i]); 2070 val |= AC_PINCTL_VREF_50; 2071 snd_hda_set_pin_ctl(codec, nids[i], val); 2072 } 2073 spec->gen.keep_vref_in_automute = 1; 2074 } 2075 2076 /* Set VREF on speaker pins on imac91 */ 2077 static void alc889_fixup_imac91_vref(struct hda_codec *codec, 2078 const struct hda_fixup *fix, int action) 2079 { 2080 static const hda_nid_t nids[] = { 0x18, 0x1a }; 2081 2082 if (action == HDA_FIXUP_ACT_INIT) 2083 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2084 } 2085 2086 /* Set VREF on speaker pins on mba11 */ 2087 static void alc889_fixup_mba11_vref(struct hda_codec *codec, 2088 const struct hda_fixup *fix, int action) 2089 { 2090 static const hda_nid_t nids[] = { 0x18 }; 2091 2092 if (action == HDA_FIXUP_ACT_INIT) 2093 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2094 } 2095 2096 /* Set VREF on speaker pins on mba21 */ 2097 static void alc889_fixup_mba21_vref(struct hda_codec *codec, 2098 const struct hda_fixup *fix, int action) 2099 { 2100 static const hda_nid_t nids[] = { 0x18, 0x19 }; 2101 2102 if (action == HDA_FIXUP_ACT_INIT) 2103 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2104 } 2105 2106 /* Don't take HP output as primary 2107 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio 2108 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 2109 */ 2110 static void alc882_fixup_no_primary_hp(struct hda_codec *codec, 2111 const struct hda_fixup *fix, int action) 2112 { 2113 struct alc_spec *spec = codec->spec; 2114 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 2115 spec->gen.no_primary_hp = 1; 2116 spec->gen.no_multi_io = 1; 2117 } 2118 } 2119 2120 static void alc_fixup_bass_chmap(struct hda_codec *codec, 2121 const struct hda_fixup *fix, int action); 2122 2123 /* For dual-codec configuration, we need to disable some features to avoid 2124 * conflicts of kctls and PCM streams 2125 */ 2126 static void alc_fixup_dual_codecs(struct hda_codec *codec, 2127 const struct hda_fixup *fix, int action) 2128 { 2129 struct alc_spec *spec = codec->spec; 2130 2131 if (action != HDA_FIXUP_ACT_PRE_PROBE) 2132 return; 2133 /* disable vmaster */ 2134 spec->gen.suppress_vmaster = 1; 2135 /* auto-mute and auto-mic switch don't work with multiple codecs */ 2136 spec->gen.suppress_auto_mute = 1; 2137 spec->gen.suppress_auto_mic = 1; 2138 /* disable aamix as well */ 2139 spec->gen.mixer_nid = 0; 2140 /* add location prefix to avoid conflicts */ 2141 codec->force_pin_prefix = 1; 2142 } 2143 2144 static void rename_ctl(struct hda_codec *codec, const char *oldname, 2145 const char *newname) 2146 { 2147 struct snd_kcontrol *kctl; 2148 2149 kctl = snd_hda_find_mixer_ctl(codec, oldname); 2150 if (kctl) 2151 snd_ctl_rename(codec->card, kctl, newname); 2152 } 2153 2154 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, 2155 const struct hda_fixup *fix, 2156 int action) 2157 { 2158 alc_fixup_dual_codecs(codec, fix, action); 2159 switch (action) { 2160 case HDA_FIXUP_ACT_PRE_PROBE: 2161 /* override card longname to provide a unique UCM profile */ 2162 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); 2163 break; 2164 case HDA_FIXUP_ACT_BUILD: 2165 /* rename Capture controls depending on the codec */ 2166 rename_ctl(codec, "Capture Volume", 2167 codec->addr == 0 ? 2168 "Rear-Panel Capture Volume" : 2169 "Front-Panel Capture Volume"); 2170 rename_ctl(codec, "Capture Switch", 2171 codec->addr == 0 ? 2172 "Rear-Panel Capture Switch" : 2173 "Front-Panel Capture Switch"); 2174 break; 2175 } 2176 } 2177 2178 static void alc1220_fixup_gb_x570(struct hda_codec *codec, 2179 const struct hda_fixup *fix, 2180 int action) 2181 { 2182 static const hda_nid_t conn1[] = { 0x0c }; 2183 static const struct coef_fw gb_x570_coefs[] = { 2184 WRITE_COEF(0x07, 0x03c0), 2185 WRITE_COEF(0x1a, 0x01c1), 2186 WRITE_COEF(0x1b, 0x0202), 2187 WRITE_COEF(0x43, 0x3005), 2188 {} 2189 }; 2190 2191 switch (action) { 2192 case HDA_FIXUP_ACT_PRE_PROBE: 2193 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2194 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); 2195 break; 2196 case HDA_FIXUP_ACT_INIT: 2197 alc_process_coef_fw(codec, gb_x570_coefs); 2198 break; 2199 } 2200 } 2201 2202 static void alc1220_fixup_clevo_p950(struct hda_codec *codec, 2203 const struct hda_fixup *fix, 2204 int action) 2205 { 2206 static const hda_nid_t conn1[] = { 0x0c }; 2207 2208 if (action != HDA_FIXUP_ACT_PRE_PROBE) 2209 return; 2210 2211 alc_update_coef_idx(codec, 0x7, 0, 0x3c3); 2212 /* We therefore want to make sure 0x14 (front headphone) and 2213 * 0x1b (speakers) use the stereo DAC 0x02 2214 */ 2215 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2216 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); 2217 } 2218 2219 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, 2220 const struct hda_fixup *fix, int action); 2221 2222 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, 2223 const struct hda_fixup *fix, 2224 int action) 2225 { 2226 alc1220_fixup_clevo_p950(codec, fix, action); 2227 alc_fixup_headset_mode_no_hp_mic(codec, fix, action); 2228 } 2229 2230 static void alc887_asus_hp_automute_hook(struct hda_codec *codec, 2231 struct hda_jack_callback *jack) 2232 { 2233 struct alc_spec *spec = codec->spec; 2234 unsigned int vref; 2235 2236 snd_hda_gen_hp_automute(codec, jack); 2237 2238 if (spec->gen.hp_jack_present) 2239 vref = AC_PINCTL_VREF_80; 2240 else 2241 vref = AC_PINCTL_VREF_HIZ; 2242 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); 2243 } 2244 2245 static void alc887_fixup_asus_jack(struct hda_codec *codec, 2246 const struct hda_fixup *fix, int action) 2247 { 2248 struct alc_spec *spec = codec->spec; 2249 if (action != HDA_FIXUP_ACT_PROBE) 2250 return; 2251 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); 2252 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; 2253 } 2254 2255 static const struct hda_fixup alc882_fixups[] = { 2256 [ALC882_FIXUP_ABIT_AW9D_MAX] = { 2257 .type = HDA_FIXUP_PINS, 2258 .v.pins = (const struct hda_pintbl[]) { 2259 { 0x15, 0x01080104 }, /* side */ 2260 { 0x16, 0x01011012 }, /* rear */ 2261 { 0x17, 0x01016011 }, /* clfe */ 2262 { } 2263 } 2264 }, 2265 [ALC882_FIXUP_LENOVO_Y530] = { 2266 .type = HDA_FIXUP_PINS, 2267 .v.pins = (const struct hda_pintbl[]) { 2268 { 0x15, 0x99130112 }, /* rear int speakers */ 2269 { 0x16, 0x99130111 }, /* subwoofer */ 2270 { } 2271 } 2272 }, 2273 [ALC882_FIXUP_PB_M5210] = { 2274 .type = HDA_FIXUP_PINCTLS, 2275 .v.pins = (const struct hda_pintbl[]) { 2276 { 0x19, PIN_VREF50 }, 2277 {} 2278 } 2279 }, 2280 [ALC882_FIXUP_ACER_ASPIRE_7736] = { 2281 .type = HDA_FIXUP_FUNC, 2282 .v.func = alc_fixup_sku_ignore, 2283 }, 2284 [ALC882_FIXUP_ASUS_W90V] = { 2285 .type = HDA_FIXUP_PINS, 2286 .v.pins = (const struct hda_pintbl[]) { 2287 { 0x16, 0x99130110 }, /* fix sequence for CLFE */ 2288 { } 2289 } 2290 }, 2291 [ALC889_FIXUP_CD] = { 2292 .type = HDA_FIXUP_PINS, 2293 .v.pins = (const struct hda_pintbl[]) { 2294 { 0x1c, 0x993301f0 }, /* CD */ 2295 { } 2296 } 2297 }, 2298 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { 2299 .type = HDA_FIXUP_PINS, 2300 .v.pins = (const struct hda_pintbl[]) { 2301 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ 2302 { } 2303 }, 2304 .chained = true, 2305 .chain_id = ALC889_FIXUP_CD, 2306 }, 2307 [ALC889_FIXUP_VAIO_TT] = { 2308 .type = HDA_FIXUP_PINS, 2309 .v.pins = (const struct hda_pintbl[]) { 2310 { 0x17, 0x90170111 }, /* hidden surround speaker */ 2311 { } 2312 } 2313 }, 2314 [ALC888_FIXUP_EEE1601] = { 2315 .type = HDA_FIXUP_VERBS, 2316 .v.verbs = (const struct hda_verb[]) { 2317 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, 2318 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, 2319 { } 2320 } 2321 }, 2322 [ALC886_FIXUP_EAPD] = { 2323 .type = HDA_FIXUP_VERBS, 2324 .v.verbs = (const struct hda_verb[]) { 2325 /* change to EAPD mode */ 2326 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2327 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 }, 2328 { } 2329 } 2330 }, 2331 [ALC882_FIXUP_EAPD] = { 2332 .type = HDA_FIXUP_VERBS, 2333 .v.verbs = (const struct hda_verb[]) { 2334 /* change to EAPD mode */ 2335 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2336 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 2337 { } 2338 } 2339 }, 2340 [ALC883_FIXUP_EAPD] = { 2341 .type = HDA_FIXUP_VERBS, 2342 .v.verbs = (const struct hda_verb[]) { 2343 /* change to EAPD mode */ 2344 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2345 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 2346 { } 2347 } 2348 }, 2349 [ALC883_FIXUP_ACER_EAPD] = { 2350 .type = HDA_FIXUP_VERBS, 2351 .v.verbs = (const struct hda_verb[]) { 2352 /* eanable EAPD on Acer laptops */ 2353 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2354 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2355 { } 2356 } 2357 }, 2358 [ALC882_FIXUP_GPIO1] = { 2359 .type = HDA_FIXUP_FUNC, 2360 .v.func = alc_fixup_gpio1, 2361 }, 2362 [ALC882_FIXUP_GPIO2] = { 2363 .type = HDA_FIXUP_FUNC, 2364 .v.func = alc_fixup_gpio2, 2365 }, 2366 [ALC882_FIXUP_GPIO3] = { 2367 .type = HDA_FIXUP_FUNC, 2368 .v.func = alc_fixup_gpio3, 2369 }, 2370 [ALC882_FIXUP_ASUS_W2JC] = { 2371 .type = HDA_FIXUP_FUNC, 2372 .v.func = alc_fixup_gpio1, 2373 .chained = true, 2374 .chain_id = ALC882_FIXUP_EAPD, 2375 }, 2376 [ALC889_FIXUP_COEF] = { 2377 .type = HDA_FIXUP_FUNC, 2378 .v.func = alc889_fixup_coef, 2379 }, 2380 [ALC882_FIXUP_ACER_ASPIRE_4930G] = { 2381 .type = HDA_FIXUP_PINS, 2382 .v.pins = (const struct hda_pintbl[]) { 2383 { 0x16, 0x99130111 }, /* CLFE speaker */ 2384 { 0x17, 0x99130112 }, /* surround speaker */ 2385 { } 2386 }, 2387 .chained = true, 2388 .chain_id = ALC882_FIXUP_GPIO1, 2389 }, 2390 [ALC882_FIXUP_ACER_ASPIRE_8930G] = { 2391 .type = HDA_FIXUP_PINS, 2392 .v.pins = (const struct hda_pintbl[]) { 2393 { 0x16, 0x99130111 }, /* CLFE speaker */ 2394 { 0x1b, 0x99130112 }, /* surround speaker */ 2395 { } 2396 }, 2397 .chained = true, 2398 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, 2399 }, 2400 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { 2401 /* additional init verbs for Acer Aspire 8930G */ 2402 .type = HDA_FIXUP_VERBS, 2403 .v.verbs = (const struct hda_verb[]) { 2404 /* Enable all DACs */ 2405 /* DAC DISABLE/MUTE 1? */ 2406 /* setting bits 1-5 disables DAC nids 0x02-0x06 2407 * apparently. Init=0x38 */ 2408 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, 2409 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, 2410 /* DAC DISABLE/MUTE 2? */ 2411 /* some bit here disables the other DACs. 2412 * Init=0x4900 */ 2413 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, 2414 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, 2415 /* DMIC fix 2416 * This laptop has a stereo digital microphone. 2417 * The mics are only 1cm apart which makes the stereo 2418 * useless. However, either the mic or the ALC889 2419 * makes the signal become a difference/sum signal 2420 * instead of standard stereo, which is annoying. 2421 * So instead we flip this bit which makes the 2422 * codec replicate the sum signal to both channels, 2423 * turning it into a normal mono mic. 2424 */ 2425 /* DMIC_CONTROL? Init value = 0x0001 */ 2426 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, 2427 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, 2428 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2429 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2430 { } 2431 }, 2432 .chained = true, 2433 .chain_id = ALC882_FIXUP_GPIO1, 2434 }, 2435 [ALC885_FIXUP_MACPRO_GPIO] = { 2436 .type = HDA_FIXUP_FUNC, 2437 .v.func = alc885_fixup_macpro_gpio, 2438 }, 2439 [ALC889_FIXUP_DAC_ROUTE] = { 2440 .type = HDA_FIXUP_FUNC, 2441 .v.func = alc889_fixup_dac_route, 2442 }, 2443 [ALC889_FIXUP_MBP_VREF] = { 2444 .type = HDA_FIXUP_FUNC, 2445 .v.func = alc889_fixup_mbp_vref, 2446 .chained = true, 2447 .chain_id = ALC882_FIXUP_GPIO1, 2448 }, 2449 [ALC889_FIXUP_IMAC91_VREF] = { 2450 .type = HDA_FIXUP_FUNC, 2451 .v.func = alc889_fixup_imac91_vref, 2452 .chained = true, 2453 .chain_id = ALC882_FIXUP_GPIO1, 2454 }, 2455 [ALC889_FIXUP_MBA11_VREF] = { 2456 .type = HDA_FIXUP_FUNC, 2457 .v.func = alc889_fixup_mba11_vref, 2458 .chained = true, 2459 .chain_id = ALC889_FIXUP_MBP_VREF, 2460 }, 2461 [ALC889_FIXUP_MBA21_VREF] = { 2462 .type = HDA_FIXUP_FUNC, 2463 .v.func = alc889_fixup_mba21_vref, 2464 .chained = true, 2465 .chain_id = ALC889_FIXUP_MBP_VREF, 2466 }, 2467 [ALC889_FIXUP_MP11_VREF] = { 2468 .type = HDA_FIXUP_FUNC, 2469 .v.func = alc889_fixup_mba11_vref, 2470 .chained = true, 2471 .chain_id = ALC885_FIXUP_MACPRO_GPIO, 2472 }, 2473 [ALC889_FIXUP_MP41_VREF] = { 2474 .type = HDA_FIXUP_FUNC, 2475 .v.func = alc889_fixup_mbp_vref, 2476 .chained = true, 2477 .chain_id = ALC885_FIXUP_MACPRO_GPIO, 2478 }, 2479 [ALC882_FIXUP_INV_DMIC] = { 2480 .type = HDA_FIXUP_FUNC, 2481 .v.func = alc_fixup_inv_dmic, 2482 }, 2483 [ALC882_FIXUP_NO_PRIMARY_HP] = { 2484 .type = HDA_FIXUP_FUNC, 2485 .v.func = alc882_fixup_no_primary_hp, 2486 }, 2487 [ALC887_FIXUP_ASUS_BASS] = { 2488 .type = HDA_FIXUP_PINS, 2489 .v.pins = (const struct hda_pintbl[]) { 2490 {0x16, 0x99130130}, /* bass speaker */ 2491 {} 2492 }, 2493 .chained = true, 2494 .chain_id = ALC887_FIXUP_BASS_CHMAP, 2495 }, 2496 [ALC887_FIXUP_BASS_CHMAP] = { 2497 .type = HDA_FIXUP_FUNC, 2498 .v.func = alc_fixup_bass_chmap, 2499 }, 2500 [ALC1220_FIXUP_GB_DUAL_CODECS] = { 2501 .type = HDA_FIXUP_FUNC, 2502 .v.func = alc1220_fixup_gb_dual_codecs, 2503 }, 2504 [ALC1220_FIXUP_GB_X570] = { 2505 .type = HDA_FIXUP_FUNC, 2506 .v.func = alc1220_fixup_gb_x570, 2507 }, 2508 [ALC1220_FIXUP_CLEVO_P950] = { 2509 .type = HDA_FIXUP_FUNC, 2510 .v.func = alc1220_fixup_clevo_p950, 2511 }, 2512 [ALC1220_FIXUP_CLEVO_PB51ED] = { 2513 .type = HDA_FIXUP_FUNC, 2514 .v.func = alc1220_fixup_clevo_pb51ed, 2515 }, 2516 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { 2517 .type = HDA_FIXUP_PINS, 2518 .v.pins = (const struct hda_pintbl[]) { 2519 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 2520 {} 2521 }, 2522 .chained = true, 2523 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, 2524 }, 2525 [ALC887_FIXUP_ASUS_AUDIO] = { 2526 .type = HDA_FIXUP_PINS, 2527 .v.pins = (const struct hda_pintbl[]) { 2528 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ 2529 { 0x19, 0x22219420 }, 2530 {} 2531 }, 2532 }, 2533 [ALC887_FIXUP_ASUS_HMIC] = { 2534 .type = HDA_FIXUP_FUNC, 2535 .v.func = alc887_fixup_asus_jack, 2536 .chained = true, 2537 .chain_id = ALC887_FIXUP_ASUS_AUDIO, 2538 }, 2539 [ALCS1200A_FIXUP_MIC_VREF] = { 2540 .type = HDA_FIXUP_PINCTLS, 2541 .v.pins = (const struct hda_pintbl[]) { 2542 { 0x18, PIN_VREF50 }, /* rear mic */ 2543 { 0x19, PIN_VREF50 }, /* front mic */ 2544 {} 2545 } 2546 }, 2547 [ALC888VD_FIXUP_MIC_100VREF] = { 2548 .type = HDA_FIXUP_PINCTLS, 2549 .v.pins = (const struct hda_pintbl[]) { 2550 { 0x18, PIN_VREF100 }, /* headset mic */ 2551 {} 2552 } 2553 }, 2554 }; 2555 2556 static const struct snd_pci_quirk alc882_fixup_tbl[] = { 2557 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), 2558 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2559 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2560 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), 2561 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2562 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), 2563 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), 2564 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", 2565 ALC882_FIXUP_ACER_ASPIRE_4930G), 2566 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", 2567 ALC882_FIXUP_ACER_ASPIRE_4930G), 2568 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", 2569 ALC882_FIXUP_ACER_ASPIRE_8930G), 2570 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", 2571 ALC882_FIXUP_ACER_ASPIRE_8930G), 2572 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", 2573 ALC882_FIXUP_ACER_ASPIRE_4930G), 2574 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), 2575 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", 2576 ALC882_FIXUP_ACER_ASPIRE_4930G), 2577 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", 2578 ALC882_FIXUP_ACER_ASPIRE_4930G), 2579 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", 2580 ALC882_FIXUP_ACER_ASPIRE_4930G), 2581 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), 2582 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), 2583 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), 2584 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), 2585 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), 2586 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), 2587 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), 2588 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), 2589 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), 2590 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), 2591 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF), 2592 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), 2593 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), 2594 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), 2595 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), 2596 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), 2597 2598 /* All Apple entries are in codec SSIDs */ 2599 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), 2600 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), 2601 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2602 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), 2603 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), 2604 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), 2605 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), 2606 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), 2607 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), 2608 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), 2609 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), 2610 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), 2611 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2612 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), 2613 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), 2614 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), 2615 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), 2616 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), 2617 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), 2618 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), 2619 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), 2620 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), 2621 2622 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 2623 SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF), 2624 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), 2625 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), 2626 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), 2627 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570), 2628 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570), 2629 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570), 2630 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), 2631 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), 2632 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950), 2633 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), 2634 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), 2635 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), 2636 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), 2637 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS), 2638 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), 2639 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 2640 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), 2641 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2642 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2643 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2644 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2645 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2646 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2647 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2648 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2649 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2650 SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2651 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2652 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2653 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2654 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2655 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2656 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2657 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2658 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED), 2659 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), 2660 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), 2661 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), 2662 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), 2663 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), 2664 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950), 2665 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950), 2666 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950), 2667 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950), 2668 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), 2669 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), 2670 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950), 2671 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2672 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), 2673 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), 2674 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), 2675 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), 2676 {} 2677 }; 2678 2679 static const struct hda_model_fixup alc882_fixup_models[] = { 2680 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, 2681 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, 2682 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, 2683 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, 2684 {.id = ALC889_FIXUP_CD, .name = "cd"}, 2685 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, 2686 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, 2687 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, 2688 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, 2689 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, 2690 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, 2691 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, 2692 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, 2693 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, 2694 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, 2695 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, 2696 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, 2697 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, 2698 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, 2699 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, 2700 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, 2701 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, 2702 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, 2703 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, 2704 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, 2705 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, 2706 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, 2707 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, 2708 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, 2709 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, 2710 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"}, 2711 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, 2712 {} 2713 }; 2714 2715 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = { 2716 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950, 2717 {0x14, 0x01014010}, 2718 {0x15, 0x01011012}, 2719 {0x16, 0x01016011}, 2720 {0x18, 0x01a19040}, 2721 {0x19, 0x02a19050}, 2722 {0x1a, 0x0181304f}, 2723 {0x1b, 0x0221401f}, 2724 {0x1e, 0x01456130}), 2725 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950, 2726 {0x14, 0x01015010}, 2727 {0x15, 0x01011012}, 2728 {0x16, 0x01011011}, 2729 {0x18, 0x01a11040}, 2730 {0x19, 0x02a19050}, 2731 {0x1a, 0x0181104f}, 2732 {0x1b, 0x0221401f}, 2733 {0x1e, 0x01451130}), 2734 {} 2735 }; 2736 2737 /* 2738 * BIOS auto configuration 2739 */ 2740 /* almost identical with ALC880 parser... */ 2741 static int alc882_parse_auto_config(struct hda_codec *codec) 2742 { 2743 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; 2744 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 2745 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); 2746 } 2747 2748 /* 2749 */ 2750 static int patch_alc882(struct hda_codec *codec) 2751 { 2752 struct alc_spec *spec; 2753 int err; 2754 2755 err = alc_alloc_spec(codec, 0x0b); 2756 if (err < 0) 2757 return err; 2758 2759 spec = codec->spec; 2760 2761 switch (codec->core.vendor_id) { 2762 case 0x10ec0882: 2763 case 0x10ec0885: 2764 case 0x10ec0900: 2765 case 0x10ec0b00: 2766 case 0x10ec1220: 2767 break; 2768 default: 2769 /* ALC883 and variants */ 2770 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 2771 break; 2772 } 2773 2774 alc_pre_init(codec); 2775 2776 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, 2777 alc882_fixups); 2778 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true); 2779 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2780 2781 alc_auto_parse_customize_define(codec); 2782 2783 if (has_cdefine_beep(codec)) 2784 spec->gen.beep_nid = 0x01; 2785 2786 /* automatic parse from the BIOS config */ 2787 err = alc882_parse_auto_config(codec); 2788 if (err < 0) 2789 goto error; 2790 2791 if (!spec->gen.no_analog && spec->gen.beep_nid) { 2792 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 2793 if (err < 0) 2794 goto error; 2795 } 2796 2797 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 2798 2799 return 0; 2800 2801 error: 2802 alc_free(codec); 2803 return err; 2804 } 2805 2806 2807 /* 2808 * ALC262 support 2809 */ 2810 static int alc262_parse_auto_config(struct hda_codec *codec) 2811 { 2812 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; 2813 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 2814 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); 2815 } 2816 2817 /* 2818 * Pin config fixes 2819 */ 2820 enum { 2821 ALC262_FIXUP_FSC_H270, 2822 ALC262_FIXUP_FSC_S7110, 2823 ALC262_FIXUP_HP_Z200, 2824 ALC262_FIXUP_TYAN, 2825 ALC262_FIXUP_LENOVO_3000, 2826 ALC262_FIXUP_BENQ, 2827 ALC262_FIXUP_BENQ_T31, 2828 ALC262_FIXUP_INV_DMIC, 2829 ALC262_FIXUP_INTEL_BAYLEYBAY, 2830 }; 2831 2832 static const struct hda_fixup alc262_fixups[] = { 2833 [ALC262_FIXUP_FSC_H270] = { 2834 .type = HDA_FIXUP_PINS, 2835 .v.pins = (const struct hda_pintbl[]) { 2836 { 0x14, 0x99130110 }, /* speaker */ 2837 { 0x15, 0x0221142f }, /* front HP */ 2838 { 0x1b, 0x0121141f }, /* rear HP */ 2839 { } 2840 } 2841 }, 2842 [ALC262_FIXUP_FSC_S7110] = { 2843 .type = HDA_FIXUP_PINS, 2844 .v.pins = (const struct hda_pintbl[]) { 2845 { 0x15, 0x90170110 }, /* speaker */ 2846 { } 2847 }, 2848 .chained = true, 2849 .chain_id = ALC262_FIXUP_BENQ, 2850 }, 2851 [ALC262_FIXUP_HP_Z200] = { 2852 .type = HDA_FIXUP_PINS, 2853 .v.pins = (const struct hda_pintbl[]) { 2854 { 0x16, 0x99130120 }, /* internal speaker */ 2855 { } 2856 } 2857 }, 2858 [ALC262_FIXUP_TYAN] = { 2859 .type = HDA_FIXUP_PINS, 2860 .v.pins = (const struct hda_pintbl[]) { 2861 { 0x14, 0x1993e1f0 }, /* int AUX */ 2862 { } 2863 } 2864 }, 2865 [ALC262_FIXUP_LENOVO_3000] = { 2866 .type = HDA_FIXUP_PINCTLS, 2867 .v.pins = (const struct hda_pintbl[]) { 2868 { 0x19, PIN_VREF50 }, 2869 {} 2870 }, 2871 .chained = true, 2872 .chain_id = ALC262_FIXUP_BENQ, 2873 }, 2874 [ALC262_FIXUP_BENQ] = { 2875 .type = HDA_FIXUP_VERBS, 2876 .v.verbs = (const struct hda_verb[]) { 2877 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2878 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 2879 {} 2880 } 2881 }, 2882 [ALC262_FIXUP_BENQ_T31] = { 2883 .type = HDA_FIXUP_VERBS, 2884 .v.verbs = (const struct hda_verb[]) { 2885 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2886 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2887 {} 2888 } 2889 }, 2890 [ALC262_FIXUP_INV_DMIC] = { 2891 .type = HDA_FIXUP_FUNC, 2892 .v.func = alc_fixup_inv_dmic, 2893 }, 2894 [ALC262_FIXUP_INTEL_BAYLEYBAY] = { 2895 .type = HDA_FIXUP_FUNC, 2896 .v.func = alc_fixup_no_depop_delay, 2897 }, 2898 }; 2899 2900 static const struct snd_pci_quirk alc262_fixup_tbl[] = { 2901 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), 2902 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), 2903 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), 2904 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), 2905 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), 2906 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), 2907 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), 2908 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), 2909 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), 2910 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), 2911 {} 2912 }; 2913 2914 static const struct hda_model_fixup alc262_fixup_models[] = { 2915 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, 2916 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, 2917 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, 2918 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, 2919 {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, 2920 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, 2921 {.id = ALC262_FIXUP_BENQ, .name = "benq"}, 2922 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, 2923 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, 2924 {} 2925 }; 2926 2927 /* 2928 */ 2929 static int patch_alc262(struct hda_codec *codec) 2930 { 2931 struct alc_spec *spec; 2932 int err; 2933 2934 err = alc_alloc_spec(codec, 0x0b); 2935 if (err < 0) 2936 return err; 2937 2938 spec = codec->spec; 2939 spec->gen.shared_mic_vref_pin = 0x18; 2940 2941 spec->shutup = alc_eapd_shutup; 2942 2943 #if 0 2944 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is 2945 * under-run 2946 */ 2947 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); 2948 #endif 2949 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 2950 2951 alc_pre_init(codec); 2952 2953 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, 2954 alc262_fixups); 2955 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2956 2957 alc_auto_parse_customize_define(codec); 2958 2959 if (has_cdefine_beep(codec)) 2960 spec->gen.beep_nid = 0x01; 2961 2962 /* automatic parse from the BIOS config */ 2963 err = alc262_parse_auto_config(codec); 2964 if (err < 0) 2965 goto error; 2966 2967 if (!spec->gen.no_analog && spec->gen.beep_nid) { 2968 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 2969 if (err < 0) 2970 goto error; 2971 } 2972 2973 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 2974 2975 return 0; 2976 2977 error: 2978 alc_free(codec); 2979 return err; 2980 } 2981 2982 /* 2983 * ALC268 2984 */ 2985 /* bind Beep switches of both NID 0x0f and 0x10 */ 2986 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, 2987 struct snd_ctl_elem_value *ucontrol) 2988 { 2989 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2990 unsigned long pval; 2991 int err; 2992 2993 mutex_lock(&codec->control_mutex); 2994 pval = kcontrol->private_value; 2995 kcontrol->private_value = (pval & ~0xff) | 0x0f; 2996 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 2997 if (err >= 0) { 2998 kcontrol->private_value = (pval & ~0xff) | 0x10; 2999 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 3000 } 3001 kcontrol->private_value = pval; 3002 mutex_unlock(&codec->control_mutex); 3003 return err; 3004 } 3005 3006 static const struct snd_kcontrol_new alc268_beep_mixer[] = { 3007 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), 3008 { 3009 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3010 .name = "Beep Playback Switch", 3011 .subdevice = HDA_SUBDEV_AMP_FLAG, 3012 .info = snd_hda_mixer_amp_switch_info, 3013 .get = snd_hda_mixer_amp_switch_get, 3014 .put = alc268_beep_switch_put, 3015 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) 3016 }, 3017 }; 3018 3019 /* set PCBEEP vol = 0, mute connections */ 3020 static const struct hda_verb alc268_beep_init_verbs[] = { 3021 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 3022 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 3023 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 3024 { } 3025 }; 3026 3027 enum { 3028 ALC268_FIXUP_INV_DMIC, 3029 ALC268_FIXUP_HP_EAPD, 3030 ALC268_FIXUP_SPDIF, 3031 }; 3032 3033 static const struct hda_fixup alc268_fixups[] = { 3034 [ALC268_FIXUP_INV_DMIC] = { 3035 .type = HDA_FIXUP_FUNC, 3036 .v.func = alc_fixup_inv_dmic, 3037 }, 3038 [ALC268_FIXUP_HP_EAPD] = { 3039 .type = HDA_FIXUP_VERBS, 3040 .v.verbs = (const struct hda_verb[]) { 3041 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, 3042 {} 3043 } 3044 }, 3045 [ALC268_FIXUP_SPDIF] = { 3046 .type = HDA_FIXUP_PINS, 3047 .v.pins = (const struct hda_pintbl[]) { 3048 { 0x1e, 0x014b1180 }, /* enable SPDIF out */ 3049 {} 3050 } 3051 }, 3052 }; 3053 3054 static const struct hda_model_fixup alc268_fixup_models[] = { 3055 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, 3056 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, 3057 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, 3058 {} 3059 }; 3060 3061 static const struct snd_pci_quirk alc268_fixup_tbl[] = { 3062 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), 3063 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), 3064 /* below is codec SSID since multiple Toshiba laptops have the 3065 * same PCI SSID 1179:ff00 3066 */ 3067 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), 3068 {} 3069 }; 3070 3071 /* 3072 * BIOS auto configuration 3073 */ 3074 static int alc268_parse_auto_config(struct hda_codec *codec) 3075 { 3076 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 3077 return alc_parse_auto_config(codec, NULL, alc268_ssids); 3078 } 3079 3080 /* 3081 */ 3082 static int patch_alc268(struct hda_codec *codec) 3083 { 3084 struct alc_spec *spec; 3085 int i, err; 3086 3087 /* ALC268 has no aa-loopback mixer */ 3088 err = alc_alloc_spec(codec, 0); 3089 if (err < 0) 3090 return err; 3091 3092 spec = codec->spec; 3093 if (has_cdefine_beep(codec)) 3094 spec->gen.beep_nid = 0x01; 3095 3096 spec->shutup = alc_eapd_shutup; 3097 3098 alc_pre_init(codec); 3099 3100 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); 3101 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 3102 3103 /* automatic parse from the BIOS config */ 3104 err = alc268_parse_auto_config(codec); 3105 if (err < 0) 3106 goto error; 3107 3108 if (err > 0 && !spec->gen.no_analog && 3109 spec->gen.autocfg.speaker_pins[0] != 0x1d) { 3110 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { 3111 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, 3112 &alc268_beep_mixer[i])) { 3113 err = -ENOMEM; 3114 goto error; 3115 } 3116 } 3117 snd_hda_add_verbs(codec, alc268_beep_init_verbs); 3118 if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) 3119 /* override the amp caps for beep generator */ 3120 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, 3121 (0x0c << AC_AMPCAP_OFFSET_SHIFT) | 3122 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | 3123 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | 3124 (0 << AC_AMPCAP_MUTE_SHIFT)); 3125 } 3126 3127 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 3128 3129 return 0; 3130 3131 error: 3132 alc_free(codec); 3133 return err; 3134 } 3135 3136 /* 3137 * ALC269 3138 */ 3139 3140 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { 3141 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ 3142 }; 3143 3144 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { 3145 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ 3146 }; 3147 3148 /* different alc269-variants */ 3149 enum { 3150 ALC269_TYPE_ALC269VA, 3151 ALC269_TYPE_ALC269VB, 3152 ALC269_TYPE_ALC269VC, 3153 ALC269_TYPE_ALC269VD, 3154 ALC269_TYPE_ALC280, 3155 ALC269_TYPE_ALC282, 3156 ALC269_TYPE_ALC283, 3157 ALC269_TYPE_ALC284, 3158 ALC269_TYPE_ALC293, 3159 ALC269_TYPE_ALC286, 3160 ALC269_TYPE_ALC298, 3161 ALC269_TYPE_ALC255, 3162 ALC269_TYPE_ALC256, 3163 ALC269_TYPE_ALC257, 3164 ALC269_TYPE_ALC215, 3165 ALC269_TYPE_ALC225, 3166 ALC269_TYPE_ALC245, 3167 ALC269_TYPE_ALC287, 3168 ALC269_TYPE_ALC294, 3169 ALC269_TYPE_ALC300, 3170 ALC269_TYPE_ALC623, 3171 ALC269_TYPE_ALC700, 3172 }; 3173 3174 /* 3175 * BIOS auto configuration 3176 */ 3177 static int alc269_parse_auto_config(struct hda_codec *codec) 3178 { 3179 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 3180 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; 3181 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 3182 struct alc_spec *spec = codec->spec; 3183 const hda_nid_t *ssids; 3184 3185 switch (spec->codec_variant) { 3186 case ALC269_TYPE_ALC269VA: 3187 case ALC269_TYPE_ALC269VC: 3188 case ALC269_TYPE_ALC280: 3189 case ALC269_TYPE_ALC284: 3190 case ALC269_TYPE_ALC293: 3191 ssids = alc269va_ssids; 3192 break; 3193 case ALC269_TYPE_ALC269VB: 3194 case ALC269_TYPE_ALC269VD: 3195 case ALC269_TYPE_ALC282: 3196 case ALC269_TYPE_ALC283: 3197 case ALC269_TYPE_ALC286: 3198 case ALC269_TYPE_ALC298: 3199 case ALC269_TYPE_ALC255: 3200 case ALC269_TYPE_ALC256: 3201 case ALC269_TYPE_ALC257: 3202 case ALC269_TYPE_ALC215: 3203 case ALC269_TYPE_ALC225: 3204 case ALC269_TYPE_ALC245: 3205 case ALC269_TYPE_ALC287: 3206 case ALC269_TYPE_ALC294: 3207 case ALC269_TYPE_ALC300: 3208 case ALC269_TYPE_ALC623: 3209 case ALC269_TYPE_ALC700: 3210 ssids = alc269_ssids; 3211 break; 3212 default: 3213 ssids = alc269_ssids; 3214 break; 3215 } 3216 3217 return alc_parse_auto_config(codec, alc269_ignore, ssids); 3218 } 3219 3220 static const struct hda_jack_keymap alc_headset_btn_keymap[] = { 3221 { SND_JACK_BTN_0, KEY_PLAYPAUSE }, 3222 { SND_JACK_BTN_1, KEY_VOICECOMMAND }, 3223 { SND_JACK_BTN_2, KEY_VOLUMEUP }, 3224 { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, 3225 {} 3226 }; 3227 3228 static void alc_headset_btn_callback(struct hda_codec *codec, 3229 struct hda_jack_callback *jack) 3230 { 3231 int report = 0; 3232 3233 if (jack->unsol_res & (7 << 13)) 3234 report |= SND_JACK_BTN_0; 3235 3236 if (jack->unsol_res & (1 << 16 | 3 << 8)) 3237 report |= SND_JACK_BTN_1; 3238 3239 /* Volume up key */ 3240 if (jack->unsol_res & (7 << 23)) 3241 report |= SND_JACK_BTN_2; 3242 3243 /* Volume down key */ 3244 if (jack->unsol_res & (7 << 10)) 3245 report |= SND_JACK_BTN_3; 3246 3247 snd_hda_jack_set_button_state(codec, jack->nid, report); 3248 } 3249 3250 static void alc_disable_headset_jack_key(struct hda_codec *codec) 3251 { 3252 struct alc_spec *spec = codec->spec; 3253 3254 if (!spec->has_hs_key) 3255 return; 3256 3257 switch (codec->core.vendor_id) { 3258 case 0x10ec0215: 3259 case 0x10ec0225: 3260 case 0x10ec0285: 3261 case 0x10ec0287: 3262 case 0x10ec0295: 3263 case 0x10ec0289: 3264 case 0x10ec0299: 3265 alc_write_coef_idx(codec, 0x48, 0x0); 3266 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); 3267 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); 3268 break; 3269 case 0x10ec0230: 3270 case 0x10ec0236: 3271 case 0x10ec0256: 3272 case 0x10ec0257: 3273 case 0x19e58326: 3274 alc_write_coef_idx(codec, 0x48, 0x0); 3275 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); 3276 break; 3277 } 3278 } 3279 3280 static void alc_enable_headset_jack_key(struct hda_codec *codec) 3281 { 3282 struct alc_spec *spec = codec->spec; 3283 3284 if (!spec->has_hs_key) 3285 return; 3286 3287 switch (codec->core.vendor_id) { 3288 case 0x10ec0215: 3289 case 0x10ec0225: 3290 case 0x10ec0285: 3291 case 0x10ec0287: 3292 case 0x10ec0295: 3293 case 0x10ec0289: 3294 case 0x10ec0299: 3295 alc_write_coef_idx(codec, 0x48, 0xd011); 3296 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); 3297 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); 3298 break; 3299 case 0x10ec0230: 3300 case 0x10ec0236: 3301 case 0x10ec0256: 3302 case 0x10ec0257: 3303 case 0x19e58326: 3304 alc_write_coef_idx(codec, 0x48, 0xd011); 3305 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); 3306 break; 3307 } 3308 } 3309 3310 static void alc_fixup_headset_jack(struct hda_codec *codec, 3311 const struct hda_fixup *fix, int action) 3312 { 3313 struct alc_spec *spec = codec->spec; 3314 hda_nid_t hp_pin; 3315 3316 switch (action) { 3317 case HDA_FIXUP_ACT_PRE_PROBE: 3318 spec->has_hs_key = 1; 3319 snd_hda_jack_detect_enable_callback(codec, 0x55, 3320 alc_headset_btn_callback); 3321 break; 3322 case HDA_FIXUP_ACT_BUILD: 3323 hp_pin = alc_get_hp_pin(spec); 3324 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55, 3325 alc_headset_btn_keymap, 3326 hp_pin)) 3327 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", 3328 false, SND_JACK_HEADSET, 3329 alc_headset_btn_keymap); 3330 3331 alc_enable_headset_jack_key(codec); 3332 break; 3333 } 3334 } 3335 3336 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) 3337 { 3338 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); 3339 } 3340 3341 static void alc269_shutup(struct hda_codec *codec) 3342 { 3343 struct alc_spec *spec = codec->spec; 3344 3345 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 3346 alc269vb_toggle_power_output(codec, 0); 3347 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 3348 (alc_get_coef0(codec) & 0x00ff) == 0x018) { 3349 msleep(150); 3350 } 3351 alc_shutup_pins(codec); 3352 } 3353 3354 static const struct coef_fw alc282_coefs[] = { 3355 WRITE_COEF(0x03, 0x0002), /* Power Down Control */ 3356 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ 3357 WRITE_COEF(0x07, 0x0200), /* DMIC control */ 3358 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ 3359 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ 3360 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ 3361 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ 3362 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ 3363 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ 3364 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ 3365 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ 3366 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ 3367 WRITE_COEF(0x34, 0xa0c0), /* ANC */ 3368 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ 3369 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ 3370 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ 3371 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ 3372 WRITE_COEF(0x63, 0x2902), /* PLL */ 3373 WRITE_COEF(0x68, 0xa080), /* capless control 2 */ 3374 WRITE_COEF(0x69, 0x3400), /* capless control 3 */ 3375 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ 3376 WRITE_COEF(0x6b, 0x0), /* capless control 5 */ 3377 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ 3378 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ 3379 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ 3380 WRITE_COEF(0x71, 0x0014), /* class D test 6 */ 3381 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ 3382 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ 3383 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ 3384 {} 3385 }; 3386 3387 static void alc282_restore_default_value(struct hda_codec *codec) 3388 { 3389 alc_process_coef_fw(codec, alc282_coefs); 3390 } 3391 3392 static void alc282_init(struct hda_codec *codec) 3393 { 3394 struct alc_spec *spec = codec->spec; 3395 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3396 bool hp_pin_sense; 3397 int coef78; 3398 3399 alc282_restore_default_value(codec); 3400 3401 if (!hp_pin) 3402 return; 3403 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3404 coef78 = alc_read_coef_idx(codec, 0x78); 3405 3406 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ 3407 /* Headphone capless set to high power mode */ 3408 alc_write_coef_idx(codec, 0x78, 0x9004); 3409 3410 if (hp_pin_sense) 3411 msleep(2); 3412 3413 snd_hda_codec_write(codec, hp_pin, 0, 3414 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3415 3416 if (hp_pin_sense) 3417 msleep(85); 3418 3419 snd_hda_codec_write(codec, hp_pin, 0, 3420 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3421 3422 if (hp_pin_sense) 3423 msleep(100); 3424 3425 /* Headphone capless set to normal mode */ 3426 alc_write_coef_idx(codec, 0x78, coef78); 3427 } 3428 3429 static void alc282_shutup(struct hda_codec *codec) 3430 { 3431 struct alc_spec *spec = codec->spec; 3432 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3433 bool hp_pin_sense; 3434 int coef78; 3435 3436 if (!hp_pin) { 3437 alc269_shutup(codec); 3438 return; 3439 } 3440 3441 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3442 coef78 = alc_read_coef_idx(codec, 0x78); 3443 alc_write_coef_idx(codec, 0x78, 0x9004); 3444 3445 if (hp_pin_sense) 3446 msleep(2); 3447 3448 snd_hda_codec_write(codec, hp_pin, 0, 3449 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3450 3451 if (hp_pin_sense) 3452 msleep(85); 3453 3454 if (!spec->no_shutup_pins) 3455 snd_hda_codec_write(codec, hp_pin, 0, 3456 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3457 3458 if (hp_pin_sense) 3459 msleep(100); 3460 3461 alc_auto_setup_eapd(codec, false); 3462 alc_shutup_pins(codec); 3463 alc_write_coef_idx(codec, 0x78, coef78); 3464 } 3465 3466 static const struct coef_fw alc283_coefs[] = { 3467 WRITE_COEF(0x03, 0x0002), /* Power Down Control */ 3468 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ 3469 WRITE_COEF(0x07, 0x0200), /* DMIC control */ 3470 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ 3471 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ 3472 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ 3473 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ 3474 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ 3475 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ 3476 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ 3477 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ 3478 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ 3479 WRITE_COEF(0x22, 0xa0c0), /* ANC */ 3480 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ 3481 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ 3482 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ 3483 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ 3484 WRITE_COEF(0x2e, 0x2902), /* PLL */ 3485 WRITE_COEF(0x33, 0xa080), /* capless control 2 */ 3486 WRITE_COEF(0x34, 0x3400), /* capless control 3 */ 3487 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ 3488 WRITE_COEF(0x36, 0x0), /* capless control 5 */ 3489 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ 3490 WRITE_COEF(0x39, 0x110a), /* class D test 3 */ 3491 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ 3492 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ 3493 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ 3494 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ 3495 WRITE_COEF(0x49, 0x0), /* test mode */ 3496 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ 3497 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ 3498 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ 3499 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ 3500 {} 3501 }; 3502 3503 static void alc283_restore_default_value(struct hda_codec *codec) 3504 { 3505 alc_process_coef_fw(codec, alc283_coefs); 3506 } 3507 3508 static void alc283_init(struct hda_codec *codec) 3509 { 3510 struct alc_spec *spec = codec->spec; 3511 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3512 bool hp_pin_sense; 3513 3514 alc283_restore_default_value(codec); 3515 3516 if (!hp_pin) 3517 return; 3518 3519 msleep(30); 3520 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3521 3522 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ 3523 /* Headphone capless set to high power mode */ 3524 alc_write_coef_idx(codec, 0x43, 0x9004); 3525 3526 snd_hda_codec_write(codec, hp_pin, 0, 3527 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3528 3529 if (hp_pin_sense) 3530 msleep(85); 3531 3532 snd_hda_codec_write(codec, hp_pin, 0, 3533 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3534 3535 if (hp_pin_sense) 3536 msleep(85); 3537 /* Index 0x46 Combo jack auto switch control 2 */ 3538 /* 3k pull low control for Headset jack. */ 3539 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); 3540 /* Headphone capless set to normal mode */ 3541 alc_write_coef_idx(codec, 0x43, 0x9614); 3542 } 3543 3544 static void alc283_shutup(struct hda_codec *codec) 3545 { 3546 struct alc_spec *spec = codec->spec; 3547 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3548 bool hp_pin_sense; 3549 3550 if (!hp_pin) { 3551 alc269_shutup(codec); 3552 return; 3553 } 3554 3555 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3556 3557 alc_write_coef_idx(codec, 0x43, 0x9004); 3558 3559 /*depop hp during suspend*/ 3560 alc_write_coef_idx(codec, 0x06, 0x2100); 3561 3562 snd_hda_codec_write(codec, hp_pin, 0, 3563 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3564 3565 if (hp_pin_sense) 3566 msleep(100); 3567 3568 if (!spec->no_shutup_pins) 3569 snd_hda_codec_write(codec, hp_pin, 0, 3570 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3571 3572 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3573 3574 if (hp_pin_sense) 3575 msleep(100); 3576 alc_auto_setup_eapd(codec, false); 3577 alc_shutup_pins(codec); 3578 alc_write_coef_idx(codec, 0x43, 0x9614); 3579 } 3580 3581 static void alc256_init(struct hda_codec *codec) 3582 { 3583 struct alc_spec *spec = codec->spec; 3584 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3585 bool hp_pin_sense; 3586 3587 if (spec->ultra_low_power) { 3588 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); 3589 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); 3590 alc_update_coef_idx(codec, 0x08, 7<<4, 0); 3591 alc_update_coef_idx(codec, 0x3b, 1<<15, 0); 3592 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); 3593 msleep(30); 3594 } 3595 3596 if (!hp_pin) 3597 hp_pin = 0x21; 3598 3599 msleep(30); 3600 3601 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3602 3603 if (hp_pin_sense) 3604 msleep(2); 3605 3606 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3607 3608 snd_hda_codec_write(codec, hp_pin, 0, 3609 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3610 3611 if (hp_pin_sense || spec->ultra_low_power) 3612 msleep(85); 3613 3614 snd_hda_codec_write(codec, hp_pin, 0, 3615 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3616 3617 if (hp_pin_sense || spec->ultra_low_power) 3618 msleep(100); 3619 3620 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); 3621 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3622 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ 3623 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); 3624 /* 3625 * Expose headphone mic (or possibly Line In on some machines) instead 3626 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See 3627 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of 3628 * this register. 3629 */ 3630 alc_write_coef_idx(codec, 0x36, 0x5757); 3631 } 3632 3633 static void alc256_shutup(struct hda_codec *codec) 3634 { 3635 struct alc_spec *spec = codec->spec; 3636 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3637 bool hp_pin_sense; 3638 3639 if (!hp_pin) 3640 hp_pin = 0x21; 3641 3642 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3643 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3644 3645 if (hp_pin_sense) 3646 msleep(2); 3647 3648 snd_hda_codec_write(codec, hp_pin, 0, 3649 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3650 3651 if (hp_pin_sense || spec->ultra_low_power) 3652 msleep(85); 3653 3654 /* 3k pull low control for Headset jack. */ 3655 /* NOTE: call this before clearing the pin, otherwise codec stalls */ 3656 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly 3657 * when booting with headset plugged. So skip setting it for the codec alc257 3658 */ 3659 if (spec->en_3kpull_low) 3660 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3661 3662 if (!spec->no_shutup_pins) 3663 snd_hda_codec_write(codec, hp_pin, 0, 3664 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3665 3666 if (hp_pin_sense || spec->ultra_low_power) 3667 msleep(100); 3668 3669 alc_auto_setup_eapd(codec, false); 3670 alc_shutup_pins(codec); 3671 if (spec->ultra_low_power) { 3672 msleep(50); 3673 alc_update_coef_idx(codec, 0x03, 1<<1, 0); 3674 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); 3675 alc_update_coef_idx(codec, 0x08, 3<<2, 0); 3676 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); 3677 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); 3678 msleep(30); 3679 } 3680 } 3681 3682 static void alc285_hp_init(struct hda_codec *codec) 3683 { 3684 struct alc_spec *spec = codec->spec; 3685 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3686 int i, val; 3687 int coef38, coef0d, coef36; 3688 3689 alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */ 3690 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */ 3691 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */ 3692 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */ 3693 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */ 3694 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0); 3695 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0); 3696 3697 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 3698 3699 if (hp_pin) 3700 snd_hda_codec_write(codec, hp_pin, 0, 3701 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3702 3703 msleep(130); 3704 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14); 3705 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0); 3706 3707 if (hp_pin) 3708 snd_hda_codec_write(codec, hp_pin, 0, 3709 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3710 msleep(10); 3711 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */ 3712 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880); 3713 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049); 3714 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0); 3715 3716 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */ 3717 val = alc_read_coefex_idx(codec, 0x58, 0x00); 3718 for (i = 0; i < 20 && val & 0x8000; i++) { 3719 msleep(50); 3720 val = alc_read_coefex_idx(codec, 0x58, 0x00); 3721 } /* Wait for depop procedure finish */ 3722 3723 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */ 3724 alc_update_coef_idx(codec, 0x38, 1<<4, coef38); 3725 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d); 3726 alc_update_coef_idx(codec, 0x36, 3<<13, coef36); 3727 3728 msleep(50); 3729 alc_update_coef_idx(codec, 0x4a, 1<<15, 0); 3730 } 3731 3732 static void alc225_init(struct hda_codec *codec) 3733 { 3734 struct alc_spec *spec = codec->spec; 3735 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3736 bool hp1_pin_sense, hp2_pin_sense; 3737 3738 if (spec->ultra_low_power) { 3739 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); 3740 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); 3741 alc_update_coef_idx(codec, 0x33, 1<<11, 0); 3742 msleep(30); 3743 } 3744 3745 if (spec->codec_variant != ALC269_TYPE_ALC287 && 3746 spec->codec_variant != ALC269_TYPE_ALC245) 3747 /* required only at boot or S3 and S4 resume time */ 3748 if (!spec->done_hp_init || 3749 is_s3_resume(codec) || 3750 is_s4_resume(codec)) { 3751 alc285_hp_init(codec); 3752 spec->done_hp_init = true; 3753 } 3754 3755 if (!hp_pin) 3756 hp_pin = 0x21; 3757 msleep(30); 3758 3759 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3760 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3761 3762 if (hp1_pin_sense || hp2_pin_sense) 3763 msleep(2); 3764 3765 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3766 3767 if (hp1_pin_sense || spec->ultra_low_power) 3768 snd_hda_codec_write(codec, hp_pin, 0, 3769 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3770 if (hp2_pin_sense) 3771 snd_hda_codec_write(codec, 0x16, 0, 3772 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3773 3774 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3775 msleep(85); 3776 3777 if (hp1_pin_sense || spec->ultra_low_power) 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 3784 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3785 msleep(100); 3786 3787 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3788 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3789 } 3790 3791 static void alc225_shutup(struct hda_codec *codec) 3792 { 3793 struct alc_spec *spec = codec->spec; 3794 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3795 bool hp1_pin_sense, hp2_pin_sense; 3796 3797 if (!hp_pin) 3798 hp_pin = 0x21; 3799 3800 alc_disable_headset_jack_key(codec); 3801 /* 3k pull low control for Headset jack. */ 3802 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); 3803 3804 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3805 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3806 3807 if (hp1_pin_sense || hp2_pin_sense) 3808 msleep(2); 3809 3810 if (hp1_pin_sense || spec->ultra_low_power) 3811 snd_hda_codec_write(codec, hp_pin, 0, 3812 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3813 if (hp2_pin_sense) 3814 snd_hda_codec_write(codec, 0x16, 0, 3815 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3816 3817 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3818 msleep(85); 3819 3820 if (hp1_pin_sense || spec->ultra_low_power) 3821 snd_hda_codec_write(codec, hp_pin, 0, 3822 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3823 if (hp2_pin_sense) 3824 snd_hda_codec_write(codec, 0x16, 0, 3825 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3826 3827 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3828 msleep(100); 3829 3830 alc_auto_setup_eapd(codec, false); 3831 alc_shutup_pins(codec); 3832 if (spec->ultra_low_power) { 3833 msleep(50); 3834 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); 3835 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); 3836 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); 3837 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); 3838 msleep(30); 3839 } 3840 3841 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3842 alc_enable_headset_jack_key(codec); 3843 } 3844 3845 static void alc_default_init(struct hda_codec *codec) 3846 { 3847 struct alc_spec *spec = codec->spec; 3848 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3849 bool hp_pin_sense; 3850 3851 if (!hp_pin) 3852 return; 3853 3854 msleep(30); 3855 3856 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3857 3858 if (hp_pin_sense) 3859 msleep(2); 3860 3861 snd_hda_codec_write(codec, hp_pin, 0, 3862 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3863 3864 if (hp_pin_sense) 3865 msleep(85); 3866 3867 snd_hda_codec_write(codec, hp_pin, 0, 3868 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3869 3870 if (hp_pin_sense) 3871 msleep(100); 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 if (hp_pin_sense) 3894 msleep(85); 3895 3896 if (!spec->no_shutup_pins) 3897 snd_hda_codec_write(codec, hp_pin, 0, 3898 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3899 3900 if (hp_pin_sense) 3901 msleep(100); 3902 3903 alc_auto_setup_eapd(codec, false); 3904 alc_shutup_pins(codec); 3905 } 3906 3907 static void alc294_hp_init(struct hda_codec *codec) 3908 { 3909 struct alc_spec *spec = codec->spec; 3910 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3911 int i, val; 3912 3913 if (!hp_pin) 3914 return; 3915 3916 snd_hda_codec_write(codec, hp_pin, 0, 3917 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3918 3919 msleep(100); 3920 3921 if (!spec->no_shutup_pins) 3922 snd_hda_codec_write(codec, hp_pin, 0, 3923 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3924 3925 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ 3926 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ 3927 3928 /* Wait for depop procedure finish */ 3929 val = alc_read_coefex_idx(codec, 0x58, 0x01); 3930 for (i = 0; i < 20 && val & 0x0080; i++) { 3931 msleep(50); 3932 val = alc_read_coefex_idx(codec, 0x58, 0x01); 3933 } 3934 /* Set HP depop to auto mode */ 3935 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); 3936 msleep(50); 3937 } 3938 3939 static void alc294_init(struct hda_codec *codec) 3940 { 3941 struct alc_spec *spec = codec->spec; 3942 3943 /* required only at boot or S4 resume time */ 3944 if (!spec->done_hp_init || 3945 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { 3946 alc294_hp_init(codec); 3947 spec->done_hp_init = true; 3948 } 3949 alc_default_init(codec); 3950 } 3951 3952 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, 3953 unsigned int val) 3954 { 3955 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); 3956 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ 3957 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ 3958 } 3959 3960 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) 3961 { 3962 unsigned int val; 3963 3964 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); 3965 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) 3966 & 0xffff; 3967 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) 3968 << 16; 3969 return val; 3970 } 3971 3972 static void alc5505_dsp_halt(struct hda_codec *codec) 3973 { 3974 unsigned int val; 3975 3976 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ 3977 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ 3978 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ 3979 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ 3980 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ 3981 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ 3982 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ 3983 val = alc5505_coef_get(codec, 0x6220); 3984 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ 3985 } 3986 3987 static void alc5505_dsp_back_from_halt(struct hda_codec *codec) 3988 { 3989 alc5505_coef_set(codec, 0x61b8, 0x04133302); 3990 alc5505_coef_set(codec, 0x61b0, 0x00005b16); 3991 alc5505_coef_set(codec, 0x61b4, 0x040a2b02); 3992 alc5505_coef_set(codec, 0x6230, 0xf80d4011); 3993 alc5505_coef_set(codec, 0x6220, 0x2002010f); 3994 alc5505_coef_set(codec, 0x880c, 0x00000004); 3995 } 3996 3997 static void alc5505_dsp_init(struct hda_codec *codec) 3998 { 3999 unsigned int val; 4000 4001 alc5505_dsp_halt(codec); 4002 alc5505_dsp_back_from_halt(codec); 4003 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ 4004 alc5505_coef_set(codec, 0x61b0, 0x5b16); 4005 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ 4006 alc5505_coef_set(codec, 0x61b4, 0x04132b02); 4007 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ 4008 alc5505_coef_set(codec, 0x61b8, 0x041f3302); 4009 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ 4010 alc5505_coef_set(codec, 0x61b8, 0x041b3302); 4011 alc5505_coef_set(codec, 0x61b8, 0x04173302); 4012 alc5505_coef_set(codec, 0x61b8, 0x04163302); 4013 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ 4014 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ 4015 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ 4016 4017 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ 4018 if (val <= 3) 4019 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ 4020 else 4021 alc5505_coef_set(codec, 0x6220, 0x6002018f); 4022 4023 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ 4024 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ 4025 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ 4026 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ 4027 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ 4028 alc5505_coef_set(codec, 0x880c, 0x00000003); 4029 alc5505_coef_set(codec, 0x880c, 0x00000010); 4030 4031 #ifdef HALT_REALTEK_ALC5505 4032 alc5505_dsp_halt(codec); 4033 #endif 4034 } 4035 4036 #ifdef HALT_REALTEK_ALC5505 4037 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ 4038 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ 4039 #else 4040 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) 4041 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) 4042 #endif 4043 4044 static int alc269_suspend(struct hda_codec *codec) 4045 { 4046 struct alc_spec *spec = codec->spec; 4047 4048 if (spec->has_alc5505_dsp) 4049 alc5505_dsp_suspend(codec); 4050 4051 return alc_suspend(codec); 4052 } 4053 4054 static int alc269_resume(struct hda_codec *codec) 4055 { 4056 struct alc_spec *spec = codec->spec; 4057 4058 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 4059 alc269vb_toggle_power_output(codec, 0); 4060 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 4061 (alc_get_coef0(codec) & 0x00ff) == 0x018) { 4062 msleep(150); 4063 } 4064 4065 codec->patch_ops.init(codec); 4066 4067 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 4068 alc269vb_toggle_power_output(codec, 1); 4069 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 4070 (alc_get_coef0(codec) & 0x00ff) == 0x017) { 4071 msleep(200); 4072 } 4073 4074 snd_hda_regmap_sync(codec); 4075 hda_call_check_power_status(codec, 0x01); 4076 4077 /* on some machine, the BIOS will clear the codec gpio data when enter 4078 * suspend, and won't restore the data after resume, so we restore it 4079 * in the driver. 4080 */ 4081 if (spec->gpio_data) 4082 alc_write_gpio_data(codec); 4083 4084 if (spec->has_alc5505_dsp) 4085 alc5505_dsp_resume(codec); 4086 4087 return 0; 4088 } 4089 4090 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, 4091 const struct hda_fixup *fix, int action) 4092 { 4093 struct alc_spec *spec = codec->spec; 4094 4095 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4096 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 4097 } 4098 4099 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, 4100 const struct hda_fixup *fix, 4101 int action) 4102 { 4103 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); 4104 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); 4105 4106 if (cfg_headphone && cfg_headset_mic == 0x411111f0) 4107 snd_hda_codec_set_pincfg(codec, 0x19, 4108 (cfg_headphone & ~AC_DEFCFG_DEVICE) | 4109 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); 4110 } 4111 4112 static void alc269_fixup_hweq(struct hda_codec *codec, 4113 const struct hda_fixup *fix, int action) 4114 { 4115 if (action == HDA_FIXUP_ACT_INIT) 4116 alc_update_coef_idx(codec, 0x1e, 0, 0x80); 4117 } 4118 4119 static void alc269_fixup_headset_mic(struct hda_codec *codec, 4120 const struct hda_fixup *fix, int action) 4121 { 4122 struct alc_spec *spec = codec->spec; 4123 4124 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4125 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 4126 } 4127 4128 static void alc271_fixup_dmic(struct hda_codec *codec, 4129 const struct hda_fixup *fix, int action) 4130 { 4131 static const struct hda_verb verbs[] = { 4132 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, 4133 {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, 4134 {} 4135 }; 4136 unsigned int cfg; 4137 4138 if (strcmp(codec->core.chip_name, "ALC271X") && 4139 strcmp(codec->core.chip_name, "ALC269VB")) 4140 return; 4141 cfg = snd_hda_codec_get_pincfg(codec, 0x12); 4142 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) 4143 snd_hda_sequence_write(codec, verbs); 4144 } 4145 4146 /* Fix the speaker amp after resume, etc */ 4147 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec, 4148 const struct hda_fixup *fix, 4149 int action) 4150 { 4151 if (action == HDA_FIXUP_ACT_INIT) 4152 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000); 4153 } 4154 4155 static void alc269_fixup_pcm_44k(struct hda_codec *codec, 4156 const struct hda_fixup *fix, int action) 4157 { 4158 struct alc_spec *spec = codec->spec; 4159 4160 if (action != HDA_FIXUP_ACT_PROBE) 4161 return; 4162 4163 /* Due to a hardware problem on Lenovo Ideadpad, we need to 4164 * fix the sample rate of analog I/O to 44.1kHz 4165 */ 4166 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; 4167 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; 4168 } 4169 4170 static void alc269_fixup_stereo_dmic(struct hda_codec *codec, 4171 const struct hda_fixup *fix, int action) 4172 { 4173 /* The digital-mic unit sends PDM (differential signal) instead of 4174 * the standard PCM, thus you can't record a valid mono stream as is. 4175 * Below is a workaround specific to ALC269 to control the dmic 4176 * signal source as mono. 4177 */ 4178 if (action == HDA_FIXUP_ACT_INIT) 4179 alc_update_coef_idx(codec, 0x07, 0, 0x80); 4180 } 4181 4182 static void alc269_quanta_automute(struct hda_codec *codec) 4183 { 4184 snd_hda_gen_update_outputs(codec); 4185 4186 alc_write_coef_idx(codec, 0x0c, 0x680); 4187 alc_write_coef_idx(codec, 0x0c, 0x480); 4188 } 4189 4190 static void alc269_fixup_quanta_mute(struct hda_codec *codec, 4191 const struct hda_fixup *fix, int action) 4192 { 4193 struct alc_spec *spec = codec->spec; 4194 if (action != HDA_FIXUP_ACT_PROBE) 4195 return; 4196 spec->gen.automute_hook = alc269_quanta_automute; 4197 } 4198 4199 static void alc269_x101_hp_automute_hook(struct hda_codec *codec, 4200 struct hda_jack_callback *jack) 4201 { 4202 struct alc_spec *spec = codec->spec; 4203 int vref; 4204 msleep(200); 4205 snd_hda_gen_hp_automute(codec, jack); 4206 4207 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 4208 msleep(100); 4209 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 4210 vref); 4211 msleep(500); 4212 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 4213 vref); 4214 } 4215 4216 /* 4217 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) 4218 */ 4219 struct hda_alc298_mbxinit { 4220 unsigned char value_0x23; 4221 unsigned char value_0x25; 4222 }; 4223 4224 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, 4225 const struct hda_alc298_mbxinit *initval, 4226 bool first) 4227 { 4228 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); 4229 alc_write_coef_idx(codec, 0x26, 0xb000); 4230 4231 if (first) 4232 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); 4233 4234 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); 4235 alc_write_coef_idx(codec, 0x26, 0xf000); 4236 alc_write_coef_idx(codec, 0x23, initval->value_0x23); 4237 4238 if (initval->value_0x23 != 0x1e) 4239 alc_write_coef_idx(codec, 0x25, initval->value_0x25); 4240 4241 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); 4242 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); 4243 } 4244 4245 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, 4246 const struct hda_fixup *fix, 4247 int action) 4248 { 4249 /* Initialization magic */ 4250 static const struct hda_alc298_mbxinit dac_init[] = { 4251 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, 4252 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, 4253 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, 4254 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, 4255 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, 4256 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, 4257 {0x2f, 0x00}, 4258 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, 4259 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, 4260 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, 4261 {} 4262 }; 4263 const struct hda_alc298_mbxinit *seq; 4264 4265 if (action != HDA_FIXUP_ACT_INIT) 4266 return; 4267 4268 /* Start */ 4269 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); 4270 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); 4271 alc_write_coef_idx(codec, 0x26, 0xf000); 4272 alc_write_coef_idx(codec, 0x22, 0x31); 4273 alc_write_coef_idx(codec, 0x23, 0x0b); 4274 alc_write_coef_idx(codec, 0x25, 0x00); 4275 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); 4276 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); 4277 4278 for (seq = dac_init; seq->value_0x23; seq++) 4279 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); 4280 } 4281 4282 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, 4283 const struct hda_fixup *fix, int action) 4284 { 4285 struct alc_spec *spec = codec->spec; 4286 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4287 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 4288 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; 4289 } 4290 } 4291 4292 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, 4293 bool polarity, bool on) 4294 { 4295 unsigned int pinval; 4296 4297 if (!pin) 4298 return; 4299 if (polarity) 4300 on = !on; 4301 pinval = snd_hda_codec_get_pin_target(codec, pin); 4302 pinval &= ~AC_PINCTL_VREFEN; 4303 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; 4304 /* temporarily power up/down for setting VREF */ 4305 snd_hda_power_up_pm(codec); 4306 snd_hda_set_pin_ctl_cache(codec, pin, pinval); 4307 snd_hda_power_down_pm(codec); 4308 } 4309 4310 /* update mute-LED according to the speaker mute state via mic VREF pin */ 4311 static int vref_mute_led_set(struct led_classdev *led_cdev, 4312 enum led_brightness brightness) 4313 { 4314 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4315 struct alc_spec *spec = codec->spec; 4316 4317 alc_update_vref_led(codec, spec->mute_led_nid, 4318 spec->mute_led_polarity, brightness); 4319 return 0; 4320 } 4321 4322 /* Make sure the led works even in runtime suspend */ 4323 static unsigned int led_power_filter(struct hda_codec *codec, 4324 hda_nid_t nid, 4325 unsigned int power_state) 4326 { 4327 struct alc_spec *spec = codec->spec; 4328 4329 if (power_state != AC_PWRST_D3 || nid == 0 || 4330 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) 4331 return power_state; 4332 4333 /* Set pin ctl again, it might have just been set to 0 */ 4334 snd_hda_set_pin_ctl(codec, nid, 4335 snd_hda_codec_get_pin_target(codec, nid)); 4336 4337 return snd_hda_gen_path_power_filter(codec, nid, power_state); 4338 } 4339 4340 static void alc269_fixup_hp_mute_led(struct hda_codec *codec, 4341 const struct hda_fixup *fix, int action) 4342 { 4343 struct alc_spec *spec = codec->spec; 4344 const struct dmi_device *dev = NULL; 4345 4346 if (action != HDA_FIXUP_ACT_PRE_PROBE) 4347 return; 4348 4349 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { 4350 int pol, pin; 4351 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) 4352 continue; 4353 if (pin < 0x0a || pin >= 0x10) 4354 break; 4355 spec->mute_led_polarity = pol; 4356 spec->mute_led_nid = pin - 0x0a + 0x18; 4357 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); 4358 codec->power_filter = led_power_filter; 4359 codec_dbg(codec, 4360 "Detected mute LED for %x:%d\n", spec->mute_led_nid, 4361 spec->mute_led_polarity); 4362 break; 4363 } 4364 } 4365 4366 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, 4367 const struct hda_fixup *fix, 4368 int action, hda_nid_t pin) 4369 { 4370 struct alc_spec *spec = codec->spec; 4371 4372 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4373 spec->mute_led_polarity = 0; 4374 spec->mute_led_nid = pin; 4375 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); 4376 codec->power_filter = led_power_filter; 4377 } 4378 } 4379 4380 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, 4381 const struct hda_fixup *fix, int action) 4382 { 4383 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); 4384 } 4385 4386 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, 4387 const struct hda_fixup *fix, int action) 4388 { 4389 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); 4390 } 4391 4392 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, 4393 const struct hda_fixup *fix, int action) 4394 { 4395 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); 4396 } 4397 4398 /* update LED status via GPIO */ 4399 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, 4400 int polarity, bool enabled) 4401 { 4402 if (polarity) 4403 enabled = !enabled; 4404 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ 4405 } 4406 4407 /* turn on/off mute LED via GPIO per vmaster hook */ 4408 static int gpio_mute_led_set(struct led_classdev *led_cdev, 4409 enum led_brightness brightness) 4410 { 4411 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4412 struct alc_spec *spec = codec->spec; 4413 4414 alc_update_gpio_led(codec, spec->gpio_mute_led_mask, 4415 spec->mute_led_polarity, !brightness); 4416 return 0; 4417 } 4418 4419 /* turn on/off mic-mute LED via GPIO per capture hook */ 4420 static int micmute_led_set(struct led_classdev *led_cdev, 4421 enum led_brightness brightness) 4422 { 4423 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4424 struct alc_spec *spec = codec->spec; 4425 4426 alc_update_gpio_led(codec, spec->gpio_mic_led_mask, 4427 spec->micmute_led_polarity, !brightness); 4428 return 0; 4429 } 4430 4431 /* setup mute and mic-mute GPIO bits, add hooks appropriately */ 4432 static void alc_fixup_hp_gpio_led(struct hda_codec *codec, 4433 int action, 4434 unsigned int mute_mask, 4435 unsigned int micmute_mask) 4436 { 4437 struct alc_spec *spec = codec->spec; 4438 4439 alc_fixup_gpio(codec, action, mute_mask | micmute_mask); 4440 4441 if (action != HDA_FIXUP_ACT_PRE_PROBE) 4442 return; 4443 if (mute_mask) { 4444 spec->gpio_mute_led_mask = mute_mask; 4445 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); 4446 } 4447 if (micmute_mask) { 4448 spec->gpio_mic_led_mask = micmute_mask; 4449 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); 4450 } 4451 } 4452 4453 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, 4454 const struct hda_fixup *fix, int action) 4455 { 4456 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); 4457 } 4458 4459 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, 4460 const struct hda_fixup *fix, int action) 4461 { 4462 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); 4463 } 4464 4465 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, 4466 const struct hda_fixup *fix, int action) 4467 { 4468 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); 4469 } 4470 4471 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, 4472 const struct hda_fixup *fix, int action) 4473 { 4474 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); 4475 } 4476 4477 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, 4478 const struct hda_fixup *fix, int action) 4479 { 4480 alc_fixup_hp_gpio_led(codec, action, 0x10, 0); 4481 } 4482 4483 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec, 4484 const struct hda_fixup *fix, int action) 4485 { 4486 struct alc_spec *spec = codec->spec; 4487 4488 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4489 spec->micmute_led_polarity = 1; 4490 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 4491 } 4492 4493 /* turn on/off mic-mute LED per capture hook via VREF change */ 4494 static int vref_micmute_led_set(struct led_classdev *led_cdev, 4495 enum led_brightness brightness) 4496 { 4497 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4498 struct alc_spec *spec = codec->spec; 4499 4500 alc_update_vref_led(codec, spec->cap_mute_led_nid, 4501 spec->micmute_led_polarity, brightness); 4502 return 0; 4503 } 4504 4505 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, 4506 const struct hda_fixup *fix, int action) 4507 { 4508 struct alc_spec *spec = codec->spec; 4509 4510 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 4511 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4512 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to 4513 * enable headphone amp 4514 */ 4515 spec->gpio_mask |= 0x10; 4516 spec->gpio_dir |= 0x10; 4517 spec->cap_mute_led_nid = 0x18; 4518 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4519 codec->power_filter = led_power_filter; 4520 } 4521 } 4522 4523 static void alc280_fixup_hp_gpio4(struct hda_codec *codec, 4524 const struct hda_fixup *fix, int action) 4525 { 4526 struct alc_spec *spec = codec->spec; 4527 4528 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 4529 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4530 spec->cap_mute_led_nid = 0x18; 4531 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4532 codec->power_filter = led_power_filter; 4533 } 4534 } 4535 4536 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp; 4537 * it needs to toggle the GPIO0 once on and off at each time (bko#210633) 4538 */ 4539 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec, 4540 const struct hda_fixup *fix, int action) 4541 { 4542 struct alc_spec *spec = codec->spec; 4543 4544 switch (action) { 4545 case HDA_FIXUP_ACT_PRE_PROBE: 4546 spec->gpio_mask |= 0x01; 4547 spec->gpio_dir |= 0x01; 4548 break; 4549 case HDA_FIXUP_ACT_INIT: 4550 /* need to toggle GPIO to enable the amp */ 4551 alc_update_gpio_data(codec, 0x01, true); 4552 msleep(100); 4553 alc_update_gpio_data(codec, 0x01, false); 4554 break; 4555 } 4556 } 4557 4558 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */ 4559 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo, 4560 struct hda_codec *codec, 4561 struct snd_pcm_substream *substream, 4562 int action) 4563 { 4564 switch (action) { 4565 case HDA_GEN_PCM_ACT_PREPARE: 4566 alc_update_gpio_data(codec, 0x04, true); 4567 break; 4568 case HDA_GEN_PCM_ACT_CLEANUP: 4569 alc_update_gpio_data(codec, 0x04, false); 4570 break; 4571 } 4572 } 4573 4574 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec, 4575 const struct hda_fixup *fix, 4576 int action) 4577 { 4578 struct alc_spec *spec = codec->spec; 4579 4580 if (action == HDA_FIXUP_ACT_PROBE) { 4581 spec->gpio_mask |= 0x04; 4582 spec->gpio_dir |= 0x04; 4583 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook; 4584 } 4585 } 4586 4587 static void alc_update_coef_led(struct hda_codec *codec, 4588 struct alc_coef_led *led, 4589 bool polarity, bool on) 4590 { 4591 if (polarity) 4592 on = !on; 4593 /* temporarily power up/down for setting COEF bit */ 4594 alc_update_coef_idx(codec, led->idx, led->mask, 4595 on ? led->on : led->off); 4596 } 4597 4598 /* update mute-LED according to the speaker mute state via COEF bit */ 4599 static int coef_mute_led_set(struct led_classdev *led_cdev, 4600 enum led_brightness brightness) 4601 { 4602 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4603 struct alc_spec *spec = codec->spec; 4604 4605 alc_update_coef_led(codec, &spec->mute_led_coef, 4606 spec->mute_led_polarity, brightness); 4607 return 0; 4608 } 4609 4610 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4611 const struct hda_fixup *fix, 4612 int action) 4613 { 4614 struct alc_spec *spec = codec->spec; 4615 4616 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4617 spec->mute_led_polarity = 0; 4618 spec->mute_led_coef.idx = 0x0b; 4619 spec->mute_led_coef.mask = 1 << 3; 4620 spec->mute_led_coef.on = 1 << 3; 4621 spec->mute_led_coef.off = 0; 4622 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4623 } 4624 } 4625 4626 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4627 const struct hda_fixup *fix, 4628 int action) 4629 { 4630 struct alc_spec *spec = codec->spec; 4631 4632 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4633 spec->mute_led_polarity = 0; 4634 spec->mute_led_coef.idx = 0x34; 4635 spec->mute_led_coef.mask = 1 << 5; 4636 spec->mute_led_coef.on = 0; 4637 spec->mute_led_coef.off = 1 << 5; 4638 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4639 } 4640 } 4641 4642 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec, 4643 const struct hda_fixup *fix, int action) 4644 { 4645 struct alc_spec *spec = codec->spec; 4646 4647 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4648 spec->mute_led_polarity = 0; 4649 spec->mute_led_coef.idx = 0x07; 4650 spec->mute_led_coef.mask = 1; 4651 spec->mute_led_coef.on = 1; 4652 spec->mute_led_coef.off = 0; 4653 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4654 } 4655 } 4656 4657 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4658 const struct hda_fixup *fix, 4659 int action) 4660 { 4661 struct alc_spec *spec = codec->spec; 4662 4663 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4664 spec->mute_led_polarity = 0; 4665 spec->mute_led_coef.idx = 0x0b; 4666 spec->mute_led_coef.mask = 3 << 2; 4667 spec->mute_led_coef.on = 2 << 2; 4668 spec->mute_led_coef.off = 1 << 2; 4669 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4670 } 4671 } 4672 4673 /* turn on/off mic-mute LED per capture hook by coef bit */ 4674 static int coef_micmute_led_set(struct led_classdev *led_cdev, 4675 enum led_brightness brightness) 4676 { 4677 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4678 struct alc_spec *spec = codec->spec; 4679 4680 alc_update_coef_led(codec, &spec->mic_led_coef, 4681 spec->micmute_led_polarity, brightness); 4682 return 0; 4683 } 4684 4685 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, 4686 const struct hda_fixup *fix, int action) 4687 { 4688 struct alc_spec *spec = codec->spec; 4689 4690 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4691 spec->mic_led_coef.idx = 0x19; 4692 spec->mic_led_coef.mask = 1 << 13; 4693 spec->mic_led_coef.on = 1 << 13; 4694 spec->mic_led_coef.off = 0; 4695 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); 4696 } 4697 } 4698 4699 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec, 4700 const struct hda_fixup *fix, int action) 4701 { 4702 struct alc_spec *spec = codec->spec; 4703 4704 if (action == HDA_FIXUP_ACT_PRE_PROBE) 4705 spec->micmute_led_polarity = 1; 4706 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 4707 } 4708 4709 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, 4710 const struct hda_fixup *fix, int action) 4711 { 4712 struct alc_spec *spec = codec->spec; 4713 4714 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4715 spec->mic_led_coef.idx = 0x35; 4716 spec->mic_led_coef.mask = 3 << 2; 4717 spec->mic_led_coef.on = 2 << 2; 4718 spec->mic_led_coef.off = 1 << 2; 4719 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); 4720 } 4721 } 4722 4723 static void alc285_fixup_hp_mute_led(struct hda_codec *codec, 4724 const struct hda_fixup *fix, int action) 4725 { 4726 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 4727 alc285_fixup_hp_coef_micmute_led(codec, fix, action); 4728 } 4729 4730 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec, 4731 const struct hda_fixup *fix, int action) 4732 { 4733 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 4734 alc285_fixup_hp_gpio_micmute_led(codec, fix, action); 4735 } 4736 4737 static void alc236_fixup_hp_mute_led(struct hda_codec *codec, 4738 const struct hda_fixup *fix, int action) 4739 { 4740 alc236_fixup_hp_mute_led_coefbit(codec, fix, action); 4741 alc236_fixup_hp_coef_micmute_led(codec, fix, action); 4742 } 4743 4744 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec, 4745 const struct hda_fixup *fix, int action) 4746 { 4747 struct alc_spec *spec = codec->spec; 4748 4749 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4750 spec->cap_mute_led_nid = 0x1a; 4751 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4752 codec->power_filter = led_power_filter; 4753 } 4754 } 4755 4756 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec, 4757 const struct hda_fixup *fix, int action) 4758 { 4759 alc236_fixup_hp_mute_led_coefbit(codec, fix, action); 4760 alc236_fixup_hp_micmute_led_vref(codec, fix, action); 4761 } 4762 4763 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec, 4764 const unsigned short coefs[2]) 4765 { 4766 alc_write_coef_idx(codec, 0x23, coefs[0]); 4767 alc_write_coef_idx(codec, 0x25, coefs[1]); 4768 alc_write_coef_idx(codec, 0x26, 0xb011); 4769 } 4770 4771 struct alc298_samsung_amp_desc { 4772 unsigned char nid; 4773 unsigned short init_seq[2][2]; 4774 }; 4775 4776 static void alc298_fixup_samsung_amp(struct hda_codec *codec, 4777 const struct hda_fixup *fix, int action) 4778 { 4779 int i, j; 4780 static const unsigned short init_seq[][2] = { 4781 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 }, 4782 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 }, 4783 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e }, 4784 { 0x41, 0x07 }, { 0x400, 0x1 } 4785 }; 4786 static const struct alc298_samsung_amp_desc amps[] = { 4787 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } }, 4788 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } } 4789 }; 4790 4791 if (action != HDA_FIXUP_ACT_INIT) 4792 return; 4793 4794 for (i = 0; i < ARRAY_SIZE(amps); i++) { 4795 alc_write_coef_idx(codec, 0x22, amps[i].nid); 4796 4797 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++) 4798 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]); 4799 4800 for (j = 0; j < ARRAY_SIZE(init_seq); j++) 4801 alc298_samsung_write_coef_pack(codec, init_seq[j]); 4802 } 4803 } 4804 4805 #include "samsung_helper.c" 4806 4807 #if IS_REACHABLE(CONFIG_INPUT) 4808 static void gpio2_mic_hotkey_event(struct hda_codec *codec, 4809 struct hda_jack_callback *event) 4810 { 4811 struct alc_spec *spec = codec->spec; 4812 4813 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore 4814 send both key on and key off event for every interrupt. */ 4815 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); 4816 input_sync(spec->kb_dev); 4817 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); 4818 input_sync(spec->kb_dev); 4819 } 4820 4821 static int alc_register_micmute_input_device(struct hda_codec *codec) 4822 { 4823 struct alc_spec *spec = codec->spec; 4824 int i; 4825 4826 spec->kb_dev = input_allocate_device(); 4827 if (!spec->kb_dev) { 4828 codec_err(codec, "Out of memory (input_allocate_device)\n"); 4829 return -ENOMEM; 4830 } 4831 4832 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; 4833 4834 spec->kb_dev->name = "Microphone Mute Button"; 4835 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); 4836 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); 4837 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); 4838 spec->kb_dev->keycode = spec->alc_mute_keycode_map; 4839 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) 4840 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); 4841 4842 if (input_register_device(spec->kb_dev)) { 4843 codec_err(codec, "input_register_device failed\n"); 4844 input_free_device(spec->kb_dev); 4845 spec->kb_dev = NULL; 4846 return -ENOMEM; 4847 } 4848 4849 return 0; 4850 } 4851 4852 /* GPIO1 = set according to SKU external amp 4853 * GPIO2 = mic mute hotkey 4854 * GPIO3 = mute LED 4855 * GPIO4 = mic mute LED 4856 */ 4857 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, 4858 const struct hda_fixup *fix, int action) 4859 { 4860 struct alc_spec *spec = codec->spec; 4861 4862 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); 4863 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4864 spec->init_amp = ALC_INIT_DEFAULT; 4865 if (alc_register_micmute_input_device(codec) != 0) 4866 return; 4867 4868 spec->gpio_mask |= 0x06; 4869 spec->gpio_dir |= 0x02; 4870 spec->gpio_data |= 0x02; 4871 snd_hda_codec_write_cache(codec, codec->core.afg, 0, 4872 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); 4873 snd_hda_jack_detect_enable_callback(codec, codec->core.afg, 4874 gpio2_mic_hotkey_event); 4875 return; 4876 } 4877 4878 if (!spec->kb_dev) 4879 return; 4880 4881 switch (action) { 4882 case HDA_FIXUP_ACT_FREE: 4883 input_unregister_device(spec->kb_dev); 4884 spec->kb_dev = NULL; 4885 } 4886 } 4887 4888 /* Line2 = mic mute hotkey 4889 * GPIO2 = mic mute LED 4890 */ 4891 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, 4892 const struct hda_fixup *fix, int action) 4893 { 4894 struct alc_spec *spec = codec->spec; 4895 4896 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 4897 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4898 spec->init_amp = ALC_INIT_DEFAULT; 4899 if (alc_register_micmute_input_device(codec) != 0) 4900 return; 4901 4902 snd_hda_jack_detect_enable_callback(codec, 0x1b, 4903 gpio2_mic_hotkey_event); 4904 return; 4905 } 4906 4907 if (!spec->kb_dev) 4908 return; 4909 4910 switch (action) { 4911 case HDA_FIXUP_ACT_FREE: 4912 input_unregister_device(spec->kb_dev); 4913 spec->kb_dev = NULL; 4914 } 4915 } 4916 #else /* INPUT */ 4917 #define alc280_fixup_hp_gpio2_mic_hotkey NULL 4918 #define alc233_fixup_lenovo_line2_mic_hotkey NULL 4919 #endif /* INPUT */ 4920 4921 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, 4922 const struct hda_fixup *fix, int action) 4923 { 4924 struct alc_spec *spec = codec->spec; 4925 4926 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); 4927 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4928 spec->cap_mute_led_nid = 0x18; 4929 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4930 } 4931 } 4932 4933 static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay) 4934 { 4935 if (delay <= 0) 4936 delay = 75; 4937 snd_hda_codec_write(codec, 0x21, 0, 4938 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 4939 msleep(delay); 4940 snd_hda_codec_write(codec, 0x21, 0, 4941 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 4942 msleep(delay); 4943 } 4944 4945 static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay) 4946 { 4947 if (delay <= 0) 4948 delay = 75; 4949 snd_hda_codec_write(codec, 0x21, 0, 4950 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 4951 msleep(delay); 4952 snd_hda_codec_write(codec, 0x21, 0, 4953 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 4954 msleep(delay); 4955 } 4956 4957 static const struct coef_fw alc225_pre_hsmode[] = { 4958 UPDATE_COEF(0x4a, 1<<8, 0), 4959 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), 4960 UPDATE_COEF(0x63, 3<<14, 3<<14), 4961 UPDATE_COEF(0x4a, 3<<4, 2<<4), 4962 UPDATE_COEF(0x4a, 3<<10, 3<<10), 4963 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), 4964 UPDATE_COEF(0x4a, 3<<10, 0), 4965 {} 4966 }; 4967 4968 static void alc_headset_mode_unplugged(struct hda_codec *codec) 4969 { 4970 struct alc_spec *spec = codec->spec; 4971 static const struct coef_fw coef0255[] = { 4972 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ 4973 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ 4974 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 4975 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ 4976 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ 4977 {} 4978 }; 4979 static const struct coef_fw coef0256[] = { 4980 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ 4981 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ 4982 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ 4983 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ 4984 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 4985 {} 4986 }; 4987 static const struct coef_fw coef0233[] = { 4988 WRITE_COEF(0x1b, 0x0c0b), 4989 WRITE_COEF(0x45, 0xc429), 4990 UPDATE_COEF(0x35, 0x4000, 0), 4991 WRITE_COEF(0x06, 0x2104), 4992 WRITE_COEF(0x1a, 0x0001), 4993 WRITE_COEF(0x26, 0x0004), 4994 WRITE_COEF(0x32, 0x42a3), 4995 {} 4996 }; 4997 static const struct coef_fw coef0288[] = { 4998 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), 4999 UPDATE_COEF(0x50, 0x2000, 0x2000), 5000 UPDATE_COEF(0x56, 0x0006, 0x0006), 5001 UPDATE_COEF(0x66, 0x0008, 0), 5002 UPDATE_COEF(0x67, 0x2000, 0), 5003 {} 5004 }; 5005 static const struct coef_fw coef0298[] = { 5006 UPDATE_COEF(0x19, 0x1300, 0x0300), 5007 {} 5008 }; 5009 static const struct coef_fw coef0292[] = { 5010 WRITE_COEF(0x76, 0x000e), 5011 WRITE_COEF(0x6c, 0x2400), 5012 WRITE_COEF(0x18, 0x7308), 5013 WRITE_COEF(0x6b, 0xc429), 5014 {} 5015 }; 5016 static const struct coef_fw coef0293[] = { 5017 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ 5018 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ 5019 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ 5020 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ 5021 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ 5022 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ 5023 {} 5024 }; 5025 static const struct coef_fw coef0668[] = { 5026 WRITE_COEF(0x15, 0x0d40), 5027 WRITE_COEF(0xb7, 0x802b), 5028 {} 5029 }; 5030 static const struct coef_fw coef0225[] = { 5031 UPDATE_COEF(0x63, 3<<14, 0), 5032 {} 5033 }; 5034 static const struct coef_fw coef0274[] = { 5035 UPDATE_COEF(0x4a, 0x0100, 0), 5036 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), 5037 UPDATE_COEF(0x6b, 0xf000, 0x5000), 5038 UPDATE_COEF(0x4a, 0x0010, 0), 5039 UPDATE_COEF(0x4a, 0x0c00, 0x0c00), 5040 WRITE_COEF(0x45, 0x5289), 5041 UPDATE_COEF(0x4a, 0x0c00, 0), 5042 {} 5043 }; 5044 5045 if (spec->no_internal_mic_pin) { 5046 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 5047 return; 5048 } 5049 5050 switch (codec->core.vendor_id) { 5051 case 0x10ec0255: 5052 alc_process_coef_fw(codec, coef0255); 5053 break; 5054 case 0x10ec0230: 5055 case 0x10ec0236: 5056 case 0x10ec0256: 5057 case 0x19e58326: 5058 alc_hp_mute_disable(codec, 75); 5059 alc_process_coef_fw(codec, coef0256); 5060 break; 5061 case 0x10ec0234: 5062 case 0x10ec0274: 5063 case 0x10ec0294: 5064 alc_process_coef_fw(codec, coef0274); 5065 break; 5066 case 0x10ec0233: 5067 case 0x10ec0283: 5068 alc_process_coef_fw(codec, coef0233); 5069 break; 5070 case 0x10ec0286: 5071 case 0x10ec0288: 5072 alc_process_coef_fw(codec, coef0288); 5073 break; 5074 case 0x10ec0298: 5075 alc_process_coef_fw(codec, coef0298); 5076 alc_process_coef_fw(codec, coef0288); 5077 break; 5078 case 0x10ec0292: 5079 alc_process_coef_fw(codec, coef0292); 5080 break; 5081 case 0x10ec0293: 5082 alc_process_coef_fw(codec, coef0293); 5083 break; 5084 case 0x10ec0668: 5085 alc_process_coef_fw(codec, coef0668); 5086 break; 5087 case 0x10ec0215: 5088 case 0x10ec0225: 5089 case 0x10ec0285: 5090 case 0x10ec0295: 5091 case 0x10ec0289: 5092 case 0x10ec0299: 5093 alc_hp_mute_disable(codec, 75); 5094 alc_process_coef_fw(codec, alc225_pre_hsmode); 5095 alc_process_coef_fw(codec, coef0225); 5096 break; 5097 case 0x10ec0867: 5098 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5099 break; 5100 } 5101 codec_dbg(codec, "Headset jack set to unplugged mode.\n"); 5102 } 5103 5104 5105 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, 5106 hda_nid_t mic_pin) 5107 { 5108 static const struct coef_fw coef0255[] = { 5109 WRITE_COEFEX(0x57, 0x03, 0x8aa6), 5110 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ 5111 {} 5112 }; 5113 static const struct coef_fw coef0256[] = { 5114 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ 5115 WRITE_COEFEX(0x57, 0x03, 0x09a3), 5116 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ 5117 {} 5118 }; 5119 static const struct coef_fw coef0233[] = { 5120 UPDATE_COEF(0x35, 0, 1<<14), 5121 WRITE_COEF(0x06, 0x2100), 5122 WRITE_COEF(0x1a, 0x0021), 5123 WRITE_COEF(0x26, 0x008c), 5124 {} 5125 }; 5126 static const struct coef_fw coef0288[] = { 5127 UPDATE_COEF(0x4f, 0x00c0, 0), 5128 UPDATE_COEF(0x50, 0x2000, 0), 5129 UPDATE_COEF(0x56, 0x0006, 0), 5130 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), 5131 UPDATE_COEF(0x66, 0x0008, 0x0008), 5132 UPDATE_COEF(0x67, 0x2000, 0x2000), 5133 {} 5134 }; 5135 static const struct coef_fw coef0292[] = { 5136 WRITE_COEF(0x19, 0xa208), 5137 WRITE_COEF(0x2e, 0xacf0), 5138 {} 5139 }; 5140 static const struct coef_fw coef0293[] = { 5141 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ 5142 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ 5143 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ 5144 {} 5145 }; 5146 static const struct coef_fw coef0688[] = { 5147 WRITE_COEF(0xb7, 0x802b), 5148 WRITE_COEF(0xb5, 0x1040), 5149 UPDATE_COEF(0xc3, 0, 1<<12), 5150 {} 5151 }; 5152 static const struct coef_fw coef0225[] = { 5153 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), 5154 UPDATE_COEF(0x4a, 3<<4, 2<<4), 5155 UPDATE_COEF(0x63, 3<<14, 0), 5156 {} 5157 }; 5158 static const struct coef_fw coef0274[] = { 5159 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), 5160 UPDATE_COEF(0x4a, 0x0010, 0), 5161 UPDATE_COEF(0x6b, 0xf000, 0), 5162 {} 5163 }; 5164 5165 switch (codec->core.vendor_id) { 5166 case 0x10ec0255: 5167 alc_write_coef_idx(codec, 0x45, 0xc489); 5168 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5169 alc_process_coef_fw(codec, coef0255); 5170 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5171 break; 5172 case 0x10ec0230: 5173 case 0x10ec0236: 5174 case 0x10ec0256: 5175 case 0x19e58326: 5176 alc_write_coef_idx(codec, 0x45, 0xc489); 5177 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5178 alc_process_coef_fw(codec, coef0256); 5179 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5180 break; 5181 case 0x10ec0234: 5182 case 0x10ec0274: 5183 case 0x10ec0294: 5184 alc_write_coef_idx(codec, 0x45, 0x4689); 5185 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5186 alc_process_coef_fw(codec, coef0274); 5187 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5188 break; 5189 case 0x10ec0233: 5190 case 0x10ec0283: 5191 alc_write_coef_idx(codec, 0x45, 0xc429); 5192 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5193 alc_process_coef_fw(codec, coef0233); 5194 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5195 break; 5196 case 0x10ec0286: 5197 case 0x10ec0288: 5198 case 0x10ec0298: 5199 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5200 alc_process_coef_fw(codec, coef0288); 5201 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5202 break; 5203 case 0x10ec0292: 5204 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5205 alc_process_coef_fw(codec, coef0292); 5206 break; 5207 case 0x10ec0293: 5208 /* Set to TRS mode */ 5209 alc_write_coef_idx(codec, 0x45, 0xc429); 5210 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5211 alc_process_coef_fw(codec, coef0293); 5212 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5213 break; 5214 case 0x10ec0867: 5215 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); 5216 fallthrough; 5217 case 0x10ec0221: 5218 case 0x10ec0662: 5219 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5220 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5221 break; 5222 case 0x10ec0668: 5223 alc_write_coef_idx(codec, 0x11, 0x0001); 5224 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5225 alc_process_coef_fw(codec, coef0688); 5226 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5227 break; 5228 case 0x10ec0215: 5229 case 0x10ec0225: 5230 case 0x10ec0285: 5231 case 0x10ec0295: 5232 case 0x10ec0289: 5233 case 0x10ec0299: 5234 alc_process_coef_fw(codec, alc225_pre_hsmode); 5235 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); 5236 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 5237 alc_process_coef_fw(codec, coef0225); 5238 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 5239 break; 5240 } 5241 codec_dbg(codec, "Headset jack set to mic-in mode.\n"); 5242 } 5243 5244 static void alc_headset_mode_default(struct hda_codec *codec) 5245 { 5246 static const struct coef_fw coef0225[] = { 5247 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), 5248 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), 5249 UPDATE_COEF(0x49, 3<<8, 0<<8), 5250 UPDATE_COEF(0x4a, 3<<4, 3<<4), 5251 UPDATE_COEF(0x63, 3<<14, 0), 5252 UPDATE_COEF(0x67, 0xf000, 0x3000), 5253 {} 5254 }; 5255 static const struct coef_fw coef0255[] = { 5256 WRITE_COEF(0x45, 0xc089), 5257 WRITE_COEF(0x45, 0xc489), 5258 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 5259 WRITE_COEF(0x49, 0x0049), 5260 {} 5261 }; 5262 static const struct coef_fw coef0256[] = { 5263 WRITE_COEF(0x45, 0xc489), 5264 WRITE_COEFEX(0x57, 0x03, 0x0da3), 5265 WRITE_COEF(0x49, 0x0049), 5266 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 5267 WRITE_COEF(0x06, 0x6100), 5268 {} 5269 }; 5270 static const struct coef_fw coef0233[] = { 5271 WRITE_COEF(0x06, 0x2100), 5272 WRITE_COEF(0x32, 0x4ea3), 5273 {} 5274 }; 5275 static const struct coef_fw coef0288[] = { 5276 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ 5277 UPDATE_COEF(0x50, 0x2000, 0x2000), 5278 UPDATE_COEF(0x56, 0x0006, 0x0006), 5279 UPDATE_COEF(0x66, 0x0008, 0), 5280 UPDATE_COEF(0x67, 0x2000, 0), 5281 {} 5282 }; 5283 static const struct coef_fw coef0292[] = { 5284 WRITE_COEF(0x76, 0x000e), 5285 WRITE_COEF(0x6c, 0x2400), 5286 WRITE_COEF(0x6b, 0xc429), 5287 WRITE_COEF(0x18, 0x7308), 5288 {} 5289 }; 5290 static const struct coef_fw coef0293[] = { 5291 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ 5292 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ 5293 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ 5294 {} 5295 }; 5296 static const struct coef_fw coef0688[] = { 5297 WRITE_COEF(0x11, 0x0041), 5298 WRITE_COEF(0x15, 0x0d40), 5299 WRITE_COEF(0xb7, 0x802b), 5300 {} 5301 }; 5302 static const struct coef_fw coef0274[] = { 5303 WRITE_COEF(0x45, 0x4289), 5304 UPDATE_COEF(0x4a, 0x0010, 0x0010), 5305 UPDATE_COEF(0x6b, 0x0f00, 0), 5306 UPDATE_COEF(0x49, 0x0300, 0x0300), 5307 {} 5308 }; 5309 5310 switch (codec->core.vendor_id) { 5311 case 0x10ec0215: 5312 case 0x10ec0225: 5313 case 0x10ec0285: 5314 case 0x10ec0295: 5315 case 0x10ec0289: 5316 case 0x10ec0299: 5317 alc_process_coef_fw(codec, alc225_pre_hsmode); 5318 alc_process_coef_fw(codec, coef0225); 5319 alc_hp_enable_unmute(codec, 75); 5320 break; 5321 case 0x10ec0255: 5322 alc_process_coef_fw(codec, coef0255); 5323 break; 5324 case 0x10ec0230: 5325 case 0x10ec0236: 5326 case 0x10ec0256: 5327 case 0x19e58326: 5328 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 5329 alc_write_coef_idx(codec, 0x45, 0xc089); 5330 msleep(50); 5331 alc_process_coef_fw(codec, coef0256); 5332 alc_hp_enable_unmute(codec, 75); 5333 break; 5334 case 0x10ec0234: 5335 case 0x10ec0274: 5336 case 0x10ec0294: 5337 alc_process_coef_fw(codec, coef0274); 5338 break; 5339 case 0x10ec0233: 5340 case 0x10ec0283: 5341 alc_process_coef_fw(codec, coef0233); 5342 break; 5343 case 0x10ec0286: 5344 case 0x10ec0288: 5345 case 0x10ec0298: 5346 alc_process_coef_fw(codec, coef0288); 5347 break; 5348 case 0x10ec0292: 5349 alc_process_coef_fw(codec, coef0292); 5350 break; 5351 case 0x10ec0293: 5352 alc_process_coef_fw(codec, coef0293); 5353 break; 5354 case 0x10ec0668: 5355 alc_process_coef_fw(codec, coef0688); 5356 break; 5357 case 0x10ec0867: 5358 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5359 break; 5360 } 5361 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); 5362 } 5363 5364 /* Iphone type */ 5365 static void alc_headset_mode_ctia(struct hda_codec *codec) 5366 { 5367 int val; 5368 5369 static const struct coef_fw coef0255[] = { 5370 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ 5371 WRITE_COEF(0x1b, 0x0c2b), 5372 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 5373 {} 5374 }; 5375 static const struct coef_fw coef0256[] = { 5376 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ 5377 WRITE_COEF(0x1b, 0x0e6b), 5378 {} 5379 }; 5380 static const struct coef_fw coef0233[] = { 5381 WRITE_COEF(0x45, 0xd429), 5382 WRITE_COEF(0x1b, 0x0c2b), 5383 WRITE_COEF(0x32, 0x4ea3), 5384 {} 5385 }; 5386 static const struct coef_fw coef0288[] = { 5387 UPDATE_COEF(0x50, 0x2000, 0x2000), 5388 UPDATE_COEF(0x56, 0x0006, 0x0006), 5389 UPDATE_COEF(0x66, 0x0008, 0), 5390 UPDATE_COEF(0x67, 0x2000, 0), 5391 {} 5392 }; 5393 static const struct coef_fw coef0292[] = { 5394 WRITE_COEF(0x6b, 0xd429), 5395 WRITE_COEF(0x76, 0x0008), 5396 WRITE_COEF(0x18, 0x7388), 5397 {} 5398 }; 5399 static const struct coef_fw coef0293[] = { 5400 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ 5401 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ 5402 {} 5403 }; 5404 static const struct coef_fw coef0688[] = { 5405 WRITE_COEF(0x11, 0x0001), 5406 WRITE_COEF(0x15, 0x0d60), 5407 WRITE_COEF(0xc3, 0x0000), 5408 {} 5409 }; 5410 static const struct coef_fw coef0225_1[] = { 5411 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), 5412 UPDATE_COEF(0x63, 3<<14, 2<<14), 5413 {} 5414 }; 5415 static const struct coef_fw coef0225_2[] = { 5416 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), 5417 UPDATE_COEF(0x63, 3<<14, 1<<14), 5418 {} 5419 }; 5420 5421 switch (codec->core.vendor_id) { 5422 case 0x10ec0255: 5423 alc_process_coef_fw(codec, coef0255); 5424 break; 5425 case 0x10ec0230: 5426 case 0x10ec0236: 5427 case 0x10ec0256: 5428 case 0x19e58326: 5429 alc_process_coef_fw(codec, coef0256); 5430 alc_hp_enable_unmute(codec, 75); 5431 break; 5432 case 0x10ec0234: 5433 case 0x10ec0274: 5434 case 0x10ec0294: 5435 alc_write_coef_idx(codec, 0x45, 0xd689); 5436 break; 5437 case 0x10ec0233: 5438 case 0x10ec0283: 5439 alc_process_coef_fw(codec, coef0233); 5440 break; 5441 case 0x10ec0298: 5442 val = alc_read_coef_idx(codec, 0x50); 5443 if (val & (1 << 12)) { 5444 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); 5445 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 5446 msleep(300); 5447 } else { 5448 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); 5449 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 5450 msleep(300); 5451 } 5452 break; 5453 case 0x10ec0286: 5454 case 0x10ec0288: 5455 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 5456 msleep(300); 5457 alc_process_coef_fw(codec, coef0288); 5458 break; 5459 case 0x10ec0292: 5460 alc_process_coef_fw(codec, coef0292); 5461 break; 5462 case 0x10ec0293: 5463 alc_process_coef_fw(codec, coef0293); 5464 break; 5465 case 0x10ec0668: 5466 alc_process_coef_fw(codec, coef0688); 5467 break; 5468 case 0x10ec0215: 5469 case 0x10ec0225: 5470 case 0x10ec0285: 5471 case 0x10ec0295: 5472 case 0x10ec0289: 5473 case 0x10ec0299: 5474 val = alc_read_coef_idx(codec, 0x45); 5475 if (val & (1 << 9)) 5476 alc_process_coef_fw(codec, coef0225_2); 5477 else 5478 alc_process_coef_fw(codec, coef0225_1); 5479 alc_hp_enable_unmute(codec, 75); 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 iPhone-style headset mode.\n"); 5486 } 5487 5488 /* Nokia type */ 5489 static void alc_headset_mode_omtp(struct hda_codec *codec) 5490 { 5491 static const struct coef_fw coef0255[] = { 5492 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ 5493 WRITE_COEF(0x1b, 0x0c2b), 5494 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 5495 {} 5496 }; 5497 static const struct coef_fw coef0256[] = { 5498 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ 5499 WRITE_COEF(0x1b, 0x0e6b), 5500 {} 5501 }; 5502 static const struct coef_fw coef0233[] = { 5503 WRITE_COEF(0x45, 0xe429), 5504 WRITE_COEF(0x1b, 0x0c2b), 5505 WRITE_COEF(0x32, 0x4ea3), 5506 {} 5507 }; 5508 static const struct coef_fw coef0288[] = { 5509 UPDATE_COEF(0x50, 0x2000, 0x2000), 5510 UPDATE_COEF(0x56, 0x0006, 0x0006), 5511 UPDATE_COEF(0x66, 0x0008, 0), 5512 UPDATE_COEF(0x67, 0x2000, 0), 5513 {} 5514 }; 5515 static const struct coef_fw coef0292[] = { 5516 WRITE_COEF(0x6b, 0xe429), 5517 WRITE_COEF(0x76, 0x0008), 5518 WRITE_COEF(0x18, 0x7388), 5519 {} 5520 }; 5521 static const struct coef_fw coef0293[] = { 5522 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ 5523 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ 5524 {} 5525 }; 5526 static const struct coef_fw coef0688[] = { 5527 WRITE_COEF(0x11, 0x0001), 5528 WRITE_COEF(0x15, 0x0d50), 5529 WRITE_COEF(0xc3, 0x0000), 5530 {} 5531 }; 5532 static const struct coef_fw coef0225[] = { 5533 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), 5534 UPDATE_COEF(0x63, 3<<14, 2<<14), 5535 {} 5536 }; 5537 5538 switch (codec->core.vendor_id) { 5539 case 0x10ec0255: 5540 alc_process_coef_fw(codec, coef0255); 5541 break; 5542 case 0x10ec0230: 5543 case 0x10ec0236: 5544 case 0x10ec0256: 5545 case 0x19e58326: 5546 alc_process_coef_fw(codec, coef0256); 5547 alc_hp_enable_unmute(codec, 75); 5548 break; 5549 case 0x10ec0234: 5550 case 0x10ec0274: 5551 case 0x10ec0294: 5552 alc_write_coef_idx(codec, 0x45, 0xe689); 5553 break; 5554 case 0x10ec0233: 5555 case 0x10ec0283: 5556 alc_process_coef_fw(codec, coef0233); 5557 break; 5558 case 0x10ec0298: 5559 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ 5560 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); 5561 msleep(300); 5562 break; 5563 case 0x10ec0286: 5564 case 0x10ec0288: 5565 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); 5566 msleep(300); 5567 alc_process_coef_fw(codec, coef0288); 5568 break; 5569 case 0x10ec0292: 5570 alc_process_coef_fw(codec, coef0292); 5571 break; 5572 case 0x10ec0293: 5573 alc_process_coef_fw(codec, coef0293); 5574 break; 5575 case 0x10ec0668: 5576 alc_process_coef_fw(codec, coef0688); 5577 break; 5578 case 0x10ec0215: 5579 case 0x10ec0225: 5580 case 0x10ec0285: 5581 case 0x10ec0295: 5582 case 0x10ec0289: 5583 case 0x10ec0299: 5584 alc_process_coef_fw(codec, coef0225); 5585 alc_hp_enable_unmute(codec, 75); 5586 break; 5587 } 5588 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); 5589 } 5590 5591 static void alc_determine_headset_type(struct hda_codec *codec) 5592 { 5593 int val; 5594 bool is_ctia = false; 5595 struct alc_spec *spec = codec->spec; 5596 static const struct coef_fw coef0255[] = { 5597 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ 5598 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref 5599 conteol) */ 5600 {} 5601 }; 5602 static const struct coef_fw coef0288[] = { 5603 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ 5604 {} 5605 }; 5606 static const struct coef_fw coef0298[] = { 5607 UPDATE_COEF(0x50, 0x2000, 0x2000), 5608 UPDATE_COEF(0x56, 0x0006, 0x0006), 5609 UPDATE_COEF(0x66, 0x0008, 0), 5610 UPDATE_COEF(0x67, 0x2000, 0), 5611 UPDATE_COEF(0x19, 0x1300, 0x1300), 5612 {} 5613 }; 5614 static const struct coef_fw coef0293[] = { 5615 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ 5616 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ 5617 {} 5618 }; 5619 static const struct coef_fw coef0688[] = { 5620 WRITE_COEF(0x11, 0x0001), 5621 WRITE_COEF(0xb7, 0x802b), 5622 WRITE_COEF(0x15, 0x0d60), 5623 WRITE_COEF(0xc3, 0x0c00), 5624 {} 5625 }; 5626 static const struct coef_fw coef0274[] = { 5627 UPDATE_COEF(0x4a, 0x0010, 0), 5628 UPDATE_COEF(0x4a, 0x8000, 0), 5629 WRITE_COEF(0x45, 0xd289), 5630 UPDATE_COEF(0x49, 0x0300, 0x0300), 5631 {} 5632 }; 5633 5634 if (spec->no_internal_mic_pin) { 5635 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 5636 return; 5637 } 5638 5639 switch (codec->core.vendor_id) { 5640 case 0x10ec0255: 5641 alc_process_coef_fw(codec, coef0255); 5642 msleep(300); 5643 val = alc_read_coef_idx(codec, 0x46); 5644 is_ctia = (val & 0x0070) == 0x0070; 5645 break; 5646 case 0x10ec0230: 5647 case 0x10ec0236: 5648 case 0x10ec0256: 5649 case 0x19e58326: 5650 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 5651 alc_write_coef_idx(codec, 0x06, 0x6104); 5652 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); 5653 5654 alc_process_coef_fw(codec, coef0255); 5655 msleep(300); 5656 val = alc_read_coef_idx(codec, 0x46); 5657 is_ctia = (val & 0x0070) == 0x0070; 5658 if (!is_ctia) { 5659 alc_write_coef_idx(codec, 0x45, 0xe089); 5660 msleep(100); 5661 val = alc_read_coef_idx(codec, 0x46); 5662 if ((val & 0x0070) == 0x0070) 5663 is_ctia = false; 5664 else 5665 is_ctia = true; 5666 } 5667 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); 5668 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5669 break; 5670 case 0x10ec0234: 5671 case 0x10ec0274: 5672 case 0x10ec0294: 5673 alc_process_coef_fw(codec, coef0274); 5674 msleep(850); 5675 val = alc_read_coef_idx(codec, 0x46); 5676 is_ctia = (val & 0x00f0) == 0x00f0; 5677 break; 5678 case 0x10ec0233: 5679 case 0x10ec0283: 5680 alc_write_coef_idx(codec, 0x45, 0xd029); 5681 msleep(300); 5682 val = alc_read_coef_idx(codec, 0x46); 5683 is_ctia = (val & 0x0070) == 0x0070; 5684 break; 5685 case 0x10ec0298: 5686 snd_hda_codec_write(codec, 0x21, 0, 5687 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 5688 msleep(100); 5689 snd_hda_codec_write(codec, 0x21, 0, 5690 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 5691 msleep(200); 5692 5693 val = alc_read_coef_idx(codec, 0x50); 5694 if (val & (1 << 12)) { 5695 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); 5696 alc_process_coef_fw(codec, coef0288); 5697 msleep(350); 5698 val = alc_read_coef_idx(codec, 0x50); 5699 is_ctia = (val & 0x0070) == 0x0070; 5700 } else { 5701 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); 5702 alc_process_coef_fw(codec, coef0288); 5703 msleep(350); 5704 val = alc_read_coef_idx(codec, 0x50); 5705 is_ctia = (val & 0x0070) == 0x0070; 5706 } 5707 alc_process_coef_fw(codec, coef0298); 5708 snd_hda_codec_write(codec, 0x21, 0, 5709 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); 5710 msleep(75); 5711 snd_hda_codec_write(codec, 0x21, 0, 5712 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 5713 break; 5714 case 0x10ec0286: 5715 case 0x10ec0288: 5716 alc_process_coef_fw(codec, coef0288); 5717 msleep(350); 5718 val = alc_read_coef_idx(codec, 0x50); 5719 is_ctia = (val & 0x0070) == 0x0070; 5720 break; 5721 case 0x10ec0292: 5722 alc_write_coef_idx(codec, 0x6b, 0xd429); 5723 msleep(300); 5724 val = alc_read_coef_idx(codec, 0x6c); 5725 is_ctia = (val & 0x001c) == 0x001c; 5726 break; 5727 case 0x10ec0293: 5728 alc_process_coef_fw(codec, coef0293); 5729 msleep(300); 5730 val = alc_read_coef_idx(codec, 0x46); 5731 is_ctia = (val & 0x0070) == 0x0070; 5732 break; 5733 case 0x10ec0668: 5734 alc_process_coef_fw(codec, coef0688); 5735 msleep(300); 5736 val = alc_read_coef_idx(codec, 0xbe); 5737 is_ctia = (val & 0x1c02) == 0x1c02; 5738 break; 5739 case 0x10ec0215: 5740 case 0x10ec0225: 5741 case 0x10ec0285: 5742 case 0x10ec0295: 5743 case 0x10ec0289: 5744 case 0x10ec0299: 5745 alc_process_coef_fw(codec, alc225_pre_hsmode); 5746 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); 5747 val = alc_read_coef_idx(codec, 0x45); 5748 if (val & (1 << 9)) { 5749 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); 5750 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); 5751 msleep(800); 5752 val = alc_read_coef_idx(codec, 0x46); 5753 is_ctia = (val & 0x00f0) == 0x00f0; 5754 } else { 5755 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); 5756 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); 5757 msleep(800); 5758 val = alc_read_coef_idx(codec, 0x46); 5759 is_ctia = (val & 0x00f0) == 0x00f0; 5760 } 5761 if (!is_ctia) { 5762 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10); 5763 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); 5764 msleep(100); 5765 val = alc_read_coef_idx(codec, 0x46); 5766 if ((val & 0x00f0) == 0x00f0) 5767 is_ctia = false; 5768 else 5769 is_ctia = true; 5770 } 5771 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); 5772 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); 5773 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 5774 break; 5775 case 0x10ec0867: 5776 is_ctia = true; 5777 break; 5778 } 5779 5780 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", 5781 is_ctia ? "yes" : "no"); 5782 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; 5783 } 5784 5785 static void alc_update_headset_mode(struct hda_codec *codec) 5786 { 5787 struct alc_spec *spec = codec->spec; 5788 5789 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; 5790 hda_nid_t hp_pin = alc_get_hp_pin(spec); 5791 5792 int new_headset_mode; 5793 5794 if (!snd_hda_jack_detect(codec, hp_pin)) 5795 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; 5796 else if (mux_pin == spec->headset_mic_pin) 5797 new_headset_mode = ALC_HEADSET_MODE_HEADSET; 5798 else if (mux_pin == spec->headphone_mic_pin) 5799 new_headset_mode = ALC_HEADSET_MODE_MIC; 5800 else 5801 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; 5802 5803 if (new_headset_mode == spec->current_headset_mode) { 5804 snd_hda_gen_update_outputs(codec); 5805 return; 5806 } 5807 5808 switch (new_headset_mode) { 5809 case ALC_HEADSET_MODE_UNPLUGGED: 5810 alc_headset_mode_unplugged(codec); 5811 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; 5812 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; 5813 spec->gen.hp_jack_present = false; 5814 break; 5815 case ALC_HEADSET_MODE_HEADSET: 5816 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) 5817 alc_determine_headset_type(codec); 5818 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) 5819 alc_headset_mode_ctia(codec); 5820 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) 5821 alc_headset_mode_omtp(codec); 5822 spec->gen.hp_jack_present = true; 5823 break; 5824 case ALC_HEADSET_MODE_MIC: 5825 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); 5826 spec->gen.hp_jack_present = false; 5827 break; 5828 case ALC_HEADSET_MODE_HEADPHONE: 5829 alc_headset_mode_default(codec); 5830 spec->gen.hp_jack_present = true; 5831 break; 5832 } 5833 if (new_headset_mode != ALC_HEADSET_MODE_MIC) { 5834 snd_hda_set_pin_ctl_cache(codec, hp_pin, 5835 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); 5836 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) 5837 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, 5838 PIN_VREFHIZ); 5839 } 5840 spec->current_headset_mode = new_headset_mode; 5841 5842 snd_hda_gen_update_outputs(codec); 5843 } 5844 5845 static void alc_update_headset_mode_hook(struct hda_codec *codec, 5846 struct snd_kcontrol *kcontrol, 5847 struct snd_ctl_elem_value *ucontrol) 5848 { 5849 alc_update_headset_mode(codec); 5850 } 5851 5852 static void alc_update_headset_jack_cb(struct hda_codec *codec, 5853 struct hda_jack_callback *jack) 5854 { 5855 snd_hda_gen_hp_automute(codec, jack); 5856 alc_update_headset_mode(codec); 5857 } 5858 5859 static void alc_probe_headset_mode(struct hda_codec *codec) 5860 { 5861 int i; 5862 struct alc_spec *spec = codec->spec; 5863 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 5864 5865 /* Find mic pins */ 5866 for (i = 0; i < cfg->num_inputs; i++) { 5867 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) 5868 spec->headset_mic_pin = cfg->inputs[i].pin; 5869 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) 5870 spec->headphone_mic_pin = cfg->inputs[i].pin; 5871 } 5872 5873 WARN_ON(spec->gen.cap_sync_hook); 5874 spec->gen.cap_sync_hook = alc_update_headset_mode_hook; 5875 spec->gen.automute_hook = alc_update_headset_mode; 5876 spec->gen.hp_automute_hook = alc_update_headset_jack_cb; 5877 } 5878 5879 static void alc_fixup_headset_mode(struct hda_codec *codec, 5880 const struct hda_fixup *fix, int action) 5881 { 5882 struct alc_spec *spec = codec->spec; 5883 5884 switch (action) { 5885 case HDA_FIXUP_ACT_PRE_PROBE: 5886 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; 5887 break; 5888 case HDA_FIXUP_ACT_PROBE: 5889 alc_probe_headset_mode(codec); 5890 break; 5891 case HDA_FIXUP_ACT_INIT: 5892 if (is_s3_resume(codec) || is_s4_resume(codec)) { 5893 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; 5894 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; 5895 } 5896 alc_update_headset_mode(codec); 5897 break; 5898 } 5899 } 5900 5901 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, 5902 const struct hda_fixup *fix, int action) 5903 { 5904 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5905 struct alc_spec *spec = codec->spec; 5906 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 5907 } 5908 else 5909 alc_fixup_headset_mode(codec, fix, action); 5910 } 5911 5912 static void alc255_set_default_jack_type(struct hda_codec *codec) 5913 { 5914 /* Set to iphone type */ 5915 static const struct coef_fw alc255fw[] = { 5916 WRITE_COEF(0x1b, 0x880b), 5917 WRITE_COEF(0x45, 0xd089), 5918 WRITE_COEF(0x1b, 0x080b), 5919 WRITE_COEF(0x46, 0x0004), 5920 WRITE_COEF(0x1b, 0x0c0b), 5921 {} 5922 }; 5923 static const struct coef_fw alc256fw[] = { 5924 WRITE_COEF(0x1b, 0x884b), 5925 WRITE_COEF(0x45, 0xd089), 5926 WRITE_COEF(0x1b, 0x084b), 5927 WRITE_COEF(0x46, 0x0004), 5928 WRITE_COEF(0x1b, 0x0c4b), 5929 {} 5930 }; 5931 switch (codec->core.vendor_id) { 5932 case 0x10ec0255: 5933 alc_process_coef_fw(codec, alc255fw); 5934 break; 5935 case 0x10ec0230: 5936 case 0x10ec0236: 5937 case 0x10ec0256: 5938 case 0x19e58326: 5939 alc_process_coef_fw(codec, alc256fw); 5940 break; 5941 } 5942 msleep(30); 5943 } 5944 5945 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, 5946 const struct hda_fixup *fix, int action) 5947 { 5948 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5949 alc255_set_default_jack_type(codec); 5950 } 5951 alc_fixup_headset_mode(codec, fix, action); 5952 } 5953 5954 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, 5955 const struct hda_fixup *fix, int action) 5956 { 5957 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5958 struct alc_spec *spec = codec->spec; 5959 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 5960 alc255_set_default_jack_type(codec); 5961 } 5962 else 5963 alc_fixup_headset_mode(codec, fix, action); 5964 } 5965 5966 static void alc288_update_headset_jack_cb(struct hda_codec *codec, 5967 struct hda_jack_callback *jack) 5968 { 5969 struct alc_spec *spec = codec->spec; 5970 5971 alc_update_headset_jack_cb(codec, jack); 5972 /* Headset Mic enable or disable, only for Dell Dino */ 5973 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); 5974 } 5975 5976 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, 5977 const struct hda_fixup *fix, int action) 5978 { 5979 alc_fixup_headset_mode(codec, fix, action); 5980 if (action == HDA_FIXUP_ACT_PROBE) { 5981 struct alc_spec *spec = codec->spec; 5982 /* toggled via hp_automute_hook */ 5983 spec->gpio_mask |= 0x40; 5984 spec->gpio_dir |= 0x40; 5985 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; 5986 } 5987 } 5988 5989 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, 5990 const struct hda_fixup *fix, int action) 5991 { 5992 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5993 struct alc_spec *spec = codec->spec; 5994 spec->gen.auto_mute_via_amp = 1; 5995 } 5996 } 5997 5998 static void alc_fixup_no_shutup(struct hda_codec *codec, 5999 const struct hda_fixup *fix, int action) 6000 { 6001 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6002 struct alc_spec *spec = codec->spec; 6003 spec->no_shutup_pins = 1; 6004 } 6005 } 6006 6007 static void alc_fixup_disable_aamix(struct hda_codec *codec, 6008 const struct hda_fixup *fix, int action) 6009 { 6010 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6011 struct alc_spec *spec = codec->spec; 6012 /* Disable AA-loopback as it causes white noise */ 6013 spec->gen.mixer_nid = 0; 6014 } 6015 } 6016 6017 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ 6018 static void alc_fixup_tpt440_dock(struct hda_codec *codec, 6019 const struct hda_fixup *fix, int action) 6020 { 6021 static const struct hda_pintbl pincfgs[] = { 6022 { 0x16, 0x21211010 }, /* dock headphone */ 6023 { 0x19, 0x21a11010 }, /* dock mic */ 6024 { } 6025 }; 6026 struct alc_spec *spec = codec->spec; 6027 6028 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6029 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 6030 codec->power_save_node = 0; /* avoid click noises */ 6031 snd_hda_apply_pincfgs(codec, pincfgs); 6032 } 6033 } 6034 6035 static void alc_fixup_tpt470_dock(struct hda_codec *codec, 6036 const struct hda_fixup *fix, int action) 6037 { 6038 static const struct hda_pintbl pincfgs[] = { 6039 { 0x17, 0x21211010 }, /* dock headphone */ 6040 { 0x19, 0x21a11010 }, /* dock mic */ 6041 { } 6042 }; 6043 struct alc_spec *spec = codec->spec; 6044 6045 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6046 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 6047 snd_hda_apply_pincfgs(codec, pincfgs); 6048 } else if (action == HDA_FIXUP_ACT_INIT) { 6049 /* Enable DOCK device */ 6050 snd_hda_codec_write(codec, 0x17, 0, 6051 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); 6052 /* Enable DOCK device */ 6053 snd_hda_codec_write(codec, 0x19, 0, 6054 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); 6055 } 6056 } 6057 6058 static void alc_fixup_tpt470_dacs(struct hda_codec *codec, 6059 const struct hda_fixup *fix, int action) 6060 { 6061 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise 6062 * the speaker output becomes too low by some reason on Thinkpads with 6063 * ALC298 codec 6064 */ 6065 static const hda_nid_t preferred_pairs[] = { 6066 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, 6067 0 6068 }; 6069 struct alc_spec *spec = codec->spec; 6070 6071 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6072 spec->gen.preferred_dacs = preferred_pairs; 6073 } 6074 6075 static void alc295_fixup_asus_dacs(struct hda_codec *codec, 6076 const struct hda_fixup *fix, int action) 6077 { 6078 static const hda_nid_t preferred_pairs[] = { 6079 0x17, 0x02, 0x21, 0x03, 0 6080 }; 6081 struct alc_spec *spec = codec->spec; 6082 6083 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6084 spec->gen.preferred_dacs = preferred_pairs; 6085 } 6086 6087 static void alc_shutup_dell_xps13(struct hda_codec *codec) 6088 { 6089 struct alc_spec *spec = codec->spec; 6090 int hp_pin = alc_get_hp_pin(spec); 6091 6092 /* Prevent pop noises when headphones are plugged in */ 6093 snd_hda_codec_write(codec, hp_pin, 0, 6094 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 6095 msleep(20); 6096 } 6097 6098 static void alc_fixup_dell_xps13(struct hda_codec *codec, 6099 const struct hda_fixup *fix, int action) 6100 { 6101 struct alc_spec *spec = codec->spec; 6102 struct hda_input_mux *imux = &spec->gen.input_mux; 6103 int i; 6104 6105 switch (action) { 6106 case HDA_FIXUP_ACT_PRE_PROBE: 6107 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise 6108 * it causes a click noise at start up 6109 */ 6110 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 6111 spec->shutup = alc_shutup_dell_xps13; 6112 break; 6113 case HDA_FIXUP_ACT_PROBE: 6114 /* Make the internal mic the default input source. */ 6115 for (i = 0; i < imux->num_items; i++) { 6116 if (spec->gen.imux_pins[i] == 0x12) { 6117 spec->gen.cur_mux[0] = i; 6118 break; 6119 } 6120 } 6121 break; 6122 } 6123 } 6124 6125 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, 6126 const struct hda_fixup *fix, int action) 6127 { 6128 struct alc_spec *spec = codec->spec; 6129 6130 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6131 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 6132 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ 6133 6134 /* Disable boost for mic-in permanently. (This code is only called 6135 from quirks that guarantee that the headphone is at NID 0x1b.) */ 6136 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); 6137 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); 6138 } else 6139 alc_fixup_headset_mode(codec, fix, action); 6140 } 6141 6142 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, 6143 const struct hda_fixup *fix, int action) 6144 { 6145 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6146 alc_write_coef_idx(codec, 0xc4, 0x8000); 6147 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); 6148 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); 6149 } 6150 alc_fixup_headset_mode(codec, fix, action); 6151 } 6152 6153 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ 6154 static int find_ext_mic_pin(struct hda_codec *codec) 6155 { 6156 struct alc_spec *spec = codec->spec; 6157 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 6158 hda_nid_t nid; 6159 unsigned int defcfg; 6160 int i; 6161 6162 for (i = 0; i < cfg->num_inputs; i++) { 6163 if (cfg->inputs[i].type != AUTO_PIN_MIC) 6164 continue; 6165 nid = cfg->inputs[i].pin; 6166 defcfg = snd_hda_codec_get_pincfg(codec, nid); 6167 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) 6168 continue; 6169 return nid; 6170 } 6171 6172 return 0; 6173 } 6174 6175 static void alc271_hp_gate_mic_jack(struct hda_codec *codec, 6176 const struct hda_fixup *fix, 6177 int action) 6178 { 6179 struct alc_spec *spec = codec->spec; 6180 6181 if (action == HDA_FIXUP_ACT_PROBE) { 6182 int mic_pin = find_ext_mic_pin(codec); 6183 int hp_pin = alc_get_hp_pin(spec); 6184 6185 if (snd_BUG_ON(!mic_pin || !hp_pin)) 6186 return; 6187 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); 6188 } 6189 } 6190 6191 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, 6192 const struct hda_fixup *fix, 6193 int action) 6194 { 6195 struct alc_spec *spec = codec->spec; 6196 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 6197 int i; 6198 6199 /* The mic boosts on level 2 and 3 are too noisy 6200 on the internal mic input. 6201 Therefore limit the boost to 0 or 1. */ 6202 6203 if (action != HDA_FIXUP_ACT_PROBE) 6204 return; 6205 6206 for (i = 0; i < cfg->num_inputs; i++) { 6207 hda_nid_t nid = cfg->inputs[i].pin; 6208 unsigned int defcfg; 6209 if (cfg->inputs[i].type != AUTO_PIN_MIC) 6210 continue; 6211 defcfg = snd_hda_codec_get_pincfg(codec, nid); 6212 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) 6213 continue; 6214 6215 snd_hda_override_amp_caps(codec, nid, HDA_INPUT, 6216 (0x00 << AC_AMPCAP_OFFSET_SHIFT) | 6217 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | 6218 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | 6219 (0 << AC_AMPCAP_MUTE_SHIFT)); 6220 } 6221 } 6222 6223 static void alc283_hp_automute_hook(struct hda_codec *codec, 6224 struct hda_jack_callback *jack) 6225 { 6226 struct alc_spec *spec = codec->spec; 6227 int vref; 6228 6229 msleep(200); 6230 snd_hda_gen_hp_automute(codec, jack); 6231 6232 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 6233 6234 msleep(600); 6235 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 6236 vref); 6237 } 6238 6239 static void alc283_fixup_chromebook(struct hda_codec *codec, 6240 const struct hda_fixup *fix, int action) 6241 { 6242 struct alc_spec *spec = codec->spec; 6243 6244 switch (action) { 6245 case HDA_FIXUP_ACT_PRE_PROBE: 6246 snd_hda_override_wcaps(codec, 0x03, 0); 6247 /* Disable AA-loopback as it causes white noise */ 6248 spec->gen.mixer_nid = 0; 6249 break; 6250 case HDA_FIXUP_ACT_INIT: 6251 /* MIC2-VREF control */ 6252 /* Set to manual mode */ 6253 alc_update_coef_idx(codec, 0x06, 0x000c, 0); 6254 /* Enable Line1 input control by verb */ 6255 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); 6256 break; 6257 } 6258 } 6259 6260 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, 6261 const struct hda_fixup *fix, int action) 6262 { 6263 struct alc_spec *spec = codec->spec; 6264 6265 switch (action) { 6266 case HDA_FIXUP_ACT_PRE_PROBE: 6267 spec->gen.hp_automute_hook = alc283_hp_automute_hook; 6268 break; 6269 case HDA_FIXUP_ACT_INIT: 6270 /* MIC2-VREF control */ 6271 /* Set to manual mode */ 6272 alc_update_coef_idx(codec, 0x06, 0x000c, 0); 6273 break; 6274 } 6275 } 6276 6277 /* mute tablet speaker pin (0x14) via dock plugging in addition */ 6278 static void asus_tx300_automute(struct hda_codec *codec) 6279 { 6280 struct alc_spec *spec = codec->spec; 6281 snd_hda_gen_update_outputs(codec); 6282 if (snd_hda_jack_detect(codec, 0x1b)) 6283 spec->gen.mute_bits |= (1ULL << 0x14); 6284 } 6285 6286 static void alc282_fixup_asus_tx300(struct hda_codec *codec, 6287 const struct hda_fixup *fix, int action) 6288 { 6289 struct alc_spec *spec = codec->spec; 6290 static const struct hda_pintbl dock_pins[] = { 6291 { 0x1b, 0x21114000 }, /* dock speaker pin */ 6292 {} 6293 }; 6294 6295 switch (action) { 6296 case HDA_FIXUP_ACT_PRE_PROBE: 6297 spec->init_amp = ALC_INIT_DEFAULT; 6298 /* TX300 needs to set up GPIO2 for the speaker amp */ 6299 alc_setup_gpio(codec, 0x04); 6300 snd_hda_apply_pincfgs(codec, dock_pins); 6301 spec->gen.auto_mute_via_amp = 1; 6302 spec->gen.automute_hook = asus_tx300_automute; 6303 snd_hda_jack_detect_enable_callback(codec, 0x1b, 6304 snd_hda_gen_hp_automute); 6305 break; 6306 case HDA_FIXUP_ACT_PROBE: 6307 spec->init_amp = ALC_INIT_DEFAULT; 6308 break; 6309 case HDA_FIXUP_ACT_BUILD: 6310 /* this is a bit tricky; give more sane names for the main 6311 * (tablet) speaker and the dock speaker, respectively 6312 */ 6313 rename_ctl(codec, "Speaker Playback Switch", 6314 "Dock Speaker Playback Switch"); 6315 rename_ctl(codec, "Bass Speaker Playback Switch", 6316 "Speaker Playback Switch"); 6317 break; 6318 } 6319 } 6320 6321 static void alc290_fixup_mono_speakers(struct hda_codec *codec, 6322 const struct hda_fixup *fix, int action) 6323 { 6324 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6325 /* DAC node 0x03 is giving mono output. We therefore want to 6326 make sure 0x14 (front speaker) and 0x15 (headphones) use the 6327 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ 6328 static const hda_nid_t conn1[] = { 0x0c }; 6329 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 6330 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); 6331 } 6332 } 6333 6334 static void alc298_fixup_speaker_volume(struct hda_codec *codec, 6335 const struct hda_fixup *fix, int action) 6336 { 6337 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6338 /* The speaker is routed to the Node 0x06 by a mistake, as a result 6339 we can't adjust the speaker's volume since this node does not has 6340 Amp-out capability. we change the speaker's route to: 6341 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( 6342 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust 6343 speaker's volume now. */ 6344 6345 static const hda_nid_t conn1[] = { 0x0c }; 6346 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); 6347 } 6348 } 6349 6350 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ 6351 static void alc295_fixup_disable_dac3(struct hda_codec *codec, 6352 const struct hda_fixup *fix, int action) 6353 { 6354 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6355 static const hda_nid_t conn[] = { 0x02, 0x03 }; 6356 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6357 } 6358 } 6359 6360 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ 6361 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, 6362 const struct hda_fixup *fix, int action) 6363 { 6364 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6365 static const hda_nid_t conn[] = { 0x02 }; 6366 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6367 } 6368 } 6369 6370 /* Hook to update amp GPIO4 for automute */ 6371 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, 6372 struct hda_jack_callback *jack) 6373 { 6374 struct alc_spec *spec = codec->spec; 6375 6376 snd_hda_gen_hp_automute(codec, jack); 6377 /* mute_led_polarity is set to 0, so we pass inverted value here */ 6378 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, 6379 !spec->gen.hp_jack_present); 6380 } 6381 6382 /* Manage GPIOs for HP EliteBook Folio 9480m. 6383 * 6384 * GPIO4 is the headphone amplifier power control 6385 * GPIO3 is the audio output mute indicator LED 6386 */ 6387 6388 static void alc280_fixup_hp_9480m(struct hda_codec *codec, 6389 const struct hda_fixup *fix, 6390 int action) 6391 { 6392 struct alc_spec *spec = codec->spec; 6393 6394 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 6395 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6396 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ 6397 spec->gpio_mask |= 0x10; 6398 spec->gpio_dir |= 0x10; 6399 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; 6400 } 6401 } 6402 6403 static void alc275_fixup_gpio4_off(struct hda_codec *codec, 6404 const struct hda_fixup *fix, 6405 int action) 6406 { 6407 struct alc_spec *spec = codec->spec; 6408 6409 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6410 spec->gpio_mask |= 0x04; 6411 spec->gpio_dir |= 0x04; 6412 /* set data bit low */ 6413 } 6414 } 6415 6416 /* Quirk for Thinkpad X1 7th and 8th Gen 6417 * The following fixed routing needed 6418 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly 6419 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC 6420 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp 6421 */ 6422 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, 6423 const struct hda_fixup *fix, int action) 6424 { 6425 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ 6426 static const hda_nid_t preferred_pairs[] = { 6427 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 6428 }; 6429 struct alc_spec *spec = codec->spec; 6430 6431 switch (action) { 6432 case HDA_FIXUP_ACT_PRE_PROBE: 6433 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6434 spec->gen.preferred_dacs = preferred_pairs; 6435 break; 6436 case HDA_FIXUP_ACT_BUILD: 6437 /* The generic parser creates somewhat unintuitive volume ctls 6438 * with the fixed routing above, and the shared DAC2 may be 6439 * confusing for PA. 6440 * Rename those to unique names so that PA doesn't touch them 6441 * and use only Master volume. 6442 */ 6443 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); 6444 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); 6445 break; 6446 } 6447 } 6448 6449 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, 6450 const struct hda_fixup *fix, 6451 int action) 6452 { 6453 alc_fixup_dual_codecs(codec, fix, action); 6454 switch (action) { 6455 case HDA_FIXUP_ACT_PRE_PROBE: 6456 /* override card longname to provide a unique UCM profile */ 6457 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); 6458 break; 6459 case HDA_FIXUP_ACT_BUILD: 6460 /* rename Capture controls depending on the codec */ 6461 rename_ctl(codec, "Capture Volume", 6462 codec->addr == 0 ? 6463 "Rear-Panel Capture Volume" : 6464 "Front-Panel Capture Volume"); 6465 rename_ctl(codec, "Capture Switch", 6466 codec->addr == 0 ? 6467 "Rear-Panel Capture Switch" : 6468 "Front-Panel Capture Switch"); 6469 break; 6470 } 6471 } 6472 6473 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, 6474 const struct hda_fixup *fix, int action) 6475 { 6476 if (action != HDA_FIXUP_ACT_PRE_PROBE) 6477 return; 6478 6479 codec->power_save_node = 1; 6480 } 6481 6482 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ 6483 static void alc274_fixup_bind_dacs(struct hda_codec *codec, 6484 const struct hda_fixup *fix, int action) 6485 { 6486 struct alc_spec *spec = codec->spec; 6487 static const hda_nid_t preferred_pairs[] = { 6488 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, 6489 0 6490 }; 6491 6492 if (action != HDA_FIXUP_ACT_PRE_PROBE) 6493 return; 6494 6495 spec->gen.preferred_dacs = preferred_pairs; 6496 spec->gen.auto_mute_via_amp = 1; 6497 codec->power_save_node = 0; 6498 } 6499 6500 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */ 6501 static void alc289_fixup_asus_ga401(struct hda_codec *codec, 6502 const struct hda_fixup *fix, int action) 6503 { 6504 static const hda_nid_t preferred_pairs[] = { 6505 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0 6506 }; 6507 struct alc_spec *spec = codec->spec; 6508 6509 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 6510 spec->gen.preferred_dacs = preferred_pairs; 6511 spec->gen.obey_preferred_dacs = 1; 6512 } 6513 } 6514 6515 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ 6516 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, 6517 const struct hda_fixup *fix, int action) 6518 { 6519 if (action != HDA_FIXUP_ACT_PRE_PROBE) 6520 return; 6521 6522 snd_hda_override_wcaps(codec, 0x03, 0); 6523 } 6524 6525 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) 6526 { 6527 switch (codec->core.vendor_id) { 6528 case 0x10ec0274: 6529 case 0x10ec0294: 6530 case 0x10ec0225: 6531 case 0x10ec0295: 6532 case 0x10ec0299: 6533 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ 6534 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); 6535 break; 6536 case 0x10ec0230: 6537 case 0x10ec0235: 6538 case 0x10ec0236: 6539 case 0x10ec0255: 6540 case 0x10ec0256: 6541 case 0x10ec0257: 6542 case 0x19e58326: 6543 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ 6544 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); 6545 break; 6546 } 6547 } 6548 6549 static void alc295_fixup_chromebook(struct hda_codec *codec, 6550 const struct hda_fixup *fix, int action) 6551 { 6552 struct alc_spec *spec = codec->spec; 6553 6554 switch (action) { 6555 case HDA_FIXUP_ACT_PRE_PROBE: 6556 spec->ultra_low_power = true; 6557 break; 6558 case HDA_FIXUP_ACT_INIT: 6559 alc_combo_jack_hp_jd_restart(codec); 6560 break; 6561 } 6562 } 6563 6564 static void alc256_fixup_chromebook(struct hda_codec *codec, 6565 const struct hda_fixup *fix, int action) 6566 { 6567 struct alc_spec *spec = codec->spec; 6568 6569 switch (action) { 6570 case HDA_FIXUP_ACT_PRE_PROBE: 6571 spec->gen.suppress_auto_mute = 1; 6572 spec->gen.suppress_auto_mic = 1; 6573 spec->en_3kpull_low = false; 6574 break; 6575 } 6576 } 6577 6578 static void alc_fixup_disable_mic_vref(struct hda_codec *codec, 6579 const struct hda_fixup *fix, int action) 6580 { 6581 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6582 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 6583 } 6584 6585 6586 static void alc294_gx502_toggle_output(struct hda_codec *codec, 6587 struct hda_jack_callback *cb) 6588 { 6589 /* The Windows driver sets the codec up in a very different way where 6590 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it 6591 */ 6592 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) 6593 alc_write_coef_idx(codec, 0x10, 0x8a20); 6594 else 6595 alc_write_coef_idx(codec, 0x10, 0x0a20); 6596 } 6597 6598 static void alc294_fixup_gx502_hp(struct hda_codec *codec, 6599 const struct hda_fixup *fix, int action) 6600 { 6601 /* Pin 0x21: headphones/headset mic */ 6602 if (!is_jack_detectable(codec, 0x21)) 6603 return; 6604 6605 switch (action) { 6606 case HDA_FIXUP_ACT_PRE_PROBE: 6607 snd_hda_jack_detect_enable_callback(codec, 0x21, 6608 alc294_gx502_toggle_output); 6609 break; 6610 case HDA_FIXUP_ACT_INIT: 6611 /* Make sure to start in a correct state, i.e. if 6612 * headphones have been plugged in before powering up the system 6613 */ 6614 alc294_gx502_toggle_output(codec, NULL); 6615 break; 6616 } 6617 } 6618 6619 static void alc294_gu502_toggle_output(struct hda_codec *codec, 6620 struct hda_jack_callback *cb) 6621 { 6622 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is 6623 * responsible from changes between speakers and headphones 6624 */ 6625 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) 6626 alc_write_coef_idx(codec, 0x10, 0x8420); 6627 else 6628 alc_write_coef_idx(codec, 0x10, 0x0a20); 6629 } 6630 6631 static void alc294_fixup_gu502_hp(struct hda_codec *codec, 6632 const struct hda_fixup *fix, int action) 6633 { 6634 if (!is_jack_detectable(codec, 0x21)) 6635 return; 6636 6637 switch (action) { 6638 case HDA_FIXUP_ACT_PRE_PROBE: 6639 snd_hda_jack_detect_enable_callback(codec, 0x21, 6640 alc294_gu502_toggle_output); 6641 break; 6642 case HDA_FIXUP_ACT_INIT: 6643 alc294_gu502_toggle_output(codec, NULL); 6644 break; 6645 } 6646 } 6647 6648 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, 6649 const struct hda_fixup *fix, int action) 6650 { 6651 if (action != HDA_FIXUP_ACT_INIT) 6652 return; 6653 6654 msleep(100); 6655 alc_write_coef_idx(codec, 0x65, 0x0); 6656 } 6657 6658 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, 6659 const struct hda_fixup *fix, int action) 6660 { 6661 switch (action) { 6662 case HDA_FIXUP_ACT_INIT: 6663 alc_combo_jack_hp_jd_restart(codec); 6664 break; 6665 } 6666 } 6667 6668 static void alc_fixup_no_int_mic(struct hda_codec *codec, 6669 const struct hda_fixup *fix, int action) 6670 { 6671 struct alc_spec *spec = codec->spec; 6672 6673 switch (action) { 6674 case HDA_FIXUP_ACT_PRE_PROBE: 6675 /* Mic RING SLEEVE swap for combo jack */ 6676 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 6677 spec->no_internal_mic_pin = true; 6678 break; 6679 case HDA_FIXUP_ACT_INIT: 6680 alc_combo_jack_hp_jd_restart(codec); 6681 break; 6682 } 6683 } 6684 6685 /* GPIO1 = amplifier on/off 6686 * GPIO3 = mic mute LED 6687 */ 6688 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, 6689 const struct hda_fixup *fix, int action) 6690 { 6691 static const hda_nid_t conn[] = { 0x02 }; 6692 6693 struct alc_spec *spec = codec->spec; 6694 static const struct hda_pintbl pincfgs[] = { 6695 { 0x14, 0x90170110 }, /* front/high speakers */ 6696 { 0x17, 0x90170130 }, /* back/bass speakers */ 6697 { } 6698 }; 6699 6700 //enable micmute led 6701 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04); 6702 6703 switch (action) { 6704 case HDA_FIXUP_ACT_PRE_PROBE: 6705 spec->micmute_led_polarity = 1; 6706 /* needed for amp of back speakers */ 6707 spec->gpio_mask |= 0x01; 6708 spec->gpio_dir |= 0x01; 6709 snd_hda_apply_pincfgs(codec, pincfgs); 6710 /* share DAC to have unified volume control */ 6711 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); 6712 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6713 break; 6714 case HDA_FIXUP_ACT_INIT: 6715 /* need to toggle GPIO to enable the amp of back speakers */ 6716 alc_update_gpio_data(codec, 0x01, true); 6717 msleep(100); 6718 alc_update_gpio_data(codec, 0x01, false); 6719 break; 6720 } 6721 } 6722 6723 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, 6724 const struct hda_fixup *fix, int action) 6725 { 6726 static const hda_nid_t conn[] = { 0x02 }; 6727 static const struct hda_pintbl pincfgs[] = { 6728 { 0x14, 0x90170110 }, /* rear speaker */ 6729 { } 6730 }; 6731 6732 switch (action) { 6733 case HDA_FIXUP_ACT_PRE_PROBE: 6734 snd_hda_apply_pincfgs(codec, pincfgs); 6735 /* force front speaker to DAC1 */ 6736 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6737 break; 6738 } 6739 } 6740 6741 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec, 6742 const struct hda_fixup *fix, 6743 int action) 6744 { 6745 static const struct coef_fw coefs[] = { 6746 WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023), 6747 WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03), 6748 WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a), 6749 WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014), 6750 WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15), 6751 WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489), 6752 WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0), 6753 WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000), 6754 WRITE_COEF(0x6e, 0x1005), { } 6755 }; 6756 6757 static const struct hda_pintbl pincfgs[] = { 6758 { 0x12, 0xb7a60130 }, /* Internal microphone*/ 6759 { 0x14, 0x90170150 }, /* B&O soundbar speakers */ 6760 { 0x17, 0x90170153 }, /* Side speakers */ 6761 { 0x19, 0x03a11040 }, /* Headset microphone */ 6762 { } 6763 }; 6764 6765 switch (action) { 6766 case HDA_FIXUP_ACT_PRE_PROBE: 6767 snd_hda_apply_pincfgs(codec, pincfgs); 6768 6769 /* Fixes volume control problem for side speakers */ 6770 alc295_fixup_disable_dac3(codec, fix, action); 6771 6772 /* Fixes no sound from headset speaker */ 6773 snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0); 6774 6775 /* Auto-enable headset mic when plugged */ 6776 snd_hda_jack_set_gating_jack(codec, 0x19, 0x21); 6777 6778 /* Headset mic volume enhancement */ 6779 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50); 6780 break; 6781 case HDA_FIXUP_ACT_INIT: 6782 alc_process_coef_fw(codec, coefs); 6783 break; 6784 case HDA_FIXUP_ACT_BUILD: 6785 rename_ctl(codec, "Bass Speaker Playback Volume", 6786 "B&O-Tuned Playback Volume"); 6787 rename_ctl(codec, "Front Playback Switch", 6788 "B&O Soundbar Playback Switch"); 6789 rename_ctl(codec, "Bass Speaker Playback Switch", 6790 "Side Speaker Playback Switch"); 6791 break; 6792 } 6793 } 6794 6795 /* for hda_fixup_thinkpad_acpi() */ 6796 #include "thinkpad_helper.c" 6797 6798 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, 6799 const struct hda_fixup *fix, int action) 6800 { 6801 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ 6802 hda_fixup_thinkpad_acpi(codec, fix, action); 6803 } 6804 6805 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */ 6806 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec, 6807 const struct hda_fixup *fix, 6808 int action) 6809 { 6810 struct alc_spec *spec = codec->spec; 6811 6812 switch (action) { 6813 case HDA_FIXUP_ACT_PRE_PROBE: 6814 spec->gen.suppress_auto_mute = 1; 6815 break; 6816 } 6817 } 6818 6819 static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data) 6820 { 6821 struct hda_codec *cdc = data; 6822 struct alc_spec *spec = cdc->spec; 6823 6824 codec_info(cdc, "ACPI Notification %d\n", event); 6825 6826 hda_component_acpi_device_notify(&spec->comps, handle, event, data); 6827 } 6828 6829 static int comp_bind(struct device *dev) 6830 { 6831 struct hda_codec *cdc = dev_to_hda_codec(dev); 6832 struct alc_spec *spec = cdc->spec; 6833 int ret; 6834 6835 ret = hda_component_manager_bind(cdc, &spec->comps); 6836 if (ret) 6837 return ret; 6838 6839 return hda_component_manager_bind_acpi_notifications(cdc, 6840 &spec->comps, 6841 comp_acpi_device_notify, cdc); 6842 } 6843 6844 static void comp_unbind(struct device *dev) 6845 { 6846 struct hda_codec *cdc = dev_to_hda_codec(dev); 6847 struct alc_spec *spec = cdc->spec; 6848 6849 hda_component_manager_unbind_acpi_notifications(cdc, &spec->comps, comp_acpi_device_notify); 6850 hda_component_manager_unbind(cdc, &spec->comps); 6851 } 6852 6853 static const struct component_master_ops comp_master_ops = { 6854 .bind = comp_bind, 6855 .unbind = comp_unbind, 6856 }; 6857 6858 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc, 6859 struct snd_pcm_substream *sub, int action) 6860 { 6861 struct alc_spec *spec = cdc->spec; 6862 6863 hda_component_manager_playback_hook(&spec->comps, action); 6864 } 6865 6866 static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus, 6867 const char *hid, const char *match_str, int count) 6868 { 6869 struct alc_spec *spec = cdc->spec; 6870 int ret; 6871 6872 switch (action) { 6873 case HDA_FIXUP_ACT_PRE_PROBE: 6874 ret = hda_component_manager_init(cdc, &spec->comps, count, bus, hid, 6875 match_str, &comp_master_ops); 6876 if (ret) 6877 return; 6878 6879 spec->gen.pcm_playback_hook = comp_generic_playback_hook; 6880 break; 6881 case HDA_FIXUP_ACT_FREE: 6882 hda_component_manager_free(cdc, &comp_master_ops); 6883 break; 6884 } 6885 } 6886 6887 static void cs35lxx_autodet_fixup(struct hda_codec *cdc, 6888 const struct hda_fixup *fix, 6889 int action) 6890 { 6891 struct device *dev = hda_codec_dev(cdc); 6892 struct acpi_device *adev; 6893 struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; 6894 const char *bus = NULL; 6895 static const struct { 6896 const char *hid; 6897 const char *name; 6898 } acpi_ids[] = {{ "CSC3554", "cs35l54-hda" }, 6899 { "CSC3556", "cs35l56-hda" }, 6900 { "CSC3557", "cs35l57-hda" }}; 6901 char *match; 6902 int i, count = 0, count_devindex = 0; 6903 6904 switch (action) { 6905 case HDA_FIXUP_ACT_PRE_PROBE: 6906 for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) { 6907 adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1); 6908 if (adev) 6909 break; 6910 } 6911 if (!adev) { 6912 dev_err(dev, "Failed to find ACPI entry for a Cirrus Amp\n"); 6913 return; 6914 } 6915 6916 count = i2c_acpi_client_count(adev); 6917 if (count > 0) { 6918 bus = "i2c"; 6919 } else { 6920 count = acpi_spi_count_resources(adev); 6921 if (count > 0) 6922 bus = "spi"; 6923 } 6924 6925 fwnode = fwnode_handle_get(acpi_fwnode_handle(adev)); 6926 acpi_dev_put(adev); 6927 6928 if (!bus) { 6929 dev_err(dev, "Did not find any buses for %s\n", acpi_ids[i].hid); 6930 return; 6931 } 6932 6933 if (!fwnode) { 6934 dev_err(dev, "Could not get fwnode for %s\n", acpi_ids[i].hid); 6935 return; 6936 } 6937 6938 /* 6939 * When available the cirrus,dev-index property is an accurate 6940 * count of the amps in a system and is used in preference to 6941 * the count of bus devices that can contain additional address 6942 * alias entries. 6943 */ 6944 count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index"); 6945 if (count_devindex > 0) 6946 count = count_devindex; 6947 6948 match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name); 6949 if (!match) 6950 return; 6951 dev_info(dev, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match); 6952 comp_generic_fixup(cdc, action, bus, acpi_ids[i].hid, match, count); 6953 6954 break; 6955 case HDA_FIXUP_ACT_FREE: 6956 /* 6957 * Pass the action on to comp_generic_fixup() so that 6958 * hda_component_manager functions can be called in just once 6959 * place. In this context the bus, hid, match_str or count 6960 * values do not need to be calculated. 6961 */ 6962 comp_generic_fixup(cdc, action, NULL, NULL, NULL, 0); 6963 break; 6964 } 6965 } 6966 6967 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 6968 { 6969 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2); 6970 } 6971 6972 static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 6973 { 6974 comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4); 6975 } 6976 6977 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action) 6978 { 6979 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2); 6980 } 6981 6982 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action) 6983 { 6984 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4); 6985 } 6986 6987 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix, 6988 int action) 6989 { 6990 comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2); 6991 } 6992 6993 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix, 6994 int action) 6995 { 6996 comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2); 6997 } 6998 6999 static void cs35l56_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7000 { 7001 comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 2); 7002 } 7003 7004 static void cs35l56_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7005 { 7006 comp_generic_fixup(cdc, action, "i2c", "CSC3556", "-%s:00-cs35l56-hda.%d", 4); 7007 } 7008 7009 static void cs35l56_fixup_spi_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7010 { 7011 comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 2); 7012 } 7013 7014 static void cs35l56_fixup_spi_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7015 { 7016 comp_generic_fixup(cdc, action, "spi", "CSC3556", "-%s:00-cs35l56-hda.%d", 4); 7017 } 7018 7019 static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7020 { 7021 /* 7022 * The same SSID has been re-used in different hardware, they have 7023 * different codecs and the newer GA403U has a ALC285. 7024 */ 7025 if (cdc->core.vendor_id == 0x10ec0285) 7026 cs35l56_fixup_i2c_two(cdc, fix, action); 7027 else 7028 alc_fixup_inv_dmic(cdc, fix, action); 7029 } 7030 7031 static void tas2781_fixup_i2c(struct hda_codec *cdc, 7032 const struct hda_fixup *fix, int action) 7033 { 7034 comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1); 7035 } 7036 7037 static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc, 7038 const struct hda_fixup *fix, int action) 7039 { 7040 comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1); 7041 } 7042 7043 static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec, 7044 const struct hda_fixup *fix, int action) 7045 { 7046 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 7047 } 7048 7049 7050 /* for alc295_fixup_hp_top_speakers */ 7051 #include "hp_x360_helper.c" 7052 7053 /* for alc285_fixup_ideapad_s740_coef() */ 7054 #include "ideapad_s740_helper.c" 7055 7056 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = { 7057 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000), 7058 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000), 7059 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089), 7060 {} 7061 }; 7062 7063 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec, 7064 const struct hda_fixup *fix, 7065 int action) 7066 { 7067 /* 7068 * A certain other OS sets these coeffs to different values. On at least 7069 * one TongFang barebone these settings might survive even a cold 7070 * reboot. So to restore a clean slate the values are explicitly reset 7071 * to default here. Without this, the external microphone is always in a 7072 * plugged-in state, while the internal microphone is always in an 7073 * unplugged state, breaking the ability to use the internal microphone. 7074 */ 7075 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs); 7076 } 7077 7078 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = { 7079 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06), 7080 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074), 7081 WRITE_COEF(0x49, 0x0149), 7082 {} 7083 }; 7084 7085 static void alc233_fixup_no_audio_jack(struct hda_codec *codec, 7086 const struct hda_fixup *fix, 7087 int action) 7088 { 7089 /* 7090 * The audio jack input and output is not detected on the ASRock NUC Box 7091 * 1100 series when cold booting without this fix. Warm rebooting from a 7092 * certain other OS makes the audio functional, as COEF settings are 7093 * preserved in this case. This fix sets these altered COEF values as 7094 * the default. 7095 */ 7096 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs); 7097 } 7098 7099 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec, 7100 const struct hda_fixup *fix, 7101 int action) 7102 { 7103 /* 7104 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec, 7105 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec 7106 * needs an additional quirk for sound working after suspend and resume. 7107 */ 7108 if (codec->core.vendor_id == 0x10ec0256) { 7109 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 7110 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120); 7111 } else { 7112 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c); 7113 } 7114 } 7115 7116 static void alc256_decrease_headphone_amp_val(struct hda_codec *codec, 7117 const struct hda_fixup *fix, int action) 7118 { 7119 u32 caps; 7120 u8 nsteps, offs; 7121 7122 if (action != HDA_FIXUP_ACT_PRE_PROBE) 7123 return; 7124 7125 caps = query_amp_caps(codec, 0x3, HDA_OUTPUT); 7126 nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10; 7127 offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10; 7128 caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET; 7129 caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT); 7130 7131 if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps)) 7132 codec_warn(codec, "failed to override amp caps for NID 0x3\n"); 7133 } 7134 7135 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec, 7136 const struct hda_fixup *fix, 7137 int action) 7138 { 7139 struct alc_spec *spec = codec->spec; 7140 struct hda_input_mux *imux = &spec->gen.input_mux; 7141 int i; 7142 7143 alc269_fixup_limit_int_mic_boost(codec, fix, action); 7144 7145 switch (action) { 7146 case HDA_FIXUP_ACT_PRE_PROBE: 7147 /** 7148 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic) 7149 * to Hi-Z to avoid pop noises at startup and when plugging and 7150 * unplugging headphones. 7151 */ 7152 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 7153 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ); 7154 break; 7155 case HDA_FIXUP_ACT_PROBE: 7156 /** 7157 * Make the internal mic (0x12) the default input source to 7158 * prevent pop noises on cold boot. 7159 */ 7160 for (i = 0; i < imux->num_items; i++) { 7161 if (spec->gen.imux_pins[i] == 0x12) { 7162 spec->gen.cur_mux[0] = i; 7163 break; 7164 } 7165 } 7166 break; 7167 } 7168 } 7169 7170 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec, 7171 const struct hda_fixup *fix, int action) 7172 { 7173 /* 7174 * The Pin Complex 0x17 for the bass speakers is wrongly reported as 7175 * unconnected. 7176 */ 7177 static const struct hda_pintbl pincfgs[] = { 7178 { 0x17, 0x90170121 }, 7179 { } 7180 }; 7181 /* 7182 * Avoid DAC 0x06 and 0x08, as they have no volume controls. 7183 * DAC 0x02 and 0x03 would be fine. 7184 */ 7185 static const hda_nid_t conn[] = { 0x02, 0x03 }; 7186 /* 7187 * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02. 7188 * Headphones (0x21) are connected to DAC 0x03. 7189 */ 7190 static const hda_nid_t preferred_pairs[] = { 7191 0x14, 0x02, 7192 0x17, 0x02, 7193 0x21, 0x03, 7194 0 7195 }; 7196 struct alc_spec *spec = codec->spec; 7197 7198 switch (action) { 7199 case HDA_FIXUP_ACT_PRE_PROBE: 7200 snd_hda_apply_pincfgs(codec, pincfgs); 7201 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7202 spec->gen.preferred_dacs = preferred_pairs; 7203 break; 7204 } 7205 } 7206 7207 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec, 7208 const struct hda_fixup *fix, int action) 7209 { 7210 static const struct hda_pintbl pincfgs[] = { 7211 { 0x14, 0x90170151 }, 7212 { 0x17, 0x90170150 }, 7213 { } 7214 }; 7215 static const hda_nid_t conn[] = { 0x02, 0x03 }; 7216 static const hda_nid_t preferred_pairs[] = { 7217 0x14, 0x02, 7218 0x17, 0x03, 7219 0x21, 0x02, 7220 0 7221 }; 7222 struct alc_spec *spec = codec->spec; 7223 7224 alc_fixup_no_shutup(codec, fix, action); 7225 7226 switch (action) { 7227 case HDA_FIXUP_ACT_PRE_PROBE: 7228 snd_hda_apply_pincfgs(codec, pincfgs); 7229 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7230 spec->gen.preferred_dacs = preferred_pairs; 7231 break; 7232 } 7233 } 7234 7235 /* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */ 7236 static void alc287_fixup_bind_dacs(struct hda_codec *codec, 7237 const struct hda_fixup *fix, int action) 7238 { 7239 struct alc_spec *spec = codec->spec; 7240 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ 7241 static const hda_nid_t preferred_pairs[] = { 7242 0x17, 0x02, 0x21, 0x03, 0 7243 }; 7244 7245 if (action != HDA_FIXUP_ACT_PRE_PROBE) 7246 return; 7247 7248 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7249 spec->gen.preferred_dacs = preferred_pairs; 7250 spec->gen.auto_mute_via_amp = 1; 7251 if (spec->gen.autocfg.speaker_pins[0] != 0x14) { 7252 snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 7253 0x0); /* Make sure 0x14 was disable */ 7254 } 7255 } 7256 /* Fix none verb table of Headset Mic pin */ 7257 static void alc_fixup_headset_mic(struct hda_codec *codec, 7258 const struct hda_fixup *fix, int action) 7259 { 7260 struct alc_spec *spec = codec->spec; 7261 static const struct hda_pintbl pincfgs[] = { 7262 { 0x19, 0x03a1103c }, 7263 { } 7264 }; 7265 7266 switch (action) { 7267 case HDA_FIXUP_ACT_PRE_PROBE: 7268 snd_hda_apply_pincfgs(codec, pincfgs); 7269 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); 7270 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 7271 break; 7272 } 7273 } 7274 7275 static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec, 7276 const struct hda_fixup *fix, int action) 7277 { 7278 /* 7279 * The Pin Complex 0x14 for the treble speakers is wrongly reported as 7280 * unconnected. 7281 * The Pin Complex 0x17 for the bass speakers has the lowest association 7282 * and sequence values so shift it up a bit to squeeze 0x14 in. 7283 */ 7284 static const struct hda_pintbl pincfgs[] = { 7285 { 0x14, 0x90170110 }, // top/treble 7286 { 0x17, 0x90170111 }, // bottom/bass 7287 { } 7288 }; 7289 7290 /* 7291 * Force DAC 0x02 for the bass speakers 0x17. 7292 */ 7293 static const hda_nid_t conn[] = { 0x02 }; 7294 7295 switch (action) { 7296 case HDA_FIXUP_ACT_PRE_PROBE: 7297 snd_hda_apply_pincfgs(codec, pincfgs); 7298 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 7299 break; 7300 } 7301 7302 cs35l41_fixup_i2c_two(codec, fix, action); 7303 alc245_fixup_hp_mute_led_coefbit(codec, fix, action); 7304 alc245_fixup_hp_gpio_led(codec, fix, action); 7305 } 7306 7307 /* 7308 * ALC287 PCM hooks 7309 */ 7310 static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo, 7311 struct hda_codec *codec, 7312 struct snd_pcm_substream *substream, 7313 int action) 7314 { 7315 alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */ 7316 switch (action) { 7317 case HDA_GEN_PCM_ACT_OPEN: 7318 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */ 7319 break; 7320 case HDA_GEN_PCM_ACT_CLOSE: 7321 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */ 7322 break; 7323 } 7324 } 7325 7326 static void alc287_s4_power_gpio3_default(struct hda_codec *codec) 7327 { 7328 if (is_s4_suspend(codec)) { 7329 alc_write_coef_idx(codec, 0x10, 0x8806); /* Change MLK to GPIO3 */ 7330 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */ 7331 } 7332 } 7333 7334 static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec, 7335 const struct hda_fixup *fix, int action) 7336 { 7337 struct alc_spec *spec = codec->spec; 7338 7339 if (action != HDA_FIXUP_ACT_PRE_PROBE) 7340 return; 7341 spec->power_hook = alc287_s4_power_gpio3_default; 7342 spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook; 7343 } 7344 7345 7346 enum { 7347 ALC269_FIXUP_GPIO2, 7348 ALC269_FIXUP_SONY_VAIO, 7349 ALC275_FIXUP_SONY_VAIO_GPIO2, 7350 ALC269_FIXUP_DELL_M101Z, 7351 ALC269_FIXUP_SKU_IGNORE, 7352 ALC269_FIXUP_ASUS_G73JW, 7353 ALC269_FIXUP_ASUS_N7601ZM_PINS, 7354 ALC269_FIXUP_ASUS_N7601ZM, 7355 ALC269_FIXUP_LENOVO_EAPD, 7356 ALC275_FIXUP_SONY_HWEQ, 7357 ALC275_FIXUP_SONY_DISABLE_AAMIX, 7358 ALC271_FIXUP_DMIC, 7359 ALC269_FIXUP_PCM_44K, 7360 ALC269_FIXUP_STEREO_DMIC, 7361 ALC269_FIXUP_HEADSET_MIC, 7362 ALC269_FIXUP_QUANTA_MUTE, 7363 ALC269_FIXUP_LIFEBOOK, 7364 ALC269_FIXUP_LIFEBOOK_EXTMIC, 7365 ALC269_FIXUP_LIFEBOOK_HP_PIN, 7366 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, 7367 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, 7368 ALC269_FIXUP_AMIC, 7369 ALC269_FIXUP_DMIC, 7370 ALC269VB_FIXUP_AMIC, 7371 ALC269VB_FIXUP_DMIC, 7372 ALC269_FIXUP_HP_MUTE_LED, 7373 ALC269_FIXUP_HP_MUTE_LED_MIC1, 7374 ALC269_FIXUP_HP_MUTE_LED_MIC2, 7375 ALC269_FIXUP_HP_MUTE_LED_MIC3, 7376 ALC269_FIXUP_HP_GPIO_LED, 7377 ALC269_FIXUP_HP_GPIO_MIC1_LED, 7378 ALC269_FIXUP_HP_LINE1_MIC1_LED, 7379 ALC269_FIXUP_INV_DMIC, 7380 ALC269_FIXUP_LENOVO_DOCK, 7381 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, 7382 ALC269_FIXUP_NO_SHUTUP, 7383 ALC286_FIXUP_SONY_MIC_NO_PRESENCE, 7384 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, 7385 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 7386 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 7387 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 7388 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 7389 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, 7390 ALC269_FIXUP_HEADSET_MODE, 7391 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, 7392 ALC269_FIXUP_ASPIRE_HEADSET_MIC, 7393 ALC269_FIXUP_ASUS_X101_FUNC, 7394 ALC269_FIXUP_ASUS_X101_VERB, 7395 ALC269_FIXUP_ASUS_X101, 7396 ALC271_FIXUP_AMIC_MIC2, 7397 ALC271_FIXUP_HP_GATE_MIC_JACK, 7398 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, 7399 ALC269_FIXUP_ACER_AC700, 7400 ALC269_FIXUP_LIMIT_INT_MIC_BOOST, 7401 ALC269VB_FIXUP_ASUS_ZENBOOK, 7402 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, 7403 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE, 7404 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, 7405 ALC269VB_FIXUP_ORDISSIMO_EVE2, 7406 ALC283_FIXUP_CHROME_BOOK, 7407 ALC283_FIXUP_SENSE_COMBO_JACK, 7408 ALC282_FIXUP_ASUS_TX300, 7409 ALC283_FIXUP_INT_MIC, 7410 ALC290_FIXUP_MONO_SPEAKERS, 7411 ALC290_FIXUP_MONO_SPEAKERS_HSJACK, 7412 ALC290_FIXUP_SUBWOOFER, 7413 ALC290_FIXUP_SUBWOOFER_HSJACK, 7414 ALC269_FIXUP_THINKPAD_ACPI, 7415 ALC269_FIXUP_DMIC_THINKPAD_ACPI, 7416 ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO, 7417 ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 7418 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 7419 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 7420 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 7421 ALC255_FIXUP_HEADSET_MODE, 7422 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, 7423 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 7424 ALC292_FIXUP_TPT440_DOCK, 7425 ALC292_FIXUP_TPT440, 7426 ALC283_FIXUP_HEADSET_MIC, 7427 ALC255_FIXUP_MIC_MUTE_LED, 7428 ALC282_FIXUP_ASPIRE_V5_PINS, 7429 ALC269VB_FIXUP_ASPIRE_E1_COEF, 7430 ALC280_FIXUP_HP_GPIO4, 7431 ALC286_FIXUP_HP_GPIO_LED, 7432 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, 7433 ALC280_FIXUP_HP_DOCK_PINS, 7434 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, 7435 ALC280_FIXUP_HP_9480M, 7436 ALC245_FIXUP_HP_X360_AMP, 7437 ALC285_FIXUP_HP_SPECTRE_X360_EB1, 7438 ALC285_FIXUP_HP_ENVY_X360, 7439 ALC288_FIXUP_DELL_HEADSET_MODE, 7440 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, 7441 ALC288_FIXUP_DELL_XPS_13, 7442 ALC288_FIXUP_DISABLE_AAMIX, 7443 ALC292_FIXUP_DELL_E7X_AAMIX, 7444 ALC292_FIXUP_DELL_E7X, 7445 ALC292_FIXUP_DISABLE_AAMIX, 7446 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, 7447 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, 7448 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 7449 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, 7450 ALC275_FIXUP_DELL_XPS, 7451 ALC293_FIXUP_LENOVO_SPK_NOISE, 7452 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 7453 ALC255_FIXUP_DELL_SPK_NOISE, 7454 ALC225_FIXUP_DISABLE_MIC_VREF, 7455 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 7456 ALC295_FIXUP_DISABLE_DAC3, 7457 ALC285_FIXUP_SPEAKER2_TO_DAC1, 7458 ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1, 7459 ALC285_FIXUP_ASUS_HEADSET_MIC, 7460 ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS, 7461 ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1, 7462 ALC285_FIXUP_ASUS_I2C_HEADSET_MIC, 7463 ALC280_FIXUP_HP_HEADSET_MIC, 7464 ALC221_FIXUP_HP_FRONT_MIC, 7465 ALC292_FIXUP_TPT460, 7466 ALC298_FIXUP_SPK_VOLUME, 7467 ALC298_FIXUP_LENOVO_SPK_VOLUME, 7468 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, 7469 ALC269_FIXUP_ATIV_BOOK_8, 7470 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE, 7471 ALC221_FIXUP_HP_MIC_NO_PRESENCE, 7472 ALC256_FIXUP_ASUS_HEADSET_MODE, 7473 ALC256_FIXUP_ASUS_MIC, 7474 ALC256_FIXUP_ASUS_AIO_GPIO2, 7475 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, 7476 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, 7477 ALC233_FIXUP_LENOVO_MULTI_CODECS, 7478 ALC233_FIXUP_ACER_HEADSET_MIC, 7479 ALC294_FIXUP_LENOVO_MIC_LOCATION, 7480 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, 7481 ALC225_FIXUP_S3_POP_NOISE, 7482 ALC700_FIXUP_INTEL_REFERENCE, 7483 ALC274_FIXUP_DELL_BIND_DACS, 7484 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, 7485 ALC298_FIXUP_TPT470_DOCK_FIX, 7486 ALC298_FIXUP_TPT470_DOCK, 7487 ALC255_FIXUP_DUMMY_LINEOUT_VERB, 7488 ALC255_FIXUP_DELL_HEADSET_MIC, 7489 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, 7490 ALC298_FIXUP_HUAWEI_MBX_STEREO, 7491 ALC295_FIXUP_HP_X360, 7492 ALC221_FIXUP_HP_HEADSET_MIC, 7493 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, 7494 ALC295_FIXUP_HP_AUTO_MUTE, 7495 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, 7496 ALC294_FIXUP_ASUS_MIC, 7497 ALC294_FIXUP_ASUS_HEADSET_MIC, 7498 ALC294_FIXUP_ASUS_SPK, 7499 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 7500 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 7501 ALC255_FIXUP_ACER_HEADSET_MIC, 7502 ALC295_FIXUP_CHROME_BOOK, 7503 ALC225_FIXUP_HEADSET_JACK, 7504 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, 7505 ALC225_FIXUP_WYSE_AUTO_MUTE, 7506 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, 7507 ALC286_FIXUP_ACER_AIO_HEADSET_MIC, 7508 ALC256_FIXUP_ASUS_HEADSET_MIC, 7509 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 7510 ALC299_FIXUP_PREDATOR_SPK, 7511 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, 7512 ALC289_FIXUP_DELL_SPK1, 7513 ALC289_FIXUP_DELL_SPK2, 7514 ALC289_FIXUP_DUAL_SPK, 7515 ALC289_FIXUP_RTK_AMP_DUAL_SPK, 7516 ALC294_FIXUP_SPK2_TO_DAC1, 7517 ALC294_FIXUP_ASUS_DUAL_SPK, 7518 ALC285_FIXUP_THINKPAD_X1_GEN7, 7519 ALC285_FIXUP_THINKPAD_HEADSET_JACK, 7520 ALC294_FIXUP_ASUS_ALLY, 7521 ALC294_FIXUP_ASUS_ALLY_PINS, 7522 ALC294_FIXUP_ASUS_ALLY_VERBS, 7523 ALC294_FIXUP_ASUS_ALLY_SPEAKER, 7524 ALC294_FIXUP_ASUS_HPE, 7525 ALC294_FIXUP_ASUS_COEF_1B, 7526 ALC294_FIXUP_ASUS_GX502_HP, 7527 ALC294_FIXUP_ASUS_GX502_PINS, 7528 ALC294_FIXUP_ASUS_GX502_VERBS, 7529 ALC294_FIXUP_ASUS_GU502_HP, 7530 ALC294_FIXUP_ASUS_GU502_PINS, 7531 ALC294_FIXUP_ASUS_GU502_VERBS, 7532 ALC294_FIXUP_ASUS_G513_PINS, 7533 ALC285_FIXUP_ASUS_G533Z_PINS, 7534 ALC285_FIXUP_HP_GPIO_LED, 7535 ALC285_FIXUP_HP_MUTE_LED, 7536 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED, 7537 ALC236_FIXUP_HP_MUTE_LED_COEFBIT2, 7538 ALC236_FIXUP_HP_GPIO_LED, 7539 ALC236_FIXUP_HP_MUTE_LED, 7540 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, 7541 ALC236_FIXUP_LENOVO_INV_DMIC, 7542 ALC298_FIXUP_SAMSUNG_AMP, 7543 ALC298_FIXUP_SAMSUNG_AMP2, 7544 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 7545 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 7546 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 7547 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, 7548 ALC269VC_FIXUP_ACER_HEADSET_MIC, 7549 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, 7550 ALC289_FIXUP_ASUS_GA401, 7551 ALC289_FIXUP_ASUS_GA502, 7552 ALC256_FIXUP_ACER_MIC_NO_PRESENCE, 7553 ALC285_FIXUP_HP_GPIO_AMP_INIT, 7554 ALC269_FIXUP_CZC_B20, 7555 ALC269_FIXUP_CZC_TMI, 7556 ALC269_FIXUP_CZC_L101, 7557 ALC269_FIXUP_LEMOTE_A1802, 7558 ALC269_FIXUP_LEMOTE_A190X, 7559 ALC256_FIXUP_INTEL_NUC8_RUGGED, 7560 ALC233_FIXUP_INTEL_NUC8_DMIC, 7561 ALC233_FIXUP_INTEL_NUC8_BOOST, 7562 ALC256_FIXUP_INTEL_NUC10, 7563 ALC255_FIXUP_XIAOMI_HEADSET_MIC, 7564 ALC274_FIXUP_HP_MIC, 7565 ALC274_FIXUP_HP_HEADSET_MIC, 7566 ALC274_FIXUP_HP_ENVY_GPIO, 7567 ALC256_FIXUP_ASUS_HPE, 7568 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 7569 ALC287_FIXUP_HP_GPIO_LED, 7570 ALC256_FIXUP_HP_HEADSET_MIC, 7571 ALC245_FIXUP_HP_GPIO_LED, 7572 ALC236_FIXUP_DELL_AIO_HEADSET_MIC, 7573 ALC282_FIXUP_ACER_DISABLE_LINEOUT, 7574 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST, 7575 ALC256_FIXUP_ACER_HEADSET_MIC, 7576 ALC285_FIXUP_IDEAPAD_S740_COEF, 7577 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST, 7578 ALC295_FIXUP_ASUS_DACS, 7579 ALC295_FIXUP_HP_OMEN, 7580 ALC285_FIXUP_HP_SPECTRE_X360, 7581 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, 7582 ALC623_FIXUP_LENOVO_THINKSTATION_P340, 7583 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, 7584 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST, 7585 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS, 7586 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, 7587 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, 7588 ALC298_FIXUP_LENOVO_C940_DUET7, 7589 ALC287_FIXUP_LENOVO_14IRP8_DUETITL, 7590 ALC287_FIXUP_LENOVO_LEGION_7, 7591 ALC287_FIXUP_13S_GEN2_SPEAKERS, 7592 ALC256_FIXUP_SET_COEF_DEFAULTS, 7593 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 7594 ALC233_FIXUP_NO_AUDIO_JACK, 7595 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME, 7596 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS, 7597 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, 7598 ALC287_FIXUP_LEGION_16ACHG6, 7599 ALC287_FIXUP_CS35L41_I2C_2, 7600 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED, 7601 ALC287_FIXUP_CS35L41_I2C_4, 7602 ALC245_FIXUP_CS35L41_SPI_2, 7603 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED, 7604 ALC245_FIXUP_CS35L41_SPI_4, 7605 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED, 7606 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED, 7607 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE, 7608 ALC287_FIXUP_LEGION_16ITHG6, 7609 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK, 7610 ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, 7611 ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN, 7612 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS, 7613 ALC236_FIXUP_DELL_DUAL_CODECS, 7614 ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, 7615 ALC287_FIXUP_TAS2781_I2C, 7616 ALC287_FIXUP_YOGA7_14ARB7_I2C, 7617 ALC245_FIXUP_HP_MUTE_LED_COEFBIT, 7618 ALC245_FIXUP_HP_X360_MUTE_LEDS, 7619 ALC287_FIXUP_THINKPAD_I2S_SPK, 7620 ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD, 7621 ALC2XX_FIXUP_HEADSET_MIC, 7622 ALC289_FIXUP_DELL_CS35L41_SPI_2, 7623 ALC294_FIXUP_CS35L41_I2C_2, 7624 ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED, 7625 ALC256_FIXUP_ACER_SFG16_MICMUTE_LED, 7626 ALC256_FIXUP_HEADPHONE_AMP_VOL, 7627 ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX, 7628 ALC285_FIXUP_CS35L56_SPI_2, 7629 ALC285_FIXUP_CS35L56_I2C_2, 7630 ALC285_FIXUP_CS35L56_I2C_4, 7631 ALC285_FIXUP_ASUS_GA403U, 7632 ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC, 7633 ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1, 7634 ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC, 7635 ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1, 7636 ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318, 7637 ALC256_FIXUP_CHROME_BOOK, 7638 ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7, 7639 ALC287_FIXUP_LENOVO_SSID_17AA3820, 7640 ALCXXX_FIXUP_CS35LXX, 7641 ALC245_FIXUP_CLEVO_NOISY_MIC, 7642 }; 7643 7644 /* A special fixup for Lenovo C940 and Yoga Duet 7; 7645 * both have the very same PCI SSID, and we need to apply different fixups 7646 * depending on the codec ID 7647 */ 7648 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec, 7649 const struct hda_fixup *fix, 7650 int action) 7651 { 7652 int id; 7653 7654 if (codec->core.vendor_id == 0x10ec0298) 7655 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */ 7656 else 7657 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */ 7658 __snd_hda_apply_fixup(codec, id, action, 0); 7659 } 7660 7661 /* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021; 7662 * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID, 7663 * so we need to apply a different fixup in this case. The only DuetITL codec 7664 * SSID reported so far is the 17aa:3802 while the 14IRP8 has the 17aa:38be 7665 * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would 7666 * have matched correctly by their codecs. 7667 */ 7668 static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec, 7669 const struct hda_fixup *fix, 7670 int action) 7671 { 7672 int id; 7673 7674 if (codec->core.subsystem_id == 0x17aa3802) 7675 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */ 7676 else 7677 id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */ 7678 __snd_hda_apply_fixup(codec, id, action, 0); 7679 } 7680 7681 /* Similar to above the Lenovo Yoga Pro 7 14ARP8 PCI SSID matches the codec SSID of the 7682 Legion Y9000X 2022 IAH7.*/ 7683 static void alc287_fixup_lenovo_14arp8_legion_iah7(struct hda_codec *codec, 7684 const struct hda_fixup *fix, 7685 int action) 7686 { 7687 int id; 7688 7689 if (codec->core.subsystem_id == 0x17aa386e) 7690 id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion Y9000X 2022 IAH7 */ 7691 else 7692 id = ALC285_FIXUP_SPEAKER2_TO_DAC1; /* Yoga Pro 7 14ARP8 */ 7693 __snd_hda_apply_fixup(codec, id, action, 0); 7694 } 7695 7696 /* Another hilarious PCI SSID conflict with Lenovo Legion Pro 7 16ARX8H (with 7697 * TAS2781 codec) and Legion 7i 16IAX7 (with CS35L41 codec); 7698 * we apply a corresponding fixup depending on the codec SSID instead 7699 */ 7700 static void alc287_fixup_lenovo_legion_7(struct hda_codec *codec, 7701 const struct hda_fixup *fix, 7702 int action) 7703 { 7704 int id; 7705 7706 if (codec->core.subsystem_id == 0x17aa38a8) 7707 id = ALC287_FIXUP_TAS2781_I2C; /* Legion Pro 7 16ARX8H */ 7708 else 7709 id = ALC287_FIXUP_CS35L41_I2C_2; /* Legion 7i 16IAX7 */ 7710 __snd_hda_apply_fixup(codec, id, action, 0); 7711 } 7712 7713 /* Yet more conflicting PCI SSID (17aa:3820) on two Lenovo models */ 7714 static void alc287_fixup_lenovo_ssid_17aa3820(struct hda_codec *codec, 7715 const struct hda_fixup *fix, 7716 int action) 7717 { 7718 int id; 7719 7720 if (codec->core.subsystem_id == 0x17aa3820) 7721 id = ALC269_FIXUP_ASPIRE_HEADSET_MIC; /* IdeaPad 330-17IKB 81DM */ 7722 else /* 0x17aa3802 */ 7723 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* "Yoga Duet 7 13ITL6 */ 7724 __snd_hda_apply_fixup(codec, id, action, 0); 7725 } 7726 7727 static const struct hda_fixup alc269_fixups[] = { 7728 [ALC269_FIXUP_GPIO2] = { 7729 .type = HDA_FIXUP_FUNC, 7730 .v.func = alc_fixup_gpio2, 7731 }, 7732 [ALC269_FIXUP_SONY_VAIO] = { 7733 .type = HDA_FIXUP_PINCTLS, 7734 .v.pins = (const struct hda_pintbl[]) { 7735 {0x19, PIN_VREFGRD}, 7736 {} 7737 } 7738 }, 7739 [ALC275_FIXUP_SONY_VAIO_GPIO2] = { 7740 .type = HDA_FIXUP_FUNC, 7741 .v.func = alc275_fixup_gpio4_off, 7742 .chained = true, 7743 .chain_id = ALC269_FIXUP_SONY_VAIO 7744 }, 7745 [ALC269_FIXUP_DELL_M101Z] = { 7746 .type = HDA_FIXUP_VERBS, 7747 .v.verbs = (const struct hda_verb[]) { 7748 /* Enables internal speaker */ 7749 {0x20, AC_VERB_SET_COEF_INDEX, 13}, 7750 {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, 7751 {} 7752 } 7753 }, 7754 [ALC269_FIXUP_SKU_IGNORE] = { 7755 .type = HDA_FIXUP_FUNC, 7756 .v.func = alc_fixup_sku_ignore, 7757 }, 7758 [ALC269_FIXUP_ASUS_G73JW] = { 7759 .type = HDA_FIXUP_PINS, 7760 .v.pins = (const struct hda_pintbl[]) { 7761 { 0x17, 0x99130111 }, /* subwoofer */ 7762 { } 7763 } 7764 }, 7765 [ALC269_FIXUP_ASUS_N7601ZM_PINS] = { 7766 .type = HDA_FIXUP_PINS, 7767 .v.pins = (const struct hda_pintbl[]) { 7768 { 0x19, 0x03A11050 }, 7769 { 0x1a, 0x03A11C30 }, 7770 { 0x21, 0x03211420 }, 7771 { } 7772 } 7773 }, 7774 [ALC269_FIXUP_ASUS_N7601ZM] = { 7775 .type = HDA_FIXUP_VERBS, 7776 .v.verbs = (const struct hda_verb[]) { 7777 {0x20, AC_VERB_SET_COEF_INDEX, 0x62}, 7778 {0x20, AC_VERB_SET_PROC_COEF, 0xa007}, 7779 {0x20, AC_VERB_SET_COEF_INDEX, 0x10}, 7780 {0x20, AC_VERB_SET_PROC_COEF, 0x8420}, 7781 {0x20, AC_VERB_SET_COEF_INDEX, 0x0f}, 7782 {0x20, AC_VERB_SET_PROC_COEF, 0x7774}, 7783 { } 7784 }, 7785 .chained = true, 7786 .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS, 7787 }, 7788 [ALC269_FIXUP_LENOVO_EAPD] = { 7789 .type = HDA_FIXUP_VERBS, 7790 .v.verbs = (const struct hda_verb[]) { 7791 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, 7792 {} 7793 } 7794 }, 7795 [ALC275_FIXUP_SONY_HWEQ] = { 7796 .type = HDA_FIXUP_FUNC, 7797 .v.func = alc269_fixup_hweq, 7798 .chained = true, 7799 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 7800 }, 7801 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { 7802 .type = HDA_FIXUP_FUNC, 7803 .v.func = alc_fixup_disable_aamix, 7804 .chained = true, 7805 .chain_id = ALC269_FIXUP_SONY_VAIO 7806 }, 7807 [ALC271_FIXUP_DMIC] = { 7808 .type = HDA_FIXUP_FUNC, 7809 .v.func = alc271_fixup_dmic, 7810 }, 7811 [ALC269_FIXUP_PCM_44K] = { 7812 .type = HDA_FIXUP_FUNC, 7813 .v.func = alc269_fixup_pcm_44k, 7814 .chained = true, 7815 .chain_id = ALC269_FIXUP_QUANTA_MUTE 7816 }, 7817 [ALC269_FIXUP_STEREO_DMIC] = { 7818 .type = HDA_FIXUP_FUNC, 7819 .v.func = alc269_fixup_stereo_dmic, 7820 }, 7821 [ALC269_FIXUP_HEADSET_MIC] = { 7822 .type = HDA_FIXUP_FUNC, 7823 .v.func = alc269_fixup_headset_mic, 7824 }, 7825 [ALC269_FIXUP_QUANTA_MUTE] = { 7826 .type = HDA_FIXUP_FUNC, 7827 .v.func = alc269_fixup_quanta_mute, 7828 }, 7829 [ALC269_FIXUP_LIFEBOOK] = { 7830 .type = HDA_FIXUP_PINS, 7831 .v.pins = (const struct hda_pintbl[]) { 7832 { 0x1a, 0x2101103f }, /* dock line-out */ 7833 { 0x1b, 0x23a11040 }, /* dock mic-in */ 7834 { } 7835 }, 7836 .chained = true, 7837 .chain_id = ALC269_FIXUP_QUANTA_MUTE 7838 }, 7839 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { 7840 .type = HDA_FIXUP_PINS, 7841 .v.pins = (const struct hda_pintbl[]) { 7842 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ 7843 { } 7844 }, 7845 }, 7846 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { 7847 .type = HDA_FIXUP_PINS, 7848 .v.pins = (const struct hda_pintbl[]) { 7849 { 0x21, 0x0221102f }, /* HP out */ 7850 { } 7851 }, 7852 }, 7853 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { 7854 .type = HDA_FIXUP_FUNC, 7855 .v.func = alc269_fixup_pincfg_no_hp_to_lineout, 7856 }, 7857 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { 7858 .type = HDA_FIXUP_FUNC, 7859 .v.func = alc269_fixup_pincfg_U7x7_headset_mic, 7860 }, 7861 [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = { 7862 .type = HDA_FIXUP_PINS, 7863 .v.pins = (const struct hda_pintbl[]) { 7864 { 0x18, 0x03a19020 }, /* headset mic */ 7865 { 0x1b, 0x90170150 }, /* speaker */ 7866 { } 7867 }, 7868 }, 7869 [ALC269_FIXUP_AMIC] = { 7870 .type = HDA_FIXUP_PINS, 7871 .v.pins = (const struct hda_pintbl[]) { 7872 { 0x14, 0x99130110 }, /* speaker */ 7873 { 0x15, 0x0121401f }, /* HP out */ 7874 { 0x18, 0x01a19c20 }, /* mic */ 7875 { 0x19, 0x99a3092f }, /* int-mic */ 7876 { } 7877 }, 7878 }, 7879 [ALC269_FIXUP_DMIC] = { 7880 .type = HDA_FIXUP_PINS, 7881 .v.pins = (const struct hda_pintbl[]) { 7882 { 0x12, 0x99a3092f }, /* int-mic */ 7883 { 0x14, 0x99130110 }, /* speaker */ 7884 { 0x15, 0x0121401f }, /* HP out */ 7885 { 0x18, 0x01a19c20 }, /* mic */ 7886 { } 7887 }, 7888 }, 7889 [ALC269VB_FIXUP_AMIC] = { 7890 .type = HDA_FIXUP_PINS, 7891 .v.pins = (const struct hda_pintbl[]) { 7892 { 0x14, 0x99130110 }, /* speaker */ 7893 { 0x18, 0x01a19c20 }, /* mic */ 7894 { 0x19, 0x99a3092f }, /* int-mic */ 7895 { 0x21, 0x0121401f }, /* HP out */ 7896 { } 7897 }, 7898 }, 7899 [ALC269VB_FIXUP_DMIC] = { 7900 .type = HDA_FIXUP_PINS, 7901 .v.pins = (const struct hda_pintbl[]) { 7902 { 0x12, 0x99a3092f }, /* int-mic */ 7903 { 0x14, 0x99130110 }, /* speaker */ 7904 { 0x18, 0x01a19c20 }, /* mic */ 7905 { 0x21, 0x0121401f }, /* HP out */ 7906 { } 7907 }, 7908 }, 7909 [ALC269_FIXUP_HP_MUTE_LED] = { 7910 .type = HDA_FIXUP_FUNC, 7911 .v.func = alc269_fixup_hp_mute_led, 7912 }, 7913 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { 7914 .type = HDA_FIXUP_FUNC, 7915 .v.func = alc269_fixup_hp_mute_led_mic1, 7916 }, 7917 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { 7918 .type = HDA_FIXUP_FUNC, 7919 .v.func = alc269_fixup_hp_mute_led_mic2, 7920 }, 7921 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { 7922 .type = HDA_FIXUP_FUNC, 7923 .v.func = alc269_fixup_hp_mute_led_mic3, 7924 .chained = true, 7925 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE 7926 }, 7927 [ALC269_FIXUP_HP_GPIO_LED] = { 7928 .type = HDA_FIXUP_FUNC, 7929 .v.func = alc269_fixup_hp_gpio_led, 7930 }, 7931 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { 7932 .type = HDA_FIXUP_FUNC, 7933 .v.func = alc269_fixup_hp_gpio_mic1_led, 7934 }, 7935 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { 7936 .type = HDA_FIXUP_FUNC, 7937 .v.func = alc269_fixup_hp_line1_mic1_led, 7938 }, 7939 [ALC269_FIXUP_INV_DMIC] = { 7940 .type = HDA_FIXUP_FUNC, 7941 .v.func = alc_fixup_inv_dmic, 7942 }, 7943 [ALC269_FIXUP_NO_SHUTUP] = { 7944 .type = HDA_FIXUP_FUNC, 7945 .v.func = alc_fixup_no_shutup, 7946 }, 7947 [ALC269_FIXUP_LENOVO_DOCK] = { 7948 .type = HDA_FIXUP_PINS, 7949 .v.pins = (const struct hda_pintbl[]) { 7950 { 0x19, 0x23a11040 }, /* dock mic */ 7951 { 0x1b, 0x2121103f }, /* dock headphone */ 7952 { } 7953 }, 7954 .chained = true, 7955 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT 7956 }, 7957 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { 7958 .type = HDA_FIXUP_FUNC, 7959 .v.func = alc269_fixup_limit_int_mic_boost, 7960 .chained = true, 7961 .chain_id = ALC269_FIXUP_LENOVO_DOCK, 7962 }, 7963 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { 7964 .type = HDA_FIXUP_FUNC, 7965 .v.func = alc269_fixup_pincfg_no_hp_to_lineout, 7966 .chained = true, 7967 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 7968 }, 7969 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { 7970 .type = HDA_FIXUP_PINS, 7971 .v.pins = (const struct hda_pintbl[]) { 7972 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7973 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 7974 { } 7975 }, 7976 .chained = true, 7977 .chain_id = ALC269_FIXUP_HEADSET_MODE 7978 }, 7979 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { 7980 .type = HDA_FIXUP_PINS, 7981 .v.pins = (const struct hda_pintbl[]) { 7982 { 0x16, 0x21014020 }, /* dock line out */ 7983 { 0x19, 0x21a19030 }, /* dock mic */ 7984 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7985 { } 7986 }, 7987 .chained = true, 7988 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 7989 }, 7990 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { 7991 .type = HDA_FIXUP_PINS, 7992 .v.pins = (const struct hda_pintbl[]) { 7993 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7994 { } 7995 }, 7996 .chained = true, 7997 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 7998 }, 7999 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { 8000 .type = HDA_FIXUP_PINS, 8001 .v.pins = (const struct hda_pintbl[]) { 8002 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8003 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8004 { } 8005 }, 8006 .chained = true, 8007 .chain_id = ALC269_FIXUP_HEADSET_MODE 8008 }, 8009 [ALC269_FIXUP_HEADSET_MODE] = { 8010 .type = HDA_FIXUP_FUNC, 8011 .v.func = alc_fixup_headset_mode, 8012 .chained = true, 8013 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8014 }, 8015 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { 8016 .type = HDA_FIXUP_FUNC, 8017 .v.func = alc_fixup_headset_mode_no_hp_mic, 8018 }, 8019 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { 8020 .type = HDA_FIXUP_PINS, 8021 .v.pins = (const struct hda_pintbl[]) { 8022 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ 8023 { } 8024 }, 8025 .chained = true, 8026 .chain_id = ALC269_FIXUP_HEADSET_MODE, 8027 }, 8028 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { 8029 .type = HDA_FIXUP_PINS, 8030 .v.pins = (const struct hda_pintbl[]) { 8031 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8032 { } 8033 }, 8034 .chained = true, 8035 .chain_id = ALC269_FIXUP_HEADSET_MIC 8036 }, 8037 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { 8038 .type = HDA_FIXUP_PINS, 8039 .v.pins = (const struct hda_pintbl[]) { 8040 {0x12, 0x90a60130}, 8041 {0x13, 0x40000000}, 8042 {0x14, 0x90170110}, 8043 {0x18, 0x411111f0}, 8044 {0x19, 0x04a11040}, 8045 {0x1a, 0x411111f0}, 8046 {0x1b, 0x90170112}, 8047 {0x1d, 0x40759a05}, 8048 {0x1e, 0x411111f0}, 8049 {0x21, 0x04211020}, 8050 { } 8051 }, 8052 .chained = true, 8053 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8054 }, 8055 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { 8056 .type = HDA_FIXUP_FUNC, 8057 .v.func = alc298_fixup_huawei_mbx_stereo, 8058 .chained = true, 8059 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8060 }, 8061 [ALC269_FIXUP_ASUS_X101_FUNC] = { 8062 .type = HDA_FIXUP_FUNC, 8063 .v.func = alc269_fixup_x101_headset_mic, 8064 }, 8065 [ALC269_FIXUP_ASUS_X101_VERB] = { 8066 .type = HDA_FIXUP_VERBS, 8067 .v.verbs = (const struct hda_verb[]) { 8068 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, 8069 {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, 8070 {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, 8071 { } 8072 }, 8073 .chained = true, 8074 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC 8075 }, 8076 [ALC269_FIXUP_ASUS_X101] = { 8077 .type = HDA_FIXUP_PINS, 8078 .v.pins = (const struct hda_pintbl[]) { 8079 { 0x18, 0x04a1182c }, /* Headset mic */ 8080 { } 8081 }, 8082 .chained = true, 8083 .chain_id = ALC269_FIXUP_ASUS_X101_VERB 8084 }, 8085 [ALC271_FIXUP_AMIC_MIC2] = { 8086 .type = HDA_FIXUP_PINS, 8087 .v.pins = (const struct hda_pintbl[]) { 8088 { 0x14, 0x99130110 }, /* speaker */ 8089 { 0x19, 0x01a19c20 }, /* mic */ 8090 { 0x1b, 0x99a7012f }, /* int-mic */ 8091 { 0x21, 0x0121401f }, /* HP out */ 8092 { } 8093 }, 8094 }, 8095 [ALC271_FIXUP_HP_GATE_MIC_JACK] = { 8096 .type = HDA_FIXUP_FUNC, 8097 .v.func = alc271_hp_gate_mic_jack, 8098 .chained = true, 8099 .chain_id = ALC271_FIXUP_AMIC_MIC2, 8100 }, 8101 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { 8102 .type = HDA_FIXUP_FUNC, 8103 .v.func = alc269_fixup_limit_int_mic_boost, 8104 .chained = true, 8105 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, 8106 }, 8107 [ALC269_FIXUP_ACER_AC700] = { 8108 .type = HDA_FIXUP_PINS, 8109 .v.pins = (const struct hda_pintbl[]) { 8110 { 0x12, 0x99a3092f }, /* int-mic */ 8111 { 0x14, 0x99130110 }, /* speaker */ 8112 { 0x18, 0x03a11c20 }, /* mic */ 8113 { 0x1e, 0x0346101e }, /* SPDIF1 */ 8114 { 0x21, 0x0321101f }, /* HP out */ 8115 { } 8116 }, 8117 .chained = true, 8118 .chain_id = ALC271_FIXUP_DMIC, 8119 }, 8120 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { 8121 .type = HDA_FIXUP_FUNC, 8122 .v.func = alc269_fixup_limit_int_mic_boost, 8123 .chained = true, 8124 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 8125 }, 8126 [ALC269VB_FIXUP_ASUS_ZENBOOK] = { 8127 .type = HDA_FIXUP_FUNC, 8128 .v.func = alc269_fixup_limit_int_mic_boost, 8129 .chained = true, 8130 .chain_id = ALC269VB_FIXUP_DMIC, 8131 }, 8132 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { 8133 .type = HDA_FIXUP_VERBS, 8134 .v.verbs = (const struct hda_verb[]) { 8135 /* class-D output amp +5dB */ 8136 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, 8137 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, 8138 {} 8139 }, 8140 .chained = true, 8141 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, 8142 }, 8143 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = { 8144 .type = HDA_FIXUP_PINS, 8145 .v.pins = (const struct hda_pintbl[]) { 8146 { 0x18, 0x01a110f0 }, /* use as headset mic */ 8147 { } 8148 }, 8149 .chained = true, 8150 .chain_id = ALC269_FIXUP_HEADSET_MIC 8151 }, 8152 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { 8153 .type = HDA_FIXUP_FUNC, 8154 .v.func = alc269_fixup_limit_int_mic_boost, 8155 .chained = true, 8156 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, 8157 }, 8158 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { 8159 .type = HDA_FIXUP_PINS, 8160 .v.pins = (const struct hda_pintbl[]) { 8161 { 0x12, 0x99a3092f }, /* int-mic */ 8162 { 0x18, 0x03a11d20 }, /* mic */ 8163 { 0x19, 0x411111f0 }, /* Unused bogus pin */ 8164 { } 8165 }, 8166 }, 8167 [ALC283_FIXUP_CHROME_BOOK] = { 8168 .type = HDA_FIXUP_FUNC, 8169 .v.func = alc283_fixup_chromebook, 8170 }, 8171 [ALC283_FIXUP_SENSE_COMBO_JACK] = { 8172 .type = HDA_FIXUP_FUNC, 8173 .v.func = alc283_fixup_sense_combo_jack, 8174 .chained = true, 8175 .chain_id = ALC283_FIXUP_CHROME_BOOK, 8176 }, 8177 [ALC282_FIXUP_ASUS_TX300] = { 8178 .type = HDA_FIXUP_FUNC, 8179 .v.func = alc282_fixup_asus_tx300, 8180 }, 8181 [ALC283_FIXUP_INT_MIC] = { 8182 .type = HDA_FIXUP_VERBS, 8183 .v.verbs = (const struct hda_verb[]) { 8184 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, 8185 {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, 8186 { } 8187 }, 8188 .chained = true, 8189 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 8190 }, 8191 [ALC290_FIXUP_SUBWOOFER_HSJACK] = { 8192 .type = HDA_FIXUP_PINS, 8193 .v.pins = (const struct hda_pintbl[]) { 8194 { 0x17, 0x90170112 }, /* subwoofer */ 8195 { } 8196 }, 8197 .chained = true, 8198 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, 8199 }, 8200 [ALC290_FIXUP_SUBWOOFER] = { 8201 .type = HDA_FIXUP_PINS, 8202 .v.pins = (const struct hda_pintbl[]) { 8203 { 0x17, 0x90170112 }, /* subwoofer */ 8204 { } 8205 }, 8206 .chained = true, 8207 .chain_id = ALC290_FIXUP_MONO_SPEAKERS, 8208 }, 8209 [ALC290_FIXUP_MONO_SPEAKERS] = { 8210 .type = HDA_FIXUP_FUNC, 8211 .v.func = alc290_fixup_mono_speakers, 8212 }, 8213 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { 8214 .type = HDA_FIXUP_FUNC, 8215 .v.func = alc290_fixup_mono_speakers, 8216 .chained = true, 8217 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 8218 }, 8219 [ALC269_FIXUP_THINKPAD_ACPI] = { 8220 .type = HDA_FIXUP_FUNC, 8221 .v.func = alc_fixup_thinkpad_acpi, 8222 .chained = true, 8223 .chain_id = ALC269_FIXUP_SKU_IGNORE, 8224 }, 8225 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { 8226 .type = HDA_FIXUP_FUNC, 8227 .v.func = alc_fixup_inv_dmic, 8228 .chained = true, 8229 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 8230 }, 8231 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { 8232 .type = HDA_FIXUP_PINS, 8233 .v.pins = (const struct hda_pintbl[]) { 8234 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8235 { } 8236 }, 8237 .chained = true, 8238 .chain_id = ALC255_FIXUP_HEADSET_MODE 8239 }, 8240 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { 8241 .type = HDA_FIXUP_PINS, 8242 .v.pins = (const struct hda_pintbl[]) { 8243 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8244 { } 8245 }, 8246 .chained = true, 8247 .chain_id = ALC255_FIXUP_HEADSET_MODE 8248 }, 8249 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8250 .type = HDA_FIXUP_PINS, 8251 .v.pins = (const struct hda_pintbl[]) { 8252 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8253 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8254 { } 8255 }, 8256 .chained = true, 8257 .chain_id = ALC255_FIXUP_HEADSET_MODE 8258 }, 8259 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { 8260 .type = HDA_FIXUP_PINS, 8261 .v.pins = (const struct hda_pintbl[]) { 8262 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8263 { } 8264 }, 8265 .chained = true, 8266 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC 8267 }, 8268 [ALC255_FIXUP_HEADSET_MODE] = { 8269 .type = HDA_FIXUP_FUNC, 8270 .v.func = alc_fixup_headset_mode_alc255, 8271 .chained = true, 8272 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8273 }, 8274 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { 8275 .type = HDA_FIXUP_FUNC, 8276 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, 8277 }, 8278 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8279 .type = HDA_FIXUP_PINS, 8280 .v.pins = (const struct hda_pintbl[]) { 8281 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8282 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8283 { } 8284 }, 8285 .chained = true, 8286 .chain_id = ALC269_FIXUP_HEADSET_MODE 8287 }, 8288 [ALC292_FIXUP_TPT440_DOCK] = { 8289 .type = HDA_FIXUP_FUNC, 8290 .v.func = alc_fixup_tpt440_dock, 8291 .chained = true, 8292 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 8293 }, 8294 [ALC292_FIXUP_TPT440] = { 8295 .type = HDA_FIXUP_FUNC, 8296 .v.func = alc_fixup_disable_aamix, 8297 .chained = true, 8298 .chain_id = ALC292_FIXUP_TPT440_DOCK, 8299 }, 8300 [ALC283_FIXUP_HEADSET_MIC] = { 8301 .type = HDA_FIXUP_PINS, 8302 .v.pins = (const struct hda_pintbl[]) { 8303 { 0x19, 0x04a110f0 }, 8304 { }, 8305 }, 8306 }, 8307 [ALC255_FIXUP_MIC_MUTE_LED] = { 8308 .type = HDA_FIXUP_FUNC, 8309 .v.func = alc_fixup_micmute_led, 8310 }, 8311 [ALC282_FIXUP_ASPIRE_V5_PINS] = { 8312 .type = HDA_FIXUP_PINS, 8313 .v.pins = (const struct hda_pintbl[]) { 8314 { 0x12, 0x90a60130 }, 8315 { 0x14, 0x90170110 }, 8316 { 0x17, 0x40000008 }, 8317 { 0x18, 0x411111f0 }, 8318 { 0x19, 0x01a1913c }, 8319 { 0x1a, 0x411111f0 }, 8320 { 0x1b, 0x411111f0 }, 8321 { 0x1d, 0x40f89b2d }, 8322 { 0x1e, 0x411111f0 }, 8323 { 0x21, 0x0321101f }, 8324 { }, 8325 }, 8326 }, 8327 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = { 8328 .type = HDA_FIXUP_FUNC, 8329 .v.func = alc269vb_fixup_aspire_e1_coef, 8330 }, 8331 [ALC280_FIXUP_HP_GPIO4] = { 8332 .type = HDA_FIXUP_FUNC, 8333 .v.func = alc280_fixup_hp_gpio4, 8334 }, 8335 [ALC286_FIXUP_HP_GPIO_LED] = { 8336 .type = HDA_FIXUP_FUNC, 8337 .v.func = alc286_fixup_hp_gpio_led, 8338 }, 8339 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { 8340 .type = HDA_FIXUP_FUNC, 8341 .v.func = alc280_fixup_hp_gpio2_mic_hotkey, 8342 }, 8343 [ALC280_FIXUP_HP_DOCK_PINS] = { 8344 .type = HDA_FIXUP_PINS, 8345 .v.pins = (const struct hda_pintbl[]) { 8346 { 0x1b, 0x21011020 }, /* line-out */ 8347 { 0x1a, 0x01a1903c }, /* headset mic */ 8348 { 0x18, 0x2181103f }, /* line-in */ 8349 { }, 8350 }, 8351 .chained = true, 8352 .chain_id = ALC280_FIXUP_HP_GPIO4 8353 }, 8354 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { 8355 .type = HDA_FIXUP_PINS, 8356 .v.pins = (const struct hda_pintbl[]) { 8357 { 0x1b, 0x21011020 }, /* line-out */ 8358 { 0x18, 0x2181103f }, /* line-in */ 8359 { }, 8360 }, 8361 .chained = true, 8362 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED 8363 }, 8364 [ALC280_FIXUP_HP_9480M] = { 8365 .type = HDA_FIXUP_FUNC, 8366 .v.func = alc280_fixup_hp_9480m, 8367 }, 8368 [ALC245_FIXUP_HP_X360_AMP] = { 8369 .type = HDA_FIXUP_FUNC, 8370 .v.func = alc245_fixup_hp_x360_amp, 8371 .chained = true, 8372 .chain_id = ALC245_FIXUP_HP_GPIO_LED 8373 }, 8374 [ALC288_FIXUP_DELL_HEADSET_MODE] = { 8375 .type = HDA_FIXUP_FUNC, 8376 .v.func = alc_fixup_headset_mode_dell_alc288, 8377 .chained = true, 8378 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 8379 }, 8380 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8381 .type = HDA_FIXUP_PINS, 8382 .v.pins = (const struct hda_pintbl[]) { 8383 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8384 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8385 { } 8386 }, 8387 .chained = true, 8388 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE 8389 }, 8390 [ALC288_FIXUP_DISABLE_AAMIX] = { 8391 .type = HDA_FIXUP_FUNC, 8392 .v.func = alc_fixup_disable_aamix, 8393 .chained = true, 8394 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE 8395 }, 8396 [ALC288_FIXUP_DELL_XPS_13] = { 8397 .type = HDA_FIXUP_FUNC, 8398 .v.func = alc_fixup_dell_xps13, 8399 .chained = true, 8400 .chain_id = ALC288_FIXUP_DISABLE_AAMIX 8401 }, 8402 [ALC292_FIXUP_DISABLE_AAMIX] = { 8403 .type = HDA_FIXUP_FUNC, 8404 .v.func = alc_fixup_disable_aamix, 8405 .chained = true, 8406 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE 8407 }, 8408 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { 8409 .type = HDA_FIXUP_FUNC, 8410 .v.func = alc_fixup_disable_aamix, 8411 .chained = true, 8412 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE 8413 }, 8414 [ALC292_FIXUP_DELL_E7X_AAMIX] = { 8415 .type = HDA_FIXUP_FUNC, 8416 .v.func = alc_fixup_dell_xps13, 8417 .chained = true, 8418 .chain_id = ALC292_FIXUP_DISABLE_AAMIX 8419 }, 8420 [ALC292_FIXUP_DELL_E7X] = { 8421 .type = HDA_FIXUP_FUNC, 8422 .v.func = alc_fixup_micmute_led, 8423 /* micmute fixup must be applied at last */ 8424 .chained_before = true, 8425 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, 8426 }, 8427 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { 8428 .type = HDA_FIXUP_PINS, 8429 .v.pins = (const struct hda_pintbl[]) { 8430 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ 8431 { } 8432 }, 8433 .chained_before = true, 8434 .chain_id = ALC269_FIXUP_HEADSET_MODE, 8435 }, 8436 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8437 .type = HDA_FIXUP_PINS, 8438 .v.pins = (const struct hda_pintbl[]) { 8439 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8440 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8441 { } 8442 }, 8443 .chained = true, 8444 .chain_id = ALC269_FIXUP_HEADSET_MODE 8445 }, 8446 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { 8447 .type = HDA_FIXUP_PINS, 8448 .v.pins = (const struct hda_pintbl[]) { 8449 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8450 { } 8451 }, 8452 .chained = true, 8453 .chain_id = ALC269_FIXUP_HEADSET_MODE 8454 }, 8455 [ALC275_FIXUP_DELL_XPS] = { 8456 .type = HDA_FIXUP_VERBS, 8457 .v.verbs = (const struct hda_verb[]) { 8458 /* Enables internal speaker */ 8459 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, 8460 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, 8461 {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, 8462 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, 8463 {} 8464 } 8465 }, 8466 [ALC293_FIXUP_LENOVO_SPK_NOISE] = { 8467 .type = HDA_FIXUP_FUNC, 8468 .v.func = alc_fixup_disable_aamix, 8469 .chained = true, 8470 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 8471 }, 8472 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { 8473 .type = HDA_FIXUP_FUNC, 8474 .v.func = alc233_fixup_lenovo_line2_mic_hotkey, 8475 }, 8476 [ALC233_FIXUP_INTEL_NUC8_DMIC] = { 8477 .type = HDA_FIXUP_FUNC, 8478 .v.func = alc_fixup_inv_dmic, 8479 .chained = true, 8480 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST, 8481 }, 8482 [ALC233_FIXUP_INTEL_NUC8_BOOST] = { 8483 .type = HDA_FIXUP_FUNC, 8484 .v.func = alc269_fixup_limit_int_mic_boost 8485 }, 8486 [ALC255_FIXUP_DELL_SPK_NOISE] = { 8487 .type = HDA_FIXUP_FUNC, 8488 .v.func = alc_fixup_disable_aamix, 8489 .chained = true, 8490 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 8491 }, 8492 [ALC225_FIXUP_DISABLE_MIC_VREF] = { 8493 .type = HDA_FIXUP_FUNC, 8494 .v.func = alc_fixup_disable_mic_vref, 8495 .chained = true, 8496 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE 8497 }, 8498 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { 8499 .type = HDA_FIXUP_VERBS, 8500 .v.verbs = (const struct hda_verb[]) { 8501 /* Disable pass-through path for FRONT 14h */ 8502 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, 8503 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, 8504 {} 8505 }, 8506 .chained = true, 8507 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF 8508 }, 8509 [ALC280_FIXUP_HP_HEADSET_MIC] = { 8510 .type = HDA_FIXUP_FUNC, 8511 .v.func = alc_fixup_disable_aamix, 8512 .chained = true, 8513 .chain_id = ALC269_FIXUP_HEADSET_MIC, 8514 }, 8515 [ALC221_FIXUP_HP_FRONT_MIC] = { 8516 .type = HDA_FIXUP_PINS, 8517 .v.pins = (const struct hda_pintbl[]) { 8518 { 0x19, 0x02a19020 }, /* Front Mic */ 8519 { } 8520 }, 8521 }, 8522 [ALC292_FIXUP_TPT460] = { 8523 .type = HDA_FIXUP_FUNC, 8524 .v.func = alc_fixup_tpt440_dock, 8525 .chained = true, 8526 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, 8527 }, 8528 [ALC298_FIXUP_SPK_VOLUME] = { 8529 .type = HDA_FIXUP_FUNC, 8530 .v.func = alc298_fixup_speaker_volume, 8531 .chained = true, 8532 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, 8533 }, 8534 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = { 8535 .type = HDA_FIXUP_FUNC, 8536 .v.func = alc298_fixup_speaker_volume, 8537 }, 8538 [ALC295_FIXUP_DISABLE_DAC3] = { 8539 .type = HDA_FIXUP_FUNC, 8540 .v.func = alc295_fixup_disable_dac3, 8541 }, 8542 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { 8543 .type = HDA_FIXUP_FUNC, 8544 .v.func = alc285_fixup_speaker2_to_dac1, 8545 .chained = true, 8546 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 8547 }, 8548 [ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = { 8549 .type = HDA_FIXUP_FUNC, 8550 .v.func = alc285_fixup_speaker2_to_dac1, 8551 .chained = true, 8552 .chain_id = ALC245_FIXUP_CS35L41_SPI_2 8553 }, 8554 [ALC285_FIXUP_ASUS_HEADSET_MIC] = { 8555 .type = HDA_FIXUP_PINS, 8556 .v.pins = (const struct hda_pintbl[]) { 8557 { 0x19, 0x03a11050 }, 8558 { 0x1b, 0x03a11c30 }, 8559 { } 8560 }, 8561 .chained = true, 8562 .chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1 8563 }, 8564 [ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = { 8565 .type = HDA_FIXUP_PINS, 8566 .v.pins = (const struct hda_pintbl[]) { 8567 { 0x14, 0x90170120 }, 8568 { } 8569 }, 8570 .chained = true, 8571 .chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC 8572 }, 8573 [ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = { 8574 .type = HDA_FIXUP_FUNC, 8575 .v.func = alc285_fixup_speaker2_to_dac1, 8576 .chained = true, 8577 .chain_id = ALC287_FIXUP_CS35L41_I2C_2 8578 }, 8579 [ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = { 8580 .type = HDA_FIXUP_PINS, 8581 .v.pins = (const struct hda_pintbl[]) { 8582 { 0x19, 0x03a11050 }, 8583 { 0x1b, 0x03a11c30 }, 8584 { } 8585 }, 8586 .chained = true, 8587 .chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1 8588 }, 8589 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { 8590 .type = HDA_FIXUP_PINS, 8591 .v.pins = (const struct hda_pintbl[]) { 8592 { 0x1b, 0x90170151 }, 8593 { } 8594 }, 8595 .chained = true, 8596 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 8597 }, 8598 [ALC269_FIXUP_ATIV_BOOK_8] = { 8599 .type = HDA_FIXUP_FUNC, 8600 .v.func = alc_fixup_auto_mute_via_amp, 8601 .chained = true, 8602 .chain_id = ALC269_FIXUP_NO_SHUTUP 8603 }, 8604 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = { 8605 .type = HDA_FIXUP_PINS, 8606 .v.pins = (const struct hda_pintbl[]) { 8607 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8608 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */ 8609 { } 8610 }, 8611 .chained = true, 8612 .chain_id = ALC269_FIXUP_HEADSET_MODE 8613 }, 8614 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { 8615 .type = HDA_FIXUP_PINS, 8616 .v.pins = (const struct hda_pintbl[]) { 8617 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8618 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 8619 { } 8620 }, 8621 .chained = true, 8622 .chain_id = ALC269_FIXUP_HEADSET_MODE 8623 }, 8624 [ALC256_FIXUP_ASUS_HEADSET_MODE] = { 8625 .type = HDA_FIXUP_FUNC, 8626 .v.func = alc_fixup_headset_mode, 8627 }, 8628 [ALC256_FIXUP_ASUS_MIC] = { 8629 .type = HDA_FIXUP_PINS, 8630 .v.pins = (const struct hda_pintbl[]) { 8631 { 0x13, 0x90a60160 }, /* use as internal mic */ 8632 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 8633 { } 8634 }, 8635 .chained = true, 8636 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 8637 }, 8638 [ALC256_FIXUP_ASUS_AIO_GPIO2] = { 8639 .type = HDA_FIXUP_FUNC, 8640 /* Set up GPIO2 for the speaker amp */ 8641 .v.func = alc_fixup_gpio4, 8642 }, 8643 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { 8644 .type = HDA_FIXUP_PINS, 8645 .v.pins = (const struct hda_pintbl[]) { 8646 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8647 { } 8648 }, 8649 .chained = true, 8650 .chain_id = ALC269_FIXUP_HEADSET_MIC 8651 }, 8652 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { 8653 .type = HDA_FIXUP_VERBS, 8654 .v.verbs = (const struct hda_verb[]) { 8655 /* Enables internal speaker */ 8656 {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, 8657 {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, 8658 {} 8659 }, 8660 .chained = true, 8661 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE 8662 }, 8663 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { 8664 .type = HDA_FIXUP_FUNC, 8665 .v.func = alc233_alc662_fixup_lenovo_dual_codecs, 8666 .chained = true, 8667 .chain_id = ALC269_FIXUP_GPIO2 8668 }, 8669 [ALC233_FIXUP_ACER_HEADSET_MIC] = { 8670 .type = HDA_FIXUP_VERBS, 8671 .v.verbs = (const struct hda_verb[]) { 8672 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 8673 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 8674 { } 8675 }, 8676 .chained = true, 8677 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE 8678 }, 8679 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { 8680 .type = HDA_FIXUP_PINS, 8681 .v.pins = (const struct hda_pintbl[]) { 8682 /* Change the mic location from front to right, otherwise there are 8683 two front mics with the same name, pulseaudio can't handle them. 8684 This is just a temporary workaround, after applying this fixup, 8685 there will be one "Front Mic" and one "Mic" in this machine. 8686 */ 8687 { 0x1a, 0x04a19040 }, 8688 { } 8689 }, 8690 }, 8691 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { 8692 .type = HDA_FIXUP_PINS, 8693 .v.pins = (const struct hda_pintbl[]) { 8694 { 0x16, 0x0101102f }, /* Rear Headset HP */ 8695 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ 8696 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ 8697 { 0x1b, 0x02011020 }, 8698 { } 8699 }, 8700 .chained = true, 8701 .chain_id = ALC225_FIXUP_S3_POP_NOISE 8702 }, 8703 [ALC225_FIXUP_S3_POP_NOISE] = { 8704 .type = HDA_FIXUP_FUNC, 8705 .v.func = alc225_fixup_s3_pop_noise, 8706 .chained = true, 8707 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8708 }, 8709 [ALC700_FIXUP_INTEL_REFERENCE] = { 8710 .type = HDA_FIXUP_VERBS, 8711 .v.verbs = (const struct hda_verb[]) { 8712 /* Enables internal speaker */ 8713 {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, 8714 {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, 8715 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, 8716 {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, 8717 {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, 8718 {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, 8719 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, 8720 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, 8721 {} 8722 } 8723 }, 8724 [ALC274_FIXUP_DELL_BIND_DACS] = { 8725 .type = HDA_FIXUP_FUNC, 8726 .v.func = alc274_fixup_bind_dacs, 8727 .chained = true, 8728 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE 8729 }, 8730 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { 8731 .type = HDA_FIXUP_PINS, 8732 .v.pins = (const struct hda_pintbl[]) { 8733 { 0x1b, 0x0401102f }, 8734 { } 8735 }, 8736 .chained = true, 8737 .chain_id = ALC274_FIXUP_DELL_BIND_DACS 8738 }, 8739 [ALC298_FIXUP_TPT470_DOCK_FIX] = { 8740 .type = HDA_FIXUP_FUNC, 8741 .v.func = alc_fixup_tpt470_dock, 8742 .chained = true, 8743 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE 8744 }, 8745 [ALC298_FIXUP_TPT470_DOCK] = { 8746 .type = HDA_FIXUP_FUNC, 8747 .v.func = alc_fixup_tpt470_dacs, 8748 .chained = true, 8749 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX 8750 }, 8751 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { 8752 .type = HDA_FIXUP_PINS, 8753 .v.pins = (const struct hda_pintbl[]) { 8754 { 0x14, 0x0201101f }, 8755 { } 8756 }, 8757 .chained = true, 8758 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 8759 }, 8760 [ALC255_FIXUP_DELL_HEADSET_MIC] = { 8761 .type = HDA_FIXUP_PINS, 8762 .v.pins = (const struct hda_pintbl[]) { 8763 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8764 { } 8765 }, 8766 .chained = true, 8767 .chain_id = ALC269_FIXUP_HEADSET_MIC 8768 }, 8769 [ALC295_FIXUP_HP_X360] = { 8770 .type = HDA_FIXUP_FUNC, 8771 .v.func = alc295_fixup_hp_top_speakers, 8772 .chained = true, 8773 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 8774 }, 8775 [ALC221_FIXUP_HP_HEADSET_MIC] = { 8776 .type = HDA_FIXUP_PINS, 8777 .v.pins = (const struct hda_pintbl[]) { 8778 { 0x19, 0x0181313f}, 8779 { } 8780 }, 8781 .chained = true, 8782 .chain_id = ALC269_FIXUP_HEADSET_MIC 8783 }, 8784 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { 8785 .type = HDA_FIXUP_FUNC, 8786 .v.func = alc285_fixup_invalidate_dacs, 8787 .chained = true, 8788 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 8789 }, 8790 [ALC295_FIXUP_HP_AUTO_MUTE] = { 8791 .type = HDA_FIXUP_FUNC, 8792 .v.func = alc_fixup_auto_mute_via_amp, 8793 }, 8794 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { 8795 .type = HDA_FIXUP_PINS, 8796 .v.pins = (const struct hda_pintbl[]) { 8797 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8798 { } 8799 }, 8800 .chained = true, 8801 .chain_id = ALC269_FIXUP_HEADSET_MIC 8802 }, 8803 [ALC294_FIXUP_ASUS_MIC] = { 8804 .type = HDA_FIXUP_PINS, 8805 .v.pins = (const struct hda_pintbl[]) { 8806 { 0x13, 0x90a60160 }, /* use as internal mic */ 8807 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 8808 { } 8809 }, 8810 .chained = true, 8811 .chain_id = ALC269_FIXUP_HEADSET_MIC 8812 }, 8813 [ALC294_FIXUP_ASUS_HEADSET_MIC] = { 8814 .type = HDA_FIXUP_PINS, 8815 .v.pins = (const struct hda_pintbl[]) { 8816 { 0x19, 0x01a1103c }, /* use as headset mic */ 8817 { } 8818 }, 8819 .chained = true, 8820 .chain_id = ALC269_FIXUP_HEADSET_MIC 8821 }, 8822 [ALC294_FIXUP_ASUS_SPK] = { 8823 .type = HDA_FIXUP_VERBS, 8824 .v.verbs = (const struct hda_verb[]) { 8825 /* Set EAPD high */ 8826 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, 8827 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, 8828 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 8829 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, 8830 { } 8831 }, 8832 .chained = true, 8833 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 8834 }, 8835 [ALC295_FIXUP_CHROME_BOOK] = { 8836 .type = HDA_FIXUP_FUNC, 8837 .v.func = alc295_fixup_chromebook, 8838 .chained = true, 8839 .chain_id = ALC225_FIXUP_HEADSET_JACK 8840 }, 8841 [ALC225_FIXUP_HEADSET_JACK] = { 8842 .type = HDA_FIXUP_FUNC, 8843 .v.func = alc_fixup_headset_jack, 8844 }, 8845 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { 8846 .type = HDA_FIXUP_PINS, 8847 .v.pins = (const struct hda_pintbl[]) { 8848 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 8849 { } 8850 }, 8851 .chained = true, 8852 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8853 }, 8854 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { 8855 .type = HDA_FIXUP_VERBS, 8856 .v.verbs = (const struct hda_verb[]) { 8857 /* Disable PCBEEP-IN passthrough */ 8858 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, 8859 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, 8860 { } 8861 }, 8862 .chained = true, 8863 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE 8864 }, 8865 [ALC255_FIXUP_ACER_HEADSET_MIC] = { 8866 .type = HDA_FIXUP_PINS, 8867 .v.pins = (const struct hda_pintbl[]) { 8868 { 0x19, 0x03a11130 }, 8869 { 0x1a, 0x90a60140 }, /* use as internal mic */ 8870 { } 8871 }, 8872 .chained = true, 8873 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC 8874 }, 8875 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { 8876 .type = HDA_FIXUP_PINS, 8877 .v.pins = (const struct hda_pintbl[]) { 8878 { 0x16, 0x01011020 }, /* Rear Line out */ 8879 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ 8880 { } 8881 }, 8882 .chained = true, 8883 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE 8884 }, 8885 [ALC225_FIXUP_WYSE_AUTO_MUTE] = { 8886 .type = HDA_FIXUP_FUNC, 8887 .v.func = alc_fixup_auto_mute_via_amp, 8888 .chained = true, 8889 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF 8890 }, 8891 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { 8892 .type = HDA_FIXUP_FUNC, 8893 .v.func = alc_fixup_disable_mic_vref, 8894 .chained = true, 8895 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8896 }, 8897 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { 8898 .type = HDA_FIXUP_VERBS, 8899 .v.verbs = (const struct hda_verb[]) { 8900 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, 8901 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, 8902 { } 8903 }, 8904 .chained = true, 8905 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE 8906 }, 8907 [ALC256_FIXUP_ASUS_HEADSET_MIC] = { 8908 .type = HDA_FIXUP_PINS, 8909 .v.pins = (const struct hda_pintbl[]) { 8910 { 0x19, 0x03a11020 }, /* headset mic with jack detect */ 8911 { } 8912 }, 8913 .chained = true, 8914 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 8915 }, 8916 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { 8917 .type = HDA_FIXUP_PINS, 8918 .v.pins = (const struct hda_pintbl[]) { 8919 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 8920 { } 8921 }, 8922 .chained = true, 8923 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 8924 }, 8925 [ALC299_FIXUP_PREDATOR_SPK] = { 8926 .type = HDA_FIXUP_PINS, 8927 .v.pins = (const struct hda_pintbl[]) { 8928 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ 8929 { } 8930 } 8931 }, 8932 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { 8933 .type = HDA_FIXUP_PINS, 8934 .v.pins = (const struct hda_pintbl[]) { 8935 { 0x19, 0x04a11040 }, 8936 { 0x21, 0x04211020 }, 8937 { } 8938 }, 8939 .chained = true, 8940 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 8941 }, 8942 [ALC289_FIXUP_DELL_SPK1] = { 8943 .type = HDA_FIXUP_PINS, 8944 .v.pins = (const struct hda_pintbl[]) { 8945 { 0x14, 0x90170140 }, 8946 { } 8947 }, 8948 .chained = true, 8949 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE 8950 }, 8951 [ALC289_FIXUP_DELL_SPK2] = { 8952 .type = HDA_FIXUP_PINS, 8953 .v.pins = (const struct hda_pintbl[]) { 8954 { 0x17, 0x90170130 }, /* bass spk */ 8955 { } 8956 }, 8957 .chained = true, 8958 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE 8959 }, 8960 [ALC289_FIXUP_DUAL_SPK] = { 8961 .type = HDA_FIXUP_FUNC, 8962 .v.func = alc285_fixup_speaker2_to_dac1, 8963 .chained = true, 8964 .chain_id = ALC289_FIXUP_DELL_SPK2 8965 }, 8966 [ALC289_FIXUP_RTK_AMP_DUAL_SPK] = { 8967 .type = HDA_FIXUP_FUNC, 8968 .v.func = alc285_fixup_speaker2_to_dac1, 8969 .chained = true, 8970 .chain_id = ALC289_FIXUP_DELL_SPK1 8971 }, 8972 [ALC294_FIXUP_SPK2_TO_DAC1] = { 8973 .type = HDA_FIXUP_FUNC, 8974 .v.func = alc285_fixup_speaker2_to_dac1, 8975 .chained = true, 8976 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 8977 }, 8978 [ALC294_FIXUP_ASUS_DUAL_SPK] = { 8979 .type = HDA_FIXUP_FUNC, 8980 /* The GPIO must be pulled to initialize the AMP */ 8981 .v.func = alc_fixup_gpio4, 8982 .chained = true, 8983 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 8984 }, 8985 [ALC294_FIXUP_ASUS_ALLY] = { 8986 .type = HDA_FIXUP_FUNC, 8987 .v.func = cs35l41_fixup_i2c_two, 8988 .chained = true, 8989 .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS 8990 }, 8991 [ALC294_FIXUP_ASUS_ALLY_PINS] = { 8992 .type = HDA_FIXUP_PINS, 8993 .v.pins = (const struct hda_pintbl[]) { 8994 { 0x19, 0x03a11050 }, 8995 { 0x1a, 0x03a11c30 }, 8996 { 0x21, 0x03211420 }, 8997 { } 8998 }, 8999 .chained = true, 9000 .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS 9001 }, 9002 [ALC294_FIXUP_ASUS_ALLY_VERBS] = { 9003 .type = HDA_FIXUP_VERBS, 9004 .v.verbs = (const struct hda_verb[]) { 9005 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 9006 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 9007 { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 }, 9008 { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 }, 9009 { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 }, 9010 { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a }, 9011 { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 }, 9012 { 0x20, AC_VERB_SET_PROC_COEF, 0x0049}, 9013 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a }, 9014 { 0x20, AC_VERB_SET_PROC_COEF, 0x201b }, 9015 { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b }, 9016 { 0x20, AC_VERB_SET_PROC_COEF, 0x4278}, 9017 { } 9018 }, 9019 .chained = true, 9020 .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER 9021 }, 9022 [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = { 9023 .type = HDA_FIXUP_FUNC, 9024 .v.func = alc285_fixup_speaker2_to_dac1, 9025 }, 9026 [ALC285_FIXUP_THINKPAD_X1_GEN7] = { 9027 .type = HDA_FIXUP_FUNC, 9028 .v.func = alc285_fixup_thinkpad_x1_gen7, 9029 .chained = true, 9030 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 9031 }, 9032 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { 9033 .type = HDA_FIXUP_FUNC, 9034 .v.func = alc_fixup_headset_jack, 9035 .chained = true, 9036 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 9037 }, 9038 [ALC294_FIXUP_ASUS_HPE] = { 9039 .type = HDA_FIXUP_VERBS, 9040 .v.verbs = (const struct hda_verb[]) { 9041 /* Set EAPD high */ 9042 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 9043 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, 9044 { } 9045 }, 9046 .chained = true, 9047 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 9048 }, 9049 [ALC294_FIXUP_ASUS_GX502_PINS] = { 9050 .type = HDA_FIXUP_PINS, 9051 .v.pins = (const struct hda_pintbl[]) { 9052 { 0x19, 0x03a11050 }, /* front HP mic */ 9053 { 0x1a, 0x01a11830 }, /* rear external mic */ 9054 { 0x21, 0x03211020 }, /* front HP out */ 9055 { } 9056 }, 9057 .chained = true, 9058 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS 9059 }, 9060 [ALC294_FIXUP_ASUS_GX502_VERBS] = { 9061 .type = HDA_FIXUP_VERBS, 9062 .v.verbs = (const struct hda_verb[]) { 9063 /* set 0x15 to HP-OUT ctrl */ 9064 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, 9065 /* unmute the 0x15 amp */ 9066 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, 9067 { } 9068 }, 9069 .chained = true, 9070 .chain_id = ALC294_FIXUP_ASUS_GX502_HP 9071 }, 9072 [ALC294_FIXUP_ASUS_GX502_HP] = { 9073 .type = HDA_FIXUP_FUNC, 9074 .v.func = alc294_fixup_gx502_hp, 9075 }, 9076 [ALC294_FIXUP_ASUS_GU502_PINS] = { 9077 .type = HDA_FIXUP_PINS, 9078 .v.pins = (const struct hda_pintbl[]) { 9079 { 0x19, 0x01a11050 }, /* rear HP mic */ 9080 { 0x1a, 0x01a11830 }, /* rear external mic */ 9081 { 0x21, 0x012110f0 }, /* rear HP out */ 9082 { } 9083 }, 9084 .chained = true, 9085 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS 9086 }, 9087 [ALC294_FIXUP_ASUS_GU502_VERBS] = { 9088 .type = HDA_FIXUP_VERBS, 9089 .v.verbs = (const struct hda_verb[]) { 9090 /* set 0x15 to HP-OUT ctrl */ 9091 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, 9092 /* unmute the 0x15 amp */ 9093 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, 9094 /* set 0x1b to HP-OUT */ 9095 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 }, 9096 { } 9097 }, 9098 .chained = true, 9099 .chain_id = ALC294_FIXUP_ASUS_GU502_HP 9100 }, 9101 [ALC294_FIXUP_ASUS_GU502_HP] = { 9102 .type = HDA_FIXUP_FUNC, 9103 .v.func = alc294_fixup_gu502_hp, 9104 }, 9105 [ALC294_FIXUP_ASUS_G513_PINS] = { 9106 .type = HDA_FIXUP_PINS, 9107 .v.pins = (const struct hda_pintbl[]) { 9108 { 0x19, 0x03a11050 }, /* front HP mic */ 9109 { 0x1a, 0x03a11c30 }, /* rear external mic */ 9110 { 0x21, 0x03211420 }, /* front HP out */ 9111 { } 9112 }, 9113 }, 9114 [ALC285_FIXUP_ASUS_G533Z_PINS] = { 9115 .type = HDA_FIXUP_PINS, 9116 .v.pins = (const struct hda_pintbl[]) { 9117 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */ 9118 { 0x19, 0x03a19020 }, /* Mic Boost Volume */ 9119 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */ 9120 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */ 9121 { 0x21, 0x03211420 }, 9122 { } 9123 }, 9124 }, 9125 [ALC294_FIXUP_ASUS_COEF_1B] = { 9126 .type = HDA_FIXUP_VERBS, 9127 .v.verbs = (const struct hda_verb[]) { 9128 /* Set bit 10 to correct noisy output after reboot from 9129 * Windows 10 (due to pop noise reduction?) 9130 */ 9131 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, 9132 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, 9133 { } 9134 }, 9135 .chained = true, 9136 .chain_id = ALC289_FIXUP_ASUS_GA401, 9137 }, 9138 [ALC285_FIXUP_HP_GPIO_LED] = { 9139 .type = HDA_FIXUP_FUNC, 9140 .v.func = alc285_fixup_hp_gpio_led, 9141 }, 9142 [ALC285_FIXUP_HP_MUTE_LED] = { 9143 .type = HDA_FIXUP_FUNC, 9144 .v.func = alc285_fixup_hp_mute_led, 9145 }, 9146 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = { 9147 .type = HDA_FIXUP_FUNC, 9148 .v.func = alc285_fixup_hp_spectre_x360_mute_led, 9149 }, 9150 [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = { 9151 .type = HDA_FIXUP_FUNC, 9152 .v.func = alc236_fixup_hp_mute_led_coefbit2, 9153 }, 9154 [ALC236_FIXUP_HP_GPIO_LED] = { 9155 .type = HDA_FIXUP_FUNC, 9156 .v.func = alc236_fixup_hp_gpio_led, 9157 }, 9158 [ALC236_FIXUP_HP_MUTE_LED] = { 9159 .type = HDA_FIXUP_FUNC, 9160 .v.func = alc236_fixup_hp_mute_led, 9161 }, 9162 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = { 9163 .type = HDA_FIXUP_FUNC, 9164 .v.func = alc236_fixup_hp_mute_led_micmute_vref, 9165 }, 9166 [ALC236_FIXUP_LENOVO_INV_DMIC] = { 9167 .type = HDA_FIXUP_FUNC, 9168 .v.func = alc_fixup_inv_dmic, 9169 .chained = true, 9170 .chain_id = ALC283_FIXUP_INT_MIC, 9171 }, 9172 [ALC298_FIXUP_SAMSUNG_AMP] = { 9173 .type = HDA_FIXUP_FUNC, 9174 .v.func = alc298_fixup_samsung_amp, 9175 .chained = true, 9176 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET 9177 }, 9178 [ALC298_FIXUP_SAMSUNG_AMP2] = { 9179 .type = HDA_FIXUP_FUNC, 9180 .v.func = alc298_fixup_samsung_amp2 9181 }, 9182 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { 9183 .type = HDA_FIXUP_VERBS, 9184 .v.verbs = (const struct hda_verb[]) { 9185 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, 9186 { } 9187 }, 9188 }, 9189 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { 9190 .type = HDA_FIXUP_VERBS, 9191 .v.verbs = (const struct hda_verb[]) { 9192 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08}, 9193 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf}, 9194 { } 9195 }, 9196 }, 9197 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { 9198 .type = HDA_FIXUP_PINS, 9199 .v.pins = (const struct hda_pintbl[]) { 9200 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9201 { } 9202 }, 9203 .chained = true, 9204 .chain_id = ALC269_FIXUP_HEADSET_MODE 9205 }, 9206 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { 9207 .type = HDA_FIXUP_PINS, 9208 .v.pins = (const struct hda_pintbl[]) { 9209 { 0x14, 0x90100120 }, /* use as internal speaker */ 9210 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ 9211 { 0x1a, 0x01011020 }, /* use as line out */ 9212 { }, 9213 }, 9214 .chained = true, 9215 .chain_id = ALC269_FIXUP_HEADSET_MIC 9216 }, 9217 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { 9218 .type = HDA_FIXUP_PINS, 9219 .v.pins = (const struct hda_pintbl[]) { 9220 { 0x18, 0x02a11030 }, /* use as headset mic */ 9221 { } 9222 }, 9223 .chained = true, 9224 .chain_id = ALC269_FIXUP_HEADSET_MIC 9225 }, 9226 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { 9227 .type = HDA_FIXUP_PINS, 9228 .v.pins = (const struct hda_pintbl[]) { 9229 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ 9230 { } 9231 }, 9232 .chained = true, 9233 .chain_id = ALC269_FIXUP_HEADSET_MIC 9234 }, 9235 [ALC289_FIXUP_ASUS_GA401] = { 9236 .type = HDA_FIXUP_FUNC, 9237 .v.func = alc289_fixup_asus_ga401, 9238 .chained = true, 9239 .chain_id = ALC289_FIXUP_ASUS_GA502, 9240 }, 9241 [ALC289_FIXUP_ASUS_GA502] = { 9242 .type = HDA_FIXUP_PINS, 9243 .v.pins = (const struct hda_pintbl[]) { 9244 { 0x19, 0x03a11020 }, /* headset mic with jack detect */ 9245 { } 9246 }, 9247 }, 9248 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { 9249 .type = HDA_FIXUP_PINS, 9250 .v.pins = (const struct hda_pintbl[]) { 9251 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ 9252 { } 9253 }, 9254 .chained = true, 9255 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 9256 }, 9257 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { 9258 .type = HDA_FIXUP_FUNC, 9259 .v.func = alc285_fixup_hp_gpio_amp_init, 9260 .chained = true, 9261 .chain_id = ALC285_FIXUP_HP_GPIO_LED 9262 }, 9263 [ALC269_FIXUP_CZC_B20] = { 9264 .type = HDA_FIXUP_PINS, 9265 .v.pins = (const struct hda_pintbl[]) { 9266 { 0x12, 0x411111f0 }, 9267 { 0x14, 0x90170110 }, /* speaker */ 9268 { 0x15, 0x032f1020 }, /* HP out */ 9269 { 0x17, 0x411111f0 }, 9270 { 0x18, 0x03ab1040 }, /* mic */ 9271 { 0x19, 0xb7a7013f }, 9272 { 0x1a, 0x0181305f }, 9273 { 0x1b, 0x411111f0 }, 9274 { 0x1d, 0x411111f0 }, 9275 { 0x1e, 0x411111f0 }, 9276 { } 9277 }, 9278 .chain_id = ALC269_FIXUP_DMIC, 9279 }, 9280 [ALC269_FIXUP_CZC_TMI] = { 9281 .type = HDA_FIXUP_PINS, 9282 .v.pins = (const struct hda_pintbl[]) { 9283 { 0x12, 0x4000c000 }, 9284 { 0x14, 0x90170110 }, /* speaker */ 9285 { 0x15, 0x0421401f }, /* HP out */ 9286 { 0x17, 0x411111f0 }, 9287 { 0x18, 0x04a19020 }, /* mic */ 9288 { 0x19, 0x411111f0 }, 9289 { 0x1a, 0x411111f0 }, 9290 { 0x1b, 0x411111f0 }, 9291 { 0x1d, 0x40448505 }, 9292 { 0x1e, 0x411111f0 }, 9293 { 0x20, 0x8000ffff }, 9294 { } 9295 }, 9296 .chain_id = ALC269_FIXUP_DMIC, 9297 }, 9298 [ALC269_FIXUP_CZC_L101] = { 9299 .type = HDA_FIXUP_PINS, 9300 .v.pins = (const struct hda_pintbl[]) { 9301 { 0x12, 0x40000000 }, 9302 { 0x14, 0x01014010 }, /* speaker */ 9303 { 0x15, 0x411111f0 }, /* HP out */ 9304 { 0x16, 0x411111f0 }, 9305 { 0x18, 0x01a19020 }, /* mic */ 9306 { 0x19, 0x02a19021 }, 9307 { 0x1a, 0x0181302f }, 9308 { 0x1b, 0x0221401f }, 9309 { 0x1c, 0x411111f0 }, 9310 { 0x1d, 0x4044c601 }, 9311 { 0x1e, 0x411111f0 }, 9312 { } 9313 }, 9314 .chain_id = ALC269_FIXUP_DMIC, 9315 }, 9316 [ALC269_FIXUP_LEMOTE_A1802] = { 9317 .type = HDA_FIXUP_PINS, 9318 .v.pins = (const struct hda_pintbl[]) { 9319 { 0x12, 0x40000000 }, 9320 { 0x14, 0x90170110 }, /* speaker */ 9321 { 0x17, 0x411111f0 }, 9322 { 0x18, 0x03a19040 }, /* mic1 */ 9323 { 0x19, 0x90a70130 }, /* mic2 */ 9324 { 0x1a, 0x411111f0 }, 9325 { 0x1b, 0x411111f0 }, 9326 { 0x1d, 0x40489d2d }, 9327 { 0x1e, 0x411111f0 }, 9328 { 0x20, 0x0003ffff }, 9329 { 0x21, 0x03214020 }, 9330 { } 9331 }, 9332 .chain_id = ALC269_FIXUP_DMIC, 9333 }, 9334 [ALC269_FIXUP_LEMOTE_A190X] = { 9335 .type = HDA_FIXUP_PINS, 9336 .v.pins = (const struct hda_pintbl[]) { 9337 { 0x14, 0x99130110 }, /* speaker */ 9338 { 0x15, 0x0121401f }, /* HP out */ 9339 { 0x18, 0x01a19c20 }, /* rear mic */ 9340 { 0x19, 0x99a3092f }, /* front mic */ 9341 { 0x1b, 0x0201401f }, /* front lineout */ 9342 { } 9343 }, 9344 .chain_id = ALC269_FIXUP_DMIC, 9345 }, 9346 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { 9347 .type = HDA_FIXUP_PINS, 9348 .v.pins = (const struct hda_pintbl[]) { 9349 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9350 { } 9351 }, 9352 .chained = true, 9353 .chain_id = ALC269_FIXUP_HEADSET_MODE 9354 }, 9355 [ALC256_FIXUP_INTEL_NUC10] = { 9356 .type = HDA_FIXUP_PINS, 9357 .v.pins = (const struct hda_pintbl[]) { 9358 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9359 { } 9360 }, 9361 .chained = true, 9362 .chain_id = ALC269_FIXUP_HEADSET_MODE 9363 }, 9364 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { 9365 .type = HDA_FIXUP_VERBS, 9366 .v.verbs = (const struct hda_verb[]) { 9367 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 9368 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 9369 { } 9370 }, 9371 .chained = true, 9372 .chain_id = ALC289_FIXUP_ASUS_GA502 9373 }, 9374 [ALC274_FIXUP_HP_MIC] = { 9375 .type = HDA_FIXUP_VERBS, 9376 .v.verbs = (const struct hda_verb[]) { 9377 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 9378 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 9379 { } 9380 }, 9381 }, 9382 [ALC274_FIXUP_HP_HEADSET_MIC] = { 9383 .type = HDA_FIXUP_FUNC, 9384 .v.func = alc274_fixup_hp_headset_mic, 9385 .chained = true, 9386 .chain_id = ALC274_FIXUP_HP_MIC 9387 }, 9388 [ALC274_FIXUP_HP_ENVY_GPIO] = { 9389 .type = HDA_FIXUP_FUNC, 9390 .v.func = alc274_fixup_hp_envy_gpio, 9391 }, 9392 [ALC256_FIXUP_ASUS_HPE] = { 9393 .type = HDA_FIXUP_VERBS, 9394 .v.verbs = (const struct hda_verb[]) { 9395 /* Set EAPD high */ 9396 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 9397 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, 9398 { } 9399 }, 9400 .chained = true, 9401 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 9402 }, 9403 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = { 9404 .type = HDA_FIXUP_FUNC, 9405 .v.func = alc_fixup_headset_jack, 9406 .chained = true, 9407 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 9408 }, 9409 [ALC287_FIXUP_HP_GPIO_LED] = { 9410 .type = HDA_FIXUP_FUNC, 9411 .v.func = alc287_fixup_hp_gpio_led, 9412 }, 9413 [ALC256_FIXUP_HP_HEADSET_MIC] = { 9414 .type = HDA_FIXUP_FUNC, 9415 .v.func = alc274_fixup_hp_headset_mic, 9416 }, 9417 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = { 9418 .type = HDA_FIXUP_FUNC, 9419 .v.func = alc_fixup_no_int_mic, 9420 .chained = true, 9421 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 9422 }, 9423 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = { 9424 .type = HDA_FIXUP_PINS, 9425 .v.pins = (const struct hda_pintbl[]) { 9426 { 0x1b, 0x411111f0 }, 9427 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 9428 { }, 9429 }, 9430 .chained = true, 9431 .chain_id = ALC269_FIXUP_HEADSET_MODE 9432 }, 9433 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = { 9434 .type = HDA_FIXUP_FUNC, 9435 .v.func = alc269_fixup_limit_int_mic_boost, 9436 .chained = true, 9437 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 9438 }, 9439 [ALC256_FIXUP_ACER_HEADSET_MIC] = { 9440 .type = HDA_FIXUP_PINS, 9441 .v.pins = (const struct hda_pintbl[]) { 9442 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */ 9443 { 0x1a, 0x90a1092f }, /* use as internal mic */ 9444 { } 9445 }, 9446 .chained = true, 9447 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9448 }, 9449 [ALC285_FIXUP_IDEAPAD_S740_COEF] = { 9450 .type = HDA_FIXUP_FUNC, 9451 .v.func = alc285_fixup_ideapad_s740_coef, 9452 .chained = true, 9453 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 9454 }, 9455 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { 9456 .type = HDA_FIXUP_FUNC, 9457 .v.func = alc269_fixup_limit_int_mic_boost, 9458 .chained = true, 9459 .chain_id = ALC285_FIXUP_HP_MUTE_LED, 9460 }, 9461 [ALC295_FIXUP_ASUS_DACS] = { 9462 .type = HDA_FIXUP_FUNC, 9463 .v.func = alc295_fixup_asus_dacs, 9464 }, 9465 [ALC295_FIXUP_HP_OMEN] = { 9466 .type = HDA_FIXUP_PINS, 9467 .v.pins = (const struct hda_pintbl[]) { 9468 { 0x12, 0xb7a60130 }, 9469 { 0x13, 0x40000000 }, 9470 { 0x14, 0x411111f0 }, 9471 { 0x16, 0x411111f0 }, 9472 { 0x17, 0x90170110 }, 9473 { 0x18, 0x411111f0 }, 9474 { 0x19, 0x02a11030 }, 9475 { 0x1a, 0x411111f0 }, 9476 { 0x1b, 0x04a19030 }, 9477 { 0x1d, 0x40600001 }, 9478 { 0x1e, 0x411111f0 }, 9479 { 0x21, 0x03211020 }, 9480 {} 9481 }, 9482 .chained = true, 9483 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED, 9484 }, 9485 [ALC285_FIXUP_HP_SPECTRE_X360] = { 9486 .type = HDA_FIXUP_FUNC, 9487 .v.func = alc285_fixup_hp_spectre_x360, 9488 }, 9489 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = { 9490 .type = HDA_FIXUP_FUNC, 9491 .v.func = alc285_fixup_hp_spectre_x360_eb1 9492 }, 9493 [ALC285_FIXUP_HP_ENVY_X360] = { 9494 .type = HDA_FIXUP_FUNC, 9495 .v.func = alc285_fixup_hp_envy_x360, 9496 .chained = true, 9497 .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT, 9498 }, 9499 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { 9500 .type = HDA_FIXUP_FUNC, 9501 .v.func = alc285_fixup_ideapad_s740_coef, 9502 .chained = true, 9503 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 9504 }, 9505 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = { 9506 .type = HDA_FIXUP_FUNC, 9507 .v.func = alc_fixup_no_shutup, 9508 .chained = true, 9509 .chain_id = ALC283_FIXUP_HEADSET_MIC, 9510 }, 9511 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = { 9512 .type = HDA_FIXUP_PINS, 9513 .v.pins = (const struct hda_pintbl[]) { 9514 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */ 9515 { } 9516 }, 9517 .chained = true, 9518 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC 9519 }, 9520 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = { 9521 .type = HDA_FIXUP_FUNC, 9522 .v.func = alc269_fixup_limit_int_mic_boost, 9523 .chained = true, 9524 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, 9525 }, 9526 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = { 9527 .type = HDA_FIXUP_FUNC, 9528 .v.func = alc285_fixup_ideapad_s740_coef, 9529 .chained = true, 9530 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, 9531 }, 9532 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = { 9533 .type = HDA_FIXUP_FUNC, 9534 .v.func = alc287_fixup_legion_15imhg05_speakers, 9535 .chained = true, 9536 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 9537 }, 9538 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = { 9539 .type = HDA_FIXUP_VERBS, 9540 //.v.verbs = legion_15imhg05_coefs, 9541 .v.verbs = (const struct hda_verb[]) { 9542 // set left speaker Legion 7i. 9543 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9544 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9545 9546 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9547 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9548 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9549 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, 9550 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9551 9552 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9553 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9554 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9555 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9556 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9557 9558 // set right speaker Legion 7i. 9559 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9560 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, 9561 9562 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9563 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9564 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9565 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, 9566 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9567 9568 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9569 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9570 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9571 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9572 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9573 {} 9574 }, 9575 .chained = true, 9576 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, 9577 }, 9578 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = { 9579 .type = HDA_FIXUP_FUNC, 9580 .v.func = alc287_fixup_legion_15imhg05_speakers, 9581 .chained = true, 9582 .chain_id = ALC269_FIXUP_HEADSET_MODE, 9583 }, 9584 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = { 9585 .type = HDA_FIXUP_VERBS, 9586 .v.verbs = (const struct hda_verb[]) { 9587 // set left speaker Yoga 7i. 9588 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9589 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9590 9591 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9592 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9593 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9594 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, 9595 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9596 9597 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9598 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9599 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9600 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9601 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9602 9603 // set right speaker Yoga 7i. 9604 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9605 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, 9606 9607 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9608 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9609 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9610 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, 9611 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9612 9613 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9614 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9615 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9616 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9617 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9618 {} 9619 }, 9620 .chained = true, 9621 .chain_id = ALC269_FIXUP_HEADSET_MODE, 9622 }, 9623 [ALC298_FIXUP_LENOVO_C940_DUET7] = { 9624 .type = HDA_FIXUP_FUNC, 9625 .v.func = alc298_fixup_lenovo_c940_duet7, 9626 }, 9627 [ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = { 9628 .type = HDA_FIXUP_FUNC, 9629 .v.func = alc287_fixup_lenovo_14irp8_duetitl, 9630 }, 9631 [ALC287_FIXUP_LENOVO_LEGION_7] = { 9632 .type = HDA_FIXUP_FUNC, 9633 .v.func = alc287_fixup_lenovo_legion_7, 9634 }, 9635 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = { 9636 .type = HDA_FIXUP_VERBS, 9637 .v.verbs = (const struct hda_verb[]) { 9638 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9639 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9640 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9641 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9642 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9643 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9644 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9645 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9646 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, 9647 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9648 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9649 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9650 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9651 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9652 {} 9653 }, 9654 .chained = true, 9655 .chain_id = ALC269_FIXUP_HEADSET_MODE, 9656 }, 9657 [ALC256_FIXUP_SET_COEF_DEFAULTS] = { 9658 .type = HDA_FIXUP_FUNC, 9659 .v.func = alc256_fixup_set_coef_defaults, 9660 }, 9661 [ALC245_FIXUP_HP_GPIO_LED] = { 9662 .type = HDA_FIXUP_FUNC, 9663 .v.func = alc245_fixup_hp_gpio_led, 9664 }, 9665 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { 9666 .type = HDA_FIXUP_PINS, 9667 .v.pins = (const struct hda_pintbl[]) { 9668 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */ 9669 { } 9670 }, 9671 .chained = true, 9672 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, 9673 }, 9674 [ALC233_FIXUP_NO_AUDIO_JACK] = { 9675 .type = HDA_FIXUP_FUNC, 9676 .v.func = alc233_fixup_no_audio_jack, 9677 }, 9678 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = { 9679 .type = HDA_FIXUP_FUNC, 9680 .v.func = alc256_fixup_mic_no_presence_and_resume, 9681 .chained = true, 9682 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9683 }, 9684 [ALC287_FIXUP_LEGION_16ACHG6] = { 9685 .type = HDA_FIXUP_FUNC, 9686 .v.func = alc287_fixup_legion_16achg6_speakers, 9687 }, 9688 [ALC287_FIXUP_CS35L41_I2C_2] = { 9689 .type = HDA_FIXUP_FUNC, 9690 .v.func = cs35l41_fixup_i2c_two, 9691 }, 9692 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = { 9693 .type = HDA_FIXUP_FUNC, 9694 .v.func = cs35l41_fixup_i2c_two, 9695 .chained = true, 9696 .chain_id = ALC285_FIXUP_HP_MUTE_LED, 9697 }, 9698 [ALC287_FIXUP_CS35L41_I2C_4] = { 9699 .type = HDA_FIXUP_FUNC, 9700 .v.func = cs35l41_fixup_i2c_four, 9701 }, 9702 [ALC245_FIXUP_CS35L41_SPI_2] = { 9703 .type = HDA_FIXUP_FUNC, 9704 .v.func = cs35l41_fixup_spi_two, 9705 }, 9706 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = { 9707 .type = HDA_FIXUP_FUNC, 9708 .v.func = cs35l41_fixup_spi_two, 9709 .chained = true, 9710 .chain_id = ALC285_FIXUP_HP_GPIO_LED, 9711 }, 9712 [ALC245_FIXUP_CS35L41_SPI_4] = { 9713 .type = HDA_FIXUP_FUNC, 9714 .v.func = cs35l41_fixup_spi_four, 9715 }, 9716 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = { 9717 .type = HDA_FIXUP_FUNC, 9718 .v.func = cs35l41_fixup_spi_four, 9719 .chained = true, 9720 .chain_id = ALC285_FIXUP_HP_GPIO_LED, 9721 }, 9722 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = { 9723 .type = HDA_FIXUP_VERBS, 9724 .v.verbs = (const struct hda_verb[]) { 9725 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 }, 9726 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 }, 9727 { } 9728 }, 9729 .chained = true, 9730 .chain_id = ALC285_FIXUP_HP_MUTE_LED, 9731 }, 9732 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = { 9733 .type = HDA_FIXUP_FUNC, 9734 .v.func = alc_fixup_dell4_mic_no_presence_quiet, 9735 .chained = true, 9736 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 9737 }, 9738 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = { 9739 .type = HDA_FIXUP_PINS, 9740 .v.pins = (const struct hda_pintbl[]) { 9741 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */ 9742 { } 9743 }, 9744 .chained = true, 9745 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 9746 }, 9747 [ALC287_FIXUP_LEGION_16ITHG6] = { 9748 .type = HDA_FIXUP_FUNC, 9749 .v.func = alc287_fixup_legion_16ithg6_speakers, 9750 }, 9751 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = { 9752 .type = HDA_FIXUP_VERBS, 9753 .v.verbs = (const struct hda_verb[]) { 9754 // enable left speaker 9755 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9756 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, 9757 9758 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9759 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9760 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9761 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a }, 9762 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9763 9764 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9765 { 0x20, AC_VERB_SET_PROC_COEF, 0xf }, 9766 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9767 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 }, 9768 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9769 9770 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9771 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 }, 9772 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9773 { 0x20, AC_VERB_SET_PROC_COEF, 0x40 }, 9774 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9775 9776 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9777 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9778 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9779 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9780 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9781 9782 // enable right speaker 9783 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, 9784 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, 9785 9786 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9787 { 0x20, AC_VERB_SET_PROC_COEF, 0xc }, 9788 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9789 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a }, 9790 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9791 9792 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9793 { 0x20, AC_VERB_SET_PROC_COEF, 0xf }, 9794 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9795 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 }, 9796 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9797 9798 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9799 { 0x20, AC_VERB_SET_PROC_COEF, 0x10 }, 9800 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9801 { 0x20, AC_VERB_SET_PROC_COEF, 0x44 }, 9802 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9803 9804 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, 9805 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, 9806 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9807 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 9808 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 9809 9810 { }, 9811 }, 9812 }, 9813 [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = { 9814 .type = HDA_FIXUP_FUNC, 9815 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin, 9816 .chained = true, 9817 .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK, 9818 }, 9819 [ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7] = { 9820 .type = HDA_FIXUP_FUNC, 9821 .v.func = alc287_fixup_lenovo_14arp8_legion_iah7, 9822 }, 9823 [ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = { 9824 .type = HDA_FIXUP_FUNC, 9825 .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin, 9826 .chained = true, 9827 .chain_id = ALC287_FIXUP_CS35L41_I2C_2, 9828 }, 9829 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = { 9830 .type = HDA_FIXUP_FUNC, 9831 .v.func = alc295_fixup_dell_inspiron_top_speakers, 9832 .chained = true, 9833 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 9834 }, 9835 [ALC236_FIXUP_DELL_DUAL_CODECS] = { 9836 .type = HDA_FIXUP_PINS, 9837 .v.func = alc1220_fixup_gb_dual_codecs, 9838 .chained = true, 9839 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 9840 }, 9841 [ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = { 9842 .type = HDA_FIXUP_FUNC, 9843 .v.func = cs35l41_fixup_i2c_two, 9844 .chained = true, 9845 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 9846 }, 9847 [ALC287_FIXUP_TAS2781_I2C] = { 9848 .type = HDA_FIXUP_FUNC, 9849 .v.func = tas2781_fixup_i2c, 9850 .chained = true, 9851 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 9852 }, 9853 [ALC287_FIXUP_YOGA7_14ARB7_I2C] = { 9854 .type = HDA_FIXUP_FUNC, 9855 .v.func = yoga7_14arb7_fixup_i2c, 9856 .chained = true, 9857 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 9858 }, 9859 [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = { 9860 .type = HDA_FIXUP_FUNC, 9861 .v.func = alc245_fixup_hp_mute_led_coefbit, 9862 }, 9863 [ALC245_FIXUP_HP_X360_MUTE_LEDS] = { 9864 .type = HDA_FIXUP_FUNC, 9865 .v.func = alc245_fixup_hp_mute_led_coefbit, 9866 .chained = true, 9867 .chain_id = ALC245_FIXUP_HP_GPIO_LED 9868 }, 9869 [ALC287_FIXUP_THINKPAD_I2S_SPK] = { 9870 .type = HDA_FIXUP_FUNC, 9871 .v.func = alc287_fixup_bind_dacs, 9872 .chained = true, 9873 .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 9874 }, 9875 [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = { 9876 .type = HDA_FIXUP_FUNC, 9877 .v.func = alc287_fixup_bind_dacs, 9878 .chained = true, 9879 .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, 9880 }, 9881 [ALC2XX_FIXUP_HEADSET_MIC] = { 9882 .type = HDA_FIXUP_FUNC, 9883 .v.func = alc_fixup_headset_mic, 9884 }, 9885 [ALC289_FIXUP_DELL_CS35L41_SPI_2] = { 9886 .type = HDA_FIXUP_FUNC, 9887 .v.func = cs35l41_fixup_spi_two, 9888 .chained = true, 9889 .chain_id = ALC289_FIXUP_DUAL_SPK 9890 }, 9891 [ALC294_FIXUP_CS35L41_I2C_2] = { 9892 .type = HDA_FIXUP_FUNC, 9893 .v.func = cs35l41_fixup_i2c_two, 9894 }, 9895 [ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED] = { 9896 .type = HDA_FIXUP_FUNC, 9897 .v.func = cs35l56_fixup_spi_four, 9898 .chained = true, 9899 .chain_id = ALC285_FIXUP_HP_GPIO_LED, 9900 }, 9901 [ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = { 9902 .type = HDA_FIXUP_FUNC, 9903 .v.func = alc256_fixup_acer_sfg16_micmute_led, 9904 }, 9905 [ALC256_FIXUP_HEADPHONE_AMP_VOL] = { 9906 .type = HDA_FIXUP_FUNC, 9907 .v.func = alc256_decrease_headphone_amp_val, 9908 }, 9909 [ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = { 9910 .type = HDA_FIXUP_FUNC, 9911 .v.func = alc245_fixup_hp_spectre_x360_eu0xxx, 9912 }, 9913 [ALC285_FIXUP_CS35L56_SPI_2] = { 9914 .type = HDA_FIXUP_FUNC, 9915 .v.func = cs35l56_fixup_spi_two, 9916 }, 9917 [ALC285_FIXUP_CS35L56_I2C_2] = { 9918 .type = HDA_FIXUP_FUNC, 9919 .v.func = cs35l56_fixup_i2c_two, 9920 }, 9921 [ALC285_FIXUP_CS35L56_I2C_4] = { 9922 .type = HDA_FIXUP_FUNC, 9923 .v.func = cs35l56_fixup_i2c_four, 9924 }, 9925 [ALC285_FIXUP_ASUS_GA403U] = { 9926 .type = HDA_FIXUP_FUNC, 9927 .v.func = alc285_fixup_asus_ga403u, 9928 }, 9929 [ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = { 9930 .type = HDA_FIXUP_PINS, 9931 .v.pins = (const struct hda_pintbl[]) { 9932 { 0x19, 0x03a11050 }, 9933 { 0x1b, 0x03a11c30 }, 9934 { } 9935 }, 9936 .chained = true, 9937 .chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1 9938 }, 9939 [ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = { 9940 .type = HDA_FIXUP_FUNC, 9941 .v.func = alc285_fixup_speaker2_to_dac1, 9942 .chained = true, 9943 .chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC, 9944 }, 9945 [ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = { 9946 .type = HDA_FIXUP_PINS, 9947 .v.pins = (const struct hda_pintbl[]) { 9948 { 0x19, 0x03a11050 }, 9949 { 0x1b, 0x03a11c30 }, 9950 { } 9951 }, 9952 .chained = true, 9953 .chain_id = ALC285_FIXUP_CS35L56_SPI_2 9954 }, 9955 [ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = { 9956 .type = HDA_FIXUP_FUNC, 9957 .v.func = alc285_fixup_speaker2_to_dac1, 9958 .chained = true, 9959 .chain_id = ALC285_FIXUP_ASUS_GA403U, 9960 }, 9961 [ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = { 9962 .type = HDA_FIXUP_FUNC, 9963 .v.func = alc287_fixup_lenovo_thinkpad_with_alc1318, 9964 .chained = true, 9965 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 9966 }, 9967 [ALC256_FIXUP_CHROME_BOOK] = { 9968 .type = HDA_FIXUP_FUNC, 9969 .v.func = alc256_fixup_chromebook, 9970 .chained = true, 9971 .chain_id = ALC225_FIXUP_HEADSET_JACK 9972 }, 9973 [ALC287_FIXUP_LENOVO_SSID_17AA3820] = { 9974 .type = HDA_FIXUP_FUNC, 9975 .v.func = alc287_fixup_lenovo_ssid_17aa3820, 9976 }, 9977 [ALCXXX_FIXUP_CS35LXX] = { 9978 .type = HDA_FIXUP_FUNC, 9979 .v.func = cs35lxx_autodet_fixup, 9980 }, 9981 [ALC245_FIXUP_CLEVO_NOISY_MIC] = { 9982 .type = HDA_FIXUP_FUNC, 9983 .v.func = alc269_fixup_limit_int_mic_boost, 9984 .chained = true, 9985 .chain_id = ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 9986 }, 9987 }; 9988 9989 static const struct snd_pci_quirk alc269_fixup_tbl[] = { 9990 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), 9991 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 9992 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 9993 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), 9994 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 9995 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), 9996 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), 9997 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 9998 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 9999 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), 10000 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10001 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF), 10002 SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), 10003 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK), 10004 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), 10005 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), 10006 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), 10007 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST), 10008 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10009 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10010 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK), 10011 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK), 10012 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), 10013 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), 10014 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), 10015 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC), 10016 SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10017 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10018 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10019 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10020 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC), 10021 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10022 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10023 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 10024 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), 10025 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), 10026 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10027 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10028 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 10029 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), 10030 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 10031 SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED), 10032 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 10033 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X), 10034 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), 10035 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), 10036 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), 10037 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), 10038 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), 10039 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), 10040 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 10041 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 10042 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 10043 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), 10044 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), 10045 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), 10046 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), 10047 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), 10048 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10049 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10050 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), 10051 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 10052 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), 10053 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 10054 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10055 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10056 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10057 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10058 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10059 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10060 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 10061 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), 10062 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), 10063 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), 10064 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), 10065 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), 10066 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), 10067 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), 10068 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), 10069 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 10070 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 10071 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), 10072 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), 10073 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), 10074 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), 10075 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), 10076 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 10077 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), 10078 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), 10079 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 10080 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 10081 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 10082 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 10083 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET), 10084 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), 10085 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK), 10086 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK), 10087 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 10088 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 10089 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK), 10090 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK), 10091 SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2), 10092 SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2), 10093 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10094 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10095 SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10096 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), 10097 SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10098 SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10099 SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10100 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 10101 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), 10102 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 10103 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 10104 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 10105 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS), 10106 SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10107 SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4), 10108 SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10109 SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10110 SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10111 SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10112 SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10113 SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10114 SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10115 SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10116 SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK), 10117 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10118 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 10119 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 10120 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), 10121 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), 10122 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10123 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10124 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10125 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10126 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), 10127 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10128 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10129 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10130 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10131 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10132 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10133 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10134 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10135 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10136 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10137 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10138 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10139 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10140 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), 10141 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), 10142 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10143 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10144 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10145 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10146 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10147 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10148 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10149 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10150 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), 10151 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10152 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), 10153 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10154 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), 10155 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10156 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10157 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10158 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10159 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10160 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10161 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10162 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10163 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10164 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10165 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10166 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10167 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10168 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10169 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), 10170 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10171 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 10172 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10173 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10174 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10175 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 10176 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE), 10177 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10178 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10179 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC), 10180 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC), 10181 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360), 10182 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), 10183 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), 10184 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10185 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10186 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 10187 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10188 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10189 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10190 SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED), 10191 SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10192 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), 10193 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 10194 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), 10195 SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10196 SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360), 10197 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10198 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10199 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), 10200 SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10201 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), 10202 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10203 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10204 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED), 10205 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10206 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10207 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), 10208 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED), 10209 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), 10210 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10211 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10212 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10213 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), 10214 SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10215 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), 10216 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), 10217 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation", 10218 ALC285_FIXUP_HP_GPIO_AMP_INIT), 10219 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation", 10220 ALC285_FIXUP_HP_GPIO_AMP_INIT), 10221 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 10222 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 10223 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), 10224 SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10225 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), 10226 SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10227 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10228 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10229 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10230 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10231 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED), 10232 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), 10233 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 10234 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 10235 SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10236 SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10237 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10238 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10239 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10240 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10241 SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10242 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10243 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10244 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10245 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 10246 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10247 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10248 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10249 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10250 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 10251 SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10252 SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10253 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), 10254 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED), 10255 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), 10256 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10257 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), 10258 SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED), 10259 SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10260 SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED), 10261 SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10262 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10263 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10264 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10265 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10266 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10267 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10268 SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED), 10269 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4), 10270 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), 10271 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), 10272 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10273 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2), 10274 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10275 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2), 10276 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED), 10277 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED), 10278 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED), 10279 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED), 10280 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED), 10281 SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10282 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10283 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10284 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10285 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10286 SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10287 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED), 10288 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10289 SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 10290 SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2), 10291 SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10292 SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10293 SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10294 SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10295 SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10296 SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10297 SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10298 SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10299 SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4), 10300 SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10301 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 10302 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), 10303 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED), 10304 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED), 10305 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED), 10306 SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED), 10307 SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10308 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10309 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10310 SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10311 SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10312 SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10313 SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10314 SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED), 10315 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10316 SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10317 SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10318 SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10319 SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10320 SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10321 SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10322 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10323 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10324 SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10325 SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10326 SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10327 SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10328 SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10329 SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10330 SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2), 10331 SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED), 10332 SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED), 10333 SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED), 10334 SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED), 10335 SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED), 10336 SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED), 10337 SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10338 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10339 SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10340 SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10341 SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2), 10342 SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2), 10343 SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10344 SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10345 SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10346 SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10347 SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10348 SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10349 SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10350 SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10351 SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10352 SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10353 SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10354 SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10355 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED), 10356 SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX), 10357 SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2), 10358 SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2), 10359 SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10360 SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 10361 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10362 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10363 SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10364 SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10365 SND_PCI_QUIRK(0x103c, 0x8c4d, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2), 10366 SND_PCI_QUIRK(0x103c, 0x8c4e, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2), 10367 SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2), 10368 SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10369 SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10370 SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED), 10371 SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED), 10372 SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10373 SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10374 SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 10375 SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2), 10376 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10377 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10378 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10379 SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10380 SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10381 SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10382 SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10383 SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10384 SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10385 SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10386 SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED), 10387 SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED), 10388 SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), 10389 SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED), 10390 SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED), 10391 SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED), 10392 SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED), 10393 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10394 SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10395 SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED), 10396 SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED), 10397 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10398 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10399 SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10400 SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2), 10401 SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2), 10402 SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10403 SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10404 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10405 SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALCXXX_FIXUP_CS35LXX), 10406 SND_PCI_QUIRK(0x103c, 0x8d08, "HP EliteBook 1045 14 G12", ALCXXX_FIXUP_CS35LXX), 10407 SND_PCI_QUIRK(0x103c, 0x8d85, "HP EliteBook 1040 14 G12", ALCXXX_FIXUP_CS35LXX), 10408 SND_PCI_QUIRK(0x103c, 0x8d86, "HP Elite x360 1040 14 G12", ALCXXX_FIXUP_CS35LXX), 10409 SND_PCI_QUIRK(0x103c, 0x8d8c, "HP EliteBook 830 13 G12", ALCXXX_FIXUP_CS35LXX), 10410 SND_PCI_QUIRK(0x103c, 0x8d8d, "HP Elite x360 830 13 G12", ALCXXX_FIXUP_CS35LXX), 10411 SND_PCI_QUIRK(0x103c, 0x8d8e, "HP EliteBook 840 14 G12", ALCXXX_FIXUP_CS35LXX), 10412 SND_PCI_QUIRK(0x103c, 0x8d8f, "HP EliteBook 840 14 G12", ALCXXX_FIXUP_CS35LXX), 10413 SND_PCI_QUIRK(0x103c, 0x8d90, "HP EliteBook 860 16 G12", ALCXXX_FIXUP_CS35LXX), 10414 SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALCXXX_FIXUP_CS35LXX), 10415 SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALCXXX_FIXUP_CS35LXX), 10416 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 10417 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 10418 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10419 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), 10420 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 10421 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10422 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK), 10423 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10424 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10425 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10426 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10427 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), 10428 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), 10429 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM), 10430 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), 10431 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), 10432 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), 10433 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE), 10434 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), 10435 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), 10436 SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC), 10437 SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC), 10438 SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC), 10439 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10440 SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10441 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2), 10442 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2), 10443 SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2), 10444 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), 10445 SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2), 10446 SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC), 10447 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), 10448 SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC), 10449 SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2), 10450 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2), 10451 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 10452 SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2), 10453 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), 10454 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2), 10455 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), 10456 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), 10457 SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY), 10458 SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2), 10459 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), 10460 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), 10461 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2), 10462 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), 10463 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), 10464 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401), 10465 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE), 10466 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), 10467 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), 10468 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 10469 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), 10470 SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2), 10471 SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2), 10472 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), 10473 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), 10474 SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC), 10475 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2), 10476 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 10477 SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2), 10478 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10479 SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2), 10480 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2), 10481 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 10482 SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1), 10483 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS), 10484 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10485 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10486 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), 10487 SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2), 10488 SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2), 10489 SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC), 10490 SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2), 10491 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), 10492 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), 10493 SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2), 10494 SND_PCI_QUIRK(0x1043, 0x1df3, "ASUS UM5606", ALC285_FIXUP_CS35L56_I2C_4), 10495 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2), 10496 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 10497 SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), 10498 SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC), 10499 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 10500 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), 10501 SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_CS35L56_I2C_2), 10502 SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_CS35L56_I2C_2), 10503 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), 10504 SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2), 10505 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2), 10506 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401), 10507 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), 10508 SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2), 10509 SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2), 10510 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2), 10511 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401), 10512 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), 10513 SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10514 SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10515 SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10516 SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10517 SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10518 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), 10519 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), 10520 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 10521 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 10522 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), 10523 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), 10524 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 10525 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 10526 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), 10527 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 10528 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 10529 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), 10530 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), 10531 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), 10532 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), 10533 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), 10534 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), 10535 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), 10536 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), 10537 SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10538 SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10539 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10540 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10541 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10542 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10543 SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10544 SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 10545 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 10546 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 10547 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP), 10548 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP), 10549 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP), 10550 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP), 10551 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP), 10552 SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP), 10553 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP), 10554 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), 10555 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP), 10556 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), 10557 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 10558 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP), 10559 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP), 10560 SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG-KB1US)", ALC298_FIXUP_SAMSUNG_AMP2), 10561 SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH-XD92G))", ALC298_FIXUP_SAMSUNG_AMP2), 10562 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 10563 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), 10564 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), 10565 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK), 10566 SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC), 10567 SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10568 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10569 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10570 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10571 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10572 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10573 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10574 SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10575 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10576 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10577 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10578 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10579 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10580 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10581 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10582 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10583 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10584 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10585 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10586 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10587 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10588 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10589 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10590 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10591 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10592 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10593 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10594 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10595 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10596 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10597 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10598 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10599 SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10600 SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10601 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10602 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10603 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10604 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10605 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10606 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10607 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10608 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10609 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10610 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10611 SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10612 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10613 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10614 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10615 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10616 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10617 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10618 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10619 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), 10620 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC), 10621 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), 10622 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10623 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10624 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10625 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10626 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10627 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME), 10628 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10629 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10630 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10631 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10632 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10633 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10634 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10635 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10636 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10637 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10638 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10639 SND_PCI_QUIRK(0x1558, 0xa741, "Clevo V54x_6x_TNE", ALC245_FIXUP_CLEVO_NOISY_MIC), 10640 SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC), 10641 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10642 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10643 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10644 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10645 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10646 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 10647 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), 10648 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 10649 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), 10650 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), 10651 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), 10652 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), 10653 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), 10654 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), 10655 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), 10656 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), 10657 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), 10658 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), 10659 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), 10660 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), 10661 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), 10662 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), 10663 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), 10664 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), 10665 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), 10666 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10667 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), 10668 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), 10669 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), 10670 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10671 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10672 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), 10673 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), 10674 SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C), 10675 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), 10676 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10677 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10678 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), 10679 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10680 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10681 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10682 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10683 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 10684 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 10685 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), 10686 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK), 10687 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10688 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10689 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10690 SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10691 SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10692 SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10693 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10694 SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10695 SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318), 10696 SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318), 10697 SND_PCI_QUIRK(0x17aa, 0x2326, "Hera2", ALC287_FIXUP_TAS2781_I2C), 10698 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 10699 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 10700 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10701 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10702 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10703 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10704 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 10705 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10706 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10707 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10708 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 10709 SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC), 10710 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10711 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL), 10712 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 10713 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7), 10714 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), 10715 SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330 / Yoga Duet 7", ALC287_FIXUP_LENOVO_SSID_17AA3820), 10716 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 10717 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), 10718 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10719 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 10720 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), 10721 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6), 10722 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10723 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10724 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10725 SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6), 10726 SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2), 10727 SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2), 10728 SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10729 SND_PCI_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7 / Yoga Pro 7 14ARP8", ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7), 10730 SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7/7i", ALC287_FIXUP_LENOVO_LEGION_7), 10731 SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C), 10732 SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2), 10733 SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2), 10734 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C), 10735 SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C), 10736 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C), 10737 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10738 SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C), 10739 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C), 10740 SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10741 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C), 10742 SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C), 10743 SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10744 SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 10745 SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2), 10746 SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2), 10747 SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2), 10748 SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2), 10749 SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C), 10750 SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C), 10751 SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C), 10752 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C), 10753 SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C), 10754 SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4), 10755 SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4), 10756 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C), 10757 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C), 10758 SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN), 10759 SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN), 10760 SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), 10761 SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2), 10762 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 10763 SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC), 10764 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), 10765 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 10766 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), 10767 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10768 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), 10769 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), 10770 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10771 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), 10772 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), 10773 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), 10774 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), 10775 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), 10776 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), 10777 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), 10778 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), 10779 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10780 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10781 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10782 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 10783 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10784 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10785 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 10786 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 10787 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 10788 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), 10789 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC), 10790 SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL), 10791 SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL), 10792 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), 10793 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10794 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), 10795 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), 10796 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), 10797 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ 10798 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), 10799 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), 10800 SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10801 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE), 10802 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), 10803 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), 10804 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP), 10805 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10806 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10807 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 10808 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10809 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 10810 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP), 10811 SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC), 10812 SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), 10813 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 10814 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), 10815 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), 10816 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), 10817 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 10818 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 10819 SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO), 10820 SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME), 10821 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), 10822 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), 10823 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), 10824 SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK), 10825 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 10826 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 10827 SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 10828 10829 #if 0 10830 /* Below is a quirk table taken from the old code. 10831 * Basically the device should work as is without the fixup table. 10832 * If BIOS doesn't give a proper info, enable the corresponding 10833 * fixup entry. 10834 */ 10835 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 10836 ALC269_FIXUP_AMIC), 10837 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), 10838 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), 10839 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), 10840 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), 10841 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), 10842 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), 10843 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), 10844 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), 10845 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), 10846 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), 10847 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), 10848 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), 10849 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), 10850 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), 10851 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), 10852 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), 10853 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), 10854 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), 10855 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), 10856 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), 10857 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), 10858 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), 10859 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), 10860 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), 10861 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), 10862 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), 10863 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), 10864 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), 10865 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), 10866 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), 10867 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), 10868 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), 10869 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), 10870 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), 10871 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), 10872 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), 10873 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), 10874 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), 10875 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), 10876 #endif 10877 {} 10878 }; 10879 10880 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { 10881 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), 10882 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), 10883 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), 10884 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), 10885 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), 10886 {} 10887 }; 10888 10889 static const struct hda_model_fixup alc269_fixup_models[] = { 10890 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, 10891 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, 10892 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, 10893 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, 10894 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, 10895 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, 10896 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, 10897 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, 10898 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, 10899 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, 10900 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 10901 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, 10902 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 10903 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, 10904 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, 10905 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, 10906 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, 10907 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, 10908 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, 10909 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, 10910 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, 10911 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, 10912 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, 10913 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, 10914 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, 10915 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, 10916 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, 10917 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, 10918 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, 10919 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, 10920 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, 10921 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, 10922 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, 10923 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, 10924 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, 10925 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, 10926 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, 10927 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, 10928 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, 10929 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, 10930 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, 10931 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, 10932 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, 10933 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, 10934 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, 10935 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, 10936 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, 10937 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, 10938 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, 10939 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, 10940 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, 10941 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, 10942 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, 10943 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, 10944 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, 10945 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, 10946 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, 10947 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, 10948 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, 10949 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, 10950 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, 10951 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, 10952 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, 10953 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, 10954 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, 10955 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, 10956 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, 10957 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"}, 10958 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, 10959 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 10960 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, 10961 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, 10962 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, 10963 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, 10964 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, 10965 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, 10966 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, 10967 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, 10968 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, 10969 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, 10970 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, 10971 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, 10972 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, 10973 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, 10974 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, 10975 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, 10976 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, 10977 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, 10978 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, 10979 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, 10980 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, 10981 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, 10982 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, 10983 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, 10984 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, 10985 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, 10986 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, 10987 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, 10988 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, 10989 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, 10990 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, 10991 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, 10992 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, 10993 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, 10994 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, 10995 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, 10996 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, 10997 {.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"}, 10998 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, 10999 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, 11000 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, 11001 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"}, 11002 {.id = ALC298_FIXUP_SAMSUNG_AMP2, .name = "alc298-samsung-amp2"}, 11003 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"}, 11004 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, 11005 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, 11006 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, 11007 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, 11008 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, 11009 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, 11010 {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"}, 11011 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, 11012 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"}, 11013 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, 11014 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, 11015 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"}, 11016 {.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"}, 11017 {} 11018 }; 11019 #define ALC225_STANDARD_PINS \ 11020 {0x21, 0x04211020} 11021 11022 #define ALC256_STANDARD_PINS \ 11023 {0x12, 0x90a60140}, \ 11024 {0x14, 0x90170110}, \ 11025 {0x21, 0x02211020} 11026 11027 #define ALC282_STANDARD_PINS \ 11028 {0x14, 0x90170110} 11029 11030 #define ALC290_STANDARD_PINS \ 11031 {0x12, 0x99a30130} 11032 11033 #define ALC292_STANDARD_PINS \ 11034 {0x14, 0x90170110}, \ 11035 {0x15, 0x0221401f} 11036 11037 #define ALC295_STANDARD_PINS \ 11038 {0x12, 0xb7a60130}, \ 11039 {0x14, 0x90170110}, \ 11040 {0x21, 0x04211020} 11041 11042 #define ALC298_STANDARD_PINS \ 11043 {0x12, 0x90a60130}, \ 11044 {0x21, 0x03211020} 11045 11046 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { 11047 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, 11048 {0x14, 0x01014020}, 11049 {0x17, 0x90170110}, 11050 {0x18, 0x02a11030}, 11051 {0x19, 0x0181303F}, 11052 {0x21, 0x0221102f}), 11053 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 11054 {0x12, 0x90a601c0}, 11055 {0x14, 0x90171120}, 11056 {0x21, 0x02211030}), 11057 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 11058 {0x14, 0x90170110}, 11059 {0x1b, 0x90a70130}, 11060 {0x21, 0x03211020}), 11061 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 11062 {0x1a, 0x90a70130}, 11063 {0x1b, 0x90170110}, 11064 {0x21, 0x03211020}), 11065 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11066 ALC225_STANDARD_PINS, 11067 {0x12, 0xb7a60130}, 11068 {0x14, 0x901701a0}), 11069 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11070 ALC225_STANDARD_PINS, 11071 {0x12, 0xb7a60130}, 11072 {0x14, 0x901701b0}), 11073 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11074 ALC225_STANDARD_PINS, 11075 {0x12, 0xb7a60150}, 11076 {0x14, 0x901701a0}), 11077 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11078 ALC225_STANDARD_PINS, 11079 {0x12, 0xb7a60150}, 11080 {0x14, 0x901701b0}), 11081 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 11082 ALC225_STANDARD_PINS, 11083 {0x12, 0xb7a60130}, 11084 {0x1b, 0x90170110}), 11085 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11086 {0x1b, 0x01111010}, 11087 {0x1e, 0x01451130}, 11088 {0x21, 0x02211020}), 11089 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 11090 {0x12, 0x90a60140}, 11091 {0x14, 0x90170110}, 11092 {0x19, 0x02a11030}, 11093 {0x21, 0x02211020}), 11094 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 11095 {0x14, 0x90170110}, 11096 {0x19, 0x02a11030}, 11097 {0x1a, 0x02a11040}, 11098 {0x1b, 0x01014020}, 11099 {0x21, 0x0221101f}), 11100 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 11101 {0x14, 0x90170110}, 11102 {0x19, 0x02a11030}, 11103 {0x1a, 0x02a11040}, 11104 {0x1b, 0x01011020}, 11105 {0x21, 0x0221101f}), 11106 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 11107 {0x14, 0x90170110}, 11108 {0x19, 0x02a11020}, 11109 {0x1a, 0x02a11030}, 11110 {0x21, 0x0221101f}), 11111 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC, 11112 {0x21, 0x02211010}), 11113 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, 11114 {0x14, 0x90170110}, 11115 {0x19, 0x02a11020}, 11116 {0x21, 0x02211030}), 11117 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 11118 {0x14, 0x90170110}, 11119 {0x21, 0x02211020}), 11120 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11121 {0x14, 0x90170130}, 11122 {0x21, 0x02211040}), 11123 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11124 {0x12, 0x90a60140}, 11125 {0x14, 0x90170110}, 11126 {0x21, 0x02211020}), 11127 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11128 {0x12, 0x90a60160}, 11129 {0x14, 0x90170120}, 11130 {0x21, 0x02211030}), 11131 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11132 {0x14, 0x90170110}, 11133 {0x1b, 0x02011020}, 11134 {0x21, 0x0221101f}), 11135 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11136 {0x14, 0x90170110}, 11137 {0x1b, 0x01011020}, 11138 {0x21, 0x0221101f}), 11139 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11140 {0x14, 0x90170130}, 11141 {0x1b, 0x01014020}, 11142 {0x21, 0x0221103f}), 11143 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11144 {0x14, 0x90170130}, 11145 {0x1b, 0x01011020}, 11146 {0x21, 0x0221103f}), 11147 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11148 {0x14, 0x90170130}, 11149 {0x1b, 0x02011020}, 11150 {0x21, 0x0221103f}), 11151 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11152 {0x14, 0x90170150}, 11153 {0x1b, 0x02011020}, 11154 {0x21, 0x0221105f}), 11155 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11156 {0x14, 0x90170110}, 11157 {0x1b, 0x01014020}, 11158 {0x21, 0x0221101f}), 11159 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11160 {0x12, 0x90a60160}, 11161 {0x14, 0x90170120}, 11162 {0x17, 0x90170140}, 11163 {0x21, 0x0321102f}), 11164 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11165 {0x12, 0x90a60160}, 11166 {0x14, 0x90170130}, 11167 {0x21, 0x02211040}), 11168 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11169 {0x12, 0x90a60160}, 11170 {0x14, 0x90170140}, 11171 {0x21, 0x02211050}), 11172 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11173 {0x12, 0x90a60170}, 11174 {0x14, 0x90170120}, 11175 {0x21, 0x02211030}), 11176 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11177 {0x12, 0x90a60170}, 11178 {0x14, 0x90170130}, 11179 {0x21, 0x02211040}), 11180 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11181 {0x12, 0x90a60170}, 11182 {0x14, 0x90171130}, 11183 {0x21, 0x02211040}), 11184 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11185 {0x12, 0x90a60170}, 11186 {0x14, 0x90170140}, 11187 {0x21, 0x02211050}), 11188 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11189 {0x12, 0x90a60180}, 11190 {0x14, 0x90170130}, 11191 {0x21, 0x02211040}), 11192 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11193 {0x12, 0x90a60180}, 11194 {0x14, 0x90170120}, 11195 {0x21, 0x02211030}), 11196 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11197 {0x1b, 0x01011020}, 11198 {0x21, 0x02211010}), 11199 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 11200 {0x14, 0x90170110}, 11201 {0x1b, 0x90a70130}, 11202 {0x21, 0x04211020}), 11203 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 11204 {0x14, 0x90170110}, 11205 {0x1b, 0x90a70130}, 11206 {0x21, 0x03211020}), 11207 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 11208 {0x12, 0x90a60130}, 11209 {0x14, 0x90170110}, 11210 {0x21, 0x03211020}), 11211 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 11212 {0x12, 0x90a60130}, 11213 {0x14, 0x90170110}, 11214 {0x21, 0x04211020}), 11215 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 11216 {0x1a, 0x90a70130}, 11217 {0x1b, 0x90170110}, 11218 {0x21, 0x03211020}), 11219 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC, 11220 {0x14, 0x90170110}, 11221 {0x19, 0x02a11020}, 11222 {0x21, 0x0221101f}), 11223 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, 11224 {0x17, 0x90170110}, 11225 {0x19, 0x03a11030}, 11226 {0x21, 0x03211020}), 11227 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, 11228 {0x12, 0x90a60130}, 11229 {0x14, 0x90170110}, 11230 {0x15, 0x0421101f}, 11231 {0x1a, 0x04a11020}), 11232 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, 11233 {0x12, 0x90a60140}, 11234 {0x14, 0x90170110}, 11235 {0x15, 0x0421101f}, 11236 {0x18, 0x02811030}, 11237 {0x1a, 0x04a1103f}, 11238 {0x1b, 0x02011020}), 11239 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11240 ALC282_STANDARD_PINS, 11241 {0x12, 0x99a30130}, 11242 {0x19, 0x03a11020}, 11243 {0x21, 0x0321101f}), 11244 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11245 ALC282_STANDARD_PINS, 11246 {0x12, 0x99a30130}, 11247 {0x19, 0x03a11020}, 11248 {0x21, 0x03211040}), 11249 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11250 ALC282_STANDARD_PINS, 11251 {0x12, 0x99a30130}, 11252 {0x19, 0x03a11030}, 11253 {0x21, 0x03211020}), 11254 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11255 ALC282_STANDARD_PINS, 11256 {0x12, 0x99a30130}, 11257 {0x19, 0x04a11020}, 11258 {0x21, 0x0421101f}), 11259 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, 11260 ALC282_STANDARD_PINS, 11261 {0x12, 0x90a60140}, 11262 {0x19, 0x04a11030}, 11263 {0x21, 0x04211020}), 11264 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, 11265 ALC282_STANDARD_PINS, 11266 {0x12, 0x90a609c0}, 11267 {0x18, 0x03a11830}, 11268 {0x19, 0x04a19831}, 11269 {0x1a, 0x0481303f}, 11270 {0x1b, 0x04211020}, 11271 {0x21, 0x0321101f}), 11272 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT, 11273 ALC282_STANDARD_PINS, 11274 {0x12, 0x90a60940}, 11275 {0x18, 0x03a11830}, 11276 {0x19, 0x04a19831}, 11277 {0x1a, 0x0481303f}, 11278 {0x1b, 0x04211020}, 11279 {0x21, 0x0321101f}), 11280 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11281 ALC282_STANDARD_PINS, 11282 {0x12, 0x90a60130}, 11283 {0x21, 0x0321101f}), 11284 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11285 {0x12, 0x90a60160}, 11286 {0x14, 0x90170120}, 11287 {0x21, 0x02211030}), 11288 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 11289 ALC282_STANDARD_PINS, 11290 {0x12, 0x90a60130}, 11291 {0x19, 0x03a11020}, 11292 {0x21, 0x0321101f}), 11293 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 11294 {0x12, 0x90a60130}, 11295 {0x14, 0x90170110}, 11296 {0x19, 0x04a11040}, 11297 {0x21, 0x04211020}), 11298 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 11299 {0x14, 0x90170110}, 11300 {0x19, 0x04a11040}, 11301 {0x1d, 0x40600001}, 11302 {0x21, 0x04211020}), 11303 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, 11304 {0x14, 0x90170110}, 11305 {0x19, 0x04a11040}, 11306 {0x21, 0x04211020}), 11307 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK, 11308 {0x14, 0x90170110}, 11309 {0x17, 0x90170111}, 11310 {0x19, 0x03a11030}, 11311 {0x21, 0x03211020}), 11312 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK, 11313 {0x17, 0x90170110}, 11314 {0x19, 0x03a11030}, 11315 {0x21, 0x03211020}), 11316 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK, 11317 {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */ 11318 {0x19, 0x04a11040}, 11319 {0x21, 0x04211020}), 11320 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, 11321 {0x12, 0x90a60130}, 11322 {0x17, 0x90170110}, 11323 {0x21, 0x02211020}), 11324 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, 11325 {0x12, 0x90a60120}, 11326 {0x14, 0x90170110}, 11327 {0x21, 0x0321101f}), 11328 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11329 ALC290_STANDARD_PINS, 11330 {0x15, 0x04211040}, 11331 {0x18, 0x90170112}, 11332 {0x1a, 0x04a11020}), 11333 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11334 ALC290_STANDARD_PINS, 11335 {0x15, 0x04211040}, 11336 {0x18, 0x90170110}, 11337 {0x1a, 0x04a11020}), 11338 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11339 ALC290_STANDARD_PINS, 11340 {0x15, 0x0421101f}, 11341 {0x1a, 0x04a11020}), 11342 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11343 ALC290_STANDARD_PINS, 11344 {0x15, 0x04211020}, 11345 {0x1a, 0x04a11040}), 11346 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11347 ALC290_STANDARD_PINS, 11348 {0x14, 0x90170110}, 11349 {0x15, 0x04211020}, 11350 {0x1a, 0x04a11040}), 11351 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11352 ALC290_STANDARD_PINS, 11353 {0x14, 0x90170110}, 11354 {0x15, 0x04211020}, 11355 {0x1a, 0x04a11020}), 11356 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 11357 ALC290_STANDARD_PINS, 11358 {0x14, 0x90170110}, 11359 {0x15, 0x0421101f}, 11360 {0x1a, 0x04a11020}), 11361 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 11362 ALC292_STANDARD_PINS, 11363 {0x12, 0x90a60140}, 11364 {0x16, 0x01014020}, 11365 {0x19, 0x01a19030}), 11366 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 11367 ALC292_STANDARD_PINS, 11368 {0x12, 0x90a60140}, 11369 {0x16, 0x01014020}, 11370 {0x18, 0x02a19031}, 11371 {0x19, 0x01a1903e}), 11372 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 11373 ALC292_STANDARD_PINS, 11374 {0x12, 0x90a60140}), 11375 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 11376 ALC292_STANDARD_PINS, 11377 {0x13, 0x90a60140}, 11378 {0x16, 0x21014020}, 11379 {0x19, 0x21a19030}), 11380 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 11381 ALC292_STANDARD_PINS, 11382 {0x13, 0x90a60140}), 11383 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE, 11384 {0x17, 0x90170110}, 11385 {0x21, 0x04211020}), 11386 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, 11387 {0x14, 0x90170110}, 11388 {0x1b, 0x90a70130}, 11389 {0x21, 0x04211020}), 11390 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 11391 {0x12, 0x90a60130}, 11392 {0x17, 0x90170110}, 11393 {0x21, 0x03211020}), 11394 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 11395 {0x12, 0x90a60130}, 11396 {0x17, 0x90170110}, 11397 {0x21, 0x04211020}), 11398 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 11399 {0x12, 0x90a60130}, 11400 {0x17, 0x90170110}, 11401 {0x21, 0x03211020}), 11402 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 11403 {0x12, 0x90a60120}, 11404 {0x17, 0x90170110}, 11405 {0x21, 0x04211030}), 11406 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 11407 {0x12, 0x90a60130}, 11408 {0x17, 0x90170110}, 11409 {0x21, 0x03211020}), 11410 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 11411 {0x12, 0x90a60130}, 11412 {0x17, 0x90170110}, 11413 {0x21, 0x03211020}), 11414 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 11415 ALC298_STANDARD_PINS, 11416 {0x17, 0x90170110}), 11417 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 11418 ALC298_STANDARD_PINS, 11419 {0x17, 0x90170140}), 11420 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 11421 ALC298_STANDARD_PINS, 11422 {0x17, 0x90170150}), 11423 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, 11424 {0x12, 0xb7a60140}, 11425 {0x13, 0xb7a60150}, 11426 {0x17, 0x90170110}, 11427 {0x1a, 0x03011020}, 11428 {0x21, 0x03211030}), 11429 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, 11430 {0x12, 0xb7a60140}, 11431 {0x17, 0x90170110}, 11432 {0x1a, 0x03a11030}, 11433 {0x21, 0x03211020}), 11434 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 11435 ALC225_STANDARD_PINS, 11436 {0x12, 0xb7a60130}, 11437 {0x17, 0x90170110}), 11438 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, 11439 {0x14, 0x01014010}, 11440 {0x17, 0x90170120}, 11441 {0x18, 0x02a11030}, 11442 {0x19, 0x02a1103f}, 11443 {0x21, 0x0221101f}), 11444 {} 11445 }; 11446 11447 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match 11448 * more machines, don't need to match all valid pins, just need to match 11449 * all the pins defined in the tbl. Just because of this reason, it is possible 11450 * that a single machine matches multiple tbls, so there is one limitation: 11451 * at most one tbl is allowed to define for the same vendor and same codec 11452 */ 11453 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { 11454 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC, 11455 {0x19, 0x40000000}), 11456 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 11457 {0x19, 0x40000000}, 11458 {0x1b, 0x40000000}), 11459 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 11460 {0x19, 0x40000000}, 11461 {0x1b, 0x40000000}), 11462 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11463 {0x19, 0x40000000}, 11464 {0x1a, 0x40000000}), 11465 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 11466 {0x19, 0x40000000}, 11467 {0x1a, 0x40000000}), 11468 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, 11469 {0x19, 0x40000000}, 11470 {0x1a, 0x40000000}), 11471 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC, 11472 {0x19, 0x40000000}), 11473 {} 11474 }; 11475 11476 static void alc269_fill_coef(struct hda_codec *codec) 11477 { 11478 struct alc_spec *spec = codec->spec; 11479 int val; 11480 11481 if (spec->codec_variant != ALC269_TYPE_ALC269VB) 11482 return; 11483 11484 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { 11485 alc_write_coef_idx(codec, 0xf, 0x960b); 11486 alc_write_coef_idx(codec, 0xe, 0x8817); 11487 } 11488 11489 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { 11490 alc_write_coef_idx(codec, 0xf, 0x960b); 11491 alc_write_coef_idx(codec, 0xe, 0x8814); 11492 } 11493 11494 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { 11495 /* Power up output pin */ 11496 alc_update_coef_idx(codec, 0x04, 0, 1<<11); 11497 } 11498 11499 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { 11500 val = alc_read_coef_idx(codec, 0xd); 11501 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { 11502 /* Capless ramp up clock control */ 11503 alc_write_coef_idx(codec, 0xd, val | (1<<10)); 11504 } 11505 val = alc_read_coef_idx(codec, 0x17); 11506 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { 11507 /* Class D power on reset */ 11508 alc_write_coef_idx(codec, 0x17, val | (1<<7)); 11509 } 11510 } 11511 11512 /* HP */ 11513 alc_update_coef_idx(codec, 0x4, 0, 1<<11); 11514 } 11515 11516 /* 11517 */ 11518 static int patch_alc269(struct hda_codec *codec) 11519 { 11520 struct alc_spec *spec; 11521 int err; 11522 11523 err = alc_alloc_spec(codec, 0x0b); 11524 if (err < 0) 11525 return err; 11526 11527 spec = codec->spec; 11528 spec->gen.shared_mic_vref_pin = 0x18; 11529 codec->power_save_node = 0; 11530 spec->en_3kpull_low = true; 11531 11532 codec->patch_ops.suspend = alc269_suspend; 11533 codec->patch_ops.resume = alc269_resume; 11534 spec->shutup = alc_default_shutup; 11535 spec->init_hook = alc_default_init; 11536 11537 switch (codec->core.vendor_id) { 11538 case 0x10ec0269: 11539 spec->codec_variant = ALC269_TYPE_ALC269VA; 11540 switch (alc_get_coef0(codec) & 0x00f0) { 11541 case 0x0010: 11542 if (codec->bus->pci && 11543 codec->bus->pci->subsystem_vendor == 0x1025 && 11544 spec->cdefine.platform_type == 1) 11545 err = alc_codec_rename(codec, "ALC271X"); 11546 spec->codec_variant = ALC269_TYPE_ALC269VB; 11547 break; 11548 case 0x0020: 11549 if (codec->bus->pci && 11550 codec->bus->pci->subsystem_vendor == 0x17aa && 11551 codec->bus->pci->subsystem_device == 0x21f3) 11552 err = alc_codec_rename(codec, "ALC3202"); 11553 spec->codec_variant = ALC269_TYPE_ALC269VC; 11554 break; 11555 case 0x0030: 11556 spec->codec_variant = ALC269_TYPE_ALC269VD; 11557 break; 11558 default: 11559 alc_fix_pll_init(codec, 0x20, 0x04, 15); 11560 } 11561 if (err < 0) 11562 goto error; 11563 spec->shutup = alc269_shutup; 11564 spec->init_hook = alc269_fill_coef; 11565 alc269_fill_coef(codec); 11566 break; 11567 11568 case 0x10ec0280: 11569 case 0x10ec0290: 11570 spec->codec_variant = ALC269_TYPE_ALC280; 11571 break; 11572 case 0x10ec0282: 11573 spec->codec_variant = ALC269_TYPE_ALC282; 11574 spec->shutup = alc282_shutup; 11575 spec->init_hook = alc282_init; 11576 break; 11577 case 0x10ec0233: 11578 case 0x10ec0283: 11579 spec->codec_variant = ALC269_TYPE_ALC283; 11580 spec->shutup = alc283_shutup; 11581 spec->init_hook = alc283_init; 11582 break; 11583 case 0x10ec0284: 11584 case 0x10ec0292: 11585 spec->codec_variant = ALC269_TYPE_ALC284; 11586 break; 11587 case 0x10ec0293: 11588 spec->codec_variant = ALC269_TYPE_ALC293; 11589 break; 11590 case 0x10ec0286: 11591 case 0x10ec0288: 11592 spec->codec_variant = ALC269_TYPE_ALC286; 11593 break; 11594 case 0x10ec0298: 11595 spec->codec_variant = ALC269_TYPE_ALC298; 11596 break; 11597 case 0x10ec0235: 11598 case 0x10ec0255: 11599 spec->codec_variant = ALC269_TYPE_ALC255; 11600 spec->shutup = alc256_shutup; 11601 spec->init_hook = alc256_init; 11602 break; 11603 case 0x10ec0230: 11604 case 0x10ec0236: 11605 case 0x10ec0256: 11606 case 0x19e58326: 11607 spec->codec_variant = ALC269_TYPE_ALC256; 11608 spec->shutup = alc256_shutup; 11609 spec->init_hook = alc256_init; 11610 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ 11611 if (codec->core.vendor_id == 0x10ec0236 && 11612 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD) 11613 spec->en_3kpull_low = false; 11614 break; 11615 case 0x10ec0257: 11616 spec->codec_variant = ALC269_TYPE_ALC257; 11617 spec->shutup = alc256_shutup; 11618 spec->init_hook = alc256_init; 11619 spec->gen.mixer_nid = 0; 11620 spec->en_3kpull_low = false; 11621 break; 11622 case 0x10ec0215: 11623 case 0x10ec0245: 11624 case 0x10ec0285: 11625 case 0x10ec0289: 11626 if (alc_get_coef0(codec) & 0x0010) 11627 spec->codec_variant = ALC269_TYPE_ALC245; 11628 else 11629 spec->codec_variant = ALC269_TYPE_ALC215; 11630 spec->shutup = alc225_shutup; 11631 spec->init_hook = alc225_init; 11632 spec->gen.mixer_nid = 0; 11633 break; 11634 case 0x10ec0225: 11635 case 0x10ec0295: 11636 case 0x10ec0299: 11637 spec->codec_variant = ALC269_TYPE_ALC225; 11638 spec->shutup = alc225_shutup; 11639 spec->init_hook = alc225_init; 11640 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ 11641 break; 11642 case 0x10ec0287: 11643 spec->codec_variant = ALC269_TYPE_ALC287; 11644 spec->shutup = alc225_shutup; 11645 spec->init_hook = alc225_init; 11646 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */ 11647 break; 11648 case 0x10ec0234: 11649 case 0x10ec0274: 11650 case 0x10ec0294: 11651 spec->codec_variant = ALC269_TYPE_ALC294; 11652 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ 11653 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ 11654 spec->init_hook = alc294_init; 11655 break; 11656 case 0x10ec0300: 11657 spec->codec_variant = ALC269_TYPE_ALC300; 11658 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ 11659 break; 11660 case 0x10ec0623: 11661 spec->codec_variant = ALC269_TYPE_ALC623; 11662 break; 11663 case 0x10ec0700: 11664 case 0x10ec0701: 11665 case 0x10ec0703: 11666 case 0x10ec0711: 11667 spec->codec_variant = ALC269_TYPE_ALC700; 11668 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ 11669 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ 11670 spec->init_hook = alc294_init; 11671 break; 11672 11673 } 11674 11675 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { 11676 spec->has_alc5505_dsp = 1; 11677 spec->init_hook = alc5505_dsp_init; 11678 } 11679 11680 alc_pre_init(codec); 11681 11682 snd_hda_pick_fixup(codec, alc269_fixup_models, 11683 alc269_fixup_tbl, alc269_fixups); 11684 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and 11685 * the quirk breaks the latter (bko#214101). 11686 * Clear the wrong entry. 11687 */ 11688 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 && 11689 codec->core.vendor_id == 0x10ec0294) { 11690 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n"); 11691 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; 11692 } 11693 11694 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); 11695 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); 11696 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, 11697 alc269_fixups); 11698 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 11699 11700 alc_auto_parse_customize_define(codec); 11701 11702 if (has_cdefine_beep(codec)) 11703 spec->gen.beep_nid = 0x01; 11704 11705 /* automatic parse from the BIOS config */ 11706 err = alc269_parse_auto_config(codec); 11707 if (err < 0) 11708 goto error; 11709 11710 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { 11711 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); 11712 if (err < 0) 11713 goto error; 11714 } 11715 11716 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 11717 11718 return 0; 11719 11720 error: 11721 alc_free(codec); 11722 return err; 11723 } 11724 11725 /* 11726 * ALC861 11727 */ 11728 11729 static int alc861_parse_auto_config(struct hda_codec *codec) 11730 { 11731 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; 11732 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; 11733 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); 11734 } 11735 11736 /* Pin config fixes */ 11737 enum { 11738 ALC861_FIXUP_FSC_AMILO_PI1505, 11739 ALC861_FIXUP_AMP_VREF_0F, 11740 ALC861_FIXUP_NO_JACK_DETECT, 11741 ALC861_FIXUP_ASUS_A6RP, 11742 ALC660_FIXUP_ASUS_W7J, 11743 }; 11744 11745 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ 11746 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, 11747 const struct hda_fixup *fix, int action) 11748 { 11749 struct alc_spec *spec = codec->spec; 11750 unsigned int val; 11751 11752 if (action != HDA_FIXUP_ACT_INIT) 11753 return; 11754 val = snd_hda_codec_get_pin_target(codec, 0x0f); 11755 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) 11756 val |= AC_PINCTL_IN_EN; 11757 val |= AC_PINCTL_VREF_50; 11758 snd_hda_set_pin_ctl(codec, 0x0f, val); 11759 spec->gen.keep_vref_in_automute = 1; 11760 } 11761 11762 /* suppress the jack-detection */ 11763 static void alc_fixup_no_jack_detect(struct hda_codec *codec, 11764 const struct hda_fixup *fix, int action) 11765 { 11766 if (action == HDA_FIXUP_ACT_PRE_PROBE) 11767 codec->no_jack_detect = 1; 11768 } 11769 11770 static const struct hda_fixup alc861_fixups[] = { 11771 [ALC861_FIXUP_FSC_AMILO_PI1505] = { 11772 .type = HDA_FIXUP_PINS, 11773 .v.pins = (const struct hda_pintbl[]) { 11774 { 0x0b, 0x0221101f }, /* HP */ 11775 { 0x0f, 0x90170310 }, /* speaker */ 11776 { } 11777 } 11778 }, 11779 [ALC861_FIXUP_AMP_VREF_0F] = { 11780 .type = HDA_FIXUP_FUNC, 11781 .v.func = alc861_fixup_asus_amp_vref_0f, 11782 }, 11783 [ALC861_FIXUP_NO_JACK_DETECT] = { 11784 .type = HDA_FIXUP_FUNC, 11785 .v.func = alc_fixup_no_jack_detect, 11786 }, 11787 [ALC861_FIXUP_ASUS_A6RP] = { 11788 .type = HDA_FIXUP_FUNC, 11789 .v.func = alc861_fixup_asus_amp_vref_0f, 11790 .chained = true, 11791 .chain_id = ALC861_FIXUP_NO_JACK_DETECT, 11792 }, 11793 [ALC660_FIXUP_ASUS_W7J] = { 11794 .type = HDA_FIXUP_VERBS, 11795 .v.verbs = (const struct hda_verb[]) { 11796 /* ASUS W7J needs a magic pin setup on unused NID 0x10 11797 * for enabling outputs 11798 */ 11799 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, 11800 { } 11801 }, 11802 } 11803 }; 11804 11805 static const struct snd_pci_quirk alc861_fixup_tbl[] = { 11806 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), 11807 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), 11808 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), 11809 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), 11810 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), 11811 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F), 11812 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), 11813 {} 11814 }; 11815 11816 /* 11817 */ 11818 static int patch_alc861(struct hda_codec *codec) 11819 { 11820 struct alc_spec *spec; 11821 int err; 11822 11823 err = alc_alloc_spec(codec, 0x15); 11824 if (err < 0) 11825 return err; 11826 11827 spec = codec->spec; 11828 if (has_cdefine_beep(codec)) 11829 spec->gen.beep_nid = 0x23; 11830 11831 spec->power_hook = alc_power_eapd; 11832 11833 alc_pre_init(codec); 11834 11835 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); 11836 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 11837 11838 /* automatic parse from the BIOS config */ 11839 err = alc861_parse_auto_config(codec); 11840 if (err < 0) 11841 goto error; 11842 11843 if (!spec->gen.no_analog) { 11844 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); 11845 if (err < 0) 11846 goto error; 11847 } 11848 11849 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 11850 11851 return 0; 11852 11853 error: 11854 alc_free(codec); 11855 return err; 11856 } 11857 11858 /* 11859 * ALC861-VD support 11860 * 11861 * Based on ALC882 11862 * 11863 * In addition, an independent DAC 11864 */ 11865 static int alc861vd_parse_auto_config(struct hda_codec *codec) 11866 { 11867 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; 11868 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 11869 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); 11870 } 11871 11872 enum { 11873 ALC660VD_FIX_ASUS_GPIO1, 11874 ALC861VD_FIX_DALLAS, 11875 }; 11876 11877 /* exclude VREF80 */ 11878 static void alc861vd_fixup_dallas(struct hda_codec *codec, 11879 const struct hda_fixup *fix, int action) 11880 { 11881 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 11882 snd_hda_override_pin_caps(codec, 0x18, 0x00000734); 11883 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); 11884 } 11885 } 11886 11887 /* reset GPIO1 */ 11888 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, 11889 const struct hda_fixup *fix, int action) 11890 { 11891 struct alc_spec *spec = codec->spec; 11892 11893 if (action == HDA_FIXUP_ACT_PRE_PROBE) 11894 spec->gpio_mask |= 0x02; 11895 alc_fixup_gpio(codec, action, 0x01); 11896 } 11897 11898 static const struct hda_fixup alc861vd_fixups[] = { 11899 [ALC660VD_FIX_ASUS_GPIO1] = { 11900 .type = HDA_FIXUP_FUNC, 11901 .v.func = alc660vd_fixup_asus_gpio1, 11902 }, 11903 [ALC861VD_FIX_DALLAS] = { 11904 .type = HDA_FIXUP_FUNC, 11905 .v.func = alc861vd_fixup_dallas, 11906 }, 11907 }; 11908 11909 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { 11910 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), 11911 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), 11912 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), 11913 {} 11914 }; 11915 11916 /* 11917 */ 11918 static int patch_alc861vd(struct hda_codec *codec) 11919 { 11920 struct alc_spec *spec; 11921 int err; 11922 11923 err = alc_alloc_spec(codec, 0x0b); 11924 if (err < 0) 11925 return err; 11926 11927 spec = codec->spec; 11928 if (has_cdefine_beep(codec)) 11929 spec->gen.beep_nid = 0x23; 11930 11931 spec->shutup = alc_eapd_shutup; 11932 11933 alc_pre_init(codec); 11934 11935 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); 11936 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 11937 11938 /* automatic parse from the BIOS config */ 11939 err = alc861vd_parse_auto_config(codec); 11940 if (err < 0) 11941 goto error; 11942 11943 if (!spec->gen.no_analog) { 11944 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 11945 if (err < 0) 11946 goto error; 11947 } 11948 11949 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 11950 11951 return 0; 11952 11953 error: 11954 alc_free(codec); 11955 return err; 11956 } 11957 11958 /* 11959 * ALC662 support 11960 * 11961 * ALC662 is almost identical with ALC880 but has cleaner and more flexible 11962 * configuration. Each pin widget can choose any input DACs and a mixer. 11963 * Each ADC is connected from a mixer of all inputs. This makes possible 11964 * 6-channel independent captures. 11965 * 11966 * In addition, an independent DAC for the multi-playback (not used in this 11967 * driver yet). 11968 */ 11969 11970 /* 11971 * BIOS auto configuration 11972 */ 11973 11974 static int alc662_parse_auto_config(struct hda_codec *codec) 11975 { 11976 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; 11977 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; 11978 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 11979 const hda_nid_t *ssids; 11980 11981 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || 11982 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || 11983 codec->core.vendor_id == 0x10ec0671) 11984 ssids = alc663_ssids; 11985 else 11986 ssids = alc662_ssids; 11987 return alc_parse_auto_config(codec, alc662_ignore, ssids); 11988 } 11989 11990 static void alc272_fixup_mario(struct hda_codec *codec, 11991 const struct hda_fixup *fix, int action) 11992 { 11993 if (action != HDA_FIXUP_ACT_PRE_PROBE) 11994 return; 11995 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, 11996 (0x3b << AC_AMPCAP_OFFSET_SHIFT) | 11997 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | 11998 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | 11999 (0 << AC_AMPCAP_MUTE_SHIFT))) 12000 codec_warn(codec, "failed to override amp caps for NID 0x2\n"); 12001 } 12002 12003 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { 12004 { .channels = 2, 12005 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, 12006 { .channels = 4, 12007 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, 12008 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ 12009 { } 12010 }; 12011 12012 /* override the 2.1 chmap */ 12013 static void alc_fixup_bass_chmap(struct hda_codec *codec, 12014 const struct hda_fixup *fix, int action) 12015 { 12016 if (action == HDA_FIXUP_ACT_BUILD) { 12017 struct alc_spec *spec = codec->spec; 12018 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; 12019 } 12020 } 12021 12022 /* avoid D3 for keeping GPIO up */ 12023 static unsigned int gpio_led_power_filter(struct hda_codec *codec, 12024 hda_nid_t nid, 12025 unsigned int power_state) 12026 { 12027 struct alc_spec *spec = codec->spec; 12028 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) 12029 return AC_PWRST_D0; 12030 return power_state; 12031 } 12032 12033 static void alc662_fixup_led_gpio1(struct hda_codec *codec, 12034 const struct hda_fixup *fix, int action) 12035 { 12036 struct alc_spec *spec = codec->spec; 12037 12038 alc_fixup_hp_gpio_led(codec, action, 0x01, 0); 12039 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12040 spec->mute_led_polarity = 1; 12041 codec->power_filter = gpio_led_power_filter; 12042 } 12043 } 12044 12045 static void alc662_usi_automute_hook(struct hda_codec *codec, 12046 struct hda_jack_callback *jack) 12047 { 12048 struct alc_spec *spec = codec->spec; 12049 int vref; 12050 msleep(200); 12051 snd_hda_gen_hp_automute(codec, jack); 12052 12053 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 12054 msleep(100); 12055 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 12056 vref); 12057 } 12058 12059 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, 12060 const struct hda_fixup *fix, int action) 12061 { 12062 struct alc_spec *spec = codec->spec; 12063 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12064 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 12065 spec->gen.hp_automute_hook = alc662_usi_automute_hook; 12066 } 12067 } 12068 12069 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, 12070 struct hda_jack_callback *cb) 12071 { 12072 /* surround speakers at 0x1b already get muted automatically when 12073 * headphones are plugged in, but we have to mute/unmute the remaining 12074 * channels manually: 12075 * 0x15 - front left/front right 12076 * 0x18 - front center/ LFE 12077 */ 12078 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { 12079 snd_hda_set_pin_ctl_cache(codec, 0x15, 0); 12080 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); 12081 } else { 12082 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); 12083 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); 12084 } 12085 } 12086 12087 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, 12088 const struct hda_fixup *fix, int action) 12089 { 12090 /* Pin 0x1b: shared headphones jack and surround speakers */ 12091 if (!is_jack_detectable(codec, 0x1b)) 12092 return; 12093 12094 switch (action) { 12095 case HDA_FIXUP_ACT_PRE_PROBE: 12096 snd_hda_jack_detect_enable_callback(codec, 0x1b, 12097 alc662_aspire_ethos_mute_speakers); 12098 /* subwoofer needs an extra GPIO setting to become audible */ 12099 alc_setup_gpio(codec, 0x02); 12100 break; 12101 case HDA_FIXUP_ACT_INIT: 12102 /* Make sure to start in a correct state, i.e. if 12103 * headphones have been plugged in before powering up the system 12104 */ 12105 alc662_aspire_ethos_mute_speakers(codec, NULL); 12106 break; 12107 } 12108 } 12109 12110 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, 12111 const struct hda_fixup *fix, int action) 12112 { 12113 struct alc_spec *spec = codec->spec; 12114 12115 static const struct hda_pintbl pincfgs[] = { 12116 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ 12117 { 0x1b, 0x0181304f }, 12118 { } 12119 }; 12120 12121 switch (action) { 12122 case HDA_FIXUP_ACT_PRE_PROBE: 12123 spec->gen.mixer_nid = 0; 12124 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 12125 snd_hda_apply_pincfgs(codec, pincfgs); 12126 break; 12127 case HDA_FIXUP_ACT_INIT: 12128 alc_write_coef_idx(codec, 0x19, 0xa054); 12129 break; 12130 } 12131 } 12132 12133 static void alc897_hp_automute_hook(struct hda_codec *codec, 12134 struct hda_jack_callback *jack) 12135 { 12136 struct alc_spec *spec = codec->spec; 12137 int vref; 12138 12139 snd_hda_gen_hp_automute(codec, jack); 12140 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP; 12141 snd_hda_set_pin_ctl(codec, 0x1b, vref); 12142 } 12143 12144 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec, 12145 const struct hda_fixup *fix, int action) 12146 { 12147 struct alc_spec *spec = codec->spec; 12148 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12149 spec->gen.hp_automute_hook = alc897_hp_automute_hook; 12150 spec->no_shutup_pins = 1; 12151 } 12152 if (action == HDA_FIXUP_ACT_PROBE) { 12153 snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100); 12154 } 12155 } 12156 12157 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec, 12158 const struct hda_fixup *fix, int action) 12159 { 12160 struct alc_spec *spec = codec->spec; 12161 12162 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 12163 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 12164 spec->gen.hp_automute_hook = alc897_hp_automute_hook; 12165 } 12166 } 12167 12168 static const struct coef_fw alc668_coefs[] = { 12169 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), 12170 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), 12171 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), 12172 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), 12173 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), 12174 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), 12175 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), 12176 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), 12177 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), 12178 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), 12179 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), 12180 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), 12181 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), 12182 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), 12183 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), 12184 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), 12185 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), 12186 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), 12187 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), 12188 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), 12189 {} 12190 }; 12191 12192 static void alc668_restore_default_value(struct hda_codec *codec) 12193 { 12194 alc_process_coef_fw(codec, alc668_coefs); 12195 } 12196 12197 enum { 12198 ALC662_FIXUP_ASPIRE, 12199 ALC662_FIXUP_LED_GPIO1, 12200 ALC662_FIXUP_IDEAPAD, 12201 ALC272_FIXUP_MARIO, 12202 ALC662_FIXUP_CZC_ET26, 12203 ALC662_FIXUP_CZC_P10T, 12204 ALC662_FIXUP_SKU_IGNORE, 12205 ALC662_FIXUP_HP_RP5800, 12206 ALC662_FIXUP_ASUS_MODE1, 12207 ALC662_FIXUP_ASUS_MODE2, 12208 ALC662_FIXUP_ASUS_MODE3, 12209 ALC662_FIXUP_ASUS_MODE4, 12210 ALC662_FIXUP_ASUS_MODE5, 12211 ALC662_FIXUP_ASUS_MODE6, 12212 ALC662_FIXUP_ASUS_MODE7, 12213 ALC662_FIXUP_ASUS_MODE8, 12214 ALC662_FIXUP_NO_JACK_DETECT, 12215 ALC662_FIXUP_ZOTAC_Z68, 12216 ALC662_FIXUP_INV_DMIC, 12217 ALC662_FIXUP_DELL_MIC_NO_PRESENCE, 12218 ALC668_FIXUP_DELL_MIC_NO_PRESENCE, 12219 ALC662_FIXUP_HEADSET_MODE, 12220 ALC668_FIXUP_HEADSET_MODE, 12221 ALC662_FIXUP_BASS_MODE4_CHMAP, 12222 ALC662_FIXUP_BASS_16, 12223 ALC662_FIXUP_BASS_1A, 12224 ALC662_FIXUP_BASS_CHMAP, 12225 ALC668_FIXUP_AUTO_MUTE, 12226 ALC668_FIXUP_DELL_DISABLE_AAMIX, 12227 ALC668_FIXUP_DELL_XPS13, 12228 ALC662_FIXUP_ASUS_Nx50, 12229 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, 12230 ALC668_FIXUP_ASUS_Nx51, 12231 ALC668_FIXUP_MIC_COEF, 12232 ALC668_FIXUP_ASUS_G751, 12233 ALC891_FIXUP_HEADSET_MODE, 12234 ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 12235 ALC662_FIXUP_ACER_VERITON, 12236 ALC892_FIXUP_ASROCK_MOBO, 12237 ALC662_FIXUP_USI_FUNC, 12238 ALC662_FIXUP_USI_HEADSET_MODE, 12239 ALC662_FIXUP_LENOVO_MULTI_CODECS, 12240 ALC669_FIXUP_ACER_ASPIRE_ETHOS, 12241 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, 12242 ALC671_FIXUP_HP_HEADSET_MIC2, 12243 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, 12244 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, 12245 ALC668_FIXUP_ASUS_NO_HEADSET_MIC, 12246 ALC668_FIXUP_HEADSET_MIC, 12247 ALC668_FIXUP_MIC_DET_COEF, 12248 ALC897_FIXUP_LENOVO_HEADSET_MIC, 12249 ALC897_FIXUP_HEADSET_MIC_PIN, 12250 ALC897_FIXUP_HP_HSMIC_VERB, 12251 ALC897_FIXUP_LENOVO_HEADSET_MODE, 12252 ALC897_FIXUP_HEADSET_MIC_PIN2, 12253 ALC897_FIXUP_UNIS_H3C_X500S, 12254 ALC897_FIXUP_HEADSET_MIC_PIN3, 12255 }; 12256 12257 static const struct hda_fixup alc662_fixups[] = { 12258 [ALC662_FIXUP_ASPIRE] = { 12259 .type = HDA_FIXUP_PINS, 12260 .v.pins = (const struct hda_pintbl[]) { 12261 { 0x15, 0x99130112 }, /* subwoofer */ 12262 { } 12263 } 12264 }, 12265 [ALC662_FIXUP_LED_GPIO1] = { 12266 .type = HDA_FIXUP_FUNC, 12267 .v.func = alc662_fixup_led_gpio1, 12268 }, 12269 [ALC662_FIXUP_IDEAPAD] = { 12270 .type = HDA_FIXUP_PINS, 12271 .v.pins = (const struct hda_pintbl[]) { 12272 { 0x17, 0x99130112 }, /* subwoofer */ 12273 { } 12274 }, 12275 .chained = true, 12276 .chain_id = ALC662_FIXUP_LED_GPIO1, 12277 }, 12278 [ALC272_FIXUP_MARIO] = { 12279 .type = HDA_FIXUP_FUNC, 12280 .v.func = alc272_fixup_mario, 12281 }, 12282 [ALC662_FIXUP_CZC_ET26] = { 12283 .type = HDA_FIXUP_PINS, 12284 .v.pins = (const struct hda_pintbl[]) { 12285 {0x12, 0x403cc000}, 12286 {0x14, 0x90170110}, /* speaker */ 12287 {0x15, 0x411111f0}, 12288 {0x16, 0x411111f0}, 12289 {0x18, 0x01a19030}, /* mic */ 12290 {0x19, 0x90a7013f}, /* int-mic */ 12291 {0x1a, 0x01014020}, 12292 {0x1b, 0x0121401f}, 12293 {0x1c, 0x411111f0}, 12294 {0x1d, 0x411111f0}, 12295 {0x1e, 0x40478e35}, 12296 {} 12297 }, 12298 .chained = true, 12299 .chain_id = ALC662_FIXUP_SKU_IGNORE 12300 }, 12301 [ALC662_FIXUP_CZC_P10T] = { 12302 .type = HDA_FIXUP_VERBS, 12303 .v.verbs = (const struct hda_verb[]) { 12304 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, 12305 {} 12306 } 12307 }, 12308 [ALC662_FIXUP_SKU_IGNORE] = { 12309 .type = HDA_FIXUP_FUNC, 12310 .v.func = alc_fixup_sku_ignore, 12311 }, 12312 [ALC662_FIXUP_HP_RP5800] = { 12313 .type = HDA_FIXUP_PINS, 12314 .v.pins = (const struct hda_pintbl[]) { 12315 { 0x14, 0x0221201f }, /* HP out */ 12316 { } 12317 }, 12318 .chained = true, 12319 .chain_id = ALC662_FIXUP_SKU_IGNORE 12320 }, 12321 [ALC662_FIXUP_ASUS_MODE1] = { 12322 .type = HDA_FIXUP_PINS, 12323 .v.pins = (const struct hda_pintbl[]) { 12324 { 0x14, 0x99130110 }, /* speaker */ 12325 { 0x18, 0x01a19c20 }, /* mic */ 12326 { 0x19, 0x99a3092f }, /* int-mic */ 12327 { 0x21, 0x0121401f }, /* HP out */ 12328 { } 12329 }, 12330 .chained = true, 12331 .chain_id = ALC662_FIXUP_SKU_IGNORE 12332 }, 12333 [ALC662_FIXUP_ASUS_MODE2] = { 12334 .type = HDA_FIXUP_PINS, 12335 .v.pins = (const struct hda_pintbl[]) { 12336 { 0x14, 0x99130110 }, /* speaker */ 12337 { 0x18, 0x01a19820 }, /* mic */ 12338 { 0x19, 0x99a3092f }, /* int-mic */ 12339 { 0x1b, 0x0121401f }, /* HP out */ 12340 { } 12341 }, 12342 .chained = true, 12343 .chain_id = ALC662_FIXUP_SKU_IGNORE 12344 }, 12345 [ALC662_FIXUP_ASUS_MODE3] = { 12346 .type = HDA_FIXUP_PINS, 12347 .v.pins = (const struct hda_pintbl[]) { 12348 { 0x14, 0x99130110 }, /* speaker */ 12349 { 0x15, 0x0121441f }, /* HP */ 12350 { 0x18, 0x01a19840 }, /* mic */ 12351 { 0x19, 0x99a3094f }, /* int-mic */ 12352 { 0x21, 0x01211420 }, /* HP2 */ 12353 { } 12354 }, 12355 .chained = true, 12356 .chain_id = ALC662_FIXUP_SKU_IGNORE 12357 }, 12358 [ALC662_FIXUP_ASUS_MODE4] = { 12359 .type = HDA_FIXUP_PINS, 12360 .v.pins = (const struct hda_pintbl[]) { 12361 { 0x14, 0x99130110 }, /* speaker */ 12362 { 0x16, 0x99130111 }, /* speaker */ 12363 { 0x18, 0x01a19840 }, /* mic */ 12364 { 0x19, 0x99a3094f }, /* int-mic */ 12365 { 0x21, 0x0121441f }, /* HP */ 12366 { } 12367 }, 12368 .chained = true, 12369 .chain_id = ALC662_FIXUP_SKU_IGNORE 12370 }, 12371 [ALC662_FIXUP_ASUS_MODE5] = { 12372 .type = HDA_FIXUP_PINS, 12373 .v.pins = (const struct hda_pintbl[]) { 12374 { 0x14, 0x99130110 }, /* speaker */ 12375 { 0x15, 0x0121441f }, /* HP */ 12376 { 0x16, 0x99130111 }, /* speaker */ 12377 { 0x18, 0x01a19840 }, /* mic */ 12378 { 0x19, 0x99a3094f }, /* int-mic */ 12379 { } 12380 }, 12381 .chained = true, 12382 .chain_id = ALC662_FIXUP_SKU_IGNORE 12383 }, 12384 [ALC662_FIXUP_ASUS_MODE6] = { 12385 .type = HDA_FIXUP_PINS, 12386 .v.pins = (const struct hda_pintbl[]) { 12387 { 0x14, 0x99130110 }, /* speaker */ 12388 { 0x15, 0x01211420 }, /* HP2 */ 12389 { 0x18, 0x01a19840 }, /* mic */ 12390 { 0x19, 0x99a3094f }, /* int-mic */ 12391 { 0x1b, 0x0121441f }, /* HP */ 12392 { } 12393 }, 12394 .chained = true, 12395 .chain_id = ALC662_FIXUP_SKU_IGNORE 12396 }, 12397 [ALC662_FIXUP_ASUS_MODE7] = { 12398 .type = HDA_FIXUP_PINS, 12399 .v.pins = (const struct hda_pintbl[]) { 12400 { 0x14, 0x99130110 }, /* speaker */ 12401 { 0x17, 0x99130111 }, /* speaker */ 12402 { 0x18, 0x01a19840 }, /* mic */ 12403 { 0x19, 0x99a3094f }, /* int-mic */ 12404 { 0x1b, 0x01214020 }, /* HP */ 12405 { 0x21, 0x0121401f }, /* HP */ 12406 { } 12407 }, 12408 .chained = true, 12409 .chain_id = ALC662_FIXUP_SKU_IGNORE 12410 }, 12411 [ALC662_FIXUP_ASUS_MODE8] = { 12412 .type = HDA_FIXUP_PINS, 12413 .v.pins = (const struct hda_pintbl[]) { 12414 { 0x14, 0x99130110 }, /* speaker */ 12415 { 0x12, 0x99a30970 }, /* int-mic */ 12416 { 0x15, 0x01214020 }, /* HP */ 12417 { 0x17, 0x99130111 }, /* speaker */ 12418 { 0x18, 0x01a19840 }, /* mic */ 12419 { 0x21, 0x0121401f }, /* HP */ 12420 { } 12421 }, 12422 .chained = true, 12423 .chain_id = ALC662_FIXUP_SKU_IGNORE 12424 }, 12425 [ALC662_FIXUP_NO_JACK_DETECT] = { 12426 .type = HDA_FIXUP_FUNC, 12427 .v.func = alc_fixup_no_jack_detect, 12428 }, 12429 [ALC662_FIXUP_ZOTAC_Z68] = { 12430 .type = HDA_FIXUP_PINS, 12431 .v.pins = (const struct hda_pintbl[]) { 12432 { 0x1b, 0x02214020 }, /* Front HP */ 12433 { } 12434 } 12435 }, 12436 [ALC662_FIXUP_INV_DMIC] = { 12437 .type = HDA_FIXUP_FUNC, 12438 .v.func = alc_fixup_inv_dmic, 12439 }, 12440 [ALC668_FIXUP_DELL_XPS13] = { 12441 .type = HDA_FIXUP_FUNC, 12442 .v.func = alc_fixup_dell_xps13, 12443 .chained = true, 12444 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX 12445 }, 12446 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { 12447 .type = HDA_FIXUP_FUNC, 12448 .v.func = alc_fixup_disable_aamix, 12449 .chained = true, 12450 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE 12451 }, 12452 [ALC668_FIXUP_AUTO_MUTE] = { 12453 .type = HDA_FIXUP_FUNC, 12454 .v.func = alc_fixup_auto_mute_via_amp, 12455 .chained = true, 12456 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE 12457 }, 12458 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { 12459 .type = HDA_FIXUP_PINS, 12460 .v.pins = (const struct hda_pintbl[]) { 12461 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12462 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ 12463 { } 12464 }, 12465 .chained = true, 12466 .chain_id = ALC662_FIXUP_HEADSET_MODE 12467 }, 12468 [ALC662_FIXUP_HEADSET_MODE] = { 12469 .type = HDA_FIXUP_FUNC, 12470 .v.func = alc_fixup_headset_mode_alc662, 12471 }, 12472 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { 12473 .type = HDA_FIXUP_PINS, 12474 .v.pins = (const struct hda_pintbl[]) { 12475 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 12476 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12477 { } 12478 }, 12479 .chained = true, 12480 .chain_id = ALC668_FIXUP_HEADSET_MODE 12481 }, 12482 [ALC668_FIXUP_HEADSET_MODE] = { 12483 .type = HDA_FIXUP_FUNC, 12484 .v.func = alc_fixup_headset_mode_alc668, 12485 }, 12486 [ALC662_FIXUP_BASS_MODE4_CHMAP] = { 12487 .type = HDA_FIXUP_FUNC, 12488 .v.func = alc_fixup_bass_chmap, 12489 .chained = true, 12490 .chain_id = ALC662_FIXUP_ASUS_MODE4 12491 }, 12492 [ALC662_FIXUP_BASS_16] = { 12493 .type = HDA_FIXUP_PINS, 12494 .v.pins = (const struct hda_pintbl[]) { 12495 {0x16, 0x80106111}, /* bass speaker */ 12496 {} 12497 }, 12498 .chained = true, 12499 .chain_id = ALC662_FIXUP_BASS_CHMAP, 12500 }, 12501 [ALC662_FIXUP_BASS_1A] = { 12502 .type = HDA_FIXUP_PINS, 12503 .v.pins = (const struct hda_pintbl[]) { 12504 {0x1a, 0x80106111}, /* bass speaker */ 12505 {} 12506 }, 12507 .chained = true, 12508 .chain_id = ALC662_FIXUP_BASS_CHMAP, 12509 }, 12510 [ALC662_FIXUP_BASS_CHMAP] = { 12511 .type = HDA_FIXUP_FUNC, 12512 .v.func = alc_fixup_bass_chmap, 12513 }, 12514 [ALC662_FIXUP_ASUS_Nx50] = { 12515 .type = HDA_FIXUP_FUNC, 12516 .v.func = alc_fixup_auto_mute_via_amp, 12517 .chained = true, 12518 .chain_id = ALC662_FIXUP_BASS_1A 12519 }, 12520 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { 12521 .type = HDA_FIXUP_FUNC, 12522 .v.func = alc_fixup_headset_mode_alc668, 12523 .chain_id = ALC662_FIXUP_BASS_CHMAP 12524 }, 12525 [ALC668_FIXUP_ASUS_Nx51] = { 12526 .type = HDA_FIXUP_PINS, 12527 .v.pins = (const struct hda_pintbl[]) { 12528 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 12529 { 0x1a, 0x90170151 }, /* bass speaker */ 12530 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12531 {} 12532 }, 12533 .chained = true, 12534 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, 12535 }, 12536 [ALC668_FIXUP_MIC_COEF] = { 12537 .type = HDA_FIXUP_VERBS, 12538 .v.verbs = (const struct hda_verb[]) { 12539 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, 12540 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, 12541 {} 12542 }, 12543 }, 12544 [ALC668_FIXUP_ASUS_G751] = { 12545 .type = HDA_FIXUP_PINS, 12546 .v.pins = (const struct hda_pintbl[]) { 12547 { 0x16, 0x0421101f }, /* HP */ 12548 {} 12549 }, 12550 .chained = true, 12551 .chain_id = ALC668_FIXUP_MIC_COEF 12552 }, 12553 [ALC891_FIXUP_HEADSET_MODE] = { 12554 .type = HDA_FIXUP_FUNC, 12555 .v.func = alc_fixup_headset_mode, 12556 }, 12557 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { 12558 .type = HDA_FIXUP_PINS, 12559 .v.pins = (const struct hda_pintbl[]) { 12560 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 12561 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 12562 { } 12563 }, 12564 .chained = true, 12565 .chain_id = ALC891_FIXUP_HEADSET_MODE 12566 }, 12567 [ALC662_FIXUP_ACER_VERITON] = { 12568 .type = HDA_FIXUP_PINS, 12569 .v.pins = (const struct hda_pintbl[]) { 12570 { 0x15, 0x50170120 }, /* no internal speaker */ 12571 { } 12572 } 12573 }, 12574 [ALC892_FIXUP_ASROCK_MOBO] = { 12575 .type = HDA_FIXUP_PINS, 12576 .v.pins = (const struct hda_pintbl[]) { 12577 { 0x15, 0x40f000f0 }, /* disabled */ 12578 { 0x16, 0x40f000f0 }, /* disabled */ 12579 { } 12580 } 12581 }, 12582 [ALC662_FIXUP_USI_FUNC] = { 12583 .type = HDA_FIXUP_FUNC, 12584 .v.func = alc662_fixup_usi_headset_mic, 12585 }, 12586 [ALC662_FIXUP_USI_HEADSET_MODE] = { 12587 .type = HDA_FIXUP_PINS, 12588 .v.pins = (const struct hda_pintbl[]) { 12589 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ 12590 { 0x18, 0x01a1903d }, 12591 { } 12592 }, 12593 .chained = true, 12594 .chain_id = ALC662_FIXUP_USI_FUNC 12595 }, 12596 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { 12597 .type = HDA_FIXUP_FUNC, 12598 .v.func = alc233_alc662_fixup_lenovo_dual_codecs, 12599 }, 12600 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { 12601 .type = HDA_FIXUP_FUNC, 12602 .v.func = alc662_fixup_aspire_ethos_hp, 12603 }, 12604 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { 12605 .type = HDA_FIXUP_PINS, 12606 .v.pins = (const struct hda_pintbl[]) { 12607 { 0x15, 0x92130110 }, /* front speakers */ 12608 { 0x18, 0x99130111 }, /* center/subwoofer */ 12609 { 0x1b, 0x11130012 }, /* surround plus jack for HP */ 12610 { } 12611 }, 12612 .chained = true, 12613 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET 12614 }, 12615 [ALC671_FIXUP_HP_HEADSET_MIC2] = { 12616 .type = HDA_FIXUP_FUNC, 12617 .v.func = alc671_fixup_hp_headset_mic2, 12618 }, 12619 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { 12620 .type = HDA_FIXUP_PINS, 12621 .v.pins = (const struct hda_pintbl[]) { 12622 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ 12623 { } 12624 }, 12625 .chained = true, 12626 .chain_id = ALC662_FIXUP_USI_FUNC 12627 }, 12628 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { 12629 .type = HDA_FIXUP_PINS, 12630 .v.pins = (const struct hda_pintbl[]) { 12631 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ 12632 { 0x1b, 0x0221144f }, 12633 { } 12634 }, 12635 .chained = true, 12636 .chain_id = ALC662_FIXUP_USI_FUNC 12637 }, 12638 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = { 12639 .type = HDA_FIXUP_PINS, 12640 .v.pins = (const struct hda_pintbl[]) { 12641 { 0x1b, 0x04a1112c }, 12642 { } 12643 }, 12644 .chained = true, 12645 .chain_id = ALC668_FIXUP_HEADSET_MIC 12646 }, 12647 [ALC668_FIXUP_HEADSET_MIC] = { 12648 .type = HDA_FIXUP_FUNC, 12649 .v.func = alc269_fixup_headset_mic, 12650 .chained = true, 12651 .chain_id = ALC668_FIXUP_MIC_DET_COEF 12652 }, 12653 [ALC668_FIXUP_MIC_DET_COEF] = { 12654 .type = HDA_FIXUP_VERBS, 12655 .v.verbs = (const struct hda_verb[]) { 12656 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 }, 12657 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 }, 12658 {} 12659 }, 12660 }, 12661 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = { 12662 .type = HDA_FIXUP_FUNC, 12663 .v.func = alc897_fixup_lenovo_headset_mic, 12664 }, 12665 [ALC897_FIXUP_HEADSET_MIC_PIN] = { 12666 .type = HDA_FIXUP_PINS, 12667 .v.pins = (const struct hda_pintbl[]) { 12668 { 0x1a, 0x03a11050 }, 12669 { } 12670 }, 12671 .chained = true, 12672 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC 12673 }, 12674 [ALC897_FIXUP_HP_HSMIC_VERB] = { 12675 .type = HDA_FIXUP_PINS, 12676 .v.pins = (const struct hda_pintbl[]) { 12677 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 12678 { } 12679 }, 12680 }, 12681 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = { 12682 .type = HDA_FIXUP_FUNC, 12683 .v.func = alc897_fixup_lenovo_headset_mode, 12684 }, 12685 [ALC897_FIXUP_HEADSET_MIC_PIN2] = { 12686 .type = HDA_FIXUP_PINS, 12687 .v.pins = (const struct hda_pintbl[]) { 12688 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ 12689 { } 12690 }, 12691 .chained = true, 12692 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE 12693 }, 12694 [ALC897_FIXUP_UNIS_H3C_X500S] = { 12695 .type = HDA_FIXUP_VERBS, 12696 .v.verbs = (const struct hda_verb[]) { 12697 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 }, 12698 {} 12699 }, 12700 }, 12701 [ALC897_FIXUP_HEADSET_MIC_PIN3] = { 12702 .type = HDA_FIXUP_PINS, 12703 .v.pins = (const struct hda_pintbl[]) { 12704 { 0x19, 0x03a11050 }, /* use as headset mic */ 12705 { } 12706 }, 12707 }, 12708 }; 12709 12710 static const struct snd_pci_quirk alc662_fixup_tbl[] = { 12711 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), 12712 SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3), 12713 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), 12714 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), 12715 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), 12716 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), 12717 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), 12718 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), 12719 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 12720 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), 12721 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), 12722 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), 12723 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12724 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12725 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), 12726 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), 12727 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), 12728 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12729 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12730 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12731 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12732 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 12733 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 12734 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12735 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12736 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB), 12737 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), 12738 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2), 12739 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2), 12740 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2), 12741 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), 12742 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), 12743 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), 12744 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), 12745 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), 12746 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), 12747 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), 12748 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), 12749 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), 12750 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC), 12751 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), 12752 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), 12753 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), 12754 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), 12755 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), 12756 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 12757 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), 12758 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), 12759 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN), 12760 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN), 12761 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN), 12762 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN), 12763 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN), 12764 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN), 12765 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN), 12766 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN), 12767 SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN), 12768 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2), 12769 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 12770 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 12771 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), 12772 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), 12773 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), 12774 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), 12775 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), 12776 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB), 12777 12778 #if 0 12779 /* Below is a quirk table taken from the old code. 12780 * Basically the device should work as is without the fixup table. 12781 * If BIOS doesn't give a proper info, enable the corresponding 12782 * fixup entry. 12783 */ 12784 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), 12785 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), 12786 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), 12787 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), 12788 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 12789 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12790 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 12791 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), 12792 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), 12793 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12794 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), 12795 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), 12796 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), 12797 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), 12798 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), 12799 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12800 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), 12801 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), 12802 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12803 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 12804 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 12805 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12806 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), 12807 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), 12808 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), 12809 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12810 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), 12811 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 12812 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12813 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), 12814 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12815 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12816 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), 12817 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), 12818 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), 12819 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), 12820 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), 12821 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), 12822 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), 12823 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 12824 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), 12825 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), 12826 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 12827 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), 12828 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), 12829 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), 12830 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), 12831 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), 12832 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 12833 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), 12834 #endif 12835 {} 12836 }; 12837 12838 static const struct hda_model_fixup alc662_fixup_models[] = { 12839 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, 12840 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, 12841 {.id = ALC272_FIXUP_MARIO, .name = "mario"}, 12842 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, 12843 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, 12844 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, 12845 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, 12846 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, 12847 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, 12848 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, 12849 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, 12850 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, 12851 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, 12852 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, 12853 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, 12854 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 12855 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, 12856 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, 12857 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, 12858 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, 12859 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, 12860 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, 12861 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, 12862 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, 12863 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, 12864 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, 12865 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, 12866 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, 12867 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, 12868 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, 12869 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, 12870 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, 12871 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"}, 12872 {} 12873 }; 12874 12875 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 12876 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 12877 {0x17, 0x02211010}, 12878 {0x18, 0x01a19030}, 12879 {0x1a, 0x01813040}, 12880 {0x21, 0x01014020}), 12881 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 12882 {0x16, 0x01813030}, 12883 {0x17, 0x02211010}, 12884 {0x18, 0x01a19040}, 12885 {0x21, 0x01014020}), 12886 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, 12887 {0x14, 0x01014010}, 12888 {0x18, 0x01a19020}, 12889 {0x1a, 0x0181302f}, 12890 {0x1b, 0x0221401f}), 12891 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 12892 {0x12, 0x99a30130}, 12893 {0x14, 0x90170110}, 12894 {0x15, 0x0321101f}, 12895 {0x16, 0x03011020}), 12896 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 12897 {0x12, 0x99a30140}, 12898 {0x14, 0x90170110}, 12899 {0x15, 0x0321101f}, 12900 {0x16, 0x03011020}), 12901 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 12902 {0x12, 0x99a30150}, 12903 {0x14, 0x90170110}, 12904 {0x15, 0x0321101f}, 12905 {0x16, 0x03011020}), 12906 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 12907 {0x14, 0x90170110}, 12908 {0x15, 0x0321101f}, 12909 {0x16, 0x03011020}), 12910 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, 12911 {0x12, 0x90a60130}, 12912 {0x14, 0x90170110}, 12913 {0x15, 0x0321101f}), 12914 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 12915 {0x14, 0x01014010}, 12916 {0x17, 0x90170150}, 12917 {0x19, 0x02a11060}, 12918 {0x1b, 0x01813030}, 12919 {0x21, 0x02211020}), 12920 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 12921 {0x14, 0x01014010}, 12922 {0x18, 0x01a19040}, 12923 {0x1b, 0x01813030}, 12924 {0x21, 0x02211020}), 12925 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 12926 {0x14, 0x01014020}, 12927 {0x17, 0x90170110}, 12928 {0x18, 0x01a19050}, 12929 {0x1b, 0x01813040}, 12930 {0x21, 0x02211030}), 12931 {} 12932 }; 12933 12934 /* 12935 */ 12936 static int patch_alc662(struct hda_codec *codec) 12937 { 12938 struct alc_spec *spec; 12939 int err; 12940 12941 err = alc_alloc_spec(codec, 0x0b); 12942 if (err < 0) 12943 return err; 12944 12945 spec = codec->spec; 12946 12947 spec->shutup = alc_eapd_shutup; 12948 12949 /* handle multiple HPs as is */ 12950 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 12951 12952 alc_fix_pll_init(codec, 0x20, 0x04, 15); 12953 12954 switch (codec->core.vendor_id) { 12955 case 0x10ec0668: 12956 spec->init_hook = alc668_restore_default_value; 12957 break; 12958 } 12959 12960 alc_pre_init(codec); 12961 12962 snd_hda_pick_fixup(codec, alc662_fixup_models, 12963 alc662_fixup_tbl, alc662_fixups); 12964 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); 12965 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 12966 12967 alc_auto_parse_customize_define(codec); 12968 12969 if (has_cdefine_beep(codec)) 12970 spec->gen.beep_nid = 0x01; 12971 12972 if ((alc_get_coef0(codec) & (1 << 14)) && 12973 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && 12974 spec->cdefine.platform_type == 1) { 12975 err = alc_codec_rename(codec, "ALC272X"); 12976 if (err < 0) 12977 goto error; 12978 } 12979 12980 /* automatic parse from the BIOS config */ 12981 err = alc662_parse_auto_config(codec); 12982 if (err < 0) 12983 goto error; 12984 12985 if (!spec->gen.no_analog && spec->gen.beep_nid) { 12986 switch (codec->core.vendor_id) { 12987 case 0x10ec0662: 12988 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 12989 break; 12990 case 0x10ec0272: 12991 case 0x10ec0663: 12992 case 0x10ec0665: 12993 case 0x10ec0668: 12994 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 12995 break; 12996 case 0x10ec0273: 12997 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); 12998 break; 12999 } 13000 if (err < 0) 13001 goto error; 13002 } 13003 13004 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 13005 13006 return 0; 13007 13008 error: 13009 alc_free(codec); 13010 return err; 13011 } 13012 13013 /* 13014 * ALC680 support 13015 */ 13016 13017 static int alc680_parse_auto_config(struct hda_codec *codec) 13018 { 13019 return alc_parse_auto_config(codec, NULL, NULL); 13020 } 13021 13022 /* 13023 */ 13024 static int patch_alc680(struct hda_codec *codec) 13025 { 13026 int err; 13027 13028 /* ALC680 has no aa-loopback mixer */ 13029 err = alc_alloc_spec(codec, 0); 13030 if (err < 0) 13031 return err; 13032 13033 /* automatic parse from the BIOS config */ 13034 err = alc680_parse_auto_config(codec); 13035 if (err < 0) { 13036 alc_free(codec); 13037 return err; 13038 } 13039 13040 return 0; 13041 } 13042 13043 /* 13044 * patch entries 13045 */ 13046 static const struct hda_device_id snd_hda_id_realtek[] = { 13047 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), 13048 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), 13049 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), 13050 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), 13051 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269), 13052 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), 13053 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), 13054 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), 13055 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), 13056 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), 13057 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), 13058 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), 13059 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), 13060 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), 13061 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), 13062 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), 13063 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), 13064 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), 13065 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), 13066 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), 13067 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), 13068 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), 13069 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), 13070 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), 13071 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), 13072 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), 13073 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), 13074 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), 13075 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), 13076 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), 13077 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), 13078 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), 13079 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), 13080 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), 13081 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), 13082 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), 13083 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), 13084 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), 13085 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), 13086 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), 13087 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), 13088 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), 13089 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), 13090 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), 13091 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), 13092 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), 13093 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), 13094 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), 13095 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), 13096 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), 13097 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), 13098 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), 13099 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), 13100 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), 13101 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), 13102 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), 13103 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), 13104 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), 13105 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), 13106 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), 13107 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), 13108 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), 13109 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), 13110 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), 13111 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), 13112 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), 13113 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), 13114 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), 13115 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), 13116 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), 13117 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), 13118 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), 13119 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662), 13120 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), 13121 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), 13122 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), 13123 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), 13124 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), 13125 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269), 13126 {} /* terminator */ 13127 }; 13128 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); 13129 13130 MODULE_LICENSE("GPL"); 13131 MODULE_DESCRIPTION("Realtek HD-audio codec"); 13132 MODULE_IMPORT_NS(SND_HDA_SCODEC_COMPONENT); 13133 13134 static struct hda_codec_driver realtek_driver = { 13135 .id = snd_hda_id_realtek, 13136 }; 13137 13138 module_hda_codec_driver(realtek_driver); 13139