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/init.h> 14 #include <linux/delay.h> 15 #include <linux/slab.h> 16 #include <linux/pci.h> 17 #include <linux/dmi.h> 18 #include <linux/module.h> 19 #include <linux/input.h> 20 #include <linux/leds.h> 21 #include <sound/core.h> 22 #include <sound/jack.h> 23 #include <sound/hda_codec.h> 24 #include "hda_local.h" 25 #include "hda_auto_parser.h" 26 #include "hda_jack.h" 27 #include "hda_generic.h" 28 29 /* keep halting ALC5505 DSP, for power saving */ 30 #define HALT_REALTEK_ALC5505 31 32 /* extra amp-initialization sequence types */ 33 enum { 34 ALC_INIT_UNDEFINED, 35 ALC_INIT_NONE, 36 ALC_INIT_DEFAULT, 37 }; 38 39 enum { 40 ALC_HEADSET_MODE_UNKNOWN, 41 ALC_HEADSET_MODE_UNPLUGGED, 42 ALC_HEADSET_MODE_HEADSET, 43 ALC_HEADSET_MODE_MIC, 44 ALC_HEADSET_MODE_HEADPHONE, 45 }; 46 47 enum { 48 ALC_HEADSET_TYPE_UNKNOWN, 49 ALC_HEADSET_TYPE_CTIA, 50 ALC_HEADSET_TYPE_OMTP, 51 }; 52 53 enum { 54 ALC_KEY_MICMUTE_INDEX, 55 }; 56 57 struct alc_customize_define { 58 unsigned int sku_cfg; 59 unsigned char port_connectivity; 60 unsigned char check_sum; 61 unsigned char customization; 62 unsigned char external_amp; 63 unsigned int enable_pcbeep:1; 64 unsigned int platform_type:1; 65 unsigned int swap:1; 66 unsigned int override:1; 67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */ 68 }; 69 70 struct alc_coef_led { 71 unsigned int idx; 72 unsigned int mask; 73 unsigned int on; 74 unsigned int off; 75 }; 76 77 struct alc_spec { 78 struct hda_gen_spec gen; /* must be at head */ 79 80 /* codec parameterization */ 81 struct alc_customize_define cdefine; 82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */ 83 84 /* GPIO bits */ 85 unsigned int gpio_mask; 86 unsigned int gpio_dir; 87 unsigned int gpio_data; 88 bool gpio_write_delay; /* add a delay before writing gpio_data */ 89 90 /* mute LED for HP laptops, see vref_mute_led_set() */ 91 int mute_led_polarity; 92 int micmute_led_polarity; 93 hda_nid_t mute_led_nid; 94 hda_nid_t cap_mute_led_nid; 95 96 unsigned int gpio_mute_led_mask; 97 unsigned int gpio_mic_led_mask; 98 struct alc_coef_led mute_led_coef; 99 struct alc_coef_led mic_led_coef; 100 101 hda_nid_t headset_mic_pin; 102 hda_nid_t headphone_mic_pin; 103 int current_headset_mode; 104 int current_headset_type; 105 106 /* hooks */ 107 void (*init_hook)(struct hda_codec *codec); 108 #ifdef CONFIG_PM 109 void (*power_hook)(struct hda_codec *codec); 110 #endif 111 void (*shutup)(struct hda_codec *codec); 112 void (*reboot_notify)(struct hda_codec *codec); 113 114 int init_amp; 115 int codec_variant; /* flag for other variants */ 116 unsigned int has_alc5505_dsp:1; 117 unsigned int no_depop_delay:1; 118 unsigned int done_hp_init:1; 119 unsigned int no_shutup_pins:1; 120 unsigned int ultra_low_power:1; 121 unsigned int has_hs_key:1; 122 123 /* for PLL fix */ 124 hda_nid_t pll_nid; 125 unsigned int pll_coef_idx, pll_coef_bit; 126 unsigned int coef0; 127 struct input_dev *kb_dev; 128 u8 alc_mute_keycode_map[1]; 129 }; 130 131 /* 132 * COEF access helper functions 133 */ 134 135 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 136 unsigned int coef_idx) 137 { 138 unsigned int val; 139 140 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 141 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); 142 return val; 143 } 144 145 #define alc_read_coef_idx(codec, coef_idx) \ 146 alc_read_coefex_idx(codec, 0x20, coef_idx) 147 148 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 149 unsigned int coef_idx, unsigned int coef_val) 150 { 151 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx); 152 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val); 153 } 154 155 #define alc_write_coef_idx(codec, coef_idx, coef_val) \ 156 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val) 157 158 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid, 159 unsigned int coef_idx, unsigned int mask, 160 unsigned int bits_set) 161 { 162 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx); 163 164 if (val != -1) 165 alc_write_coefex_idx(codec, nid, coef_idx, 166 (val & ~mask) | bits_set); 167 } 168 169 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \ 170 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set) 171 172 /* a special bypass for COEF 0; read the cached value at the second time */ 173 static unsigned int alc_get_coef0(struct hda_codec *codec) 174 { 175 struct alc_spec *spec = codec->spec; 176 177 if (!spec->coef0) 178 spec->coef0 = alc_read_coef_idx(codec, 0); 179 return spec->coef0; 180 } 181 182 /* coef writes/updates batch */ 183 struct coef_fw { 184 unsigned char nid; 185 unsigned char idx; 186 unsigned short mask; 187 unsigned short val; 188 }; 189 190 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \ 191 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) } 192 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val) 193 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val) 194 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val) 195 196 static void alc_process_coef_fw(struct hda_codec *codec, 197 const struct coef_fw *fw) 198 { 199 for (; fw->nid; fw++) { 200 if (fw->mask == (unsigned short)-1) 201 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val); 202 else 203 alc_update_coefex_idx(codec, fw->nid, fw->idx, 204 fw->mask, fw->val); 205 } 206 } 207 208 /* 209 * GPIO setup tables, used in initialization 210 */ 211 212 /* Enable GPIO mask and set output */ 213 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask) 214 { 215 struct alc_spec *spec = codec->spec; 216 217 spec->gpio_mask |= mask; 218 spec->gpio_dir |= mask; 219 spec->gpio_data |= mask; 220 } 221 222 static void alc_write_gpio_data(struct hda_codec *codec) 223 { 224 struct alc_spec *spec = codec->spec; 225 226 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 227 spec->gpio_data); 228 } 229 230 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask, 231 bool on) 232 { 233 struct alc_spec *spec = codec->spec; 234 unsigned int oldval = spec->gpio_data; 235 236 if (on) 237 spec->gpio_data |= mask; 238 else 239 spec->gpio_data &= ~mask; 240 if (oldval != spec->gpio_data) 241 alc_write_gpio_data(codec); 242 } 243 244 static void alc_write_gpio(struct hda_codec *codec) 245 { 246 struct alc_spec *spec = codec->spec; 247 248 if (!spec->gpio_mask) 249 return; 250 251 snd_hda_codec_write(codec, codec->core.afg, 0, 252 AC_VERB_SET_GPIO_MASK, spec->gpio_mask); 253 snd_hda_codec_write(codec, codec->core.afg, 0, 254 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir); 255 if (spec->gpio_write_delay) 256 msleep(1); 257 alc_write_gpio_data(codec); 258 } 259 260 static void alc_fixup_gpio(struct hda_codec *codec, int action, 261 unsigned int mask) 262 { 263 if (action == HDA_FIXUP_ACT_PRE_PROBE) 264 alc_setup_gpio(codec, mask); 265 } 266 267 static void alc_fixup_gpio1(struct hda_codec *codec, 268 const struct hda_fixup *fix, int action) 269 { 270 alc_fixup_gpio(codec, action, 0x01); 271 } 272 273 static void alc_fixup_gpio2(struct hda_codec *codec, 274 const struct hda_fixup *fix, int action) 275 { 276 alc_fixup_gpio(codec, action, 0x02); 277 } 278 279 static void alc_fixup_gpio3(struct hda_codec *codec, 280 const struct hda_fixup *fix, int action) 281 { 282 alc_fixup_gpio(codec, action, 0x03); 283 } 284 285 static void alc_fixup_gpio4(struct hda_codec *codec, 286 const struct hda_fixup *fix, int action) 287 { 288 alc_fixup_gpio(codec, action, 0x04); 289 } 290 291 static void alc_fixup_micmute_led(struct hda_codec *codec, 292 const struct hda_fixup *fix, int action) 293 { 294 if (action == HDA_FIXUP_ACT_PROBE) 295 snd_hda_gen_add_micmute_led_cdev(codec, NULL); 296 } 297 298 /* 299 * Fix hardware PLL issue 300 * On some codecs, the analog PLL gating control must be off while 301 * the default value is 1. 302 */ 303 static void alc_fix_pll(struct hda_codec *codec) 304 { 305 struct alc_spec *spec = codec->spec; 306 307 if (spec->pll_nid) 308 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx, 309 1 << spec->pll_coef_bit, 0); 310 } 311 312 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid, 313 unsigned int coef_idx, unsigned int coef_bit) 314 { 315 struct alc_spec *spec = codec->spec; 316 spec->pll_nid = nid; 317 spec->pll_coef_idx = coef_idx; 318 spec->pll_coef_bit = coef_bit; 319 alc_fix_pll(codec); 320 } 321 322 /* update the master volume per volume-knob's unsol event */ 323 static void alc_update_knob_master(struct hda_codec *codec, 324 struct hda_jack_callback *jack) 325 { 326 unsigned int val; 327 struct snd_kcontrol *kctl; 328 struct snd_ctl_elem_value *uctl; 329 330 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume"); 331 if (!kctl) 332 return; 333 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); 334 if (!uctl) 335 return; 336 val = snd_hda_codec_read(codec, jack->nid, 0, 337 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0); 338 val &= HDA_AMP_VOLMASK; 339 uctl->value.integer.value[0] = val; 340 uctl->value.integer.value[1] = val; 341 kctl->put(kctl, uctl); 342 kfree(uctl); 343 } 344 345 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) 346 { 347 /* For some reason, the res given from ALC880 is broken. 348 Here we adjust it properly. */ 349 snd_hda_jack_unsol_event(codec, res >> 2); 350 } 351 352 /* Change EAPD to verb control */ 353 static void alc_fill_eapd_coef(struct hda_codec *codec) 354 { 355 int coef; 356 357 coef = alc_get_coef0(codec); 358 359 switch (codec->core.vendor_id) { 360 case 0x10ec0262: 361 alc_update_coef_idx(codec, 0x7, 0, 1<<5); 362 break; 363 case 0x10ec0267: 364 case 0x10ec0268: 365 alc_update_coef_idx(codec, 0x7, 0, 1<<13); 366 break; 367 case 0x10ec0269: 368 if ((coef & 0x00f0) == 0x0010) 369 alc_update_coef_idx(codec, 0xd, 0, 1<<14); 370 if ((coef & 0x00f0) == 0x0020) 371 alc_update_coef_idx(codec, 0x4, 1<<15, 0); 372 if ((coef & 0x00f0) == 0x0030) 373 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 374 break; 375 case 0x10ec0280: 376 case 0x10ec0284: 377 case 0x10ec0290: 378 case 0x10ec0292: 379 alc_update_coef_idx(codec, 0x4, 1<<15, 0); 380 break; 381 case 0x10ec0225: 382 case 0x10ec0295: 383 case 0x10ec0299: 384 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 385 fallthrough; 386 case 0x10ec0215: 387 case 0x10ec0233: 388 case 0x10ec0235: 389 case 0x10ec0236: 390 case 0x10ec0245: 391 case 0x10ec0255: 392 case 0x10ec0256: 393 case 0x10ec0257: 394 case 0x10ec0282: 395 case 0x10ec0283: 396 case 0x10ec0286: 397 case 0x10ec0287: 398 case 0x10ec0288: 399 case 0x10ec0285: 400 case 0x10ec0298: 401 case 0x10ec0289: 402 case 0x10ec0300: 403 alc_update_coef_idx(codec, 0x10, 1<<9, 0); 404 break; 405 case 0x10ec0275: 406 alc_update_coef_idx(codec, 0xe, 0, 1<<0); 407 break; 408 case 0x10ec0293: 409 alc_update_coef_idx(codec, 0xa, 1<<13, 0); 410 break; 411 case 0x10ec0234: 412 case 0x10ec0274: 413 case 0x10ec0294: 414 case 0x10ec0700: 415 case 0x10ec0701: 416 case 0x10ec0703: 417 case 0x10ec0711: 418 alc_update_coef_idx(codec, 0x10, 1<<15, 0); 419 break; 420 case 0x10ec0662: 421 if ((coef & 0x00f0) == 0x0030) 422 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */ 423 break; 424 case 0x10ec0272: 425 case 0x10ec0273: 426 case 0x10ec0663: 427 case 0x10ec0665: 428 case 0x10ec0670: 429 case 0x10ec0671: 430 case 0x10ec0672: 431 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */ 432 break; 433 case 0x10ec0222: 434 case 0x10ec0623: 435 alc_update_coef_idx(codec, 0x19, 1<<13, 0); 436 break; 437 case 0x10ec0668: 438 alc_update_coef_idx(codec, 0x7, 3<<13, 0); 439 break; 440 case 0x10ec0867: 441 alc_update_coef_idx(codec, 0x4, 1<<10, 0); 442 break; 443 case 0x10ec0888: 444 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030) 445 alc_update_coef_idx(codec, 0x7, 1<<5, 0); 446 break; 447 case 0x10ec0892: 448 alc_update_coef_idx(codec, 0x7, 1<<5, 0); 449 break; 450 case 0x10ec0899: 451 case 0x10ec0900: 452 case 0x10ec0b00: 453 case 0x10ec1168: 454 case 0x10ec1220: 455 alc_update_coef_idx(codec, 0x7, 1<<1, 0); 456 break; 457 } 458 } 459 460 /* additional initialization for ALC888 variants */ 461 static void alc888_coef_init(struct hda_codec *codec) 462 { 463 switch (alc_get_coef0(codec) & 0x00f0) { 464 /* alc888-VA */ 465 case 0x00: 466 /* alc888-VB */ 467 case 0x10: 468 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ 469 break; 470 } 471 } 472 473 /* turn on/off EAPD control (only if available) */ 474 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) 475 { 476 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) 477 return; 478 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) 479 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, 480 on ? 2 : 0); 481 } 482 483 /* turn on/off EAPD controls of the codec */ 484 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on) 485 { 486 /* We currently only handle front, HP */ 487 static const hda_nid_t pins[] = { 488 0x0f, 0x10, 0x14, 0x15, 0x17, 0 489 }; 490 const hda_nid_t *p; 491 for (p = pins; *p; p++) 492 set_eapd(codec, *p, on); 493 } 494 495 static int find_ext_mic_pin(struct hda_codec *codec); 496 497 static void alc_headset_mic_no_shutup(struct hda_codec *codec) 498 { 499 const struct hda_pincfg *pin; 500 int mic_pin = find_ext_mic_pin(codec); 501 int i; 502 503 /* don't shut up pins when unloading the driver; otherwise it breaks 504 * the default pin setup at the next load of the driver 505 */ 506 if (codec->bus->shutdown) 507 return; 508 509 snd_array_for_each(&codec->init_pins, i, pin) { 510 /* use read here for syncing after issuing each verb */ 511 if (pin->nid != mic_pin) 512 snd_hda_codec_read(codec, pin->nid, 0, 513 AC_VERB_SET_PIN_WIDGET_CONTROL, 0); 514 } 515 516 codec->pins_shutup = 1; 517 } 518 519 static void alc_shutup_pins(struct hda_codec *codec) 520 { 521 struct alc_spec *spec = codec->spec; 522 523 switch (codec->core.vendor_id) { 524 case 0x10ec0283: 525 case 0x10ec0286: 526 case 0x10ec0288: 527 case 0x10ec0298: 528 alc_headset_mic_no_shutup(codec); 529 break; 530 default: 531 if (!spec->no_shutup_pins) 532 snd_hda_shutup_pins(codec); 533 break; 534 } 535 } 536 537 /* generic shutup callback; 538 * just turning off EAPD and a little pause for avoiding pop-noise 539 */ 540 static void alc_eapd_shutup(struct hda_codec *codec) 541 { 542 struct alc_spec *spec = codec->spec; 543 544 alc_auto_setup_eapd(codec, false); 545 if (!spec->no_depop_delay) 546 msleep(200); 547 alc_shutup_pins(codec); 548 } 549 550 /* generic EAPD initialization */ 551 static void alc_auto_init_amp(struct hda_codec *codec, int type) 552 { 553 alc_auto_setup_eapd(codec, true); 554 alc_write_gpio(codec); 555 switch (type) { 556 case ALC_INIT_DEFAULT: 557 switch (codec->core.vendor_id) { 558 case 0x10ec0260: 559 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); 560 break; 561 case 0x10ec0880: 562 case 0x10ec0882: 563 case 0x10ec0883: 564 case 0x10ec0885: 565 alc_update_coef_idx(codec, 7, 0, 0x2030); 566 break; 567 case 0x10ec0888: 568 alc888_coef_init(codec); 569 break; 570 } 571 break; 572 } 573 } 574 575 /* get a primary headphone pin if available */ 576 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec) 577 { 578 if (spec->gen.autocfg.hp_pins[0]) 579 return spec->gen.autocfg.hp_pins[0]; 580 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT) 581 return spec->gen.autocfg.line_out_pins[0]; 582 return 0; 583 } 584 585 /* 586 * Realtek SSID verification 587 */ 588 589 /* Could be any non-zero and even value. When used as fixup, tells 590 * the driver to ignore any present sku defines. 591 */ 592 #define ALC_FIXUP_SKU_IGNORE (2) 593 594 static void alc_fixup_sku_ignore(struct hda_codec *codec, 595 const struct hda_fixup *fix, int action) 596 { 597 struct alc_spec *spec = codec->spec; 598 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 599 spec->cdefine.fixup = 1; 600 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE; 601 } 602 } 603 604 static void alc_fixup_no_depop_delay(struct hda_codec *codec, 605 const struct hda_fixup *fix, int action) 606 { 607 struct alc_spec *spec = codec->spec; 608 609 if (action == HDA_FIXUP_ACT_PROBE) { 610 spec->no_depop_delay = 1; 611 codec->depop_delay = 0; 612 } 613 } 614 615 static int alc_auto_parse_customize_define(struct hda_codec *codec) 616 { 617 unsigned int ass, tmp, i; 618 unsigned nid = 0; 619 struct alc_spec *spec = codec->spec; 620 621 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ 622 623 if (spec->cdefine.fixup) { 624 ass = spec->cdefine.sku_cfg; 625 if (ass == ALC_FIXUP_SKU_IGNORE) 626 return -1; 627 goto do_sku; 628 } 629 630 if (!codec->bus->pci) 631 return -1; 632 ass = codec->core.subsystem_id & 0xffff; 633 if (ass != codec->bus->pci->subsystem_device && (ass & 1)) 634 goto do_sku; 635 636 nid = 0x1d; 637 if (codec->core.vendor_id == 0x10ec0260) 638 nid = 0x17; 639 ass = snd_hda_codec_get_pincfg(codec, nid); 640 641 if (!(ass & 1)) { 642 codec_info(codec, "%s: SKU not ready 0x%08x\n", 643 codec->core.chip_name, ass); 644 return -1; 645 } 646 647 /* check sum */ 648 tmp = 0; 649 for (i = 1; i < 16; i++) { 650 if ((ass >> i) & 1) 651 tmp++; 652 } 653 if (((ass >> 16) & 0xf) != tmp) 654 return -1; 655 656 spec->cdefine.port_connectivity = ass >> 30; 657 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20; 658 spec->cdefine.check_sum = (ass >> 16) & 0xf; 659 spec->cdefine.customization = ass >> 8; 660 do_sku: 661 spec->cdefine.sku_cfg = ass; 662 spec->cdefine.external_amp = (ass & 0x38) >> 3; 663 spec->cdefine.platform_type = (ass & 0x4) >> 2; 664 spec->cdefine.swap = (ass & 0x2) >> 1; 665 spec->cdefine.override = ass & 0x1; 666 667 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n", 668 nid, spec->cdefine.sku_cfg); 669 codec_dbg(codec, "SKU: port_connectivity=0x%x\n", 670 spec->cdefine.port_connectivity); 671 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); 672 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); 673 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization); 674 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp); 675 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type); 676 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap); 677 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override); 678 679 return 0; 680 } 681 682 /* return the position of NID in the list, or -1 if not found */ 683 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) 684 { 685 int i; 686 for (i = 0; i < nums; i++) 687 if (list[i] == nid) 688 return i; 689 return -1; 690 } 691 /* return true if the given NID is found in the list */ 692 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums) 693 { 694 return find_idx_in_nid_list(nid, list, nums) >= 0; 695 } 696 697 /* check subsystem ID and set up device-specific initialization; 698 * return 1 if initialized, 0 if invalid SSID 699 */ 700 /* 32-bit subsystem ID for BIOS loading in HD Audio codec. 701 * 31 ~ 16 : Manufacture ID 702 * 15 ~ 8 : SKU ID 703 * 7 ~ 0 : Assembly ID 704 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 705 */ 706 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) 707 { 708 unsigned int ass, tmp, i; 709 unsigned nid; 710 struct alc_spec *spec = codec->spec; 711 712 if (spec->cdefine.fixup) { 713 ass = spec->cdefine.sku_cfg; 714 if (ass == ALC_FIXUP_SKU_IGNORE) 715 return 0; 716 goto do_sku; 717 } 718 719 ass = codec->core.subsystem_id & 0xffff; 720 if (codec->bus->pci && 721 ass != codec->bus->pci->subsystem_device && (ass & 1)) 722 goto do_sku; 723 724 /* invalid SSID, check the special NID pin defcfg instead */ 725 /* 726 * 31~30 : port connectivity 727 * 29~21 : reserve 728 * 20 : PCBEEP input 729 * 19~16 : Check sum (15:1) 730 * 15~1 : Custom 731 * 0 : override 732 */ 733 nid = 0x1d; 734 if (codec->core.vendor_id == 0x10ec0260) 735 nid = 0x17; 736 ass = snd_hda_codec_get_pincfg(codec, nid); 737 codec_dbg(codec, 738 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n", 739 ass, nid); 740 if (!(ass & 1)) 741 return 0; 742 if ((ass >> 30) != 1) /* no physical connection */ 743 return 0; 744 745 /* check sum */ 746 tmp = 0; 747 for (i = 1; i < 16; i++) { 748 if ((ass >> i) & 1) 749 tmp++; 750 } 751 if (((ass >> 16) & 0xf) != tmp) 752 return 0; 753 do_sku: 754 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", 755 ass & 0xffff, codec->core.vendor_id); 756 /* 757 * 0 : override 758 * 1 : Swap Jack 759 * 2 : 0 --> Desktop, 1 --> Laptop 760 * 3~5 : External Amplifier control 761 * 7~6 : Reserved 762 */ 763 tmp = (ass & 0x38) >> 3; /* external Amp control */ 764 if (spec->init_amp == ALC_INIT_UNDEFINED) { 765 switch (tmp) { 766 case 1: 767 alc_setup_gpio(codec, 0x01); 768 break; 769 case 3: 770 alc_setup_gpio(codec, 0x02); 771 break; 772 case 7: 773 alc_setup_gpio(codec, 0x03); 774 break; 775 case 5: 776 default: 777 spec->init_amp = ALC_INIT_DEFAULT; 778 break; 779 } 780 } 781 782 /* is laptop or Desktop and enable the function "Mute internal speaker 783 * when the external headphone out jack is plugged" 784 */ 785 if (!(ass & 0x8000)) 786 return 1; 787 /* 788 * 10~8 : Jack location 789 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered 790 * 14~13: Resvered 791 * 15 : 1 --> enable the function "Mute internal speaker 792 * when the external headphone out jack is plugged" 793 */ 794 if (!alc_get_hp_pin(spec)) { 795 hda_nid_t nid; 796 tmp = (ass >> 11) & 0x3; /* HP to chassis */ 797 nid = ports[tmp]; 798 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, 799 spec->gen.autocfg.line_outs)) 800 return 1; 801 spec->gen.autocfg.hp_pins[0] = nid; 802 } 803 return 1; 804 } 805 806 /* Check the validity of ALC subsystem-id 807 * ports contains an array of 4 pin NIDs for port-A, E, D and I */ 808 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) 809 { 810 if (!alc_subsystem_id(codec, ports)) { 811 struct alc_spec *spec = codec->spec; 812 if (spec->init_amp == ALC_INIT_UNDEFINED) { 813 codec_dbg(codec, 814 "realtek: Enable default setup for auto mode as fallback\n"); 815 spec->init_amp = ALC_INIT_DEFAULT; 816 } 817 } 818 } 819 820 /* 821 */ 822 823 static void alc_fixup_inv_dmic(struct hda_codec *codec, 824 const struct hda_fixup *fix, int action) 825 { 826 struct alc_spec *spec = codec->spec; 827 828 spec->gen.inv_dmic_split = 1; 829 } 830 831 832 static int alc_build_controls(struct hda_codec *codec) 833 { 834 int err; 835 836 err = snd_hda_gen_build_controls(codec); 837 if (err < 0) 838 return err; 839 840 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD); 841 return 0; 842 } 843 844 845 /* 846 * Common callbacks 847 */ 848 849 static void alc_pre_init(struct hda_codec *codec) 850 { 851 alc_fill_eapd_coef(codec); 852 } 853 854 #define is_s3_resume(codec) \ 855 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME) 856 #define is_s4_resume(codec) \ 857 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE) 858 859 static int alc_init(struct hda_codec *codec) 860 { 861 struct alc_spec *spec = codec->spec; 862 863 /* hibernation resume needs the full chip initialization */ 864 if (is_s4_resume(codec)) 865 alc_pre_init(codec); 866 867 if (spec->init_hook) 868 spec->init_hook(codec); 869 870 spec->gen.skip_verbs = 1; /* applied in below */ 871 snd_hda_gen_init(codec); 872 alc_fix_pll(codec); 873 alc_auto_init_amp(codec, spec->init_amp); 874 snd_hda_apply_verbs(codec); /* apply verbs here after own init */ 875 876 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT); 877 878 return 0; 879 } 880 881 static inline void alc_shutup(struct hda_codec *codec) 882 { 883 struct alc_spec *spec = codec->spec; 884 885 if (!snd_hda_get_bool_hint(codec, "shutup")) 886 return; /* disabled explicitly by hints */ 887 888 if (spec && spec->shutup) 889 spec->shutup(codec); 890 else 891 alc_shutup_pins(codec); 892 } 893 894 static void alc_reboot_notify(struct hda_codec *codec) 895 { 896 struct alc_spec *spec = codec->spec; 897 898 if (spec && spec->reboot_notify) 899 spec->reboot_notify(codec); 900 else 901 alc_shutup(codec); 902 } 903 904 #define alc_free snd_hda_gen_free 905 906 #ifdef CONFIG_PM 907 static void alc_power_eapd(struct hda_codec *codec) 908 { 909 alc_auto_setup_eapd(codec, false); 910 } 911 912 static int alc_suspend(struct hda_codec *codec) 913 { 914 struct alc_spec *spec = codec->spec; 915 alc_shutup(codec); 916 if (spec && spec->power_hook) 917 spec->power_hook(codec); 918 return 0; 919 } 920 #endif 921 922 #ifdef CONFIG_PM 923 static int alc_resume(struct hda_codec *codec) 924 { 925 struct alc_spec *spec = codec->spec; 926 927 if (!spec->no_depop_delay) 928 msleep(150); /* to avoid pop noise */ 929 codec->patch_ops.init(codec); 930 snd_hda_regmap_sync(codec); 931 hda_call_check_power_status(codec, 0x01); 932 return 0; 933 } 934 #endif 935 936 /* 937 */ 938 static const struct hda_codec_ops alc_patch_ops = { 939 .build_controls = alc_build_controls, 940 .build_pcms = snd_hda_gen_build_pcms, 941 .init = alc_init, 942 .free = alc_free, 943 .unsol_event = snd_hda_jack_unsol_event, 944 #ifdef CONFIG_PM 945 .resume = alc_resume, 946 .suspend = alc_suspend, 947 .check_power_status = snd_hda_gen_check_power_status, 948 #endif 949 .reboot_notify = alc_reboot_notify, 950 }; 951 952 953 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name) 954 955 /* 956 * Rename codecs appropriately from COEF value or subvendor id 957 */ 958 struct alc_codec_rename_table { 959 unsigned int vendor_id; 960 unsigned short coef_mask; 961 unsigned short coef_bits; 962 const char *name; 963 }; 964 965 struct alc_codec_rename_pci_table { 966 unsigned int codec_vendor_id; 967 unsigned short pci_subvendor; 968 unsigned short pci_subdevice; 969 const char *name; 970 }; 971 972 static const struct alc_codec_rename_table rename_tbl[] = { 973 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" }, 974 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, 975 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, 976 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" }, 977 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" }, 978 { 0x10ec0269, 0xffff, 0xa023, "ALC259" }, 979 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" }, 980 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" }, 981 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" }, 982 { 0x10ec0662, 0xffff, 0x4020, "ALC656" }, 983 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" }, 984 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" }, 985 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" }, 986 { 0x10ec0899, 0x2000, 0x2000, "ALC899" }, 987 { 0x10ec0892, 0xffff, 0x8020, "ALC661" }, 988 { 0x10ec0892, 0xffff, 0x8011, "ALC661" }, 989 { 0x10ec0892, 0xffff, 0x4011, "ALC656" }, 990 { } /* terminator */ 991 }; 992 993 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = { 994 { 0x10ec0280, 0x1028, 0, "ALC3220" }, 995 { 0x10ec0282, 0x1028, 0, "ALC3221" }, 996 { 0x10ec0283, 0x1028, 0, "ALC3223" }, 997 { 0x10ec0288, 0x1028, 0, "ALC3263" }, 998 { 0x10ec0292, 0x1028, 0, "ALC3226" }, 999 { 0x10ec0293, 0x1028, 0, "ALC3235" }, 1000 { 0x10ec0255, 0x1028, 0, "ALC3234" }, 1001 { 0x10ec0668, 0x1028, 0, "ALC3661" }, 1002 { 0x10ec0275, 0x1028, 0, "ALC3260" }, 1003 { 0x10ec0899, 0x1028, 0, "ALC3861" }, 1004 { 0x10ec0298, 0x1028, 0, "ALC3266" }, 1005 { 0x10ec0236, 0x1028, 0, "ALC3204" }, 1006 { 0x10ec0256, 0x1028, 0, "ALC3246" }, 1007 { 0x10ec0225, 0x1028, 0, "ALC3253" }, 1008 { 0x10ec0295, 0x1028, 0, "ALC3254" }, 1009 { 0x10ec0299, 0x1028, 0, "ALC3271" }, 1010 { 0x10ec0670, 0x1025, 0, "ALC669X" }, 1011 { 0x10ec0676, 0x1025, 0, "ALC679X" }, 1012 { 0x10ec0282, 0x1043, 0, "ALC3229" }, 1013 { 0x10ec0233, 0x1043, 0, "ALC3236" }, 1014 { 0x10ec0280, 0x103c, 0, "ALC3228" }, 1015 { 0x10ec0282, 0x103c, 0, "ALC3227" }, 1016 { 0x10ec0286, 0x103c, 0, "ALC3242" }, 1017 { 0x10ec0290, 0x103c, 0, "ALC3241" }, 1018 { 0x10ec0668, 0x103c, 0, "ALC3662" }, 1019 { 0x10ec0283, 0x17aa, 0, "ALC3239" }, 1020 { 0x10ec0292, 0x17aa, 0, "ALC3232" }, 1021 { } /* terminator */ 1022 }; 1023 1024 static int alc_codec_rename_from_preset(struct hda_codec *codec) 1025 { 1026 const struct alc_codec_rename_table *p; 1027 const struct alc_codec_rename_pci_table *q; 1028 1029 for (p = rename_tbl; p->vendor_id; p++) { 1030 if (p->vendor_id != codec->core.vendor_id) 1031 continue; 1032 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) 1033 return alc_codec_rename(codec, p->name); 1034 } 1035 1036 if (!codec->bus->pci) 1037 return 0; 1038 for (q = rename_pci_tbl; q->codec_vendor_id; q++) { 1039 if (q->codec_vendor_id != codec->core.vendor_id) 1040 continue; 1041 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) 1042 continue; 1043 if (!q->pci_subdevice || 1044 q->pci_subdevice == codec->bus->pci->subsystem_device) 1045 return alc_codec_rename(codec, q->name); 1046 } 1047 1048 return 0; 1049 } 1050 1051 1052 /* 1053 * Digital-beep handlers 1054 */ 1055 #ifdef CONFIG_SND_HDA_INPUT_BEEP 1056 1057 /* additional beep mixers; private_value will be overwritten */ 1058 static const struct snd_kcontrol_new alc_beep_mixer[] = { 1059 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT), 1060 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT), 1061 }; 1062 1063 /* set up and create beep controls */ 1064 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid, 1065 int idx, int dir) 1066 { 1067 struct snd_kcontrol_new *knew; 1068 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir); 1069 int i; 1070 1071 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) { 1072 knew = snd_hda_gen_add_kctl(&spec->gen, NULL, 1073 &alc_beep_mixer[i]); 1074 if (!knew) 1075 return -ENOMEM; 1076 knew->private_value = beep_amp; 1077 } 1078 return 0; 1079 } 1080 1081 static const struct snd_pci_quirk beep_allow_list[] = { 1082 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), 1083 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1), 1084 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), 1085 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), 1086 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), 1087 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), 1088 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), 1089 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), 1090 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), 1091 /* denylist -- no beep available */ 1092 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), 1093 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), 1094 {} 1095 }; 1096 1097 static inline int has_cdefine_beep(struct hda_codec *codec) 1098 { 1099 struct alc_spec *spec = codec->spec; 1100 const struct snd_pci_quirk *q; 1101 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list); 1102 if (q) 1103 return q->value; 1104 return spec->cdefine.enable_pcbeep; 1105 } 1106 #else 1107 #define set_beep_amp(spec, nid, idx, dir) 0 1108 #define has_cdefine_beep(codec) 0 1109 #endif 1110 1111 /* parse the BIOS configuration and set up the alc_spec */ 1112 /* return 1 if successful, 0 if the proper config is not found, 1113 * or a negative error code 1114 */ 1115 static int alc_parse_auto_config(struct hda_codec *codec, 1116 const hda_nid_t *ignore_nids, 1117 const hda_nid_t *ssid_nids) 1118 { 1119 struct alc_spec *spec = codec->spec; 1120 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 1121 int err; 1122 1123 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids, 1124 spec->parse_flags); 1125 if (err < 0) 1126 return err; 1127 1128 if (ssid_nids) 1129 alc_ssid_check(codec, ssid_nids); 1130 1131 err = snd_hda_gen_parse_auto_config(codec, cfg); 1132 if (err < 0) 1133 return err; 1134 1135 return 1; 1136 } 1137 1138 /* common preparation job for alc_spec */ 1139 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid) 1140 { 1141 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL); 1142 int err; 1143 1144 if (!spec) 1145 return -ENOMEM; 1146 codec->spec = spec; 1147 snd_hda_gen_spec_init(&spec->gen); 1148 spec->gen.mixer_nid = mixer_nid; 1149 spec->gen.own_eapd_ctl = 1; 1150 codec->single_adc_amp = 1; 1151 /* FIXME: do we need this for all Realtek codec models? */ 1152 codec->spdif_status_reset = 1; 1153 codec->forced_resume = 1; 1154 codec->patch_ops = alc_patch_ops; 1155 1156 err = alc_codec_rename_from_preset(codec); 1157 if (err < 0) { 1158 kfree(spec); 1159 return err; 1160 } 1161 return 0; 1162 } 1163 1164 static int alc880_parse_auto_config(struct hda_codec *codec) 1165 { 1166 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 }; 1167 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 1168 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids); 1169 } 1170 1171 /* 1172 * ALC880 fix-ups 1173 */ 1174 enum { 1175 ALC880_FIXUP_GPIO1, 1176 ALC880_FIXUP_GPIO2, 1177 ALC880_FIXUP_MEDION_RIM, 1178 ALC880_FIXUP_LG, 1179 ALC880_FIXUP_LG_LW25, 1180 ALC880_FIXUP_W810, 1181 ALC880_FIXUP_EAPD_COEF, 1182 ALC880_FIXUP_TCL_S700, 1183 ALC880_FIXUP_VOL_KNOB, 1184 ALC880_FIXUP_FUJITSU, 1185 ALC880_FIXUP_F1734, 1186 ALC880_FIXUP_UNIWILL, 1187 ALC880_FIXUP_UNIWILL_DIG, 1188 ALC880_FIXUP_Z71V, 1189 ALC880_FIXUP_ASUS_W5A, 1190 ALC880_FIXUP_3ST_BASE, 1191 ALC880_FIXUP_3ST, 1192 ALC880_FIXUP_3ST_DIG, 1193 ALC880_FIXUP_5ST_BASE, 1194 ALC880_FIXUP_5ST, 1195 ALC880_FIXUP_5ST_DIG, 1196 ALC880_FIXUP_6ST_BASE, 1197 ALC880_FIXUP_6ST, 1198 ALC880_FIXUP_6ST_DIG, 1199 ALC880_FIXUP_6ST_AUTOMUTE, 1200 }; 1201 1202 /* enable the volume-knob widget support on NID 0x21 */ 1203 static void alc880_fixup_vol_knob(struct hda_codec *codec, 1204 const struct hda_fixup *fix, int action) 1205 { 1206 if (action == HDA_FIXUP_ACT_PROBE) 1207 snd_hda_jack_detect_enable_callback(codec, 0x21, 1208 alc_update_knob_master); 1209 } 1210 1211 static const struct hda_fixup alc880_fixups[] = { 1212 [ALC880_FIXUP_GPIO1] = { 1213 .type = HDA_FIXUP_FUNC, 1214 .v.func = alc_fixup_gpio1, 1215 }, 1216 [ALC880_FIXUP_GPIO2] = { 1217 .type = HDA_FIXUP_FUNC, 1218 .v.func = alc_fixup_gpio2, 1219 }, 1220 [ALC880_FIXUP_MEDION_RIM] = { 1221 .type = HDA_FIXUP_VERBS, 1222 .v.verbs = (const struct hda_verb[]) { 1223 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1224 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 1225 { } 1226 }, 1227 .chained = true, 1228 .chain_id = ALC880_FIXUP_GPIO2, 1229 }, 1230 [ALC880_FIXUP_LG] = { 1231 .type = HDA_FIXUP_PINS, 1232 .v.pins = (const struct hda_pintbl[]) { 1233 /* disable bogus unused pins */ 1234 { 0x16, 0x411111f0 }, 1235 { 0x18, 0x411111f0 }, 1236 { 0x1a, 0x411111f0 }, 1237 { } 1238 } 1239 }, 1240 [ALC880_FIXUP_LG_LW25] = { 1241 .type = HDA_FIXUP_PINS, 1242 .v.pins = (const struct hda_pintbl[]) { 1243 { 0x1a, 0x0181344f }, /* line-in */ 1244 { 0x1b, 0x0321403f }, /* headphone */ 1245 { } 1246 } 1247 }, 1248 [ALC880_FIXUP_W810] = { 1249 .type = HDA_FIXUP_PINS, 1250 .v.pins = (const struct hda_pintbl[]) { 1251 /* disable bogus unused pins */ 1252 { 0x17, 0x411111f0 }, 1253 { } 1254 }, 1255 .chained = true, 1256 .chain_id = ALC880_FIXUP_GPIO2, 1257 }, 1258 [ALC880_FIXUP_EAPD_COEF] = { 1259 .type = HDA_FIXUP_VERBS, 1260 .v.verbs = (const struct hda_verb[]) { 1261 /* change to EAPD mode */ 1262 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1263 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 1264 {} 1265 }, 1266 }, 1267 [ALC880_FIXUP_TCL_S700] = { 1268 .type = HDA_FIXUP_VERBS, 1269 .v.verbs = (const struct hda_verb[]) { 1270 /* change to EAPD mode */ 1271 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 1272 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 1273 {} 1274 }, 1275 .chained = true, 1276 .chain_id = ALC880_FIXUP_GPIO2, 1277 }, 1278 [ALC880_FIXUP_VOL_KNOB] = { 1279 .type = HDA_FIXUP_FUNC, 1280 .v.func = alc880_fixup_vol_knob, 1281 }, 1282 [ALC880_FIXUP_FUJITSU] = { 1283 /* override all pins as BIOS on old Amilo is broken */ 1284 .type = HDA_FIXUP_PINS, 1285 .v.pins = (const struct hda_pintbl[]) { 1286 { 0x14, 0x0121401f }, /* HP */ 1287 { 0x15, 0x99030120 }, /* speaker */ 1288 { 0x16, 0x99030130 }, /* bass speaker */ 1289 { 0x17, 0x411111f0 }, /* N/A */ 1290 { 0x18, 0x411111f0 }, /* N/A */ 1291 { 0x19, 0x01a19950 }, /* mic-in */ 1292 { 0x1a, 0x411111f0 }, /* N/A */ 1293 { 0x1b, 0x411111f0 }, /* N/A */ 1294 { 0x1c, 0x411111f0 }, /* N/A */ 1295 { 0x1d, 0x411111f0 }, /* N/A */ 1296 { 0x1e, 0x01454140 }, /* SPDIF out */ 1297 { } 1298 }, 1299 .chained = true, 1300 .chain_id = ALC880_FIXUP_VOL_KNOB, 1301 }, 1302 [ALC880_FIXUP_F1734] = { 1303 /* almost compatible with FUJITSU, but no bass and SPDIF */ 1304 .type = HDA_FIXUP_PINS, 1305 .v.pins = (const struct hda_pintbl[]) { 1306 { 0x14, 0x0121401f }, /* HP */ 1307 { 0x15, 0x99030120 }, /* speaker */ 1308 { 0x16, 0x411111f0 }, /* N/A */ 1309 { 0x17, 0x411111f0 }, /* N/A */ 1310 { 0x18, 0x411111f0 }, /* N/A */ 1311 { 0x19, 0x01a19950 }, /* mic-in */ 1312 { 0x1a, 0x411111f0 }, /* N/A */ 1313 { 0x1b, 0x411111f0 }, /* N/A */ 1314 { 0x1c, 0x411111f0 }, /* N/A */ 1315 { 0x1d, 0x411111f0 }, /* N/A */ 1316 { 0x1e, 0x411111f0 }, /* N/A */ 1317 { } 1318 }, 1319 .chained = true, 1320 .chain_id = ALC880_FIXUP_VOL_KNOB, 1321 }, 1322 [ALC880_FIXUP_UNIWILL] = { 1323 /* need to fix HP and speaker pins to be parsed correctly */ 1324 .type = HDA_FIXUP_PINS, 1325 .v.pins = (const struct hda_pintbl[]) { 1326 { 0x14, 0x0121411f }, /* HP */ 1327 { 0x15, 0x99030120 }, /* speaker */ 1328 { 0x16, 0x99030130 }, /* bass speaker */ 1329 { } 1330 }, 1331 }, 1332 [ALC880_FIXUP_UNIWILL_DIG] = { 1333 .type = HDA_FIXUP_PINS, 1334 .v.pins = (const struct hda_pintbl[]) { 1335 /* disable bogus unused pins */ 1336 { 0x17, 0x411111f0 }, 1337 { 0x19, 0x411111f0 }, 1338 { 0x1b, 0x411111f0 }, 1339 { 0x1f, 0x411111f0 }, 1340 { } 1341 } 1342 }, 1343 [ALC880_FIXUP_Z71V] = { 1344 .type = HDA_FIXUP_PINS, 1345 .v.pins = (const struct hda_pintbl[]) { 1346 /* set up the whole pins as BIOS is utterly broken */ 1347 { 0x14, 0x99030120 }, /* speaker */ 1348 { 0x15, 0x0121411f }, /* HP */ 1349 { 0x16, 0x411111f0 }, /* N/A */ 1350 { 0x17, 0x411111f0 }, /* N/A */ 1351 { 0x18, 0x01a19950 }, /* mic-in */ 1352 { 0x19, 0x411111f0 }, /* N/A */ 1353 { 0x1a, 0x01813031 }, /* line-in */ 1354 { 0x1b, 0x411111f0 }, /* N/A */ 1355 { 0x1c, 0x411111f0 }, /* N/A */ 1356 { 0x1d, 0x411111f0 }, /* N/A */ 1357 { 0x1e, 0x0144111e }, /* SPDIF */ 1358 { } 1359 } 1360 }, 1361 [ALC880_FIXUP_ASUS_W5A] = { 1362 .type = HDA_FIXUP_PINS, 1363 .v.pins = (const struct hda_pintbl[]) { 1364 /* set up the whole pins as BIOS is utterly broken */ 1365 { 0x14, 0x0121411f }, /* HP */ 1366 { 0x15, 0x411111f0 }, /* N/A */ 1367 { 0x16, 0x411111f0 }, /* N/A */ 1368 { 0x17, 0x411111f0 }, /* N/A */ 1369 { 0x18, 0x90a60160 }, /* mic */ 1370 { 0x19, 0x411111f0 }, /* N/A */ 1371 { 0x1a, 0x411111f0 }, /* N/A */ 1372 { 0x1b, 0x411111f0 }, /* N/A */ 1373 { 0x1c, 0x411111f0 }, /* N/A */ 1374 { 0x1d, 0x411111f0 }, /* N/A */ 1375 { 0x1e, 0xb743111e }, /* SPDIF out */ 1376 { } 1377 }, 1378 .chained = true, 1379 .chain_id = ALC880_FIXUP_GPIO1, 1380 }, 1381 [ALC880_FIXUP_3ST_BASE] = { 1382 .type = HDA_FIXUP_PINS, 1383 .v.pins = (const struct hda_pintbl[]) { 1384 { 0x14, 0x01014010 }, /* line-out */ 1385 { 0x15, 0x411111f0 }, /* N/A */ 1386 { 0x16, 0x411111f0 }, /* N/A */ 1387 { 0x17, 0x411111f0 }, /* N/A */ 1388 { 0x18, 0x01a19c30 }, /* mic-in */ 1389 { 0x19, 0x0121411f }, /* HP */ 1390 { 0x1a, 0x01813031 }, /* line-in */ 1391 { 0x1b, 0x02a19c40 }, /* front-mic */ 1392 { 0x1c, 0x411111f0 }, /* N/A */ 1393 { 0x1d, 0x411111f0 }, /* N/A */ 1394 /* 0x1e is filled in below */ 1395 { 0x1f, 0x411111f0 }, /* N/A */ 1396 { } 1397 } 1398 }, 1399 [ALC880_FIXUP_3ST] = { 1400 .type = HDA_FIXUP_PINS, 1401 .v.pins = (const struct hda_pintbl[]) { 1402 { 0x1e, 0x411111f0 }, /* N/A */ 1403 { } 1404 }, 1405 .chained = true, 1406 .chain_id = ALC880_FIXUP_3ST_BASE, 1407 }, 1408 [ALC880_FIXUP_3ST_DIG] = { 1409 .type = HDA_FIXUP_PINS, 1410 .v.pins = (const struct hda_pintbl[]) { 1411 { 0x1e, 0x0144111e }, /* SPDIF */ 1412 { } 1413 }, 1414 .chained = true, 1415 .chain_id = ALC880_FIXUP_3ST_BASE, 1416 }, 1417 [ALC880_FIXUP_5ST_BASE] = { 1418 .type = HDA_FIXUP_PINS, 1419 .v.pins = (const struct hda_pintbl[]) { 1420 { 0x14, 0x01014010 }, /* front */ 1421 { 0x15, 0x411111f0 }, /* N/A */ 1422 { 0x16, 0x01011411 }, /* CLFE */ 1423 { 0x17, 0x01016412 }, /* surr */ 1424 { 0x18, 0x01a19c30 }, /* mic-in */ 1425 { 0x19, 0x0121411f }, /* HP */ 1426 { 0x1a, 0x01813031 }, /* line-in */ 1427 { 0x1b, 0x02a19c40 }, /* front-mic */ 1428 { 0x1c, 0x411111f0 }, /* N/A */ 1429 { 0x1d, 0x411111f0 }, /* N/A */ 1430 /* 0x1e is filled in below */ 1431 { 0x1f, 0x411111f0 }, /* N/A */ 1432 { } 1433 } 1434 }, 1435 [ALC880_FIXUP_5ST] = { 1436 .type = HDA_FIXUP_PINS, 1437 .v.pins = (const struct hda_pintbl[]) { 1438 { 0x1e, 0x411111f0 }, /* N/A */ 1439 { } 1440 }, 1441 .chained = true, 1442 .chain_id = ALC880_FIXUP_5ST_BASE, 1443 }, 1444 [ALC880_FIXUP_5ST_DIG] = { 1445 .type = HDA_FIXUP_PINS, 1446 .v.pins = (const struct hda_pintbl[]) { 1447 { 0x1e, 0x0144111e }, /* SPDIF */ 1448 { } 1449 }, 1450 .chained = true, 1451 .chain_id = ALC880_FIXUP_5ST_BASE, 1452 }, 1453 [ALC880_FIXUP_6ST_BASE] = { 1454 .type = HDA_FIXUP_PINS, 1455 .v.pins = (const struct hda_pintbl[]) { 1456 { 0x14, 0x01014010 }, /* front */ 1457 { 0x15, 0x01016412 }, /* surr */ 1458 { 0x16, 0x01011411 }, /* CLFE */ 1459 { 0x17, 0x01012414 }, /* side */ 1460 { 0x18, 0x01a19c30 }, /* mic-in */ 1461 { 0x19, 0x02a19c40 }, /* front-mic */ 1462 { 0x1a, 0x01813031 }, /* line-in */ 1463 { 0x1b, 0x0121411f }, /* HP */ 1464 { 0x1c, 0x411111f0 }, /* N/A */ 1465 { 0x1d, 0x411111f0 }, /* N/A */ 1466 /* 0x1e is filled in below */ 1467 { 0x1f, 0x411111f0 }, /* N/A */ 1468 { } 1469 } 1470 }, 1471 [ALC880_FIXUP_6ST] = { 1472 .type = HDA_FIXUP_PINS, 1473 .v.pins = (const struct hda_pintbl[]) { 1474 { 0x1e, 0x411111f0 }, /* N/A */ 1475 { } 1476 }, 1477 .chained = true, 1478 .chain_id = ALC880_FIXUP_6ST_BASE, 1479 }, 1480 [ALC880_FIXUP_6ST_DIG] = { 1481 .type = HDA_FIXUP_PINS, 1482 .v.pins = (const struct hda_pintbl[]) { 1483 { 0x1e, 0x0144111e }, /* SPDIF */ 1484 { } 1485 }, 1486 .chained = true, 1487 .chain_id = ALC880_FIXUP_6ST_BASE, 1488 }, 1489 [ALC880_FIXUP_6ST_AUTOMUTE] = { 1490 .type = HDA_FIXUP_PINS, 1491 .v.pins = (const struct hda_pintbl[]) { 1492 { 0x1b, 0x0121401f }, /* HP with jack detect */ 1493 { } 1494 }, 1495 .chained_before = true, 1496 .chain_id = ALC880_FIXUP_6ST_BASE, 1497 }, 1498 }; 1499 1500 static const struct snd_pci_quirk alc880_fixup_tbl[] = { 1501 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810), 1502 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A), 1503 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V), 1504 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1), 1505 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE), 1506 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2), 1507 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF), 1508 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG), 1509 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734), 1510 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL), 1511 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB), 1512 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810), 1513 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM), 1514 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE), 1515 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU), 1516 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU), 1517 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734), 1518 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU), 1519 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), 1520 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), 1521 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), 1522 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), 1523 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), 1524 1525 /* Below is the copied entries from alc880_quirks.c. 1526 * It's not quite sure whether BIOS sets the correct pin-config table 1527 * on these machines, thus they are kept to be compatible with 1528 * the old static quirks. Once when it's confirmed to work without 1529 * these overrides, it'd be better to remove. 1530 */ 1531 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG), 1532 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST), 1533 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG), 1534 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG), 1535 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG), 1536 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG), 1537 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG), 1538 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST), 1539 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG), 1540 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST), 1541 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST), 1542 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST), 1543 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST), 1544 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST), 1545 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG), 1546 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG), 1547 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG), 1548 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG), 1549 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG), 1550 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG), 1551 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG), 1552 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */ 1553 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG), 1554 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1555 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1556 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1557 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1558 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1559 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1560 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG), 1561 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1562 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1563 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG), 1564 /* default Intel */ 1565 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST), 1566 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG), 1567 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG), 1568 {} 1569 }; 1570 1571 static const struct hda_model_fixup alc880_fixup_models[] = { 1572 {.id = ALC880_FIXUP_3ST, .name = "3stack"}, 1573 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"}, 1574 {.id = ALC880_FIXUP_5ST, .name = "5stack"}, 1575 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"}, 1576 {.id = ALC880_FIXUP_6ST, .name = "6stack"}, 1577 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"}, 1578 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"}, 1579 {} 1580 }; 1581 1582 1583 /* 1584 * OK, here we have finally the patch for ALC880 1585 */ 1586 static int patch_alc880(struct hda_codec *codec) 1587 { 1588 struct alc_spec *spec; 1589 int err; 1590 1591 err = alc_alloc_spec(codec, 0x0b); 1592 if (err < 0) 1593 return err; 1594 1595 spec = codec->spec; 1596 spec->gen.need_dac_fix = 1; 1597 spec->gen.beep_nid = 0x01; 1598 1599 codec->patch_ops.unsol_event = alc880_unsol_event; 1600 1601 alc_pre_init(codec); 1602 1603 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl, 1604 alc880_fixups); 1605 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 1606 1607 /* automatic parse from the BIOS config */ 1608 err = alc880_parse_auto_config(codec); 1609 if (err < 0) 1610 goto error; 1611 1612 if (!spec->gen.no_analog) { 1613 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 1614 if (err < 0) 1615 goto error; 1616 } 1617 1618 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 1619 1620 return 0; 1621 1622 error: 1623 alc_free(codec); 1624 return err; 1625 } 1626 1627 1628 /* 1629 * ALC260 support 1630 */ 1631 static int alc260_parse_auto_config(struct hda_codec *codec) 1632 { 1633 static const hda_nid_t alc260_ignore[] = { 0x17, 0 }; 1634 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 }; 1635 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids); 1636 } 1637 1638 /* 1639 * Pin config fixes 1640 */ 1641 enum { 1642 ALC260_FIXUP_HP_DC5750, 1643 ALC260_FIXUP_HP_PIN_0F, 1644 ALC260_FIXUP_COEF, 1645 ALC260_FIXUP_GPIO1, 1646 ALC260_FIXUP_GPIO1_TOGGLE, 1647 ALC260_FIXUP_REPLACER, 1648 ALC260_FIXUP_HP_B1900, 1649 ALC260_FIXUP_KN1, 1650 ALC260_FIXUP_FSC_S7020, 1651 ALC260_FIXUP_FSC_S7020_JWSE, 1652 ALC260_FIXUP_VAIO_PINS, 1653 }; 1654 1655 static void alc260_gpio1_automute(struct hda_codec *codec) 1656 { 1657 struct alc_spec *spec = codec->spec; 1658 1659 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present); 1660 } 1661 1662 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, 1663 const struct hda_fixup *fix, int action) 1664 { 1665 struct alc_spec *spec = codec->spec; 1666 if (action == HDA_FIXUP_ACT_PROBE) { 1667 /* although the machine has only one output pin, we need to 1668 * toggle GPIO1 according to the jack state 1669 */ 1670 spec->gen.automute_hook = alc260_gpio1_automute; 1671 spec->gen.detect_hp = 1; 1672 spec->gen.automute_speaker = 1; 1673 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ 1674 snd_hda_jack_detect_enable_callback(codec, 0x0f, 1675 snd_hda_gen_hp_automute); 1676 alc_setup_gpio(codec, 0x01); 1677 } 1678 } 1679 1680 static void alc260_fixup_kn1(struct hda_codec *codec, 1681 const struct hda_fixup *fix, int action) 1682 { 1683 struct alc_spec *spec = codec->spec; 1684 static const struct hda_pintbl pincfgs[] = { 1685 { 0x0f, 0x02214000 }, /* HP/speaker */ 1686 { 0x12, 0x90a60160 }, /* int mic */ 1687 { 0x13, 0x02a19000 }, /* ext mic */ 1688 { 0x18, 0x01446000 }, /* SPDIF out */ 1689 /* disable bogus I/O pins */ 1690 { 0x10, 0x411111f0 }, 1691 { 0x11, 0x411111f0 }, 1692 { 0x14, 0x411111f0 }, 1693 { 0x15, 0x411111f0 }, 1694 { 0x16, 0x411111f0 }, 1695 { 0x17, 0x411111f0 }, 1696 { 0x19, 0x411111f0 }, 1697 { } 1698 }; 1699 1700 switch (action) { 1701 case HDA_FIXUP_ACT_PRE_PROBE: 1702 snd_hda_apply_pincfgs(codec, pincfgs); 1703 spec->init_amp = ALC_INIT_NONE; 1704 break; 1705 } 1706 } 1707 1708 static void alc260_fixup_fsc_s7020(struct hda_codec *codec, 1709 const struct hda_fixup *fix, int action) 1710 { 1711 struct alc_spec *spec = codec->spec; 1712 if (action == HDA_FIXUP_ACT_PRE_PROBE) 1713 spec->init_amp = ALC_INIT_NONE; 1714 } 1715 1716 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, 1717 const struct hda_fixup *fix, int action) 1718 { 1719 struct alc_spec *spec = codec->spec; 1720 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 1721 spec->gen.add_jack_modes = 1; 1722 spec->gen.hp_mic = 1; 1723 } 1724 } 1725 1726 static const struct hda_fixup alc260_fixups[] = { 1727 [ALC260_FIXUP_HP_DC5750] = { 1728 .type = HDA_FIXUP_PINS, 1729 .v.pins = (const struct hda_pintbl[]) { 1730 { 0x11, 0x90130110 }, /* speaker */ 1731 { } 1732 } 1733 }, 1734 [ALC260_FIXUP_HP_PIN_0F] = { 1735 .type = HDA_FIXUP_PINS, 1736 .v.pins = (const struct hda_pintbl[]) { 1737 { 0x0f, 0x01214000 }, /* HP */ 1738 { } 1739 } 1740 }, 1741 [ALC260_FIXUP_COEF] = { 1742 .type = HDA_FIXUP_VERBS, 1743 .v.verbs = (const struct hda_verb[]) { 1744 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, 1745 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 }, 1746 { } 1747 }, 1748 }, 1749 [ALC260_FIXUP_GPIO1] = { 1750 .type = HDA_FIXUP_FUNC, 1751 .v.func = alc_fixup_gpio1, 1752 }, 1753 [ALC260_FIXUP_GPIO1_TOGGLE] = { 1754 .type = HDA_FIXUP_FUNC, 1755 .v.func = alc260_fixup_gpio1_toggle, 1756 .chained = true, 1757 .chain_id = ALC260_FIXUP_HP_PIN_0F, 1758 }, 1759 [ALC260_FIXUP_REPLACER] = { 1760 .type = HDA_FIXUP_VERBS, 1761 .v.verbs = (const struct hda_verb[]) { 1762 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 }, 1763 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 }, 1764 { } 1765 }, 1766 .chained = true, 1767 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE, 1768 }, 1769 [ALC260_FIXUP_HP_B1900] = { 1770 .type = HDA_FIXUP_FUNC, 1771 .v.func = alc260_fixup_gpio1_toggle, 1772 .chained = true, 1773 .chain_id = ALC260_FIXUP_COEF, 1774 }, 1775 [ALC260_FIXUP_KN1] = { 1776 .type = HDA_FIXUP_FUNC, 1777 .v.func = alc260_fixup_kn1, 1778 }, 1779 [ALC260_FIXUP_FSC_S7020] = { 1780 .type = HDA_FIXUP_FUNC, 1781 .v.func = alc260_fixup_fsc_s7020, 1782 }, 1783 [ALC260_FIXUP_FSC_S7020_JWSE] = { 1784 .type = HDA_FIXUP_FUNC, 1785 .v.func = alc260_fixup_fsc_s7020_jwse, 1786 .chained = true, 1787 .chain_id = ALC260_FIXUP_FSC_S7020, 1788 }, 1789 [ALC260_FIXUP_VAIO_PINS] = { 1790 .type = HDA_FIXUP_PINS, 1791 .v.pins = (const struct hda_pintbl[]) { 1792 /* Pin configs are missing completely on some VAIOs */ 1793 { 0x0f, 0x01211020 }, 1794 { 0x10, 0x0001003f }, 1795 { 0x11, 0x411111f0 }, 1796 { 0x12, 0x01a15930 }, 1797 { 0x13, 0x411111f0 }, 1798 { 0x14, 0x411111f0 }, 1799 { 0x15, 0x411111f0 }, 1800 { 0x16, 0x411111f0 }, 1801 { 0x17, 0x411111f0 }, 1802 { 0x18, 0x411111f0 }, 1803 { 0x19, 0x411111f0 }, 1804 { } 1805 } 1806 }, 1807 }; 1808 1809 static const struct snd_pci_quirk alc260_fixup_tbl[] = { 1810 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1), 1811 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF), 1812 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1), 1813 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750), 1814 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900), 1815 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS), 1816 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F), 1817 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020), 1818 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1), 1819 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1), 1820 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER), 1821 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF), 1822 {} 1823 }; 1824 1825 static const struct hda_model_fixup alc260_fixup_models[] = { 1826 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"}, 1827 {.id = ALC260_FIXUP_COEF, .name = "coef"}, 1828 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"}, 1829 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"}, 1830 {} 1831 }; 1832 1833 /* 1834 */ 1835 static int patch_alc260(struct hda_codec *codec) 1836 { 1837 struct alc_spec *spec; 1838 int err; 1839 1840 err = alc_alloc_spec(codec, 0x07); 1841 if (err < 0) 1842 return err; 1843 1844 spec = codec->spec; 1845 /* as quite a few machines require HP amp for speaker outputs, 1846 * it's easier to enable it unconditionally; even if it's unneeded, 1847 * it's almost harmless. 1848 */ 1849 spec->gen.prefer_hp_amp = 1; 1850 spec->gen.beep_nid = 0x01; 1851 1852 spec->shutup = alc_eapd_shutup; 1853 1854 alc_pre_init(codec); 1855 1856 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl, 1857 alc260_fixups); 1858 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 1859 1860 /* automatic parse from the BIOS config */ 1861 err = alc260_parse_auto_config(codec); 1862 if (err < 0) 1863 goto error; 1864 1865 if (!spec->gen.no_analog) { 1866 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT); 1867 if (err < 0) 1868 goto error; 1869 } 1870 1871 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 1872 1873 return 0; 1874 1875 error: 1876 alc_free(codec); 1877 return err; 1878 } 1879 1880 1881 /* 1882 * ALC882/883/885/888/889 support 1883 * 1884 * ALC882 is almost identical with ALC880 but has cleaner and more flexible 1885 * configuration. Each pin widget can choose any input DACs and a mixer. 1886 * Each ADC is connected from a mixer of all inputs. This makes possible 1887 * 6-channel independent captures. 1888 * 1889 * In addition, an independent DAC for the multi-playback (not used in this 1890 * driver yet). 1891 */ 1892 1893 /* 1894 * Pin config fixes 1895 */ 1896 enum { 1897 ALC882_FIXUP_ABIT_AW9D_MAX, 1898 ALC882_FIXUP_LENOVO_Y530, 1899 ALC882_FIXUP_PB_M5210, 1900 ALC882_FIXUP_ACER_ASPIRE_7736, 1901 ALC882_FIXUP_ASUS_W90V, 1902 ALC889_FIXUP_CD, 1903 ALC889_FIXUP_FRONT_HP_NO_PRESENCE, 1904 ALC889_FIXUP_VAIO_TT, 1905 ALC888_FIXUP_EEE1601, 1906 ALC882_FIXUP_EAPD, 1907 ALC883_FIXUP_EAPD, 1908 ALC883_FIXUP_ACER_EAPD, 1909 ALC882_FIXUP_GPIO1, 1910 ALC882_FIXUP_GPIO2, 1911 ALC882_FIXUP_GPIO3, 1912 ALC889_FIXUP_COEF, 1913 ALC882_FIXUP_ASUS_W2JC, 1914 ALC882_FIXUP_ACER_ASPIRE_4930G, 1915 ALC882_FIXUP_ACER_ASPIRE_8930G, 1916 ALC882_FIXUP_ASPIRE_8930G_VERBS, 1917 ALC885_FIXUP_MACPRO_GPIO, 1918 ALC889_FIXUP_DAC_ROUTE, 1919 ALC889_FIXUP_MBP_VREF, 1920 ALC889_FIXUP_IMAC91_VREF, 1921 ALC889_FIXUP_MBA11_VREF, 1922 ALC889_FIXUP_MBA21_VREF, 1923 ALC889_FIXUP_MP11_VREF, 1924 ALC889_FIXUP_MP41_VREF, 1925 ALC882_FIXUP_INV_DMIC, 1926 ALC882_FIXUP_NO_PRIMARY_HP, 1927 ALC887_FIXUP_ASUS_BASS, 1928 ALC887_FIXUP_BASS_CHMAP, 1929 ALC1220_FIXUP_GB_DUAL_CODECS, 1930 ALC1220_FIXUP_CLEVO_P950, 1931 ALC1220_FIXUP_CLEVO_PB51ED, 1932 ALC1220_FIXUP_CLEVO_PB51ED_PINS, 1933 ALC887_FIXUP_ASUS_AUDIO, 1934 ALC887_FIXUP_ASUS_HMIC, 1935 }; 1936 1937 static void alc889_fixup_coef(struct hda_codec *codec, 1938 const struct hda_fixup *fix, int action) 1939 { 1940 if (action != HDA_FIXUP_ACT_INIT) 1941 return; 1942 alc_update_coef_idx(codec, 7, 0, 0x2030); 1943 } 1944 1945 /* set up GPIO at initialization */ 1946 static void alc885_fixup_macpro_gpio(struct hda_codec *codec, 1947 const struct hda_fixup *fix, int action) 1948 { 1949 struct alc_spec *spec = codec->spec; 1950 1951 spec->gpio_write_delay = true; 1952 alc_fixup_gpio3(codec, fix, action); 1953 } 1954 1955 /* Fix the connection of some pins for ALC889: 1956 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't 1957 * work correctly (bko#42740) 1958 */ 1959 static void alc889_fixup_dac_route(struct hda_codec *codec, 1960 const struct hda_fixup *fix, int action) 1961 { 1962 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 1963 /* fake the connections during parsing the tree */ 1964 static const hda_nid_t conn1[] = { 0x0c, 0x0d }; 1965 static const hda_nid_t conn2[] = { 0x0e, 0x0f }; 1966 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 1967 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); 1968 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2); 1969 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2); 1970 } else if (action == HDA_FIXUP_ACT_PROBE) { 1971 /* restore the connections */ 1972 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 }; 1973 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); 1974 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); 1975 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn); 1976 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn); 1977 } 1978 } 1979 1980 /* Set VREF on HP pin */ 1981 static void alc889_fixup_mbp_vref(struct hda_codec *codec, 1982 const struct hda_fixup *fix, int action) 1983 { 1984 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 }; 1985 struct alc_spec *spec = codec->spec; 1986 int i; 1987 1988 if (action != HDA_FIXUP_ACT_INIT) 1989 return; 1990 for (i = 0; i < ARRAY_SIZE(nids); i++) { 1991 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]); 1992 if (get_defcfg_device(val) != AC_JACK_HP_OUT) 1993 continue; 1994 val = snd_hda_codec_get_pin_target(codec, nids[i]); 1995 val |= AC_PINCTL_VREF_80; 1996 snd_hda_set_pin_ctl(codec, nids[i], val); 1997 spec->gen.keep_vref_in_automute = 1; 1998 break; 1999 } 2000 } 2001 2002 static void alc889_fixup_mac_pins(struct hda_codec *codec, 2003 const hda_nid_t *nids, int num_nids) 2004 { 2005 struct alc_spec *spec = codec->spec; 2006 int i; 2007 2008 for (i = 0; i < num_nids; i++) { 2009 unsigned int val; 2010 val = snd_hda_codec_get_pin_target(codec, nids[i]); 2011 val |= AC_PINCTL_VREF_50; 2012 snd_hda_set_pin_ctl(codec, nids[i], val); 2013 } 2014 spec->gen.keep_vref_in_automute = 1; 2015 } 2016 2017 /* Set VREF on speaker pins on imac91 */ 2018 static void alc889_fixup_imac91_vref(struct hda_codec *codec, 2019 const struct hda_fixup *fix, int action) 2020 { 2021 static const hda_nid_t nids[] = { 0x18, 0x1a }; 2022 2023 if (action == HDA_FIXUP_ACT_INIT) 2024 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2025 } 2026 2027 /* Set VREF on speaker pins on mba11 */ 2028 static void alc889_fixup_mba11_vref(struct hda_codec *codec, 2029 const struct hda_fixup *fix, int action) 2030 { 2031 static const hda_nid_t nids[] = { 0x18 }; 2032 2033 if (action == HDA_FIXUP_ACT_INIT) 2034 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2035 } 2036 2037 /* Set VREF on speaker pins on mba21 */ 2038 static void alc889_fixup_mba21_vref(struct hda_codec *codec, 2039 const struct hda_fixup *fix, int action) 2040 { 2041 static const hda_nid_t nids[] = { 0x18, 0x19 }; 2042 2043 if (action == HDA_FIXUP_ACT_INIT) 2044 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 2045 } 2046 2047 /* Don't take HP output as primary 2048 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio 2049 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 2050 */ 2051 static void alc882_fixup_no_primary_hp(struct hda_codec *codec, 2052 const struct hda_fixup *fix, int action) 2053 { 2054 struct alc_spec *spec = codec->spec; 2055 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 2056 spec->gen.no_primary_hp = 1; 2057 spec->gen.no_multi_io = 1; 2058 } 2059 } 2060 2061 static void alc_fixup_bass_chmap(struct hda_codec *codec, 2062 const struct hda_fixup *fix, int action); 2063 2064 /* For dual-codec configuration, we need to disable some features to avoid 2065 * conflicts of kctls and PCM streams 2066 */ 2067 static void alc_fixup_dual_codecs(struct hda_codec *codec, 2068 const struct hda_fixup *fix, int action) 2069 { 2070 struct alc_spec *spec = codec->spec; 2071 2072 if (action != HDA_FIXUP_ACT_PRE_PROBE) 2073 return; 2074 /* disable vmaster */ 2075 spec->gen.suppress_vmaster = 1; 2076 /* auto-mute and auto-mic switch don't work with multiple codecs */ 2077 spec->gen.suppress_auto_mute = 1; 2078 spec->gen.suppress_auto_mic = 1; 2079 /* disable aamix as well */ 2080 spec->gen.mixer_nid = 0; 2081 /* add location prefix to avoid conflicts */ 2082 codec->force_pin_prefix = 1; 2083 } 2084 2085 static void rename_ctl(struct hda_codec *codec, const char *oldname, 2086 const char *newname) 2087 { 2088 struct snd_kcontrol *kctl; 2089 2090 kctl = snd_hda_find_mixer_ctl(codec, oldname); 2091 if (kctl) 2092 strcpy(kctl->id.name, newname); 2093 } 2094 2095 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, 2096 const struct hda_fixup *fix, 2097 int action) 2098 { 2099 alc_fixup_dual_codecs(codec, fix, action); 2100 switch (action) { 2101 case HDA_FIXUP_ACT_PRE_PROBE: 2102 /* override card longname to provide a unique UCM profile */ 2103 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); 2104 break; 2105 case HDA_FIXUP_ACT_BUILD: 2106 /* rename Capture controls depending on the codec */ 2107 rename_ctl(codec, "Capture Volume", 2108 codec->addr == 0 ? 2109 "Rear-Panel Capture Volume" : 2110 "Front-Panel Capture Volume"); 2111 rename_ctl(codec, "Capture Switch", 2112 codec->addr == 0 ? 2113 "Rear-Panel Capture Switch" : 2114 "Front-Panel Capture Switch"); 2115 break; 2116 } 2117 } 2118 2119 static void alc1220_fixup_clevo_p950(struct hda_codec *codec, 2120 const struct hda_fixup *fix, 2121 int action) 2122 { 2123 static const hda_nid_t conn1[] = { 0x0c }; 2124 2125 if (action != HDA_FIXUP_ACT_PRE_PROBE) 2126 return; 2127 2128 alc_update_coef_idx(codec, 0x7, 0, 0x3c3); 2129 /* We therefore want to make sure 0x14 (front headphone) and 2130 * 0x1b (speakers) use the stereo DAC 0x02 2131 */ 2132 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 2133 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1); 2134 } 2135 2136 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, 2137 const struct hda_fixup *fix, int action); 2138 2139 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec, 2140 const struct hda_fixup *fix, 2141 int action) 2142 { 2143 alc1220_fixup_clevo_p950(codec, fix, action); 2144 alc_fixup_headset_mode_no_hp_mic(codec, fix, action); 2145 } 2146 2147 static void alc887_asus_hp_automute_hook(struct hda_codec *codec, 2148 struct hda_jack_callback *jack) 2149 { 2150 struct alc_spec *spec = codec->spec; 2151 unsigned int vref; 2152 2153 snd_hda_gen_hp_automute(codec, jack); 2154 2155 if (spec->gen.hp_jack_present) 2156 vref = AC_PINCTL_VREF_80; 2157 else 2158 vref = AC_PINCTL_VREF_HIZ; 2159 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref); 2160 } 2161 2162 static void alc887_fixup_asus_jack(struct hda_codec *codec, 2163 const struct hda_fixup *fix, int action) 2164 { 2165 struct alc_spec *spec = codec->spec; 2166 if (action != HDA_FIXUP_ACT_PROBE) 2167 return; 2168 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP); 2169 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook; 2170 } 2171 2172 static const struct hda_fixup alc882_fixups[] = { 2173 [ALC882_FIXUP_ABIT_AW9D_MAX] = { 2174 .type = HDA_FIXUP_PINS, 2175 .v.pins = (const struct hda_pintbl[]) { 2176 { 0x15, 0x01080104 }, /* side */ 2177 { 0x16, 0x01011012 }, /* rear */ 2178 { 0x17, 0x01016011 }, /* clfe */ 2179 { } 2180 } 2181 }, 2182 [ALC882_FIXUP_LENOVO_Y530] = { 2183 .type = HDA_FIXUP_PINS, 2184 .v.pins = (const struct hda_pintbl[]) { 2185 { 0x15, 0x99130112 }, /* rear int speakers */ 2186 { 0x16, 0x99130111 }, /* subwoofer */ 2187 { } 2188 } 2189 }, 2190 [ALC882_FIXUP_PB_M5210] = { 2191 .type = HDA_FIXUP_PINCTLS, 2192 .v.pins = (const struct hda_pintbl[]) { 2193 { 0x19, PIN_VREF50 }, 2194 {} 2195 } 2196 }, 2197 [ALC882_FIXUP_ACER_ASPIRE_7736] = { 2198 .type = HDA_FIXUP_FUNC, 2199 .v.func = alc_fixup_sku_ignore, 2200 }, 2201 [ALC882_FIXUP_ASUS_W90V] = { 2202 .type = HDA_FIXUP_PINS, 2203 .v.pins = (const struct hda_pintbl[]) { 2204 { 0x16, 0x99130110 }, /* fix sequence for CLFE */ 2205 { } 2206 } 2207 }, 2208 [ALC889_FIXUP_CD] = { 2209 .type = HDA_FIXUP_PINS, 2210 .v.pins = (const struct hda_pintbl[]) { 2211 { 0x1c, 0x993301f0 }, /* CD */ 2212 { } 2213 } 2214 }, 2215 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = { 2216 .type = HDA_FIXUP_PINS, 2217 .v.pins = (const struct hda_pintbl[]) { 2218 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */ 2219 { } 2220 }, 2221 .chained = true, 2222 .chain_id = ALC889_FIXUP_CD, 2223 }, 2224 [ALC889_FIXUP_VAIO_TT] = { 2225 .type = HDA_FIXUP_PINS, 2226 .v.pins = (const struct hda_pintbl[]) { 2227 { 0x17, 0x90170111 }, /* hidden surround speaker */ 2228 { } 2229 } 2230 }, 2231 [ALC888_FIXUP_EEE1601] = { 2232 .type = HDA_FIXUP_VERBS, 2233 .v.verbs = (const struct hda_verb[]) { 2234 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, 2235 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 }, 2236 { } 2237 } 2238 }, 2239 [ALC882_FIXUP_EAPD] = { 2240 .type = HDA_FIXUP_VERBS, 2241 .v.verbs = (const struct hda_verb[]) { 2242 /* change to EAPD mode */ 2243 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2244 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 }, 2245 { } 2246 } 2247 }, 2248 [ALC883_FIXUP_EAPD] = { 2249 .type = HDA_FIXUP_VERBS, 2250 .v.verbs = (const struct hda_verb[]) { 2251 /* change to EAPD mode */ 2252 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2253 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 2254 { } 2255 } 2256 }, 2257 [ALC883_FIXUP_ACER_EAPD] = { 2258 .type = HDA_FIXUP_VERBS, 2259 .v.verbs = (const struct hda_verb[]) { 2260 /* eanable EAPD on Acer laptops */ 2261 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2262 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2263 { } 2264 } 2265 }, 2266 [ALC882_FIXUP_GPIO1] = { 2267 .type = HDA_FIXUP_FUNC, 2268 .v.func = alc_fixup_gpio1, 2269 }, 2270 [ALC882_FIXUP_GPIO2] = { 2271 .type = HDA_FIXUP_FUNC, 2272 .v.func = alc_fixup_gpio2, 2273 }, 2274 [ALC882_FIXUP_GPIO3] = { 2275 .type = HDA_FIXUP_FUNC, 2276 .v.func = alc_fixup_gpio3, 2277 }, 2278 [ALC882_FIXUP_ASUS_W2JC] = { 2279 .type = HDA_FIXUP_FUNC, 2280 .v.func = alc_fixup_gpio1, 2281 .chained = true, 2282 .chain_id = ALC882_FIXUP_EAPD, 2283 }, 2284 [ALC889_FIXUP_COEF] = { 2285 .type = HDA_FIXUP_FUNC, 2286 .v.func = alc889_fixup_coef, 2287 }, 2288 [ALC882_FIXUP_ACER_ASPIRE_4930G] = { 2289 .type = HDA_FIXUP_PINS, 2290 .v.pins = (const struct hda_pintbl[]) { 2291 { 0x16, 0x99130111 }, /* CLFE speaker */ 2292 { 0x17, 0x99130112 }, /* surround speaker */ 2293 { } 2294 }, 2295 .chained = true, 2296 .chain_id = ALC882_FIXUP_GPIO1, 2297 }, 2298 [ALC882_FIXUP_ACER_ASPIRE_8930G] = { 2299 .type = HDA_FIXUP_PINS, 2300 .v.pins = (const struct hda_pintbl[]) { 2301 { 0x16, 0x99130111 }, /* CLFE speaker */ 2302 { 0x1b, 0x99130112 }, /* surround speaker */ 2303 { } 2304 }, 2305 .chained = true, 2306 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS, 2307 }, 2308 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = { 2309 /* additional init verbs for Acer Aspire 8930G */ 2310 .type = HDA_FIXUP_VERBS, 2311 .v.verbs = (const struct hda_verb[]) { 2312 /* Enable all DACs */ 2313 /* DAC DISABLE/MUTE 1? */ 2314 /* setting bits 1-5 disables DAC nids 0x02-0x06 2315 * apparently. Init=0x38 */ 2316 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 }, 2317 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, 2318 /* DAC DISABLE/MUTE 2? */ 2319 /* some bit here disables the other DACs. 2320 * Init=0x4900 */ 2321 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 }, 2322 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 }, 2323 /* DMIC fix 2324 * This laptop has a stereo digital microphone. 2325 * The mics are only 1cm apart which makes the stereo 2326 * useless. However, either the mic or the ALC889 2327 * makes the signal become a difference/sum signal 2328 * instead of standard stereo, which is annoying. 2329 * So instead we flip this bit which makes the 2330 * codec replicate the sum signal to both channels, 2331 * turning it into a normal mono mic. 2332 */ 2333 /* DMIC_CONTROL? Init value = 0x0001 */ 2334 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b }, 2335 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 }, 2336 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2337 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2338 { } 2339 }, 2340 .chained = true, 2341 .chain_id = ALC882_FIXUP_GPIO1, 2342 }, 2343 [ALC885_FIXUP_MACPRO_GPIO] = { 2344 .type = HDA_FIXUP_FUNC, 2345 .v.func = alc885_fixup_macpro_gpio, 2346 }, 2347 [ALC889_FIXUP_DAC_ROUTE] = { 2348 .type = HDA_FIXUP_FUNC, 2349 .v.func = alc889_fixup_dac_route, 2350 }, 2351 [ALC889_FIXUP_MBP_VREF] = { 2352 .type = HDA_FIXUP_FUNC, 2353 .v.func = alc889_fixup_mbp_vref, 2354 .chained = true, 2355 .chain_id = ALC882_FIXUP_GPIO1, 2356 }, 2357 [ALC889_FIXUP_IMAC91_VREF] = { 2358 .type = HDA_FIXUP_FUNC, 2359 .v.func = alc889_fixup_imac91_vref, 2360 .chained = true, 2361 .chain_id = ALC882_FIXUP_GPIO1, 2362 }, 2363 [ALC889_FIXUP_MBA11_VREF] = { 2364 .type = HDA_FIXUP_FUNC, 2365 .v.func = alc889_fixup_mba11_vref, 2366 .chained = true, 2367 .chain_id = ALC889_FIXUP_MBP_VREF, 2368 }, 2369 [ALC889_FIXUP_MBA21_VREF] = { 2370 .type = HDA_FIXUP_FUNC, 2371 .v.func = alc889_fixup_mba21_vref, 2372 .chained = true, 2373 .chain_id = ALC889_FIXUP_MBP_VREF, 2374 }, 2375 [ALC889_FIXUP_MP11_VREF] = { 2376 .type = HDA_FIXUP_FUNC, 2377 .v.func = alc889_fixup_mba11_vref, 2378 .chained = true, 2379 .chain_id = ALC885_FIXUP_MACPRO_GPIO, 2380 }, 2381 [ALC889_FIXUP_MP41_VREF] = { 2382 .type = HDA_FIXUP_FUNC, 2383 .v.func = alc889_fixup_mbp_vref, 2384 .chained = true, 2385 .chain_id = ALC885_FIXUP_MACPRO_GPIO, 2386 }, 2387 [ALC882_FIXUP_INV_DMIC] = { 2388 .type = HDA_FIXUP_FUNC, 2389 .v.func = alc_fixup_inv_dmic, 2390 }, 2391 [ALC882_FIXUP_NO_PRIMARY_HP] = { 2392 .type = HDA_FIXUP_FUNC, 2393 .v.func = alc882_fixup_no_primary_hp, 2394 }, 2395 [ALC887_FIXUP_ASUS_BASS] = { 2396 .type = HDA_FIXUP_PINS, 2397 .v.pins = (const struct hda_pintbl[]) { 2398 {0x16, 0x99130130}, /* bass speaker */ 2399 {} 2400 }, 2401 .chained = true, 2402 .chain_id = ALC887_FIXUP_BASS_CHMAP, 2403 }, 2404 [ALC887_FIXUP_BASS_CHMAP] = { 2405 .type = HDA_FIXUP_FUNC, 2406 .v.func = alc_fixup_bass_chmap, 2407 }, 2408 [ALC1220_FIXUP_GB_DUAL_CODECS] = { 2409 .type = HDA_FIXUP_FUNC, 2410 .v.func = alc1220_fixup_gb_dual_codecs, 2411 }, 2412 [ALC1220_FIXUP_CLEVO_P950] = { 2413 .type = HDA_FIXUP_FUNC, 2414 .v.func = alc1220_fixup_clevo_p950, 2415 }, 2416 [ALC1220_FIXUP_CLEVO_PB51ED] = { 2417 .type = HDA_FIXUP_FUNC, 2418 .v.func = alc1220_fixup_clevo_pb51ed, 2419 }, 2420 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = { 2421 .type = HDA_FIXUP_PINS, 2422 .v.pins = (const struct hda_pintbl[]) { 2423 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 2424 {} 2425 }, 2426 .chained = true, 2427 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED, 2428 }, 2429 [ALC887_FIXUP_ASUS_AUDIO] = { 2430 .type = HDA_FIXUP_PINS, 2431 .v.pins = (const struct hda_pintbl[]) { 2432 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */ 2433 { 0x19, 0x22219420 }, 2434 {} 2435 }, 2436 }, 2437 [ALC887_FIXUP_ASUS_HMIC] = { 2438 .type = HDA_FIXUP_FUNC, 2439 .v.func = alc887_fixup_asus_jack, 2440 .chained = true, 2441 .chain_id = ALC887_FIXUP_ASUS_AUDIO, 2442 }, 2443 }; 2444 2445 static const struct snd_pci_quirk alc882_fixup_tbl[] = { 2446 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD), 2447 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2448 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2449 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD), 2450 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD), 2451 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD), 2452 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD), 2453 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G", 2454 ALC882_FIXUP_ACER_ASPIRE_4930G), 2455 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G", 2456 ALC882_FIXUP_ACER_ASPIRE_4930G), 2457 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G", 2458 ALC882_FIXUP_ACER_ASPIRE_8930G), 2459 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G", 2460 ALC882_FIXUP_ACER_ASPIRE_8930G), 2461 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G", 2462 ALC882_FIXUP_ACER_ASPIRE_4930G), 2463 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G", 2464 ALC882_FIXUP_ACER_ASPIRE_4930G), 2465 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", 2466 ALC882_FIXUP_ACER_ASPIRE_4930G), 2467 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), 2468 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G", 2469 ALC882_FIXUP_ACER_ASPIRE_4930G), 2470 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), 2471 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), 2472 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), 2473 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD), 2474 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V), 2475 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC), 2476 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC), 2477 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601), 2478 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS), 2479 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), 2480 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), 2481 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), 2482 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), 2483 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), 2484 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), 2485 2486 /* All Apple entries are in codec SSIDs */ 2487 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), 2488 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), 2489 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2490 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF), 2491 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), 2492 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), 2493 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), 2494 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), 2495 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), 2496 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF), 2497 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), 2498 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), 2499 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2500 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), 2501 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), 2502 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), 2503 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), 2504 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), 2505 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), 2506 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), 2507 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), 2508 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), 2509 2510 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 2511 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), 2512 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), 2513 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), 2514 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), 2515 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950), 2516 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), 2517 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), 2518 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), 2519 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), 2520 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), 2521 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), 2522 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 2523 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), 2524 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), 2525 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), 2526 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), 2527 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950), 2528 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), 2529 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2530 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2531 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2532 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2533 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2534 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), 2535 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), 2536 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), 2537 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF), 2538 {} 2539 }; 2540 2541 static const struct hda_model_fixup alc882_fixup_models[] = { 2542 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"}, 2543 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"}, 2544 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"}, 2545 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"}, 2546 {.id = ALC889_FIXUP_CD, .name = "cd"}, 2547 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"}, 2548 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"}, 2549 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"}, 2550 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"}, 2551 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"}, 2552 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"}, 2553 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"}, 2554 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"}, 2555 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"}, 2556 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"}, 2557 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, 2558 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, 2559 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, 2560 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"}, 2561 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"}, 2562 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"}, 2563 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"}, 2564 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"}, 2565 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"}, 2566 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"}, 2567 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"}, 2568 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, 2569 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, 2570 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"}, 2571 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, 2572 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"}, 2573 {} 2574 }; 2575 2576 /* 2577 * BIOS auto configuration 2578 */ 2579 /* almost identical with ALC880 parser... */ 2580 static int alc882_parse_auto_config(struct hda_codec *codec) 2581 { 2582 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 }; 2583 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 2584 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids); 2585 } 2586 2587 /* 2588 */ 2589 static int patch_alc882(struct hda_codec *codec) 2590 { 2591 struct alc_spec *spec; 2592 int err; 2593 2594 err = alc_alloc_spec(codec, 0x0b); 2595 if (err < 0) 2596 return err; 2597 2598 spec = codec->spec; 2599 2600 switch (codec->core.vendor_id) { 2601 case 0x10ec0882: 2602 case 0x10ec0885: 2603 case 0x10ec0900: 2604 case 0x10ec0b00: 2605 case 0x10ec1220: 2606 break; 2607 default: 2608 /* ALC883 and variants */ 2609 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 2610 break; 2611 } 2612 2613 alc_pre_init(codec); 2614 2615 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, 2616 alc882_fixups); 2617 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2618 2619 alc_auto_parse_customize_define(codec); 2620 2621 if (has_cdefine_beep(codec)) 2622 spec->gen.beep_nid = 0x01; 2623 2624 /* automatic parse from the BIOS config */ 2625 err = alc882_parse_auto_config(codec); 2626 if (err < 0) 2627 goto error; 2628 2629 if (!spec->gen.no_analog && spec->gen.beep_nid) { 2630 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 2631 if (err < 0) 2632 goto error; 2633 } 2634 2635 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 2636 2637 return 0; 2638 2639 error: 2640 alc_free(codec); 2641 return err; 2642 } 2643 2644 2645 /* 2646 * ALC262 support 2647 */ 2648 static int alc262_parse_auto_config(struct hda_codec *codec) 2649 { 2650 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 }; 2651 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 2652 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids); 2653 } 2654 2655 /* 2656 * Pin config fixes 2657 */ 2658 enum { 2659 ALC262_FIXUP_FSC_H270, 2660 ALC262_FIXUP_FSC_S7110, 2661 ALC262_FIXUP_HP_Z200, 2662 ALC262_FIXUP_TYAN, 2663 ALC262_FIXUP_LENOVO_3000, 2664 ALC262_FIXUP_BENQ, 2665 ALC262_FIXUP_BENQ_T31, 2666 ALC262_FIXUP_INV_DMIC, 2667 ALC262_FIXUP_INTEL_BAYLEYBAY, 2668 }; 2669 2670 static const struct hda_fixup alc262_fixups[] = { 2671 [ALC262_FIXUP_FSC_H270] = { 2672 .type = HDA_FIXUP_PINS, 2673 .v.pins = (const struct hda_pintbl[]) { 2674 { 0x14, 0x99130110 }, /* speaker */ 2675 { 0x15, 0x0221142f }, /* front HP */ 2676 { 0x1b, 0x0121141f }, /* rear HP */ 2677 { } 2678 } 2679 }, 2680 [ALC262_FIXUP_FSC_S7110] = { 2681 .type = HDA_FIXUP_PINS, 2682 .v.pins = (const struct hda_pintbl[]) { 2683 { 0x15, 0x90170110 }, /* speaker */ 2684 { } 2685 }, 2686 .chained = true, 2687 .chain_id = ALC262_FIXUP_BENQ, 2688 }, 2689 [ALC262_FIXUP_HP_Z200] = { 2690 .type = HDA_FIXUP_PINS, 2691 .v.pins = (const struct hda_pintbl[]) { 2692 { 0x16, 0x99130120 }, /* internal speaker */ 2693 { } 2694 } 2695 }, 2696 [ALC262_FIXUP_TYAN] = { 2697 .type = HDA_FIXUP_PINS, 2698 .v.pins = (const struct hda_pintbl[]) { 2699 { 0x14, 0x1993e1f0 }, /* int AUX */ 2700 { } 2701 } 2702 }, 2703 [ALC262_FIXUP_LENOVO_3000] = { 2704 .type = HDA_FIXUP_PINCTLS, 2705 .v.pins = (const struct hda_pintbl[]) { 2706 { 0x19, PIN_VREF50 }, 2707 {} 2708 }, 2709 .chained = true, 2710 .chain_id = ALC262_FIXUP_BENQ, 2711 }, 2712 [ALC262_FIXUP_BENQ] = { 2713 .type = HDA_FIXUP_VERBS, 2714 .v.verbs = (const struct hda_verb[]) { 2715 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2716 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, 2717 {} 2718 } 2719 }, 2720 [ALC262_FIXUP_BENQ_T31] = { 2721 .type = HDA_FIXUP_VERBS, 2722 .v.verbs = (const struct hda_verb[]) { 2723 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, 2724 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 }, 2725 {} 2726 } 2727 }, 2728 [ALC262_FIXUP_INV_DMIC] = { 2729 .type = HDA_FIXUP_FUNC, 2730 .v.func = alc_fixup_inv_dmic, 2731 }, 2732 [ALC262_FIXUP_INTEL_BAYLEYBAY] = { 2733 .type = HDA_FIXUP_FUNC, 2734 .v.func = alc_fixup_no_depop_delay, 2735 }, 2736 }; 2737 2738 static const struct snd_pci_quirk alc262_fixup_tbl[] = { 2739 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200), 2740 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110), 2741 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ), 2742 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN), 2743 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270), 2744 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), 2745 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), 2746 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), 2747 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), 2748 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY), 2749 {} 2750 }; 2751 2752 static const struct hda_model_fixup alc262_fixup_models[] = { 2753 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"}, 2754 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"}, 2755 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"}, 2756 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"}, 2757 {.id = ALC262_FIXUP_TYAN, .name = "tyan"}, 2758 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"}, 2759 {.id = ALC262_FIXUP_BENQ, .name = "benq"}, 2760 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"}, 2761 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"}, 2762 {} 2763 }; 2764 2765 /* 2766 */ 2767 static int patch_alc262(struct hda_codec *codec) 2768 { 2769 struct alc_spec *spec; 2770 int err; 2771 2772 err = alc_alloc_spec(codec, 0x0b); 2773 if (err < 0) 2774 return err; 2775 2776 spec = codec->spec; 2777 spec->gen.shared_mic_vref_pin = 0x18; 2778 2779 spec->shutup = alc_eapd_shutup; 2780 2781 #if 0 2782 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is 2783 * under-run 2784 */ 2785 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80); 2786 #endif 2787 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 2788 2789 alc_pre_init(codec); 2790 2791 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl, 2792 alc262_fixups); 2793 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2794 2795 alc_auto_parse_customize_define(codec); 2796 2797 if (has_cdefine_beep(codec)) 2798 spec->gen.beep_nid = 0x01; 2799 2800 /* automatic parse from the BIOS config */ 2801 err = alc262_parse_auto_config(codec); 2802 if (err < 0) 2803 goto error; 2804 2805 if (!spec->gen.no_analog && spec->gen.beep_nid) { 2806 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 2807 if (err < 0) 2808 goto error; 2809 } 2810 2811 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 2812 2813 return 0; 2814 2815 error: 2816 alc_free(codec); 2817 return err; 2818 } 2819 2820 /* 2821 * ALC268 2822 */ 2823 /* bind Beep switches of both NID 0x0f and 0x10 */ 2824 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, 2825 struct snd_ctl_elem_value *ucontrol) 2826 { 2827 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2828 unsigned long pval; 2829 int err; 2830 2831 mutex_lock(&codec->control_mutex); 2832 pval = kcontrol->private_value; 2833 kcontrol->private_value = (pval & ~0xff) | 0x0f; 2834 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 2835 if (err >= 0) { 2836 kcontrol->private_value = (pval & ~0xff) | 0x10; 2837 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 2838 } 2839 kcontrol->private_value = pval; 2840 mutex_unlock(&codec->control_mutex); 2841 return err; 2842 } 2843 2844 static const struct snd_kcontrol_new alc268_beep_mixer[] = { 2845 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), 2846 { 2847 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2848 .name = "Beep Playback Switch", 2849 .subdevice = HDA_SUBDEV_AMP_FLAG, 2850 .info = snd_hda_mixer_amp_switch_info, 2851 .get = snd_hda_mixer_amp_switch_get, 2852 .put = alc268_beep_switch_put, 2853 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) 2854 }, 2855 }; 2856 2857 /* set PCBEEP vol = 0, mute connections */ 2858 static const struct hda_verb alc268_beep_init_verbs[] = { 2859 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 2860 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2861 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2862 { } 2863 }; 2864 2865 enum { 2866 ALC268_FIXUP_INV_DMIC, 2867 ALC268_FIXUP_HP_EAPD, 2868 ALC268_FIXUP_SPDIF, 2869 }; 2870 2871 static const struct hda_fixup alc268_fixups[] = { 2872 [ALC268_FIXUP_INV_DMIC] = { 2873 .type = HDA_FIXUP_FUNC, 2874 .v.func = alc_fixup_inv_dmic, 2875 }, 2876 [ALC268_FIXUP_HP_EAPD] = { 2877 .type = HDA_FIXUP_VERBS, 2878 .v.verbs = (const struct hda_verb[]) { 2879 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0}, 2880 {} 2881 } 2882 }, 2883 [ALC268_FIXUP_SPDIF] = { 2884 .type = HDA_FIXUP_PINS, 2885 .v.pins = (const struct hda_pintbl[]) { 2886 { 0x1e, 0x014b1180 }, /* enable SPDIF out */ 2887 {} 2888 } 2889 }, 2890 }; 2891 2892 static const struct hda_model_fixup alc268_fixup_models[] = { 2893 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"}, 2894 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"}, 2895 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"}, 2896 {} 2897 }; 2898 2899 static const struct snd_pci_quirk alc268_fixup_tbl[] = { 2900 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF), 2901 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC), 2902 /* below is codec SSID since multiple Toshiba laptops have the 2903 * same PCI SSID 1179:ff00 2904 */ 2905 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD), 2906 {} 2907 }; 2908 2909 /* 2910 * BIOS auto configuration 2911 */ 2912 static int alc268_parse_auto_config(struct hda_codec *codec) 2913 { 2914 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 2915 return alc_parse_auto_config(codec, NULL, alc268_ssids); 2916 } 2917 2918 /* 2919 */ 2920 static int patch_alc268(struct hda_codec *codec) 2921 { 2922 struct alc_spec *spec; 2923 int i, err; 2924 2925 /* ALC268 has no aa-loopback mixer */ 2926 err = alc_alloc_spec(codec, 0); 2927 if (err < 0) 2928 return err; 2929 2930 spec = codec->spec; 2931 if (has_cdefine_beep(codec)) 2932 spec->gen.beep_nid = 0x01; 2933 2934 spec->shutup = alc_eapd_shutup; 2935 2936 alc_pre_init(codec); 2937 2938 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups); 2939 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2940 2941 /* automatic parse from the BIOS config */ 2942 err = alc268_parse_auto_config(codec); 2943 if (err < 0) 2944 goto error; 2945 2946 if (err > 0 && !spec->gen.no_analog && 2947 spec->gen.autocfg.speaker_pins[0] != 0x1d) { 2948 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) { 2949 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, 2950 &alc268_beep_mixer[i])) { 2951 err = -ENOMEM; 2952 goto error; 2953 } 2954 } 2955 snd_hda_add_verbs(codec, alc268_beep_init_verbs); 2956 if (!query_amp_caps(codec, 0x1d, HDA_INPUT)) 2957 /* override the amp caps for beep generator */ 2958 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT, 2959 (0x0c << AC_AMPCAP_OFFSET_SHIFT) | 2960 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) | 2961 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) | 2962 (0 << AC_AMPCAP_MUTE_SHIFT)); 2963 } 2964 2965 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 2966 2967 return 0; 2968 2969 error: 2970 alc_free(codec); 2971 return err; 2972 } 2973 2974 /* 2975 * ALC269 2976 */ 2977 2978 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = { 2979 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ 2980 }; 2981 2982 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = { 2983 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ 2984 }; 2985 2986 /* different alc269-variants */ 2987 enum { 2988 ALC269_TYPE_ALC269VA, 2989 ALC269_TYPE_ALC269VB, 2990 ALC269_TYPE_ALC269VC, 2991 ALC269_TYPE_ALC269VD, 2992 ALC269_TYPE_ALC280, 2993 ALC269_TYPE_ALC282, 2994 ALC269_TYPE_ALC283, 2995 ALC269_TYPE_ALC284, 2996 ALC269_TYPE_ALC293, 2997 ALC269_TYPE_ALC286, 2998 ALC269_TYPE_ALC298, 2999 ALC269_TYPE_ALC255, 3000 ALC269_TYPE_ALC256, 3001 ALC269_TYPE_ALC257, 3002 ALC269_TYPE_ALC215, 3003 ALC269_TYPE_ALC225, 3004 ALC269_TYPE_ALC294, 3005 ALC269_TYPE_ALC300, 3006 ALC269_TYPE_ALC623, 3007 ALC269_TYPE_ALC700, 3008 }; 3009 3010 /* 3011 * BIOS auto configuration 3012 */ 3013 static int alc269_parse_auto_config(struct hda_codec *codec) 3014 { 3015 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 3016 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 }; 3017 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 3018 struct alc_spec *spec = codec->spec; 3019 const hda_nid_t *ssids; 3020 3021 switch (spec->codec_variant) { 3022 case ALC269_TYPE_ALC269VA: 3023 case ALC269_TYPE_ALC269VC: 3024 case ALC269_TYPE_ALC280: 3025 case ALC269_TYPE_ALC284: 3026 case ALC269_TYPE_ALC293: 3027 ssids = alc269va_ssids; 3028 break; 3029 case ALC269_TYPE_ALC269VB: 3030 case ALC269_TYPE_ALC269VD: 3031 case ALC269_TYPE_ALC282: 3032 case ALC269_TYPE_ALC283: 3033 case ALC269_TYPE_ALC286: 3034 case ALC269_TYPE_ALC298: 3035 case ALC269_TYPE_ALC255: 3036 case ALC269_TYPE_ALC256: 3037 case ALC269_TYPE_ALC257: 3038 case ALC269_TYPE_ALC215: 3039 case ALC269_TYPE_ALC225: 3040 case ALC269_TYPE_ALC294: 3041 case ALC269_TYPE_ALC300: 3042 case ALC269_TYPE_ALC623: 3043 case ALC269_TYPE_ALC700: 3044 ssids = alc269_ssids; 3045 break; 3046 default: 3047 ssids = alc269_ssids; 3048 break; 3049 } 3050 3051 return alc_parse_auto_config(codec, alc269_ignore, ssids); 3052 } 3053 3054 static const struct hda_jack_keymap alc_headset_btn_keymap[] = { 3055 { SND_JACK_BTN_0, KEY_PLAYPAUSE }, 3056 { SND_JACK_BTN_1, KEY_VOICECOMMAND }, 3057 { SND_JACK_BTN_2, KEY_VOLUMEUP }, 3058 { SND_JACK_BTN_3, KEY_VOLUMEDOWN }, 3059 {} 3060 }; 3061 3062 static void alc_headset_btn_callback(struct hda_codec *codec, 3063 struct hda_jack_callback *jack) 3064 { 3065 int report = 0; 3066 3067 if (jack->unsol_res & (7 << 13)) 3068 report |= SND_JACK_BTN_0; 3069 3070 if (jack->unsol_res & (1 << 16 | 3 << 8)) 3071 report |= SND_JACK_BTN_1; 3072 3073 /* Volume up key */ 3074 if (jack->unsol_res & (7 << 23)) 3075 report |= SND_JACK_BTN_2; 3076 3077 /* Volume down key */ 3078 if (jack->unsol_res & (7 << 10)) 3079 report |= SND_JACK_BTN_3; 3080 3081 jack->jack->button_state = report; 3082 } 3083 3084 static void alc_disable_headset_jack_key(struct hda_codec *codec) 3085 { 3086 struct alc_spec *spec = codec->spec; 3087 3088 if (!spec->has_hs_key) 3089 return; 3090 3091 switch (codec->core.vendor_id) { 3092 case 0x10ec0215: 3093 case 0x10ec0225: 3094 case 0x10ec0285: 3095 case 0x10ec0295: 3096 case 0x10ec0289: 3097 case 0x10ec0299: 3098 alc_write_coef_idx(codec, 0x48, 0x0); 3099 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); 3100 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); 3101 break; 3102 case 0x10ec0236: 3103 case 0x10ec0256: 3104 alc_write_coef_idx(codec, 0x48, 0x0); 3105 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); 3106 break; 3107 } 3108 } 3109 3110 static void alc_enable_headset_jack_key(struct hda_codec *codec) 3111 { 3112 struct alc_spec *spec = codec->spec; 3113 3114 if (!spec->has_hs_key) 3115 return; 3116 3117 switch (codec->core.vendor_id) { 3118 case 0x10ec0215: 3119 case 0x10ec0225: 3120 case 0x10ec0285: 3121 case 0x10ec0295: 3122 case 0x10ec0289: 3123 case 0x10ec0299: 3124 alc_write_coef_idx(codec, 0x48, 0xd011); 3125 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); 3126 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); 3127 break; 3128 case 0x10ec0236: 3129 case 0x10ec0256: 3130 alc_write_coef_idx(codec, 0x48, 0xd011); 3131 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); 3132 break; 3133 } 3134 } 3135 3136 static void alc_fixup_headset_jack(struct hda_codec *codec, 3137 const struct hda_fixup *fix, int action) 3138 { 3139 struct alc_spec *spec = codec->spec; 3140 3141 switch (action) { 3142 case HDA_FIXUP_ACT_PRE_PROBE: 3143 spec->has_hs_key = 1; 3144 snd_hda_jack_detect_enable_callback(codec, 0x55, 3145 alc_headset_btn_callback); 3146 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, 3147 SND_JACK_HEADSET, alc_headset_btn_keymap); 3148 break; 3149 case HDA_FIXUP_ACT_INIT: 3150 alc_enable_headset_jack_key(codec); 3151 break; 3152 } 3153 } 3154 3155 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) 3156 { 3157 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); 3158 } 3159 3160 static void alc269_shutup(struct hda_codec *codec) 3161 { 3162 struct alc_spec *spec = codec->spec; 3163 3164 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 3165 alc269vb_toggle_power_output(codec, 0); 3166 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 3167 (alc_get_coef0(codec) & 0x00ff) == 0x018) { 3168 msleep(150); 3169 } 3170 alc_shutup_pins(codec); 3171 } 3172 3173 static const struct coef_fw alc282_coefs[] = { 3174 WRITE_COEF(0x03, 0x0002), /* Power Down Control */ 3175 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ 3176 WRITE_COEF(0x07, 0x0200), /* DMIC control */ 3177 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ 3178 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ 3179 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ 3180 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ 3181 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */ 3182 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ 3183 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ 3184 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */ 3185 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */ 3186 WRITE_COEF(0x34, 0xa0c0), /* ANC */ 3187 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */ 3188 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ 3189 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ 3190 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ 3191 WRITE_COEF(0x63, 0x2902), /* PLL */ 3192 WRITE_COEF(0x68, 0xa080), /* capless control 2 */ 3193 WRITE_COEF(0x69, 0x3400), /* capless control 3 */ 3194 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */ 3195 WRITE_COEF(0x6b, 0x0), /* capless control 5 */ 3196 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */ 3197 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */ 3198 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */ 3199 WRITE_COEF(0x71, 0x0014), /* class D test 6 */ 3200 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */ 3201 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */ 3202 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */ 3203 {} 3204 }; 3205 3206 static void alc282_restore_default_value(struct hda_codec *codec) 3207 { 3208 alc_process_coef_fw(codec, alc282_coefs); 3209 } 3210 3211 static void alc282_init(struct hda_codec *codec) 3212 { 3213 struct alc_spec *spec = codec->spec; 3214 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3215 bool hp_pin_sense; 3216 int coef78; 3217 3218 alc282_restore_default_value(codec); 3219 3220 if (!hp_pin) 3221 return; 3222 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3223 coef78 = alc_read_coef_idx(codec, 0x78); 3224 3225 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */ 3226 /* Headphone capless set to high power mode */ 3227 alc_write_coef_idx(codec, 0x78, 0x9004); 3228 3229 if (hp_pin_sense) 3230 msleep(2); 3231 3232 snd_hda_codec_write(codec, hp_pin, 0, 3233 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3234 3235 if (hp_pin_sense) 3236 msleep(85); 3237 3238 snd_hda_codec_write(codec, hp_pin, 0, 3239 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3240 3241 if (hp_pin_sense) 3242 msleep(100); 3243 3244 /* Headphone capless set to normal mode */ 3245 alc_write_coef_idx(codec, 0x78, coef78); 3246 } 3247 3248 static void alc282_shutup(struct hda_codec *codec) 3249 { 3250 struct alc_spec *spec = codec->spec; 3251 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3252 bool hp_pin_sense; 3253 int coef78; 3254 3255 if (!hp_pin) { 3256 alc269_shutup(codec); 3257 return; 3258 } 3259 3260 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3261 coef78 = alc_read_coef_idx(codec, 0x78); 3262 alc_write_coef_idx(codec, 0x78, 0x9004); 3263 3264 if (hp_pin_sense) 3265 msleep(2); 3266 3267 snd_hda_codec_write(codec, hp_pin, 0, 3268 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3269 3270 if (hp_pin_sense) 3271 msleep(85); 3272 3273 if (!spec->no_shutup_pins) 3274 snd_hda_codec_write(codec, hp_pin, 0, 3275 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3276 3277 if (hp_pin_sense) 3278 msleep(100); 3279 3280 alc_auto_setup_eapd(codec, false); 3281 alc_shutup_pins(codec); 3282 alc_write_coef_idx(codec, 0x78, coef78); 3283 } 3284 3285 static const struct coef_fw alc283_coefs[] = { 3286 WRITE_COEF(0x03, 0x0002), /* Power Down Control */ 3287 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */ 3288 WRITE_COEF(0x07, 0x0200), /* DMIC control */ 3289 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */ 3290 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */ 3291 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */ 3292 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */ 3293 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */ 3294 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */ 3295 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */ 3296 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */ 3297 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */ 3298 WRITE_COEF(0x22, 0xa0c0), /* ANC */ 3299 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */ 3300 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */ 3301 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */ 3302 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */ 3303 WRITE_COEF(0x2e, 0x2902), /* PLL */ 3304 WRITE_COEF(0x33, 0xa080), /* capless control 2 */ 3305 WRITE_COEF(0x34, 0x3400), /* capless control 3 */ 3306 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */ 3307 WRITE_COEF(0x36, 0x0), /* capless control 5 */ 3308 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */ 3309 WRITE_COEF(0x39, 0x110a), /* class D test 3 */ 3310 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */ 3311 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */ 3312 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */ 3313 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */ 3314 WRITE_COEF(0x49, 0x0), /* test mode */ 3315 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */ 3316 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */ 3317 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */ 3318 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */ 3319 {} 3320 }; 3321 3322 static void alc283_restore_default_value(struct hda_codec *codec) 3323 { 3324 alc_process_coef_fw(codec, alc283_coefs); 3325 } 3326 3327 static void alc283_init(struct hda_codec *codec) 3328 { 3329 struct alc_spec *spec = codec->spec; 3330 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3331 bool hp_pin_sense; 3332 3333 alc283_restore_default_value(codec); 3334 3335 if (!hp_pin) 3336 return; 3337 3338 msleep(30); 3339 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3340 3341 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */ 3342 /* Headphone capless set to high power mode */ 3343 alc_write_coef_idx(codec, 0x43, 0x9004); 3344 3345 snd_hda_codec_write(codec, hp_pin, 0, 3346 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3347 3348 if (hp_pin_sense) 3349 msleep(85); 3350 3351 snd_hda_codec_write(codec, hp_pin, 0, 3352 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3353 3354 if (hp_pin_sense) 3355 msleep(85); 3356 /* Index 0x46 Combo jack auto switch control 2 */ 3357 /* 3k pull low control for Headset jack. */ 3358 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); 3359 /* Headphone capless set to normal mode */ 3360 alc_write_coef_idx(codec, 0x43, 0x9614); 3361 } 3362 3363 static void alc283_shutup(struct hda_codec *codec) 3364 { 3365 struct alc_spec *spec = codec->spec; 3366 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3367 bool hp_pin_sense; 3368 3369 if (!hp_pin) { 3370 alc269_shutup(codec); 3371 return; 3372 } 3373 3374 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3375 3376 alc_write_coef_idx(codec, 0x43, 0x9004); 3377 3378 /*depop hp during suspend*/ 3379 alc_write_coef_idx(codec, 0x06, 0x2100); 3380 3381 snd_hda_codec_write(codec, hp_pin, 0, 3382 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3383 3384 if (hp_pin_sense) 3385 msleep(100); 3386 3387 if (!spec->no_shutup_pins) 3388 snd_hda_codec_write(codec, hp_pin, 0, 3389 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3390 3391 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3392 3393 if (hp_pin_sense) 3394 msleep(100); 3395 alc_auto_setup_eapd(codec, false); 3396 alc_shutup_pins(codec); 3397 alc_write_coef_idx(codec, 0x43, 0x9614); 3398 } 3399 3400 static void alc256_init(struct hda_codec *codec) 3401 { 3402 struct alc_spec *spec = codec->spec; 3403 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3404 bool hp_pin_sense; 3405 3406 if (!hp_pin) 3407 hp_pin = 0x21; 3408 3409 msleep(30); 3410 3411 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3412 3413 if (hp_pin_sense) 3414 msleep(2); 3415 3416 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3417 if (spec->ultra_low_power) { 3418 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); 3419 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); 3420 alc_update_coef_idx(codec, 0x08, 7<<4, 0); 3421 alc_update_coef_idx(codec, 0x3b, 1<<15, 0); 3422 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); 3423 msleep(30); 3424 } 3425 3426 snd_hda_codec_write(codec, hp_pin, 0, 3427 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3428 3429 if (hp_pin_sense || spec->ultra_low_power) 3430 msleep(85); 3431 3432 snd_hda_codec_write(codec, hp_pin, 0, 3433 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3434 3435 if (hp_pin_sense || spec->ultra_low_power) 3436 msleep(100); 3437 3438 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); 3439 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3440 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ 3441 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); 3442 /* 3443 * Expose headphone mic (or possibly Line In on some machines) instead 3444 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See 3445 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of 3446 * this register. 3447 */ 3448 alc_write_coef_idx(codec, 0x36, 0x5757); 3449 } 3450 3451 static void alc256_shutup(struct hda_codec *codec) 3452 { 3453 struct alc_spec *spec = codec->spec; 3454 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3455 bool hp_pin_sense; 3456 3457 if (!hp_pin) 3458 hp_pin = 0x21; 3459 3460 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3461 3462 if (hp_pin_sense) 3463 msleep(2); 3464 3465 snd_hda_codec_write(codec, hp_pin, 0, 3466 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3467 3468 if (hp_pin_sense || spec->ultra_low_power) 3469 msleep(85); 3470 3471 /* 3k pull low control for Headset jack. */ 3472 /* NOTE: call this before clearing the pin, otherwise codec stalls */ 3473 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly 3474 * when booting with headset plugged. So skip setting it for the codec alc257 3475 */ 3476 if (codec->core.vendor_id != 0x10ec0257) 3477 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3478 3479 if (!spec->no_shutup_pins) 3480 snd_hda_codec_write(codec, hp_pin, 0, 3481 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3482 3483 if (hp_pin_sense || spec->ultra_low_power) 3484 msleep(100); 3485 3486 alc_auto_setup_eapd(codec, false); 3487 alc_shutup_pins(codec); 3488 if (spec->ultra_low_power) { 3489 msleep(50); 3490 alc_update_coef_idx(codec, 0x03, 1<<1, 0); 3491 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); 3492 alc_update_coef_idx(codec, 0x08, 3<<2, 0); 3493 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); 3494 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); 3495 msleep(30); 3496 } 3497 } 3498 3499 static void alc225_init(struct hda_codec *codec) 3500 { 3501 struct alc_spec *spec = codec->spec; 3502 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3503 bool hp1_pin_sense, hp2_pin_sense; 3504 3505 if (!hp_pin) 3506 hp_pin = 0x21; 3507 msleep(30); 3508 3509 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3510 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3511 3512 if (hp1_pin_sense || hp2_pin_sense) 3513 msleep(2); 3514 3515 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3516 if (spec->ultra_low_power) { 3517 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); 3518 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); 3519 alc_update_coef_idx(codec, 0x33, 1<<11, 0); 3520 msleep(30); 3521 } 3522 3523 if (hp1_pin_sense || spec->ultra_low_power) 3524 snd_hda_codec_write(codec, hp_pin, 0, 3525 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3526 if (hp2_pin_sense) 3527 snd_hda_codec_write(codec, 0x16, 0, 3528 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3529 3530 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3531 msleep(85); 3532 3533 if (hp1_pin_sense || spec->ultra_low_power) 3534 snd_hda_codec_write(codec, hp_pin, 0, 3535 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3536 if (hp2_pin_sense) 3537 snd_hda_codec_write(codec, 0x16, 0, 3538 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3539 3540 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3541 msleep(100); 3542 3543 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3544 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3545 } 3546 3547 static void alc225_shutup(struct hda_codec *codec) 3548 { 3549 struct alc_spec *spec = codec->spec; 3550 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3551 bool hp1_pin_sense, hp2_pin_sense; 3552 3553 if (!hp_pin) 3554 hp_pin = 0x21; 3555 3556 alc_disable_headset_jack_key(codec); 3557 /* 3k pull low control for Headset jack. */ 3558 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); 3559 3560 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3561 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3562 3563 if (hp1_pin_sense || hp2_pin_sense) 3564 msleep(2); 3565 3566 if (hp1_pin_sense || spec->ultra_low_power) 3567 snd_hda_codec_write(codec, hp_pin, 0, 3568 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3569 if (hp2_pin_sense) 3570 snd_hda_codec_write(codec, 0x16, 0, 3571 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3572 3573 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3574 msleep(85); 3575 3576 if (hp1_pin_sense || spec->ultra_low_power) 3577 snd_hda_codec_write(codec, hp_pin, 0, 3578 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3579 if (hp2_pin_sense) 3580 snd_hda_codec_write(codec, 0x16, 0, 3581 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3582 3583 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3584 msleep(100); 3585 3586 alc_auto_setup_eapd(codec, false); 3587 alc_shutup_pins(codec); 3588 if (spec->ultra_low_power) { 3589 msleep(50); 3590 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); 3591 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); 3592 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); 3593 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); 3594 msleep(30); 3595 } 3596 3597 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3598 alc_enable_headset_jack_key(codec); 3599 } 3600 3601 static void alc_default_init(struct hda_codec *codec) 3602 { 3603 struct alc_spec *spec = codec->spec; 3604 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3605 bool hp_pin_sense; 3606 3607 if (!hp_pin) 3608 return; 3609 3610 msleep(30); 3611 3612 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3613 3614 if (hp_pin_sense) 3615 msleep(2); 3616 3617 snd_hda_codec_write(codec, hp_pin, 0, 3618 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3619 3620 if (hp_pin_sense) 3621 msleep(85); 3622 3623 snd_hda_codec_write(codec, hp_pin, 0, 3624 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3625 3626 if (hp_pin_sense) 3627 msleep(100); 3628 } 3629 3630 static void alc_default_shutup(struct hda_codec *codec) 3631 { 3632 struct alc_spec *spec = codec->spec; 3633 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3634 bool hp_pin_sense; 3635 3636 if (!hp_pin) { 3637 alc269_shutup(codec); 3638 return; 3639 } 3640 3641 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3642 3643 if (hp_pin_sense) 3644 msleep(2); 3645 3646 snd_hda_codec_write(codec, hp_pin, 0, 3647 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3648 3649 if (hp_pin_sense) 3650 msleep(85); 3651 3652 if (!spec->no_shutup_pins) 3653 snd_hda_codec_write(codec, hp_pin, 0, 3654 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3655 3656 if (hp_pin_sense) 3657 msleep(100); 3658 3659 alc_auto_setup_eapd(codec, false); 3660 alc_shutup_pins(codec); 3661 } 3662 3663 static void alc294_hp_init(struct hda_codec *codec) 3664 { 3665 struct alc_spec *spec = codec->spec; 3666 hda_nid_t hp_pin = alc_get_hp_pin(spec); 3667 int i, val; 3668 3669 if (!hp_pin) 3670 return; 3671 3672 snd_hda_codec_write(codec, hp_pin, 0, 3673 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3674 3675 msleep(100); 3676 3677 if (!spec->no_shutup_pins) 3678 snd_hda_codec_write(codec, hp_pin, 0, 3679 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3680 3681 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ 3682 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ 3683 3684 /* Wait for depop procedure finish */ 3685 val = alc_read_coefex_idx(codec, 0x58, 0x01); 3686 for (i = 0; i < 20 && val & 0x0080; i++) { 3687 msleep(50); 3688 val = alc_read_coefex_idx(codec, 0x58, 0x01); 3689 } 3690 /* Set HP depop to auto mode */ 3691 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); 3692 msleep(50); 3693 } 3694 3695 static void alc294_init(struct hda_codec *codec) 3696 { 3697 struct alc_spec *spec = codec->spec; 3698 3699 /* required only at boot or S4 resume time */ 3700 if (!spec->done_hp_init || 3701 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { 3702 alc294_hp_init(codec); 3703 spec->done_hp_init = true; 3704 } 3705 alc_default_init(codec); 3706 } 3707 3708 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, 3709 unsigned int val) 3710 { 3711 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); 3712 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ 3713 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ 3714 } 3715 3716 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) 3717 { 3718 unsigned int val; 3719 3720 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); 3721 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) 3722 & 0xffff; 3723 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) 3724 << 16; 3725 return val; 3726 } 3727 3728 static void alc5505_dsp_halt(struct hda_codec *codec) 3729 { 3730 unsigned int val; 3731 3732 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ 3733 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ 3734 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ 3735 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ 3736 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ 3737 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ 3738 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ 3739 val = alc5505_coef_get(codec, 0x6220); 3740 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ 3741 } 3742 3743 static void alc5505_dsp_back_from_halt(struct hda_codec *codec) 3744 { 3745 alc5505_coef_set(codec, 0x61b8, 0x04133302); 3746 alc5505_coef_set(codec, 0x61b0, 0x00005b16); 3747 alc5505_coef_set(codec, 0x61b4, 0x040a2b02); 3748 alc5505_coef_set(codec, 0x6230, 0xf80d4011); 3749 alc5505_coef_set(codec, 0x6220, 0x2002010f); 3750 alc5505_coef_set(codec, 0x880c, 0x00000004); 3751 } 3752 3753 static void alc5505_dsp_init(struct hda_codec *codec) 3754 { 3755 unsigned int val; 3756 3757 alc5505_dsp_halt(codec); 3758 alc5505_dsp_back_from_halt(codec); 3759 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ 3760 alc5505_coef_set(codec, 0x61b0, 0x5b16); 3761 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ 3762 alc5505_coef_set(codec, 0x61b4, 0x04132b02); 3763 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ 3764 alc5505_coef_set(codec, 0x61b8, 0x041f3302); 3765 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ 3766 alc5505_coef_set(codec, 0x61b8, 0x041b3302); 3767 alc5505_coef_set(codec, 0x61b8, 0x04173302); 3768 alc5505_coef_set(codec, 0x61b8, 0x04163302); 3769 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ 3770 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ 3771 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ 3772 3773 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ 3774 if (val <= 3) 3775 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ 3776 else 3777 alc5505_coef_set(codec, 0x6220, 0x6002018f); 3778 3779 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ 3780 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ 3781 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ 3782 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ 3783 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ 3784 alc5505_coef_set(codec, 0x880c, 0x00000003); 3785 alc5505_coef_set(codec, 0x880c, 0x00000010); 3786 3787 #ifdef HALT_REALTEK_ALC5505 3788 alc5505_dsp_halt(codec); 3789 #endif 3790 } 3791 3792 #ifdef HALT_REALTEK_ALC5505 3793 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ 3794 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ 3795 #else 3796 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) 3797 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) 3798 #endif 3799 3800 #ifdef CONFIG_PM 3801 static int alc269_suspend(struct hda_codec *codec) 3802 { 3803 struct alc_spec *spec = codec->spec; 3804 3805 if (spec->has_alc5505_dsp) 3806 alc5505_dsp_suspend(codec); 3807 return alc_suspend(codec); 3808 } 3809 3810 static int alc269_resume(struct hda_codec *codec) 3811 { 3812 struct alc_spec *spec = codec->spec; 3813 3814 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 3815 alc269vb_toggle_power_output(codec, 0); 3816 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 3817 (alc_get_coef0(codec) & 0x00ff) == 0x018) { 3818 msleep(150); 3819 } 3820 3821 codec->patch_ops.init(codec); 3822 3823 if (spec->codec_variant == ALC269_TYPE_ALC269VB) 3824 alc269vb_toggle_power_output(codec, 1); 3825 if (spec->codec_variant == ALC269_TYPE_ALC269VB && 3826 (alc_get_coef0(codec) & 0x00ff) == 0x017) { 3827 msleep(200); 3828 } 3829 3830 snd_hda_regmap_sync(codec); 3831 hda_call_check_power_status(codec, 0x01); 3832 3833 /* on some machine, the BIOS will clear the codec gpio data when enter 3834 * suspend, and won't restore the data after resume, so we restore it 3835 * in the driver. 3836 */ 3837 if (spec->gpio_data) 3838 alc_write_gpio_data(codec); 3839 3840 if (spec->has_alc5505_dsp) 3841 alc5505_dsp_resume(codec); 3842 3843 return 0; 3844 } 3845 #endif /* CONFIG_PM */ 3846 3847 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, 3848 const struct hda_fixup *fix, int action) 3849 { 3850 struct alc_spec *spec = codec->spec; 3851 3852 if (action == HDA_FIXUP_ACT_PRE_PROBE) 3853 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 3854 } 3855 3856 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, 3857 const struct hda_fixup *fix, 3858 int action) 3859 { 3860 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); 3861 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); 3862 3863 if (cfg_headphone && cfg_headset_mic == 0x411111f0) 3864 snd_hda_codec_set_pincfg(codec, 0x19, 3865 (cfg_headphone & ~AC_DEFCFG_DEVICE) | 3866 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT)); 3867 } 3868 3869 static void alc269_fixup_hweq(struct hda_codec *codec, 3870 const struct hda_fixup *fix, int action) 3871 { 3872 if (action == HDA_FIXUP_ACT_INIT) 3873 alc_update_coef_idx(codec, 0x1e, 0, 0x80); 3874 } 3875 3876 static void alc269_fixup_headset_mic(struct hda_codec *codec, 3877 const struct hda_fixup *fix, int action) 3878 { 3879 struct alc_spec *spec = codec->spec; 3880 3881 if (action == HDA_FIXUP_ACT_PRE_PROBE) 3882 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 3883 } 3884 3885 static void alc271_fixup_dmic(struct hda_codec *codec, 3886 const struct hda_fixup *fix, int action) 3887 { 3888 static const struct hda_verb verbs[] = { 3889 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d}, 3890 {0x20, AC_VERB_SET_PROC_COEF, 0x4000}, 3891 {} 3892 }; 3893 unsigned int cfg; 3894 3895 if (strcmp(codec->core.chip_name, "ALC271X") && 3896 strcmp(codec->core.chip_name, "ALC269VB")) 3897 return; 3898 cfg = snd_hda_codec_get_pincfg(codec, 0x12); 3899 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED) 3900 snd_hda_sequence_write(codec, verbs); 3901 } 3902 3903 static void alc269_fixup_pcm_44k(struct hda_codec *codec, 3904 const struct hda_fixup *fix, int action) 3905 { 3906 struct alc_spec *spec = codec->spec; 3907 3908 if (action != HDA_FIXUP_ACT_PROBE) 3909 return; 3910 3911 /* Due to a hardware problem on Lenovo Ideadpad, we need to 3912 * fix the sample rate of analog I/O to 44.1kHz 3913 */ 3914 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback; 3915 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture; 3916 } 3917 3918 static void alc269_fixup_stereo_dmic(struct hda_codec *codec, 3919 const struct hda_fixup *fix, int action) 3920 { 3921 /* The digital-mic unit sends PDM (differential signal) instead of 3922 * the standard PCM, thus you can't record a valid mono stream as is. 3923 * Below is a workaround specific to ALC269 to control the dmic 3924 * signal source as mono. 3925 */ 3926 if (action == HDA_FIXUP_ACT_INIT) 3927 alc_update_coef_idx(codec, 0x07, 0, 0x80); 3928 } 3929 3930 static void alc269_quanta_automute(struct hda_codec *codec) 3931 { 3932 snd_hda_gen_update_outputs(codec); 3933 3934 alc_write_coef_idx(codec, 0x0c, 0x680); 3935 alc_write_coef_idx(codec, 0x0c, 0x480); 3936 } 3937 3938 static void alc269_fixup_quanta_mute(struct hda_codec *codec, 3939 const struct hda_fixup *fix, int action) 3940 { 3941 struct alc_spec *spec = codec->spec; 3942 if (action != HDA_FIXUP_ACT_PROBE) 3943 return; 3944 spec->gen.automute_hook = alc269_quanta_automute; 3945 } 3946 3947 static void alc269_x101_hp_automute_hook(struct hda_codec *codec, 3948 struct hda_jack_callback *jack) 3949 { 3950 struct alc_spec *spec = codec->spec; 3951 int vref; 3952 msleep(200); 3953 snd_hda_gen_hp_automute(codec, jack); 3954 3955 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 3956 msleep(100); 3957 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 3958 vref); 3959 msleep(500); 3960 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 3961 vref); 3962 } 3963 3964 /* 3965 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801) 3966 */ 3967 struct hda_alc298_mbxinit { 3968 unsigned char value_0x23; 3969 unsigned char value_0x25; 3970 }; 3971 3972 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, 3973 const struct hda_alc298_mbxinit *initval, 3974 bool first) 3975 { 3976 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); 3977 alc_write_coef_idx(codec, 0x26, 0xb000); 3978 3979 if (first) 3980 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); 3981 3982 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); 3983 alc_write_coef_idx(codec, 0x26, 0xf000); 3984 alc_write_coef_idx(codec, 0x23, initval->value_0x23); 3985 3986 if (initval->value_0x23 != 0x1e) 3987 alc_write_coef_idx(codec, 0x25, initval->value_0x25); 3988 3989 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); 3990 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); 3991 } 3992 3993 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, 3994 const struct hda_fixup *fix, 3995 int action) 3996 { 3997 /* Initialization magic */ 3998 static const struct hda_alc298_mbxinit dac_init[] = { 3999 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00}, 4000 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00}, 4001 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00}, 4002 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24}, 4003 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f}, 4004 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00}, 4005 {0x2f, 0x00}, 4006 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, 4007 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c}, 4008 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80}, 4009 {} 4010 }; 4011 const struct hda_alc298_mbxinit *seq; 4012 4013 if (action != HDA_FIXUP_ACT_INIT) 4014 return; 4015 4016 /* Start */ 4017 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); 4018 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); 4019 alc_write_coef_idx(codec, 0x26, 0xf000); 4020 alc_write_coef_idx(codec, 0x22, 0x31); 4021 alc_write_coef_idx(codec, 0x23, 0x0b); 4022 alc_write_coef_idx(codec, 0x25, 0x00); 4023 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); 4024 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); 4025 4026 for (seq = dac_init; seq->value_0x23; seq++) 4027 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); 4028 } 4029 4030 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, 4031 const struct hda_fixup *fix, int action) 4032 { 4033 struct alc_spec *spec = codec->spec; 4034 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4035 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 4036 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook; 4037 } 4038 } 4039 4040 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, 4041 bool polarity, bool on) 4042 { 4043 unsigned int pinval; 4044 4045 if (!pin) 4046 return; 4047 if (polarity) 4048 on = !on; 4049 pinval = snd_hda_codec_get_pin_target(codec, pin); 4050 pinval &= ~AC_PINCTL_VREFEN; 4051 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ; 4052 /* temporarily power up/down for setting VREF */ 4053 snd_hda_power_up_pm(codec); 4054 snd_hda_set_pin_ctl_cache(codec, pin, pinval); 4055 snd_hda_power_down_pm(codec); 4056 } 4057 4058 /* update mute-LED according to the speaker mute state via mic VREF pin */ 4059 static int vref_mute_led_set(struct led_classdev *led_cdev, 4060 enum led_brightness brightness) 4061 { 4062 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4063 struct alc_spec *spec = codec->spec; 4064 4065 alc_update_vref_led(codec, spec->mute_led_nid, 4066 spec->mute_led_polarity, brightness); 4067 return 0; 4068 } 4069 4070 /* Make sure the led works even in runtime suspend */ 4071 static unsigned int led_power_filter(struct hda_codec *codec, 4072 hda_nid_t nid, 4073 unsigned int power_state) 4074 { 4075 struct alc_spec *spec = codec->spec; 4076 4077 if (power_state != AC_PWRST_D3 || nid == 0 || 4078 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid)) 4079 return power_state; 4080 4081 /* Set pin ctl again, it might have just been set to 0 */ 4082 snd_hda_set_pin_ctl(codec, nid, 4083 snd_hda_codec_get_pin_target(codec, nid)); 4084 4085 return snd_hda_gen_path_power_filter(codec, nid, power_state); 4086 } 4087 4088 static void alc269_fixup_hp_mute_led(struct hda_codec *codec, 4089 const struct hda_fixup *fix, int action) 4090 { 4091 struct alc_spec *spec = codec->spec; 4092 const struct dmi_device *dev = NULL; 4093 4094 if (action != HDA_FIXUP_ACT_PRE_PROBE) 4095 return; 4096 4097 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { 4098 int pol, pin; 4099 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2) 4100 continue; 4101 if (pin < 0x0a || pin >= 0x10) 4102 break; 4103 spec->mute_led_polarity = pol; 4104 spec->mute_led_nid = pin - 0x0a + 0x18; 4105 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); 4106 codec->power_filter = led_power_filter; 4107 codec_dbg(codec, 4108 "Detected mute LED for %x:%d\n", spec->mute_led_nid, 4109 spec->mute_led_polarity); 4110 break; 4111 } 4112 } 4113 4114 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, 4115 const struct hda_fixup *fix, 4116 int action, hda_nid_t pin) 4117 { 4118 struct alc_spec *spec = codec->spec; 4119 4120 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4121 spec->mute_led_polarity = 0; 4122 spec->mute_led_nid = pin; 4123 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); 4124 codec->power_filter = led_power_filter; 4125 } 4126 } 4127 4128 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, 4129 const struct hda_fixup *fix, int action) 4130 { 4131 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); 4132 } 4133 4134 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, 4135 const struct hda_fixup *fix, int action) 4136 { 4137 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); 4138 } 4139 4140 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, 4141 const struct hda_fixup *fix, int action) 4142 { 4143 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); 4144 } 4145 4146 /* update LED status via GPIO */ 4147 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, 4148 int polarity, bool enabled) 4149 { 4150 if (polarity) 4151 enabled = !enabled; 4152 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */ 4153 } 4154 4155 /* turn on/off mute LED via GPIO per vmaster hook */ 4156 static int gpio_mute_led_set(struct led_classdev *led_cdev, 4157 enum led_brightness brightness) 4158 { 4159 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4160 struct alc_spec *spec = codec->spec; 4161 4162 alc_update_gpio_led(codec, spec->gpio_mute_led_mask, 4163 spec->mute_led_polarity, !brightness); 4164 return 0; 4165 } 4166 4167 /* turn on/off mic-mute LED via GPIO per capture hook */ 4168 static int micmute_led_set(struct led_classdev *led_cdev, 4169 enum led_brightness brightness) 4170 { 4171 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4172 struct alc_spec *spec = codec->spec; 4173 4174 alc_update_gpio_led(codec, spec->gpio_mic_led_mask, 4175 spec->micmute_led_polarity, !brightness); 4176 return 0; 4177 } 4178 4179 /* setup mute and mic-mute GPIO bits, add hooks appropriately */ 4180 static void alc_fixup_hp_gpio_led(struct hda_codec *codec, 4181 int action, 4182 unsigned int mute_mask, 4183 unsigned int micmute_mask) 4184 { 4185 struct alc_spec *spec = codec->spec; 4186 4187 alc_fixup_gpio(codec, action, mute_mask | micmute_mask); 4188 4189 if (action != HDA_FIXUP_ACT_PRE_PROBE) 4190 return; 4191 if (mute_mask) { 4192 spec->gpio_mute_led_mask = mute_mask; 4193 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set); 4194 } 4195 if (micmute_mask) { 4196 spec->gpio_mic_led_mask = micmute_mask; 4197 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set); 4198 } 4199 } 4200 4201 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, 4202 const struct hda_fixup *fix, int action) 4203 { 4204 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); 4205 } 4206 4207 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, 4208 const struct hda_fixup *fix, int action) 4209 { 4210 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); 4211 } 4212 4213 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, 4214 const struct hda_fixup *fix, int action) 4215 { 4216 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); 4217 } 4218 4219 /* turn on/off mic-mute LED per capture hook via VREF change */ 4220 static int vref_micmute_led_set(struct led_classdev *led_cdev, 4221 enum led_brightness brightness) 4222 { 4223 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4224 struct alc_spec *spec = codec->spec; 4225 4226 alc_update_vref_led(codec, spec->cap_mute_led_nid, 4227 spec->micmute_led_polarity, brightness); 4228 return 0; 4229 } 4230 4231 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, 4232 const struct hda_fixup *fix, int action) 4233 { 4234 struct alc_spec *spec = codec->spec; 4235 4236 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 4237 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4238 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to 4239 * enable headphone amp 4240 */ 4241 spec->gpio_mask |= 0x10; 4242 spec->gpio_dir |= 0x10; 4243 spec->cap_mute_led_nid = 0x18; 4244 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4245 codec->power_filter = led_power_filter; 4246 } 4247 } 4248 4249 static void alc280_fixup_hp_gpio4(struct hda_codec *codec, 4250 const struct hda_fixup *fix, int action) 4251 { 4252 struct alc_spec *spec = codec->spec; 4253 4254 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 4255 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4256 spec->cap_mute_led_nid = 0x18; 4257 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4258 codec->power_filter = led_power_filter; 4259 } 4260 } 4261 4262 static void alc_update_coef_led(struct hda_codec *codec, 4263 struct alc_coef_led *led, 4264 bool polarity, bool on) 4265 { 4266 if (polarity) 4267 on = !on; 4268 /* temporarily power up/down for setting COEF bit */ 4269 alc_update_coef_idx(codec, led->idx, led->mask, 4270 on ? led->on : led->off); 4271 } 4272 4273 /* update mute-LED according to the speaker mute state via COEF bit */ 4274 static int coef_mute_led_set(struct led_classdev *led_cdev, 4275 enum led_brightness brightness) 4276 { 4277 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4278 struct alc_spec *spec = codec->spec; 4279 4280 alc_update_coef_led(codec, &spec->mute_led_coef, 4281 spec->mute_led_polarity, brightness); 4282 return 0; 4283 } 4284 4285 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4286 const struct hda_fixup *fix, 4287 int action) 4288 { 4289 struct alc_spec *spec = codec->spec; 4290 4291 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4292 spec->mute_led_polarity = 0; 4293 spec->mute_led_coef.idx = 0x0b; 4294 spec->mute_led_coef.mask = 1 << 3; 4295 spec->mute_led_coef.on = 1 << 3; 4296 spec->mute_led_coef.off = 0; 4297 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4298 } 4299 } 4300 4301 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, 4302 const struct hda_fixup *fix, 4303 int action) 4304 { 4305 struct alc_spec *spec = codec->spec; 4306 4307 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4308 spec->mute_led_polarity = 0; 4309 spec->mute_led_coef.idx = 0x34; 4310 spec->mute_led_coef.mask = 1 << 5; 4311 spec->mute_led_coef.on = 0; 4312 spec->mute_led_coef.off = 1 << 5; 4313 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); 4314 } 4315 } 4316 4317 /* turn on/off mic-mute LED per capture hook by coef bit */ 4318 static int coef_micmute_led_set(struct led_classdev *led_cdev, 4319 enum led_brightness brightness) 4320 { 4321 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); 4322 struct alc_spec *spec = codec->spec; 4323 4324 alc_update_coef_led(codec, &spec->mic_led_coef, 4325 spec->micmute_led_polarity, brightness); 4326 return 0; 4327 } 4328 4329 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, 4330 const struct hda_fixup *fix, int action) 4331 { 4332 struct alc_spec *spec = codec->spec; 4333 4334 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4335 spec->mic_led_coef.idx = 0x19; 4336 spec->mic_led_coef.mask = 1 << 13; 4337 spec->mic_led_coef.on = 1 << 13; 4338 spec->mic_led_coef.off = 0; 4339 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); 4340 } 4341 } 4342 4343 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, 4344 const struct hda_fixup *fix, int action) 4345 { 4346 struct alc_spec *spec = codec->spec; 4347 4348 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4349 spec->mic_led_coef.idx = 0x35; 4350 spec->mic_led_coef.mask = 3 << 2; 4351 spec->mic_led_coef.on = 2 << 2; 4352 spec->mic_led_coef.off = 1 << 2; 4353 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); 4354 } 4355 } 4356 4357 static void alc285_fixup_hp_mute_led(struct hda_codec *codec, 4358 const struct hda_fixup *fix, int action) 4359 { 4360 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 4361 alc285_fixup_hp_coef_micmute_led(codec, fix, action); 4362 } 4363 4364 static void alc236_fixup_hp_mute_led(struct hda_codec *codec, 4365 const struct hda_fixup *fix, int action) 4366 { 4367 alc236_fixup_hp_mute_led_coefbit(codec, fix, action); 4368 alc236_fixup_hp_coef_micmute_led(codec, fix, action); 4369 } 4370 4371 #if IS_REACHABLE(CONFIG_INPUT) 4372 static void gpio2_mic_hotkey_event(struct hda_codec *codec, 4373 struct hda_jack_callback *event) 4374 { 4375 struct alc_spec *spec = codec->spec; 4376 4377 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore 4378 send both key on and key off event for every interrupt. */ 4379 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1); 4380 input_sync(spec->kb_dev); 4381 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0); 4382 input_sync(spec->kb_dev); 4383 } 4384 4385 static int alc_register_micmute_input_device(struct hda_codec *codec) 4386 { 4387 struct alc_spec *spec = codec->spec; 4388 int i; 4389 4390 spec->kb_dev = input_allocate_device(); 4391 if (!spec->kb_dev) { 4392 codec_err(codec, "Out of memory (input_allocate_device)\n"); 4393 return -ENOMEM; 4394 } 4395 4396 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE; 4397 4398 spec->kb_dev->name = "Microphone Mute Button"; 4399 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY); 4400 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]); 4401 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map); 4402 spec->kb_dev->keycode = spec->alc_mute_keycode_map; 4403 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++) 4404 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit); 4405 4406 if (input_register_device(spec->kb_dev)) { 4407 codec_err(codec, "input_register_device failed\n"); 4408 input_free_device(spec->kb_dev); 4409 spec->kb_dev = NULL; 4410 return -ENOMEM; 4411 } 4412 4413 return 0; 4414 } 4415 4416 /* GPIO1 = set according to SKU external amp 4417 * GPIO2 = mic mute hotkey 4418 * GPIO3 = mute LED 4419 * GPIO4 = mic mute LED 4420 */ 4421 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, 4422 const struct hda_fixup *fix, int action) 4423 { 4424 struct alc_spec *spec = codec->spec; 4425 4426 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); 4427 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4428 spec->init_amp = ALC_INIT_DEFAULT; 4429 if (alc_register_micmute_input_device(codec) != 0) 4430 return; 4431 4432 spec->gpio_mask |= 0x06; 4433 spec->gpio_dir |= 0x02; 4434 spec->gpio_data |= 0x02; 4435 snd_hda_codec_write_cache(codec, codec->core.afg, 0, 4436 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04); 4437 snd_hda_jack_detect_enable_callback(codec, codec->core.afg, 4438 gpio2_mic_hotkey_event); 4439 return; 4440 } 4441 4442 if (!spec->kb_dev) 4443 return; 4444 4445 switch (action) { 4446 case HDA_FIXUP_ACT_FREE: 4447 input_unregister_device(spec->kb_dev); 4448 spec->kb_dev = NULL; 4449 } 4450 } 4451 4452 /* Line2 = mic mute hotkey 4453 * GPIO2 = mic mute LED 4454 */ 4455 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, 4456 const struct hda_fixup *fix, int action) 4457 { 4458 struct alc_spec *spec = codec->spec; 4459 4460 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); 4461 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4462 spec->init_amp = ALC_INIT_DEFAULT; 4463 if (alc_register_micmute_input_device(codec) != 0) 4464 return; 4465 4466 snd_hda_jack_detect_enable_callback(codec, 0x1b, 4467 gpio2_mic_hotkey_event); 4468 return; 4469 } 4470 4471 if (!spec->kb_dev) 4472 return; 4473 4474 switch (action) { 4475 case HDA_FIXUP_ACT_FREE: 4476 input_unregister_device(spec->kb_dev); 4477 spec->kb_dev = NULL; 4478 } 4479 } 4480 #else /* INPUT */ 4481 #define alc280_fixup_hp_gpio2_mic_hotkey NULL 4482 #define alc233_fixup_lenovo_line2_mic_hotkey NULL 4483 #endif /* INPUT */ 4484 4485 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, 4486 const struct hda_fixup *fix, int action) 4487 { 4488 struct alc_spec *spec = codec->spec; 4489 4490 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); 4491 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 4492 spec->cap_mute_led_nid = 0x18; 4493 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); 4494 } 4495 } 4496 4497 static const struct coef_fw alc225_pre_hsmode[] = { 4498 UPDATE_COEF(0x4a, 1<<8, 0), 4499 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), 4500 UPDATE_COEF(0x63, 3<<14, 3<<14), 4501 UPDATE_COEF(0x4a, 3<<4, 2<<4), 4502 UPDATE_COEF(0x4a, 3<<10, 3<<10), 4503 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), 4504 UPDATE_COEF(0x4a, 3<<10, 0), 4505 {} 4506 }; 4507 4508 static void alc_headset_mode_unplugged(struct hda_codec *codec) 4509 { 4510 static const struct coef_fw coef0255[] = { 4511 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */ 4512 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ 4513 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 4514 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ 4515 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */ 4516 {} 4517 }; 4518 static const struct coef_fw coef0256[] = { 4519 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */ 4520 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */ 4521 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */ 4522 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */ 4523 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 4524 {} 4525 }; 4526 static const struct coef_fw coef0233[] = { 4527 WRITE_COEF(0x1b, 0x0c0b), 4528 WRITE_COEF(0x45, 0xc429), 4529 UPDATE_COEF(0x35, 0x4000, 0), 4530 WRITE_COEF(0x06, 0x2104), 4531 WRITE_COEF(0x1a, 0x0001), 4532 WRITE_COEF(0x26, 0x0004), 4533 WRITE_COEF(0x32, 0x42a3), 4534 {} 4535 }; 4536 static const struct coef_fw coef0288[] = { 4537 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), 4538 UPDATE_COEF(0x50, 0x2000, 0x2000), 4539 UPDATE_COEF(0x56, 0x0006, 0x0006), 4540 UPDATE_COEF(0x66, 0x0008, 0), 4541 UPDATE_COEF(0x67, 0x2000, 0), 4542 {} 4543 }; 4544 static const struct coef_fw coef0298[] = { 4545 UPDATE_COEF(0x19, 0x1300, 0x0300), 4546 {} 4547 }; 4548 static const struct coef_fw coef0292[] = { 4549 WRITE_COEF(0x76, 0x000e), 4550 WRITE_COEF(0x6c, 0x2400), 4551 WRITE_COEF(0x18, 0x7308), 4552 WRITE_COEF(0x6b, 0xc429), 4553 {} 4554 }; 4555 static const struct coef_fw coef0293[] = { 4556 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */ 4557 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */ 4558 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */ 4559 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */ 4560 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */ 4561 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ 4562 {} 4563 }; 4564 static const struct coef_fw coef0668[] = { 4565 WRITE_COEF(0x15, 0x0d40), 4566 WRITE_COEF(0xb7, 0x802b), 4567 {} 4568 }; 4569 static const struct coef_fw coef0225[] = { 4570 UPDATE_COEF(0x63, 3<<14, 0), 4571 {} 4572 }; 4573 static const struct coef_fw coef0274[] = { 4574 UPDATE_COEF(0x4a, 0x0100, 0), 4575 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), 4576 UPDATE_COEF(0x6b, 0xf000, 0x5000), 4577 UPDATE_COEF(0x4a, 0x0010, 0), 4578 UPDATE_COEF(0x4a, 0x0c00, 0x0c00), 4579 WRITE_COEF(0x45, 0x5289), 4580 UPDATE_COEF(0x4a, 0x0c00, 0), 4581 {} 4582 }; 4583 4584 switch (codec->core.vendor_id) { 4585 case 0x10ec0255: 4586 alc_process_coef_fw(codec, coef0255); 4587 break; 4588 case 0x10ec0236: 4589 case 0x10ec0256: 4590 alc_process_coef_fw(codec, coef0256); 4591 break; 4592 case 0x10ec0234: 4593 case 0x10ec0274: 4594 case 0x10ec0294: 4595 alc_process_coef_fw(codec, coef0274); 4596 break; 4597 case 0x10ec0233: 4598 case 0x10ec0283: 4599 alc_process_coef_fw(codec, coef0233); 4600 break; 4601 case 0x10ec0286: 4602 case 0x10ec0288: 4603 alc_process_coef_fw(codec, coef0288); 4604 break; 4605 case 0x10ec0298: 4606 alc_process_coef_fw(codec, coef0298); 4607 alc_process_coef_fw(codec, coef0288); 4608 break; 4609 case 0x10ec0292: 4610 alc_process_coef_fw(codec, coef0292); 4611 break; 4612 case 0x10ec0293: 4613 alc_process_coef_fw(codec, coef0293); 4614 break; 4615 case 0x10ec0668: 4616 alc_process_coef_fw(codec, coef0668); 4617 break; 4618 case 0x10ec0215: 4619 case 0x10ec0225: 4620 case 0x10ec0285: 4621 case 0x10ec0295: 4622 case 0x10ec0289: 4623 case 0x10ec0299: 4624 alc_process_coef_fw(codec, alc225_pre_hsmode); 4625 alc_process_coef_fw(codec, coef0225); 4626 break; 4627 case 0x10ec0867: 4628 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 4629 break; 4630 } 4631 codec_dbg(codec, "Headset jack set to unplugged mode.\n"); 4632 } 4633 4634 4635 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, 4636 hda_nid_t mic_pin) 4637 { 4638 static const struct coef_fw coef0255[] = { 4639 WRITE_COEFEX(0x57, 0x03, 0x8aa6), 4640 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ 4641 {} 4642 }; 4643 static const struct coef_fw coef0256[] = { 4644 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/ 4645 WRITE_COEFEX(0x57, 0x03, 0x09a3), 4646 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */ 4647 {} 4648 }; 4649 static const struct coef_fw coef0233[] = { 4650 UPDATE_COEF(0x35, 0, 1<<14), 4651 WRITE_COEF(0x06, 0x2100), 4652 WRITE_COEF(0x1a, 0x0021), 4653 WRITE_COEF(0x26, 0x008c), 4654 {} 4655 }; 4656 static const struct coef_fw coef0288[] = { 4657 UPDATE_COEF(0x4f, 0x00c0, 0), 4658 UPDATE_COEF(0x50, 0x2000, 0), 4659 UPDATE_COEF(0x56, 0x0006, 0), 4660 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), 4661 UPDATE_COEF(0x66, 0x0008, 0x0008), 4662 UPDATE_COEF(0x67, 0x2000, 0x2000), 4663 {} 4664 }; 4665 static const struct coef_fw coef0292[] = { 4666 WRITE_COEF(0x19, 0xa208), 4667 WRITE_COEF(0x2e, 0xacf0), 4668 {} 4669 }; 4670 static const struct coef_fw coef0293[] = { 4671 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */ 4672 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */ 4673 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ 4674 {} 4675 }; 4676 static const struct coef_fw coef0688[] = { 4677 WRITE_COEF(0xb7, 0x802b), 4678 WRITE_COEF(0xb5, 0x1040), 4679 UPDATE_COEF(0xc3, 0, 1<<12), 4680 {} 4681 }; 4682 static const struct coef_fw coef0225[] = { 4683 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), 4684 UPDATE_COEF(0x4a, 3<<4, 2<<4), 4685 UPDATE_COEF(0x63, 3<<14, 0), 4686 {} 4687 }; 4688 static const struct coef_fw coef0274[] = { 4689 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), 4690 UPDATE_COEF(0x4a, 0x0010, 0), 4691 UPDATE_COEF(0x6b, 0xf000, 0), 4692 {} 4693 }; 4694 4695 switch (codec->core.vendor_id) { 4696 case 0x10ec0255: 4697 alc_write_coef_idx(codec, 0x45, 0xc489); 4698 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4699 alc_process_coef_fw(codec, coef0255); 4700 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4701 break; 4702 case 0x10ec0236: 4703 case 0x10ec0256: 4704 alc_write_coef_idx(codec, 0x45, 0xc489); 4705 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4706 alc_process_coef_fw(codec, coef0256); 4707 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4708 break; 4709 case 0x10ec0234: 4710 case 0x10ec0274: 4711 case 0x10ec0294: 4712 alc_write_coef_idx(codec, 0x45, 0x4689); 4713 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4714 alc_process_coef_fw(codec, coef0274); 4715 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4716 break; 4717 case 0x10ec0233: 4718 case 0x10ec0283: 4719 alc_write_coef_idx(codec, 0x45, 0xc429); 4720 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4721 alc_process_coef_fw(codec, coef0233); 4722 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4723 break; 4724 case 0x10ec0286: 4725 case 0x10ec0288: 4726 case 0x10ec0298: 4727 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4728 alc_process_coef_fw(codec, coef0288); 4729 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4730 break; 4731 case 0x10ec0292: 4732 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4733 alc_process_coef_fw(codec, coef0292); 4734 break; 4735 case 0x10ec0293: 4736 /* Set to TRS mode */ 4737 alc_write_coef_idx(codec, 0x45, 0xc429); 4738 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4739 alc_process_coef_fw(codec, coef0293); 4740 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4741 break; 4742 case 0x10ec0867: 4743 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); 4744 fallthrough; 4745 case 0x10ec0221: 4746 case 0x10ec0662: 4747 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4748 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4749 break; 4750 case 0x10ec0668: 4751 alc_write_coef_idx(codec, 0x11, 0x0001); 4752 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4753 alc_process_coef_fw(codec, coef0688); 4754 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4755 break; 4756 case 0x10ec0215: 4757 case 0x10ec0225: 4758 case 0x10ec0285: 4759 case 0x10ec0295: 4760 case 0x10ec0289: 4761 case 0x10ec0299: 4762 alc_process_coef_fw(codec, alc225_pre_hsmode); 4763 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); 4764 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); 4765 alc_process_coef_fw(codec, coef0225); 4766 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 4767 break; 4768 } 4769 codec_dbg(codec, "Headset jack set to mic-in mode.\n"); 4770 } 4771 4772 static void alc_headset_mode_default(struct hda_codec *codec) 4773 { 4774 static const struct coef_fw coef0225[] = { 4775 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), 4776 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), 4777 UPDATE_COEF(0x49, 3<<8, 0<<8), 4778 UPDATE_COEF(0x4a, 3<<4, 3<<4), 4779 UPDATE_COEF(0x63, 3<<14, 0), 4780 UPDATE_COEF(0x67, 0xf000, 0x3000), 4781 {} 4782 }; 4783 static const struct coef_fw coef0255[] = { 4784 WRITE_COEF(0x45, 0xc089), 4785 WRITE_COEF(0x45, 0xc489), 4786 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 4787 WRITE_COEF(0x49, 0x0049), 4788 {} 4789 }; 4790 static const struct coef_fw coef0256[] = { 4791 WRITE_COEF(0x45, 0xc489), 4792 WRITE_COEFEX(0x57, 0x03, 0x0da3), 4793 WRITE_COEF(0x49, 0x0049), 4794 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/ 4795 WRITE_COEF(0x06, 0x6100), 4796 {} 4797 }; 4798 static const struct coef_fw coef0233[] = { 4799 WRITE_COEF(0x06, 0x2100), 4800 WRITE_COEF(0x32, 0x4ea3), 4801 {} 4802 }; 4803 static const struct coef_fw coef0288[] = { 4804 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */ 4805 UPDATE_COEF(0x50, 0x2000, 0x2000), 4806 UPDATE_COEF(0x56, 0x0006, 0x0006), 4807 UPDATE_COEF(0x66, 0x0008, 0), 4808 UPDATE_COEF(0x67, 0x2000, 0), 4809 {} 4810 }; 4811 static const struct coef_fw coef0292[] = { 4812 WRITE_COEF(0x76, 0x000e), 4813 WRITE_COEF(0x6c, 0x2400), 4814 WRITE_COEF(0x6b, 0xc429), 4815 WRITE_COEF(0x18, 0x7308), 4816 {} 4817 }; 4818 static const struct coef_fw coef0293[] = { 4819 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */ 4820 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */ 4821 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */ 4822 {} 4823 }; 4824 static const struct coef_fw coef0688[] = { 4825 WRITE_COEF(0x11, 0x0041), 4826 WRITE_COEF(0x15, 0x0d40), 4827 WRITE_COEF(0xb7, 0x802b), 4828 {} 4829 }; 4830 static const struct coef_fw coef0274[] = { 4831 WRITE_COEF(0x45, 0x4289), 4832 UPDATE_COEF(0x4a, 0x0010, 0x0010), 4833 UPDATE_COEF(0x6b, 0x0f00, 0), 4834 UPDATE_COEF(0x49, 0x0300, 0x0300), 4835 {} 4836 }; 4837 4838 switch (codec->core.vendor_id) { 4839 case 0x10ec0215: 4840 case 0x10ec0225: 4841 case 0x10ec0285: 4842 case 0x10ec0295: 4843 case 0x10ec0289: 4844 case 0x10ec0299: 4845 alc_process_coef_fw(codec, alc225_pre_hsmode); 4846 alc_process_coef_fw(codec, coef0225); 4847 break; 4848 case 0x10ec0255: 4849 alc_process_coef_fw(codec, coef0255); 4850 break; 4851 case 0x10ec0236: 4852 case 0x10ec0256: 4853 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 4854 alc_write_coef_idx(codec, 0x45, 0xc089); 4855 msleep(50); 4856 alc_process_coef_fw(codec, coef0256); 4857 break; 4858 case 0x10ec0234: 4859 case 0x10ec0274: 4860 case 0x10ec0294: 4861 alc_process_coef_fw(codec, coef0274); 4862 break; 4863 case 0x10ec0233: 4864 case 0x10ec0283: 4865 alc_process_coef_fw(codec, coef0233); 4866 break; 4867 case 0x10ec0286: 4868 case 0x10ec0288: 4869 case 0x10ec0298: 4870 alc_process_coef_fw(codec, coef0288); 4871 break; 4872 case 0x10ec0292: 4873 alc_process_coef_fw(codec, coef0292); 4874 break; 4875 case 0x10ec0293: 4876 alc_process_coef_fw(codec, coef0293); 4877 break; 4878 case 0x10ec0668: 4879 alc_process_coef_fw(codec, coef0688); 4880 break; 4881 case 0x10ec0867: 4882 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 4883 break; 4884 } 4885 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n"); 4886 } 4887 4888 /* Iphone type */ 4889 static void alc_headset_mode_ctia(struct hda_codec *codec) 4890 { 4891 int val; 4892 4893 static const struct coef_fw coef0255[] = { 4894 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ 4895 WRITE_COEF(0x1b, 0x0c2b), 4896 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 4897 {} 4898 }; 4899 static const struct coef_fw coef0256[] = { 4900 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ 4901 WRITE_COEF(0x1b, 0x0e6b), 4902 {} 4903 }; 4904 static const struct coef_fw coef0233[] = { 4905 WRITE_COEF(0x45, 0xd429), 4906 WRITE_COEF(0x1b, 0x0c2b), 4907 WRITE_COEF(0x32, 0x4ea3), 4908 {} 4909 }; 4910 static const struct coef_fw coef0288[] = { 4911 UPDATE_COEF(0x50, 0x2000, 0x2000), 4912 UPDATE_COEF(0x56, 0x0006, 0x0006), 4913 UPDATE_COEF(0x66, 0x0008, 0), 4914 UPDATE_COEF(0x67, 0x2000, 0), 4915 {} 4916 }; 4917 static const struct coef_fw coef0292[] = { 4918 WRITE_COEF(0x6b, 0xd429), 4919 WRITE_COEF(0x76, 0x0008), 4920 WRITE_COEF(0x18, 0x7388), 4921 {} 4922 }; 4923 static const struct coef_fw coef0293[] = { 4924 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */ 4925 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ 4926 {} 4927 }; 4928 static const struct coef_fw coef0688[] = { 4929 WRITE_COEF(0x11, 0x0001), 4930 WRITE_COEF(0x15, 0x0d60), 4931 WRITE_COEF(0xc3, 0x0000), 4932 {} 4933 }; 4934 static const struct coef_fw coef0225_1[] = { 4935 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), 4936 UPDATE_COEF(0x63, 3<<14, 2<<14), 4937 {} 4938 }; 4939 static const struct coef_fw coef0225_2[] = { 4940 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), 4941 UPDATE_COEF(0x63, 3<<14, 1<<14), 4942 {} 4943 }; 4944 4945 switch (codec->core.vendor_id) { 4946 case 0x10ec0255: 4947 alc_process_coef_fw(codec, coef0255); 4948 break; 4949 case 0x10ec0236: 4950 case 0x10ec0256: 4951 alc_process_coef_fw(codec, coef0256); 4952 break; 4953 case 0x10ec0234: 4954 case 0x10ec0274: 4955 case 0x10ec0294: 4956 alc_write_coef_idx(codec, 0x45, 0xd689); 4957 break; 4958 case 0x10ec0233: 4959 case 0x10ec0283: 4960 alc_process_coef_fw(codec, coef0233); 4961 break; 4962 case 0x10ec0298: 4963 val = alc_read_coef_idx(codec, 0x50); 4964 if (val & (1 << 12)) { 4965 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); 4966 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 4967 msleep(300); 4968 } else { 4969 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); 4970 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 4971 msleep(300); 4972 } 4973 break; 4974 case 0x10ec0286: 4975 case 0x10ec0288: 4976 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); 4977 msleep(300); 4978 alc_process_coef_fw(codec, coef0288); 4979 break; 4980 case 0x10ec0292: 4981 alc_process_coef_fw(codec, coef0292); 4982 break; 4983 case 0x10ec0293: 4984 alc_process_coef_fw(codec, coef0293); 4985 break; 4986 case 0x10ec0668: 4987 alc_process_coef_fw(codec, coef0688); 4988 break; 4989 case 0x10ec0215: 4990 case 0x10ec0225: 4991 case 0x10ec0285: 4992 case 0x10ec0295: 4993 case 0x10ec0289: 4994 case 0x10ec0299: 4995 val = alc_read_coef_idx(codec, 0x45); 4996 if (val & (1 << 9)) 4997 alc_process_coef_fw(codec, coef0225_2); 4998 else 4999 alc_process_coef_fw(codec, coef0225_1); 5000 break; 5001 case 0x10ec0867: 5002 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5003 break; 5004 } 5005 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n"); 5006 } 5007 5008 /* Nokia type */ 5009 static void alc_headset_mode_omtp(struct hda_codec *codec) 5010 { 5011 static const struct coef_fw coef0255[] = { 5012 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ 5013 WRITE_COEF(0x1b, 0x0c2b), 5014 WRITE_COEFEX(0x57, 0x03, 0x8ea6), 5015 {} 5016 }; 5017 static const struct coef_fw coef0256[] = { 5018 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */ 5019 WRITE_COEF(0x1b, 0x0e6b), 5020 {} 5021 }; 5022 static const struct coef_fw coef0233[] = { 5023 WRITE_COEF(0x45, 0xe429), 5024 WRITE_COEF(0x1b, 0x0c2b), 5025 WRITE_COEF(0x32, 0x4ea3), 5026 {} 5027 }; 5028 static const struct coef_fw coef0288[] = { 5029 UPDATE_COEF(0x50, 0x2000, 0x2000), 5030 UPDATE_COEF(0x56, 0x0006, 0x0006), 5031 UPDATE_COEF(0x66, 0x0008, 0), 5032 UPDATE_COEF(0x67, 0x2000, 0), 5033 {} 5034 }; 5035 static const struct coef_fw coef0292[] = { 5036 WRITE_COEF(0x6b, 0xe429), 5037 WRITE_COEF(0x76, 0x0008), 5038 WRITE_COEF(0x18, 0x7388), 5039 {} 5040 }; 5041 static const struct coef_fw coef0293[] = { 5042 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */ 5043 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */ 5044 {} 5045 }; 5046 static const struct coef_fw coef0688[] = { 5047 WRITE_COEF(0x11, 0x0001), 5048 WRITE_COEF(0x15, 0x0d50), 5049 WRITE_COEF(0xc3, 0x0000), 5050 {} 5051 }; 5052 static const struct coef_fw coef0225[] = { 5053 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), 5054 UPDATE_COEF(0x63, 3<<14, 2<<14), 5055 {} 5056 }; 5057 5058 switch (codec->core.vendor_id) { 5059 case 0x10ec0255: 5060 alc_process_coef_fw(codec, coef0255); 5061 break; 5062 case 0x10ec0236: 5063 case 0x10ec0256: 5064 alc_process_coef_fw(codec, coef0256); 5065 break; 5066 case 0x10ec0234: 5067 case 0x10ec0274: 5068 case 0x10ec0294: 5069 alc_write_coef_idx(codec, 0x45, 0xe689); 5070 break; 5071 case 0x10ec0233: 5072 case 0x10ec0283: 5073 alc_process_coef_fw(codec, coef0233); 5074 break; 5075 case 0x10ec0298: 5076 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ 5077 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); 5078 msleep(300); 5079 break; 5080 case 0x10ec0286: 5081 case 0x10ec0288: 5082 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); 5083 msleep(300); 5084 alc_process_coef_fw(codec, coef0288); 5085 break; 5086 case 0x10ec0292: 5087 alc_process_coef_fw(codec, coef0292); 5088 break; 5089 case 0x10ec0293: 5090 alc_process_coef_fw(codec, coef0293); 5091 break; 5092 case 0x10ec0668: 5093 alc_process_coef_fw(codec, coef0688); 5094 break; 5095 case 0x10ec0215: 5096 case 0x10ec0225: 5097 case 0x10ec0285: 5098 case 0x10ec0295: 5099 case 0x10ec0289: 5100 case 0x10ec0299: 5101 alc_process_coef_fw(codec, coef0225); 5102 break; 5103 } 5104 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n"); 5105 } 5106 5107 static void alc_determine_headset_type(struct hda_codec *codec) 5108 { 5109 int val; 5110 bool is_ctia = false; 5111 struct alc_spec *spec = codec->spec; 5112 static const struct coef_fw coef0255[] = { 5113 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/ 5114 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref 5115 conteol) */ 5116 {} 5117 }; 5118 static const struct coef_fw coef0288[] = { 5119 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ 5120 {} 5121 }; 5122 static const struct coef_fw coef0298[] = { 5123 UPDATE_COEF(0x50, 0x2000, 0x2000), 5124 UPDATE_COEF(0x56, 0x0006, 0x0006), 5125 UPDATE_COEF(0x66, 0x0008, 0), 5126 UPDATE_COEF(0x67, 0x2000, 0), 5127 UPDATE_COEF(0x19, 0x1300, 0x1300), 5128 {} 5129 }; 5130 static const struct coef_fw coef0293[] = { 5131 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ 5132 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ 5133 {} 5134 }; 5135 static const struct coef_fw coef0688[] = { 5136 WRITE_COEF(0x11, 0x0001), 5137 WRITE_COEF(0xb7, 0x802b), 5138 WRITE_COEF(0x15, 0x0d60), 5139 WRITE_COEF(0xc3, 0x0c00), 5140 {} 5141 }; 5142 static const struct coef_fw coef0274[] = { 5143 UPDATE_COEF(0x4a, 0x0010, 0), 5144 UPDATE_COEF(0x4a, 0x8000, 0), 5145 WRITE_COEF(0x45, 0xd289), 5146 UPDATE_COEF(0x49, 0x0300, 0x0300), 5147 {} 5148 }; 5149 5150 switch (codec->core.vendor_id) { 5151 case 0x10ec0255: 5152 alc_process_coef_fw(codec, coef0255); 5153 msleep(300); 5154 val = alc_read_coef_idx(codec, 0x46); 5155 is_ctia = (val & 0x0070) == 0x0070; 5156 break; 5157 case 0x10ec0236: 5158 case 0x10ec0256: 5159 alc_write_coef_idx(codec, 0x1b, 0x0e4b); 5160 alc_write_coef_idx(codec, 0x06, 0x6104); 5161 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); 5162 5163 snd_hda_codec_write(codec, 0x21, 0, 5164 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 5165 msleep(80); 5166 snd_hda_codec_write(codec, 0x21, 0, 5167 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 5168 5169 alc_process_coef_fw(codec, coef0255); 5170 msleep(300); 5171 val = alc_read_coef_idx(codec, 0x46); 5172 is_ctia = (val & 0x0070) == 0x0070; 5173 5174 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3); 5175 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); 5176 5177 snd_hda_codec_write(codec, 0x21, 0, 5178 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 5179 msleep(80); 5180 snd_hda_codec_write(codec, 0x21, 0, 5181 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 5182 break; 5183 case 0x10ec0234: 5184 case 0x10ec0274: 5185 case 0x10ec0294: 5186 alc_process_coef_fw(codec, coef0274); 5187 msleep(80); 5188 val = alc_read_coef_idx(codec, 0x46); 5189 is_ctia = (val & 0x00f0) == 0x00f0; 5190 break; 5191 case 0x10ec0233: 5192 case 0x10ec0283: 5193 alc_write_coef_idx(codec, 0x45, 0xd029); 5194 msleep(300); 5195 val = alc_read_coef_idx(codec, 0x46); 5196 is_ctia = (val & 0x0070) == 0x0070; 5197 break; 5198 case 0x10ec0298: 5199 snd_hda_codec_write(codec, 0x21, 0, 5200 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 5201 msleep(100); 5202 snd_hda_codec_write(codec, 0x21, 0, 5203 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 5204 msleep(200); 5205 5206 val = alc_read_coef_idx(codec, 0x50); 5207 if (val & (1 << 12)) { 5208 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); 5209 alc_process_coef_fw(codec, coef0288); 5210 msleep(350); 5211 val = alc_read_coef_idx(codec, 0x50); 5212 is_ctia = (val & 0x0070) == 0x0070; 5213 } else { 5214 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); 5215 alc_process_coef_fw(codec, coef0288); 5216 msleep(350); 5217 val = alc_read_coef_idx(codec, 0x50); 5218 is_ctia = (val & 0x0070) == 0x0070; 5219 } 5220 alc_process_coef_fw(codec, coef0298); 5221 snd_hda_codec_write(codec, 0x21, 0, 5222 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); 5223 msleep(75); 5224 snd_hda_codec_write(codec, 0x21, 0, 5225 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 5226 break; 5227 case 0x10ec0286: 5228 case 0x10ec0288: 5229 alc_process_coef_fw(codec, coef0288); 5230 msleep(350); 5231 val = alc_read_coef_idx(codec, 0x50); 5232 is_ctia = (val & 0x0070) == 0x0070; 5233 break; 5234 case 0x10ec0292: 5235 alc_write_coef_idx(codec, 0x6b, 0xd429); 5236 msleep(300); 5237 val = alc_read_coef_idx(codec, 0x6c); 5238 is_ctia = (val & 0x001c) == 0x001c; 5239 break; 5240 case 0x10ec0293: 5241 alc_process_coef_fw(codec, coef0293); 5242 msleep(300); 5243 val = alc_read_coef_idx(codec, 0x46); 5244 is_ctia = (val & 0x0070) == 0x0070; 5245 break; 5246 case 0x10ec0668: 5247 alc_process_coef_fw(codec, coef0688); 5248 msleep(300); 5249 val = alc_read_coef_idx(codec, 0xbe); 5250 is_ctia = (val & 0x1c02) == 0x1c02; 5251 break; 5252 case 0x10ec0215: 5253 case 0x10ec0225: 5254 case 0x10ec0285: 5255 case 0x10ec0295: 5256 case 0x10ec0289: 5257 case 0x10ec0299: 5258 snd_hda_codec_write(codec, 0x21, 0, 5259 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 5260 msleep(80); 5261 snd_hda_codec_write(codec, 0x21, 0, 5262 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 5263 5264 alc_process_coef_fw(codec, alc225_pre_hsmode); 5265 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); 5266 val = alc_read_coef_idx(codec, 0x45); 5267 if (val & (1 << 9)) { 5268 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); 5269 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); 5270 msleep(800); 5271 val = alc_read_coef_idx(codec, 0x46); 5272 is_ctia = (val & 0x00f0) == 0x00f0; 5273 } else { 5274 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); 5275 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); 5276 msleep(800); 5277 val = alc_read_coef_idx(codec, 0x46); 5278 is_ctia = (val & 0x00f0) == 0x00f0; 5279 } 5280 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); 5281 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); 5282 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 5283 5284 snd_hda_codec_write(codec, 0x21, 0, 5285 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 5286 msleep(80); 5287 snd_hda_codec_write(codec, 0x21, 0, 5288 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 5289 break; 5290 case 0x10ec0867: 5291 is_ctia = true; 5292 break; 5293 } 5294 5295 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n", 5296 is_ctia ? "yes" : "no"); 5297 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; 5298 } 5299 5300 static void alc_update_headset_mode(struct hda_codec *codec) 5301 { 5302 struct alc_spec *spec = codec->spec; 5303 5304 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; 5305 hda_nid_t hp_pin = alc_get_hp_pin(spec); 5306 5307 int new_headset_mode; 5308 5309 if (!snd_hda_jack_detect(codec, hp_pin)) 5310 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED; 5311 else if (mux_pin == spec->headset_mic_pin) 5312 new_headset_mode = ALC_HEADSET_MODE_HEADSET; 5313 else if (mux_pin == spec->headphone_mic_pin) 5314 new_headset_mode = ALC_HEADSET_MODE_MIC; 5315 else 5316 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; 5317 5318 if (new_headset_mode == spec->current_headset_mode) { 5319 snd_hda_gen_update_outputs(codec); 5320 return; 5321 } 5322 5323 switch (new_headset_mode) { 5324 case ALC_HEADSET_MODE_UNPLUGGED: 5325 alc_headset_mode_unplugged(codec); 5326 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; 5327 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; 5328 spec->gen.hp_jack_present = false; 5329 break; 5330 case ALC_HEADSET_MODE_HEADSET: 5331 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN) 5332 alc_determine_headset_type(codec); 5333 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA) 5334 alc_headset_mode_ctia(codec); 5335 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP) 5336 alc_headset_mode_omtp(codec); 5337 spec->gen.hp_jack_present = true; 5338 break; 5339 case ALC_HEADSET_MODE_MIC: 5340 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin); 5341 spec->gen.hp_jack_present = false; 5342 break; 5343 case ALC_HEADSET_MODE_HEADPHONE: 5344 alc_headset_mode_default(codec); 5345 spec->gen.hp_jack_present = true; 5346 break; 5347 } 5348 if (new_headset_mode != ALC_HEADSET_MODE_MIC) { 5349 snd_hda_set_pin_ctl_cache(codec, hp_pin, 5350 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN); 5351 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin) 5352 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin, 5353 PIN_VREFHIZ); 5354 } 5355 spec->current_headset_mode = new_headset_mode; 5356 5357 snd_hda_gen_update_outputs(codec); 5358 } 5359 5360 static void alc_update_headset_mode_hook(struct hda_codec *codec, 5361 struct snd_kcontrol *kcontrol, 5362 struct snd_ctl_elem_value *ucontrol) 5363 { 5364 alc_update_headset_mode(codec); 5365 } 5366 5367 static void alc_update_headset_jack_cb(struct hda_codec *codec, 5368 struct hda_jack_callback *jack) 5369 { 5370 snd_hda_gen_hp_automute(codec, jack); 5371 } 5372 5373 static void alc_probe_headset_mode(struct hda_codec *codec) 5374 { 5375 int i; 5376 struct alc_spec *spec = codec->spec; 5377 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 5378 5379 /* Find mic pins */ 5380 for (i = 0; i < cfg->num_inputs; i++) { 5381 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin) 5382 spec->headset_mic_pin = cfg->inputs[i].pin; 5383 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin) 5384 spec->headphone_mic_pin = cfg->inputs[i].pin; 5385 } 5386 5387 WARN_ON(spec->gen.cap_sync_hook); 5388 spec->gen.cap_sync_hook = alc_update_headset_mode_hook; 5389 spec->gen.automute_hook = alc_update_headset_mode; 5390 spec->gen.hp_automute_hook = alc_update_headset_jack_cb; 5391 } 5392 5393 static void alc_fixup_headset_mode(struct hda_codec *codec, 5394 const struct hda_fixup *fix, int action) 5395 { 5396 struct alc_spec *spec = codec->spec; 5397 5398 switch (action) { 5399 case HDA_FIXUP_ACT_PRE_PROBE: 5400 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC; 5401 break; 5402 case HDA_FIXUP_ACT_PROBE: 5403 alc_probe_headset_mode(codec); 5404 break; 5405 case HDA_FIXUP_ACT_INIT: 5406 if (is_s3_resume(codec) || is_s4_resume(codec)) { 5407 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN; 5408 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; 5409 } 5410 alc_update_headset_mode(codec); 5411 break; 5412 } 5413 } 5414 5415 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, 5416 const struct hda_fixup *fix, int action) 5417 { 5418 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5419 struct alc_spec *spec = codec->spec; 5420 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 5421 } 5422 else 5423 alc_fixup_headset_mode(codec, fix, action); 5424 } 5425 5426 static void alc255_set_default_jack_type(struct hda_codec *codec) 5427 { 5428 /* Set to iphone type */ 5429 static const struct coef_fw alc255fw[] = { 5430 WRITE_COEF(0x1b, 0x880b), 5431 WRITE_COEF(0x45, 0xd089), 5432 WRITE_COEF(0x1b, 0x080b), 5433 WRITE_COEF(0x46, 0x0004), 5434 WRITE_COEF(0x1b, 0x0c0b), 5435 {} 5436 }; 5437 static const struct coef_fw alc256fw[] = { 5438 WRITE_COEF(0x1b, 0x884b), 5439 WRITE_COEF(0x45, 0xd089), 5440 WRITE_COEF(0x1b, 0x084b), 5441 WRITE_COEF(0x46, 0x0004), 5442 WRITE_COEF(0x1b, 0x0c4b), 5443 {} 5444 }; 5445 switch (codec->core.vendor_id) { 5446 case 0x10ec0255: 5447 alc_process_coef_fw(codec, alc255fw); 5448 break; 5449 case 0x10ec0236: 5450 case 0x10ec0256: 5451 alc_process_coef_fw(codec, alc256fw); 5452 break; 5453 } 5454 msleep(30); 5455 } 5456 5457 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, 5458 const struct hda_fixup *fix, int action) 5459 { 5460 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5461 alc255_set_default_jack_type(codec); 5462 } 5463 alc_fixup_headset_mode(codec, fix, action); 5464 } 5465 5466 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, 5467 const struct hda_fixup *fix, int action) 5468 { 5469 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5470 struct alc_spec *spec = codec->spec; 5471 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 5472 alc255_set_default_jack_type(codec); 5473 } 5474 else 5475 alc_fixup_headset_mode(codec, fix, action); 5476 } 5477 5478 static void alc288_update_headset_jack_cb(struct hda_codec *codec, 5479 struct hda_jack_callback *jack) 5480 { 5481 struct alc_spec *spec = codec->spec; 5482 5483 alc_update_headset_jack_cb(codec, jack); 5484 /* Headset Mic enable or disable, only for Dell Dino */ 5485 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); 5486 } 5487 5488 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, 5489 const struct hda_fixup *fix, int action) 5490 { 5491 alc_fixup_headset_mode(codec, fix, action); 5492 if (action == HDA_FIXUP_ACT_PROBE) { 5493 struct alc_spec *spec = codec->spec; 5494 /* toggled via hp_automute_hook */ 5495 spec->gpio_mask |= 0x40; 5496 spec->gpio_dir |= 0x40; 5497 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb; 5498 } 5499 } 5500 5501 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec, 5502 const struct hda_fixup *fix, int action) 5503 { 5504 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5505 struct alc_spec *spec = codec->spec; 5506 spec->gen.auto_mute_via_amp = 1; 5507 } 5508 } 5509 5510 static void alc_fixup_no_shutup(struct hda_codec *codec, 5511 const struct hda_fixup *fix, int action) 5512 { 5513 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5514 struct alc_spec *spec = codec->spec; 5515 spec->no_shutup_pins = 1; 5516 } 5517 } 5518 5519 static void alc_fixup_disable_aamix(struct hda_codec *codec, 5520 const struct hda_fixup *fix, int action) 5521 { 5522 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5523 struct alc_spec *spec = codec->spec; 5524 /* Disable AA-loopback as it causes white noise */ 5525 spec->gen.mixer_nid = 0; 5526 } 5527 } 5528 5529 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */ 5530 static void alc_fixup_tpt440_dock(struct hda_codec *codec, 5531 const struct hda_fixup *fix, int action) 5532 { 5533 static const struct hda_pintbl pincfgs[] = { 5534 { 0x16, 0x21211010 }, /* dock headphone */ 5535 { 0x19, 0x21a11010 }, /* dock mic */ 5536 { } 5537 }; 5538 struct alc_spec *spec = codec->spec; 5539 5540 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5541 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */ 5542 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 5543 codec->power_save_node = 0; /* avoid click noises */ 5544 snd_hda_apply_pincfgs(codec, pincfgs); 5545 } 5546 } 5547 5548 static void alc_fixup_tpt470_dock(struct hda_codec *codec, 5549 const struct hda_fixup *fix, int action) 5550 { 5551 static const struct hda_pintbl pincfgs[] = { 5552 { 0x17, 0x21211010 }, /* dock headphone */ 5553 { 0x19, 0x21a11010 }, /* dock mic */ 5554 { } 5555 }; 5556 struct alc_spec *spec = codec->spec; 5557 5558 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5559 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 5560 snd_hda_apply_pincfgs(codec, pincfgs); 5561 } else if (action == HDA_FIXUP_ACT_INIT) { 5562 /* Enable DOCK device */ 5563 snd_hda_codec_write(codec, 0x17, 0, 5564 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); 5565 /* Enable DOCK device */ 5566 snd_hda_codec_write(codec, 0x19, 0, 5567 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0); 5568 } 5569 } 5570 5571 static void alc_fixup_tpt470_dacs(struct hda_codec *codec, 5572 const struct hda_fixup *fix, int action) 5573 { 5574 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise 5575 * the speaker output becomes too low by some reason on Thinkpads with 5576 * ALC298 codec 5577 */ 5578 static const hda_nid_t preferred_pairs[] = { 5579 0x14, 0x03, 0x17, 0x02, 0x21, 0x02, 5580 0 5581 }; 5582 struct alc_spec *spec = codec->spec; 5583 5584 if (action == HDA_FIXUP_ACT_PRE_PROBE) 5585 spec->gen.preferred_dacs = preferred_pairs; 5586 } 5587 5588 static void alc_shutup_dell_xps13(struct hda_codec *codec) 5589 { 5590 struct alc_spec *spec = codec->spec; 5591 int hp_pin = alc_get_hp_pin(spec); 5592 5593 /* Prevent pop noises when headphones are plugged in */ 5594 snd_hda_codec_write(codec, hp_pin, 0, 5595 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 5596 msleep(20); 5597 } 5598 5599 static void alc_fixup_dell_xps13(struct hda_codec *codec, 5600 const struct hda_fixup *fix, int action) 5601 { 5602 struct alc_spec *spec = codec->spec; 5603 struct hda_input_mux *imux = &spec->gen.input_mux; 5604 int i; 5605 5606 switch (action) { 5607 case HDA_FIXUP_ACT_PRE_PROBE: 5608 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise 5609 * it causes a click noise at start up 5610 */ 5611 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 5612 spec->shutup = alc_shutup_dell_xps13; 5613 break; 5614 case HDA_FIXUP_ACT_PROBE: 5615 /* Make the internal mic the default input source. */ 5616 for (i = 0; i < imux->num_items; i++) { 5617 if (spec->gen.imux_pins[i] == 0x12) { 5618 spec->gen.cur_mux[0] = i; 5619 break; 5620 } 5621 } 5622 break; 5623 } 5624 } 5625 5626 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec, 5627 const struct hda_fixup *fix, int action) 5628 { 5629 struct alc_spec *spec = codec->spec; 5630 5631 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5632 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 5633 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */ 5634 5635 /* Disable boost for mic-in permanently. (This code is only called 5636 from quirks that guarantee that the headphone is at NID 0x1b.) */ 5637 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000); 5638 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP); 5639 } else 5640 alc_fixup_headset_mode(codec, fix, action); 5641 } 5642 5643 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, 5644 const struct hda_fixup *fix, int action) 5645 { 5646 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5647 alc_write_coef_idx(codec, 0xc4, 0x8000); 5648 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0); 5649 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); 5650 } 5651 alc_fixup_headset_mode(codec, fix, action); 5652 } 5653 5654 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */ 5655 static int find_ext_mic_pin(struct hda_codec *codec) 5656 { 5657 struct alc_spec *spec = codec->spec; 5658 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 5659 hda_nid_t nid; 5660 unsigned int defcfg; 5661 int i; 5662 5663 for (i = 0; i < cfg->num_inputs; i++) { 5664 if (cfg->inputs[i].type != AUTO_PIN_MIC) 5665 continue; 5666 nid = cfg->inputs[i].pin; 5667 defcfg = snd_hda_codec_get_pincfg(codec, nid); 5668 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT) 5669 continue; 5670 return nid; 5671 } 5672 5673 return 0; 5674 } 5675 5676 static void alc271_hp_gate_mic_jack(struct hda_codec *codec, 5677 const struct hda_fixup *fix, 5678 int action) 5679 { 5680 struct alc_spec *spec = codec->spec; 5681 5682 if (action == HDA_FIXUP_ACT_PROBE) { 5683 int mic_pin = find_ext_mic_pin(codec); 5684 int hp_pin = alc_get_hp_pin(spec); 5685 5686 if (snd_BUG_ON(!mic_pin || !hp_pin)) 5687 return; 5688 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); 5689 } 5690 } 5691 5692 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, 5693 const struct hda_fixup *fix, 5694 int action) 5695 { 5696 struct alc_spec *spec = codec->spec; 5697 struct auto_pin_cfg *cfg = &spec->gen.autocfg; 5698 int i; 5699 5700 /* The mic boosts on level 2 and 3 are too noisy 5701 on the internal mic input. 5702 Therefore limit the boost to 0 or 1. */ 5703 5704 if (action != HDA_FIXUP_ACT_PROBE) 5705 return; 5706 5707 for (i = 0; i < cfg->num_inputs; i++) { 5708 hda_nid_t nid = cfg->inputs[i].pin; 5709 unsigned int defcfg; 5710 if (cfg->inputs[i].type != AUTO_PIN_MIC) 5711 continue; 5712 defcfg = snd_hda_codec_get_pincfg(codec, nid); 5713 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) 5714 continue; 5715 5716 snd_hda_override_amp_caps(codec, nid, HDA_INPUT, 5717 (0x00 << AC_AMPCAP_OFFSET_SHIFT) | 5718 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | 5719 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | 5720 (0 << AC_AMPCAP_MUTE_SHIFT)); 5721 } 5722 } 5723 5724 static void alc283_hp_automute_hook(struct hda_codec *codec, 5725 struct hda_jack_callback *jack) 5726 { 5727 struct alc_spec *spec = codec->spec; 5728 int vref; 5729 5730 msleep(200); 5731 snd_hda_gen_hp_automute(codec, jack); 5732 5733 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 5734 5735 msleep(600); 5736 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 5737 vref); 5738 } 5739 5740 static void alc283_fixup_chromebook(struct hda_codec *codec, 5741 const struct hda_fixup *fix, int action) 5742 { 5743 struct alc_spec *spec = codec->spec; 5744 5745 switch (action) { 5746 case HDA_FIXUP_ACT_PRE_PROBE: 5747 snd_hda_override_wcaps(codec, 0x03, 0); 5748 /* Disable AA-loopback as it causes white noise */ 5749 spec->gen.mixer_nid = 0; 5750 break; 5751 case HDA_FIXUP_ACT_INIT: 5752 /* MIC2-VREF control */ 5753 /* Set to manual mode */ 5754 alc_update_coef_idx(codec, 0x06, 0x000c, 0); 5755 /* Enable Line1 input control by verb */ 5756 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); 5757 break; 5758 } 5759 } 5760 5761 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, 5762 const struct hda_fixup *fix, int action) 5763 { 5764 struct alc_spec *spec = codec->spec; 5765 5766 switch (action) { 5767 case HDA_FIXUP_ACT_PRE_PROBE: 5768 spec->gen.hp_automute_hook = alc283_hp_automute_hook; 5769 break; 5770 case HDA_FIXUP_ACT_INIT: 5771 /* MIC2-VREF control */ 5772 /* Set to manual mode */ 5773 alc_update_coef_idx(codec, 0x06, 0x000c, 0); 5774 break; 5775 } 5776 } 5777 5778 /* mute tablet speaker pin (0x14) via dock plugging in addition */ 5779 static void asus_tx300_automute(struct hda_codec *codec) 5780 { 5781 struct alc_spec *spec = codec->spec; 5782 snd_hda_gen_update_outputs(codec); 5783 if (snd_hda_jack_detect(codec, 0x1b)) 5784 spec->gen.mute_bits |= (1ULL << 0x14); 5785 } 5786 5787 static void alc282_fixup_asus_tx300(struct hda_codec *codec, 5788 const struct hda_fixup *fix, int action) 5789 { 5790 struct alc_spec *spec = codec->spec; 5791 static const struct hda_pintbl dock_pins[] = { 5792 { 0x1b, 0x21114000 }, /* dock speaker pin */ 5793 {} 5794 }; 5795 5796 switch (action) { 5797 case HDA_FIXUP_ACT_PRE_PROBE: 5798 spec->init_amp = ALC_INIT_DEFAULT; 5799 /* TX300 needs to set up GPIO2 for the speaker amp */ 5800 alc_setup_gpio(codec, 0x04); 5801 snd_hda_apply_pincfgs(codec, dock_pins); 5802 spec->gen.auto_mute_via_amp = 1; 5803 spec->gen.automute_hook = asus_tx300_automute; 5804 snd_hda_jack_detect_enable_callback(codec, 0x1b, 5805 snd_hda_gen_hp_automute); 5806 break; 5807 case HDA_FIXUP_ACT_PROBE: 5808 spec->init_amp = ALC_INIT_DEFAULT; 5809 break; 5810 case HDA_FIXUP_ACT_BUILD: 5811 /* this is a bit tricky; give more sane names for the main 5812 * (tablet) speaker and the dock speaker, respectively 5813 */ 5814 rename_ctl(codec, "Speaker Playback Switch", 5815 "Dock Speaker Playback Switch"); 5816 rename_ctl(codec, "Bass Speaker Playback Switch", 5817 "Speaker Playback Switch"); 5818 break; 5819 } 5820 } 5821 5822 static void alc290_fixup_mono_speakers(struct hda_codec *codec, 5823 const struct hda_fixup *fix, int action) 5824 { 5825 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5826 /* DAC node 0x03 is giving mono output. We therefore want to 5827 make sure 0x14 (front speaker) and 0x15 (headphones) use the 5828 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */ 5829 static const hda_nid_t conn1[] = { 0x0c }; 5830 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); 5831 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); 5832 } 5833 } 5834 5835 static void alc298_fixup_speaker_volume(struct hda_codec *codec, 5836 const struct hda_fixup *fix, int action) 5837 { 5838 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5839 /* The speaker is routed to the Node 0x06 by a mistake, as a result 5840 we can't adjust the speaker's volume since this node does not has 5841 Amp-out capability. we change the speaker's route to: 5842 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 ( 5843 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust 5844 speaker's volume now. */ 5845 5846 static const hda_nid_t conn1[] = { 0x0c }; 5847 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); 5848 } 5849 } 5850 5851 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */ 5852 static void alc295_fixup_disable_dac3(struct hda_codec *codec, 5853 const struct hda_fixup *fix, int action) 5854 { 5855 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5856 static const hda_nid_t conn[] = { 0x02, 0x03 }; 5857 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 5858 } 5859 } 5860 5861 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */ 5862 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, 5863 const struct hda_fixup *fix, int action) 5864 { 5865 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5866 static const hda_nid_t conn[] = { 0x02 }; 5867 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 5868 } 5869 } 5870 5871 /* Hook to update amp GPIO4 for automute */ 5872 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, 5873 struct hda_jack_callback *jack) 5874 { 5875 struct alc_spec *spec = codec->spec; 5876 5877 snd_hda_gen_hp_automute(codec, jack); 5878 /* mute_led_polarity is set to 0, so we pass inverted value here */ 5879 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, 5880 !spec->gen.hp_jack_present); 5881 } 5882 5883 /* Manage GPIOs for HP EliteBook Folio 9480m. 5884 * 5885 * GPIO4 is the headphone amplifier power control 5886 * GPIO3 is the audio output mute indicator LED 5887 */ 5888 5889 static void alc280_fixup_hp_9480m(struct hda_codec *codec, 5890 const struct hda_fixup *fix, 5891 int action) 5892 { 5893 struct alc_spec *spec = codec->spec; 5894 5895 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); 5896 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5897 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */ 5898 spec->gpio_mask |= 0x10; 5899 spec->gpio_dir |= 0x10; 5900 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook; 5901 } 5902 } 5903 5904 static void alc275_fixup_gpio4_off(struct hda_codec *codec, 5905 const struct hda_fixup *fix, 5906 int action) 5907 { 5908 struct alc_spec *spec = codec->spec; 5909 5910 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 5911 spec->gpio_mask |= 0x04; 5912 spec->gpio_dir |= 0x04; 5913 /* set data bit low */ 5914 } 5915 } 5916 5917 /* Quirk for Thinkpad X1 7th and 8th Gen 5918 * The following fixed routing needed 5919 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly 5920 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC 5921 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp 5922 */ 5923 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, 5924 const struct hda_fixup *fix, int action) 5925 { 5926 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ 5927 static const hda_nid_t preferred_pairs[] = { 5928 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0 5929 }; 5930 struct alc_spec *spec = codec->spec; 5931 5932 switch (action) { 5933 case HDA_FIXUP_ACT_PRE_PROBE: 5934 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 5935 spec->gen.preferred_dacs = preferred_pairs; 5936 break; 5937 case HDA_FIXUP_ACT_BUILD: 5938 /* The generic parser creates somewhat unintuitive volume ctls 5939 * with the fixed routing above, and the shared DAC2 may be 5940 * confusing for PA. 5941 * Rename those to unique names so that PA doesn't touch them 5942 * and use only Master volume. 5943 */ 5944 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); 5945 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); 5946 break; 5947 } 5948 } 5949 5950 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, 5951 const struct hda_fixup *fix, 5952 int action) 5953 { 5954 alc_fixup_dual_codecs(codec, fix, action); 5955 switch (action) { 5956 case HDA_FIXUP_ACT_PRE_PROBE: 5957 /* override card longname to provide a unique UCM profile */ 5958 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); 5959 break; 5960 case HDA_FIXUP_ACT_BUILD: 5961 /* rename Capture controls depending on the codec */ 5962 rename_ctl(codec, "Capture Volume", 5963 codec->addr == 0 ? 5964 "Rear-Panel Capture Volume" : 5965 "Front-Panel Capture Volume"); 5966 rename_ctl(codec, "Capture Switch", 5967 codec->addr == 0 ? 5968 "Rear-Panel Capture Switch" : 5969 "Front-Panel Capture Switch"); 5970 break; 5971 } 5972 } 5973 5974 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, 5975 const struct hda_fixup *fix, int action) 5976 { 5977 if (action != HDA_FIXUP_ACT_PRE_PROBE) 5978 return; 5979 5980 codec->power_save_node = 1; 5981 } 5982 5983 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ 5984 static void alc274_fixup_bind_dacs(struct hda_codec *codec, 5985 const struct hda_fixup *fix, int action) 5986 { 5987 struct alc_spec *spec = codec->spec; 5988 static const hda_nid_t preferred_pairs[] = { 5989 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, 5990 0 5991 }; 5992 5993 if (action != HDA_FIXUP_ACT_PRE_PROBE) 5994 return; 5995 5996 spec->gen.preferred_dacs = preferred_pairs; 5997 spec->gen.auto_mute_via_amp = 1; 5998 codec->power_save_node = 0; 5999 } 6000 6001 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ 6002 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, 6003 const struct hda_fixup *fix, int action) 6004 { 6005 if (action != HDA_FIXUP_ACT_PRE_PROBE) 6006 return; 6007 6008 snd_hda_override_wcaps(codec, 0x03, 0); 6009 } 6010 6011 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) 6012 { 6013 switch (codec->core.vendor_id) { 6014 case 0x10ec0274: 6015 case 0x10ec0294: 6016 case 0x10ec0225: 6017 case 0x10ec0295: 6018 case 0x10ec0299: 6019 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ 6020 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); 6021 break; 6022 case 0x10ec0235: 6023 case 0x10ec0236: 6024 case 0x10ec0255: 6025 case 0x10ec0256: 6026 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ 6027 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); 6028 break; 6029 } 6030 } 6031 6032 static void alc295_fixup_chromebook(struct hda_codec *codec, 6033 const struct hda_fixup *fix, int action) 6034 { 6035 struct alc_spec *spec = codec->spec; 6036 6037 switch (action) { 6038 case HDA_FIXUP_ACT_PRE_PROBE: 6039 spec->ultra_low_power = true; 6040 break; 6041 case HDA_FIXUP_ACT_INIT: 6042 alc_combo_jack_hp_jd_restart(codec); 6043 break; 6044 } 6045 } 6046 6047 static void alc_fixup_disable_mic_vref(struct hda_codec *codec, 6048 const struct hda_fixup *fix, int action) 6049 { 6050 if (action == HDA_FIXUP_ACT_PRE_PROBE) 6051 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 6052 } 6053 6054 6055 static void alc294_gx502_toggle_output(struct hda_codec *codec, 6056 struct hda_jack_callback *cb) 6057 { 6058 /* The Windows driver sets the codec up in a very different way where 6059 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it 6060 */ 6061 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) 6062 alc_write_coef_idx(codec, 0x10, 0x8a20); 6063 else 6064 alc_write_coef_idx(codec, 0x10, 0x0a20); 6065 } 6066 6067 static void alc294_fixup_gx502_hp(struct hda_codec *codec, 6068 const struct hda_fixup *fix, int action) 6069 { 6070 /* Pin 0x21: headphones/headset mic */ 6071 if (!is_jack_detectable(codec, 0x21)) 6072 return; 6073 6074 switch (action) { 6075 case HDA_FIXUP_ACT_PRE_PROBE: 6076 snd_hda_jack_detect_enable_callback(codec, 0x21, 6077 alc294_gx502_toggle_output); 6078 break; 6079 case HDA_FIXUP_ACT_INIT: 6080 /* Make sure to start in a correct state, i.e. if 6081 * headphones have been plugged in before powering up the system 6082 */ 6083 alc294_gx502_toggle_output(codec, NULL); 6084 break; 6085 } 6086 } 6087 6088 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, 6089 const struct hda_fixup *fix, int action) 6090 { 6091 if (action != HDA_FIXUP_ACT_INIT) 6092 return; 6093 6094 msleep(100); 6095 alc_write_coef_idx(codec, 0x65, 0x0); 6096 } 6097 6098 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, 6099 const struct hda_fixup *fix, int action) 6100 { 6101 switch (action) { 6102 case HDA_FIXUP_ACT_INIT: 6103 alc_combo_jack_hp_jd_restart(codec); 6104 break; 6105 } 6106 } 6107 6108 /* for hda_fixup_thinkpad_acpi() */ 6109 #include "thinkpad_helper.c" 6110 6111 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, 6112 const struct hda_fixup *fix, int action) 6113 { 6114 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ 6115 hda_fixup_thinkpad_acpi(codec, fix, action); 6116 } 6117 6118 /* for alc295_fixup_hp_top_speakers */ 6119 #include "hp_x360_helper.c" 6120 6121 enum { 6122 ALC269_FIXUP_GPIO2, 6123 ALC269_FIXUP_SONY_VAIO, 6124 ALC275_FIXUP_SONY_VAIO_GPIO2, 6125 ALC269_FIXUP_DELL_M101Z, 6126 ALC269_FIXUP_SKU_IGNORE, 6127 ALC269_FIXUP_ASUS_G73JW, 6128 ALC269_FIXUP_LENOVO_EAPD, 6129 ALC275_FIXUP_SONY_HWEQ, 6130 ALC275_FIXUP_SONY_DISABLE_AAMIX, 6131 ALC271_FIXUP_DMIC, 6132 ALC269_FIXUP_PCM_44K, 6133 ALC269_FIXUP_STEREO_DMIC, 6134 ALC269_FIXUP_HEADSET_MIC, 6135 ALC269_FIXUP_QUANTA_MUTE, 6136 ALC269_FIXUP_LIFEBOOK, 6137 ALC269_FIXUP_LIFEBOOK_EXTMIC, 6138 ALC269_FIXUP_LIFEBOOK_HP_PIN, 6139 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT, 6140 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, 6141 ALC269_FIXUP_AMIC, 6142 ALC269_FIXUP_DMIC, 6143 ALC269VB_FIXUP_AMIC, 6144 ALC269VB_FIXUP_DMIC, 6145 ALC269_FIXUP_HP_MUTE_LED, 6146 ALC269_FIXUP_HP_MUTE_LED_MIC1, 6147 ALC269_FIXUP_HP_MUTE_LED_MIC2, 6148 ALC269_FIXUP_HP_MUTE_LED_MIC3, 6149 ALC269_FIXUP_HP_GPIO_LED, 6150 ALC269_FIXUP_HP_GPIO_MIC1_LED, 6151 ALC269_FIXUP_HP_LINE1_MIC1_LED, 6152 ALC269_FIXUP_INV_DMIC, 6153 ALC269_FIXUP_LENOVO_DOCK, 6154 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, 6155 ALC269_FIXUP_NO_SHUTUP, 6156 ALC286_FIXUP_SONY_MIC_NO_PRESENCE, 6157 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, 6158 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 6159 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 6160 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 6161 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 6162 ALC269_FIXUP_HEADSET_MODE, 6163 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, 6164 ALC269_FIXUP_ASPIRE_HEADSET_MIC, 6165 ALC269_FIXUP_ASUS_X101_FUNC, 6166 ALC269_FIXUP_ASUS_X101_VERB, 6167 ALC269_FIXUP_ASUS_X101, 6168 ALC271_FIXUP_AMIC_MIC2, 6169 ALC271_FIXUP_HP_GATE_MIC_JACK, 6170 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, 6171 ALC269_FIXUP_ACER_AC700, 6172 ALC269_FIXUP_LIMIT_INT_MIC_BOOST, 6173 ALC269VB_FIXUP_ASUS_ZENBOOK, 6174 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, 6175 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, 6176 ALC269VB_FIXUP_ORDISSIMO_EVE2, 6177 ALC283_FIXUP_CHROME_BOOK, 6178 ALC283_FIXUP_SENSE_COMBO_JACK, 6179 ALC282_FIXUP_ASUS_TX300, 6180 ALC283_FIXUP_INT_MIC, 6181 ALC290_FIXUP_MONO_SPEAKERS, 6182 ALC290_FIXUP_MONO_SPEAKERS_HSJACK, 6183 ALC290_FIXUP_SUBWOOFER, 6184 ALC290_FIXUP_SUBWOOFER_HSJACK, 6185 ALC269_FIXUP_THINKPAD_ACPI, 6186 ALC269_FIXUP_DMIC_THINKPAD_ACPI, 6187 ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 6188 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 6189 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 6190 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 6191 ALC255_FIXUP_HEADSET_MODE, 6192 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC, 6193 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 6194 ALC292_FIXUP_TPT440_DOCK, 6195 ALC292_FIXUP_TPT440, 6196 ALC283_FIXUP_HEADSET_MIC, 6197 ALC255_FIXUP_MIC_MUTE_LED, 6198 ALC282_FIXUP_ASPIRE_V5_PINS, 6199 ALC280_FIXUP_HP_GPIO4, 6200 ALC286_FIXUP_HP_GPIO_LED, 6201 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, 6202 ALC280_FIXUP_HP_DOCK_PINS, 6203 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, 6204 ALC280_FIXUP_HP_9480M, 6205 ALC288_FIXUP_DELL_HEADSET_MODE, 6206 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, 6207 ALC288_FIXUP_DELL_XPS_13, 6208 ALC288_FIXUP_DISABLE_AAMIX, 6209 ALC292_FIXUP_DELL_E7X_AAMIX, 6210 ALC292_FIXUP_DELL_E7X, 6211 ALC292_FIXUP_DISABLE_AAMIX, 6212 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, 6213 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, 6214 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 6215 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, 6216 ALC275_FIXUP_DELL_XPS, 6217 ALC293_FIXUP_LENOVO_SPK_NOISE, 6218 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 6219 ALC255_FIXUP_DELL_SPK_NOISE, 6220 ALC225_FIXUP_DISABLE_MIC_VREF, 6221 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 6222 ALC295_FIXUP_DISABLE_DAC3, 6223 ALC285_FIXUP_SPEAKER2_TO_DAC1, 6224 ALC280_FIXUP_HP_HEADSET_MIC, 6225 ALC221_FIXUP_HP_FRONT_MIC, 6226 ALC292_FIXUP_TPT460, 6227 ALC298_FIXUP_SPK_VOLUME, 6228 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, 6229 ALC269_FIXUP_ATIV_BOOK_8, 6230 ALC221_FIXUP_HP_MIC_NO_PRESENCE, 6231 ALC256_FIXUP_ASUS_HEADSET_MODE, 6232 ALC256_FIXUP_ASUS_MIC, 6233 ALC256_FIXUP_ASUS_AIO_GPIO2, 6234 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, 6235 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, 6236 ALC233_FIXUP_LENOVO_MULTI_CODECS, 6237 ALC233_FIXUP_ACER_HEADSET_MIC, 6238 ALC294_FIXUP_LENOVO_MIC_LOCATION, 6239 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, 6240 ALC225_FIXUP_S3_POP_NOISE, 6241 ALC700_FIXUP_INTEL_REFERENCE, 6242 ALC274_FIXUP_DELL_BIND_DACS, 6243 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, 6244 ALC298_FIXUP_TPT470_DOCK_FIX, 6245 ALC298_FIXUP_TPT470_DOCK, 6246 ALC255_FIXUP_DUMMY_LINEOUT_VERB, 6247 ALC255_FIXUP_DELL_HEADSET_MIC, 6248 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS, 6249 ALC298_FIXUP_HUAWEI_MBX_STEREO, 6250 ALC295_FIXUP_HP_X360, 6251 ALC221_FIXUP_HP_HEADSET_MIC, 6252 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE, 6253 ALC295_FIXUP_HP_AUTO_MUTE, 6254 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, 6255 ALC294_FIXUP_ASUS_MIC, 6256 ALC294_FIXUP_ASUS_HEADSET_MIC, 6257 ALC294_FIXUP_ASUS_SPK, 6258 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, 6259 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 6260 ALC255_FIXUP_ACER_HEADSET_MIC, 6261 ALC295_FIXUP_CHROME_BOOK, 6262 ALC225_FIXUP_HEADSET_JACK, 6263 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, 6264 ALC225_FIXUP_WYSE_AUTO_MUTE, 6265 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, 6266 ALC286_FIXUP_ACER_AIO_HEADSET_MIC, 6267 ALC256_FIXUP_ASUS_HEADSET_MIC, 6268 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 6269 ALC299_FIXUP_PREDATOR_SPK, 6270 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, 6271 ALC289_FIXUP_DELL_SPK2, 6272 ALC289_FIXUP_DUAL_SPK, 6273 ALC294_FIXUP_SPK2_TO_DAC1, 6274 ALC294_FIXUP_ASUS_DUAL_SPK, 6275 ALC285_FIXUP_THINKPAD_X1_GEN7, 6276 ALC285_FIXUP_THINKPAD_HEADSET_JACK, 6277 ALC294_FIXUP_ASUS_HPE, 6278 ALC294_FIXUP_ASUS_COEF_1B, 6279 ALC294_FIXUP_ASUS_GX502_HP, 6280 ALC294_FIXUP_ASUS_GX502_PINS, 6281 ALC294_FIXUP_ASUS_GX502_VERBS, 6282 ALC285_FIXUP_HP_GPIO_LED, 6283 ALC285_FIXUP_HP_MUTE_LED, 6284 ALC236_FIXUP_HP_MUTE_LED, 6285 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 6286 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 6287 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, 6288 ALC269VC_FIXUP_ACER_HEADSET_MIC, 6289 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, 6290 ALC289_FIXUP_ASUS_GA401, 6291 ALC289_FIXUP_ASUS_GA502, 6292 ALC256_FIXUP_ACER_MIC_NO_PRESENCE, 6293 ALC285_FIXUP_HP_GPIO_AMP_INIT, 6294 ALC269_FIXUP_CZC_B20, 6295 ALC269_FIXUP_CZC_TMI, 6296 ALC269_FIXUP_CZC_L101, 6297 ALC269_FIXUP_LEMOTE_A1802, 6298 ALC269_FIXUP_LEMOTE_A190X, 6299 ALC256_FIXUP_INTEL_NUC8_RUGGED, 6300 ALC255_FIXUP_XIAOMI_HEADSET_MIC, 6301 ALC274_FIXUP_HP_MIC, 6302 ALC274_FIXUP_HP_HEADSET_MIC, 6303 ALC256_FIXUP_ASUS_HPE, 6304 }; 6305 6306 static const struct hda_fixup alc269_fixups[] = { 6307 [ALC269_FIXUP_GPIO2] = { 6308 .type = HDA_FIXUP_FUNC, 6309 .v.func = alc_fixup_gpio2, 6310 }, 6311 [ALC269_FIXUP_SONY_VAIO] = { 6312 .type = HDA_FIXUP_PINCTLS, 6313 .v.pins = (const struct hda_pintbl[]) { 6314 {0x19, PIN_VREFGRD}, 6315 {} 6316 } 6317 }, 6318 [ALC275_FIXUP_SONY_VAIO_GPIO2] = { 6319 .type = HDA_FIXUP_FUNC, 6320 .v.func = alc275_fixup_gpio4_off, 6321 .chained = true, 6322 .chain_id = ALC269_FIXUP_SONY_VAIO 6323 }, 6324 [ALC269_FIXUP_DELL_M101Z] = { 6325 .type = HDA_FIXUP_VERBS, 6326 .v.verbs = (const struct hda_verb[]) { 6327 /* Enables internal speaker */ 6328 {0x20, AC_VERB_SET_COEF_INDEX, 13}, 6329 {0x20, AC_VERB_SET_PROC_COEF, 0x4040}, 6330 {} 6331 } 6332 }, 6333 [ALC269_FIXUP_SKU_IGNORE] = { 6334 .type = HDA_FIXUP_FUNC, 6335 .v.func = alc_fixup_sku_ignore, 6336 }, 6337 [ALC269_FIXUP_ASUS_G73JW] = { 6338 .type = HDA_FIXUP_PINS, 6339 .v.pins = (const struct hda_pintbl[]) { 6340 { 0x17, 0x99130111 }, /* subwoofer */ 6341 { } 6342 } 6343 }, 6344 [ALC269_FIXUP_LENOVO_EAPD] = { 6345 .type = HDA_FIXUP_VERBS, 6346 .v.verbs = (const struct hda_verb[]) { 6347 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, 6348 {} 6349 } 6350 }, 6351 [ALC275_FIXUP_SONY_HWEQ] = { 6352 .type = HDA_FIXUP_FUNC, 6353 .v.func = alc269_fixup_hweq, 6354 .chained = true, 6355 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2 6356 }, 6357 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = { 6358 .type = HDA_FIXUP_FUNC, 6359 .v.func = alc_fixup_disable_aamix, 6360 .chained = true, 6361 .chain_id = ALC269_FIXUP_SONY_VAIO 6362 }, 6363 [ALC271_FIXUP_DMIC] = { 6364 .type = HDA_FIXUP_FUNC, 6365 .v.func = alc271_fixup_dmic, 6366 }, 6367 [ALC269_FIXUP_PCM_44K] = { 6368 .type = HDA_FIXUP_FUNC, 6369 .v.func = alc269_fixup_pcm_44k, 6370 .chained = true, 6371 .chain_id = ALC269_FIXUP_QUANTA_MUTE 6372 }, 6373 [ALC269_FIXUP_STEREO_DMIC] = { 6374 .type = HDA_FIXUP_FUNC, 6375 .v.func = alc269_fixup_stereo_dmic, 6376 }, 6377 [ALC269_FIXUP_HEADSET_MIC] = { 6378 .type = HDA_FIXUP_FUNC, 6379 .v.func = alc269_fixup_headset_mic, 6380 }, 6381 [ALC269_FIXUP_QUANTA_MUTE] = { 6382 .type = HDA_FIXUP_FUNC, 6383 .v.func = alc269_fixup_quanta_mute, 6384 }, 6385 [ALC269_FIXUP_LIFEBOOK] = { 6386 .type = HDA_FIXUP_PINS, 6387 .v.pins = (const struct hda_pintbl[]) { 6388 { 0x1a, 0x2101103f }, /* dock line-out */ 6389 { 0x1b, 0x23a11040 }, /* dock mic-in */ 6390 { } 6391 }, 6392 .chained = true, 6393 .chain_id = ALC269_FIXUP_QUANTA_MUTE 6394 }, 6395 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = { 6396 .type = HDA_FIXUP_PINS, 6397 .v.pins = (const struct hda_pintbl[]) { 6398 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */ 6399 { } 6400 }, 6401 }, 6402 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = { 6403 .type = HDA_FIXUP_PINS, 6404 .v.pins = (const struct hda_pintbl[]) { 6405 { 0x21, 0x0221102f }, /* HP out */ 6406 { } 6407 }, 6408 }, 6409 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = { 6410 .type = HDA_FIXUP_FUNC, 6411 .v.func = alc269_fixup_pincfg_no_hp_to_lineout, 6412 }, 6413 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { 6414 .type = HDA_FIXUP_FUNC, 6415 .v.func = alc269_fixup_pincfg_U7x7_headset_mic, 6416 }, 6417 [ALC269_FIXUP_AMIC] = { 6418 .type = HDA_FIXUP_PINS, 6419 .v.pins = (const struct hda_pintbl[]) { 6420 { 0x14, 0x99130110 }, /* speaker */ 6421 { 0x15, 0x0121401f }, /* HP out */ 6422 { 0x18, 0x01a19c20 }, /* mic */ 6423 { 0x19, 0x99a3092f }, /* int-mic */ 6424 { } 6425 }, 6426 }, 6427 [ALC269_FIXUP_DMIC] = { 6428 .type = HDA_FIXUP_PINS, 6429 .v.pins = (const struct hda_pintbl[]) { 6430 { 0x12, 0x99a3092f }, /* int-mic */ 6431 { 0x14, 0x99130110 }, /* speaker */ 6432 { 0x15, 0x0121401f }, /* HP out */ 6433 { 0x18, 0x01a19c20 }, /* mic */ 6434 { } 6435 }, 6436 }, 6437 [ALC269VB_FIXUP_AMIC] = { 6438 .type = HDA_FIXUP_PINS, 6439 .v.pins = (const struct hda_pintbl[]) { 6440 { 0x14, 0x99130110 }, /* speaker */ 6441 { 0x18, 0x01a19c20 }, /* mic */ 6442 { 0x19, 0x99a3092f }, /* int-mic */ 6443 { 0x21, 0x0121401f }, /* HP out */ 6444 { } 6445 }, 6446 }, 6447 [ALC269VB_FIXUP_DMIC] = { 6448 .type = HDA_FIXUP_PINS, 6449 .v.pins = (const struct hda_pintbl[]) { 6450 { 0x12, 0x99a3092f }, /* int-mic */ 6451 { 0x14, 0x99130110 }, /* speaker */ 6452 { 0x18, 0x01a19c20 }, /* mic */ 6453 { 0x21, 0x0121401f }, /* HP out */ 6454 { } 6455 }, 6456 }, 6457 [ALC269_FIXUP_HP_MUTE_LED] = { 6458 .type = HDA_FIXUP_FUNC, 6459 .v.func = alc269_fixup_hp_mute_led, 6460 }, 6461 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = { 6462 .type = HDA_FIXUP_FUNC, 6463 .v.func = alc269_fixup_hp_mute_led_mic1, 6464 }, 6465 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = { 6466 .type = HDA_FIXUP_FUNC, 6467 .v.func = alc269_fixup_hp_mute_led_mic2, 6468 }, 6469 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { 6470 .type = HDA_FIXUP_FUNC, 6471 .v.func = alc269_fixup_hp_mute_led_mic3, 6472 .chained = true, 6473 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE 6474 }, 6475 [ALC269_FIXUP_HP_GPIO_LED] = { 6476 .type = HDA_FIXUP_FUNC, 6477 .v.func = alc269_fixup_hp_gpio_led, 6478 }, 6479 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = { 6480 .type = HDA_FIXUP_FUNC, 6481 .v.func = alc269_fixup_hp_gpio_mic1_led, 6482 }, 6483 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = { 6484 .type = HDA_FIXUP_FUNC, 6485 .v.func = alc269_fixup_hp_line1_mic1_led, 6486 }, 6487 [ALC269_FIXUP_INV_DMIC] = { 6488 .type = HDA_FIXUP_FUNC, 6489 .v.func = alc_fixup_inv_dmic, 6490 }, 6491 [ALC269_FIXUP_NO_SHUTUP] = { 6492 .type = HDA_FIXUP_FUNC, 6493 .v.func = alc_fixup_no_shutup, 6494 }, 6495 [ALC269_FIXUP_LENOVO_DOCK] = { 6496 .type = HDA_FIXUP_PINS, 6497 .v.pins = (const struct hda_pintbl[]) { 6498 { 0x19, 0x23a11040 }, /* dock mic */ 6499 { 0x1b, 0x2121103f }, /* dock headphone */ 6500 { } 6501 }, 6502 .chained = true, 6503 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT 6504 }, 6505 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { 6506 .type = HDA_FIXUP_FUNC, 6507 .v.func = alc269_fixup_limit_int_mic_boost, 6508 .chained = true, 6509 .chain_id = ALC269_FIXUP_LENOVO_DOCK, 6510 }, 6511 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { 6512 .type = HDA_FIXUP_FUNC, 6513 .v.func = alc269_fixup_pincfg_no_hp_to_lineout, 6514 .chained = true, 6515 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 6516 }, 6517 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = { 6518 .type = HDA_FIXUP_PINS, 6519 .v.pins = (const struct hda_pintbl[]) { 6520 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6521 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 6522 { } 6523 }, 6524 .chained = true, 6525 .chain_id = ALC269_FIXUP_HEADSET_MODE 6526 }, 6527 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = { 6528 .type = HDA_FIXUP_PINS, 6529 .v.pins = (const struct hda_pintbl[]) { 6530 { 0x16, 0x21014020 }, /* dock line out */ 6531 { 0x19, 0x21a19030 }, /* dock mic */ 6532 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6533 { } 6534 }, 6535 .chained = true, 6536 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 6537 }, 6538 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = { 6539 .type = HDA_FIXUP_PINS, 6540 .v.pins = (const struct hda_pintbl[]) { 6541 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6542 { } 6543 }, 6544 .chained = true, 6545 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 6546 }, 6547 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = { 6548 .type = HDA_FIXUP_PINS, 6549 .v.pins = (const struct hda_pintbl[]) { 6550 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6551 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 6552 { } 6553 }, 6554 .chained = true, 6555 .chain_id = ALC269_FIXUP_HEADSET_MODE 6556 }, 6557 [ALC269_FIXUP_HEADSET_MODE] = { 6558 .type = HDA_FIXUP_FUNC, 6559 .v.func = alc_fixup_headset_mode, 6560 .chained = true, 6561 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 6562 }, 6563 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = { 6564 .type = HDA_FIXUP_FUNC, 6565 .v.func = alc_fixup_headset_mode_no_hp_mic, 6566 }, 6567 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = { 6568 .type = HDA_FIXUP_PINS, 6569 .v.pins = (const struct hda_pintbl[]) { 6570 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */ 6571 { } 6572 }, 6573 .chained = true, 6574 .chain_id = ALC269_FIXUP_HEADSET_MODE, 6575 }, 6576 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = { 6577 .type = HDA_FIXUP_PINS, 6578 .v.pins = (const struct hda_pintbl[]) { 6579 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6580 { } 6581 }, 6582 .chained = true, 6583 .chain_id = ALC269_FIXUP_HEADSET_MIC 6584 }, 6585 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = { 6586 .type = HDA_FIXUP_PINS, 6587 .v.pins = (const struct hda_pintbl[]) { 6588 {0x12, 0x90a60130}, 6589 {0x13, 0x40000000}, 6590 {0x14, 0x90170110}, 6591 {0x18, 0x411111f0}, 6592 {0x19, 0x04a11040}, 6593 {0x1a, 0x411111f0}, 6594 {0x1b, 0x90170112}, 6595 {0x1d, 0x40759a05}, 6596 {0x1e, 0x411111f0}, 6597 {0x21, 0x04211020}, 6598 { } 6599 }, 6600 .chained = true, 6601 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 6602 }, 6603 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = { 6604 .type = HDA_FIXUP_FUNC, 6605 .v.func = alc298_fixup_huawei_mbx_stereo, 6606 .chained = true, 6607 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 6608 }, 6609 [ALC269_FIXUP_ASUS_X101_FUNC] = { 6610 .type = HDA_FIXUP_FUNC, 6611 .v.func = alc269_fixup_x101_headset_mic, 6612 }, 6613 [ALC269_FIXUP_ASUS_X101_VERB] = { 6614 .type = HDA_FIXUP_VERBS, 6615 .v.verbs = (const struct hda_verb[]) { 6616 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, 6617 {0x20, AC_VERB_SET_COEF_INDEX, 0x08}, 6618 {0x20, AC_VERB_SET_PROC_COEF, 0x0310}, 6619 { } 6620 }, 6621 .chained = true, 6622 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC 6623 }, 6624 [ALC269_FIXUP_ASUS_X101] = { 6625 .type = HDA_FIXUP_PINS, 6626 .v.pins = (const struct hda_pintbl[]) { 6627 { 0x18, 0x04a1182c }, /* Headset mic */ 6628 { } 6629 }, 6630 .chained = true, 6631 .chain_id = ALC269_FIXUP_ASUS_X101_VERB 6632 }, 6633 [ALC271_FIXUP_AMIC_MIC2] = { 6634 .type = HDA_FIXUP_PINS, 6635 .v.pins = (const struct hda_pintbl[]) { 6636 { 0x14, 0x99130110 }, /* speaker */ 6637 { 0x19, 0x01a19c20 }, /* mic */ 6638 { 0x1b, 0x99a7012f }, /* int-mic */ 6639 { 0x21, 0x0121401f }, /* HP out */ 6640 { } 6641 }, 6642 }, 6643 [ALC271_FIXUP_HP_GATE_MIC_JACK] = { 6644 .type = HDA_FIXUP_FUNC, 6645 .v.func = alc271_hp_gate_mic_jack, 6646 .chained = true, 6647 .chain_id = ALC271_FIXUP_AMIC_MIC2, 6648 }, 6649 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = { 6650 .type = HDA_FIXUP_FUNC, 6651 .v.func = alc269_fixup_limit_int_mic_boost, 6652 .chained = true, 6653 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK, 6654 }, 6655 [ALC269_FIXUP_ACER_AC700] = { 6656 .type = HDA_FIXUP_PINS, 6657 .v.pins = (const struct hda_pintbl[]) { 6658 { 0x12, 0x99a3092f }, /* int-mic */ 6659 { 0x14, 0x99130110 }, /* speaker */ 6660 { 0x18, 0x03a11c20 }, /* mic */ 6661 { 0x1e, 0x0346101e }, /* SPDIF1 */ 6662 { 0x21, 0x0321101f }, /* HP out */ 6663 { } 6664 }, 6665 .chained = true, 6666 .chain_id = ALC271_FIXUP_DMIC, 6667 }, 6668 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { 6669 .type = HDA_FIXUP_FUNC, 6670 .v.func = alc269_fixup_limit_int_mic_boost, 6671 .chained = true, 6672 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 6673 }, 6674 [ALC269VB_FIXUP_ASUS_ZENBOOK] = { 6675 .type = HDA_FIXUP_FUNC, 6676 .v.func = alc269_fixup_limit_int_mic_boost, 6677 .chained = true, 6678 .chain_id = ALC269VB_FIXUP_DMIC, 6679 }, 6680 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = { 6681 .type = HDA_FIXUP_VERBS, 6682 .v.verbs = (const struct hda_verb[]) { 6683 /* class-D output amp +5dB */ 6684 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 }, 6685 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 }, 6686 {} 6687 }, 6688 .chained = true, 6689 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK, 6690 }, 6691 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { 6692 .type = HDA_FIXUP_FUNC, 6693 .v.func = alc269_fixup_limit_int_mic_boost, 6694 .chained = true, 6695 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1, 6696 }, 6697 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = { 6698 .type = HDA_FIXUP_PINS, 6699 .v.pins = (const struct hda_pintbl[]) { 6700 { 0x12, 0x99a3092f }, /* int-mic */ 6701 { 0x18, 0x03a11d20 }, /* mic */ 6702 { 0x19, 0x411111f0 }, /* Unused bogus pin */ 6703 { } 6704 }, 6705 }, 6706 [ALC283_FIXUP_CHROME_BOOK] = { 6707 .type = HDA_FIXUP_FUNC, 6708 .v.func = alc283_fixup_chromebook, 6709 }, 6710 [ALC283_FIXUP_SENSE_COMBO_JACK] = { 6711 .type = HDA_FIXUP_FUNC, 6712 .v.func = alc283_fixup_sense_combo_jack, 6713 .chained = true, 6714 .chain_id = ALC283_FIXUP_CHROME_BOOK, 6715 }, 6716 [ALC282_FIXUP_ASUS_TX300] = { 6717 .type = HDA_FIXUP_FUNC, 6718 .v.func = alc282_fixup_asus_tx300, 6719 }, 6720 [ALC283_FIXUP_INT_MIC] = { 6721 .type = HDA_FIXUP_VERBS, 6722 .v.verbs = (const struct hda_verb[]) { 6723 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, 6724 {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, 6725 { } 6726 }, 6727 .chained = true, 6728 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 6729 }, 6730 [ALC290_FIXUP_SUBWOOFER_HSJACK] = { 6731 .type = HDA_FIXUP_PINS, 6732 .v.pins = (const struct hda_pintbl[]) { 6733 { 0x17, 0x90170112 }, /* subwoofer */ 6734 { } 6735 }, 6736 .chained = true, 6737 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, 6738 }, 6739 [ALC290_FIXUP_SUBWOOFER] = { 6740 .type = HDA_FIXUP_PINS, 6741 .v.pins = (const struct hda_pintbl[]) { 6742 { 0x17, 0x90170112 }, /* subwoofer */ 6743 { } 6744 }, 6745 .chained = true, 6746 .chain_id = ALC290_FIXUP_MONO_SPEAKERS, 6747 }, 6748 [ALC290_FIXUP_MONO_SPEAKERS] = { 6749 .type = HDA_FIXUP_FUNC, 6750 .v.func = alc290_fixup_mono_speakers, 6751 }, 6752 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = { 6753 .type = HDA_FIXUP_FUNC, 6754 .v.func = alc290_fixup_mono_speakers, 6755 .chained = true, 6756 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 6757 }, 6758 [ALC269_FIXUP_THINKPAD_ACPI] = { 6759 .type = HDA_FIXUP_FUNC, 6760 .v.func = alc_fixup_thinkpad_acpi, 6761 .chained = true, 6762 .chain_id = ALC269_FIXUP_SKU_IGNORE, 6763 }, 6764 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = { 6765 .type = HDA_FIXUP_FUNC, 6766 .v.func = alc_fixup_inv_dmic, 6767 .chained = true, 6768 .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 6769 }, 6770 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = { 6771 .type = HDA_FIXUP_PINS, 6772 .v.pins = (const struct hda_pintbl[]) { 6773 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6774 { } 6775 }, 6776 .chained = true, 6777 .chain_id = ALC255_FIXUP_HEADSET_MODE 6778 }, 6779 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = { 6780 .type = HDA_FIXUP_PINS, 6781 .v.pins = (const struct hda_pintbl[]) { 6782 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6783 { } 6784 }, 6785 .chained = true, 6786 .chain_id = ALC255_FIXUP_HEADSET_MODE 6787 }, 6788 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { 6789 .type = HDA_FIXUP_PINS, 6790 .v.pins = (const struct hda_pintbl[]) { 6791 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6792 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 6793 { } 6794 }, 6795 .chained = true, 6796 .chain_id = ALC255_FIXUP_HEADSET_MODE 6797 }, 6798 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = { 6799 .type = HDA_FIXUP_PINS, 6800 .v.pins = (const struct hda_pintbl[]) { 6801 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6802 { } 6803 }, 6804 .chained = true, 6805 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC 6806 }, 6807 [ALC255_FIXUP_HEADSET_MODE] = { 6808 .type = HDA_FIXUP_FUNC, 6809 .v.func = alc_fixup_headset_mode_alc255, 6810 .chained = true, 6811 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 6812 }, 6813 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = { 6814 .type = HDA_FIXUP_FUNC, 6815 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic, 6816 }, 6817 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = { 6818 .type = HDA_FIXUP_PINS, 6819 .v.pins = (const struct hda_pintbl[]) { 6820 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 6821 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6822 { } 6823 }, 6824 .chained = true, 6825 .chain_id = ALC269_FIXUP_HEADSET_MODE 6826 }, 6827 [ALC292_FIXUP_TPT440_DOCK] = { 6828 .type = HDA_FIXUP_FUNC, 6829 .v.func = alc_fixup_tpt440_dock, 6830 .chained = true, 6831 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 6832 }, 6833 [ALC292_FIXUP_TPT440] = { 6834 .type = HDA_FIXUP_FUNC, 6835 .v.func = alc_fixup_disable_aamix, 6836 .chained = true, 6837 .chain_id = ALC292_FIXUP_TPT440_DOCK, 6838 }, 6839 [ALC283_FIXUP_HEADSET_MIC] = { 6840 .type = HDA_FIXUP_PINS, 6841 .v.pins = (const struct hda_pintbl[]) { 6842 { 0x19, 0x04a110f0 }, 6843 { }, 6844 }, 6845 }, 6846 [ALC255_FIXUP_MIC_MUTE_LED] = { 6847 .type = HDA_FIXUP_FUNC, 6848 .v.func = alc_fixup_micmute_led, 6849 }, 6850 [ALC282_FIXUP_ASPIRE_V5_PINS] = { 6851 .type = HDA_FIXUP_PINS, 6852 .v.pins = (const struct hda_pintbl[]) { 6853 { 0x12, 0x90a60130 }, 6854 { 0x14, 0x90170110 }, 6855 { 0x17, 0x40000008 }, 6856 { 0x18, 0x411111f0 }, 6857 { 0x19, 0x01a1913c }, 6858 { 0x1a, 0x411111f0 }, 6859 { 0x1b, 0x411111f0 }, 6860 { 0x1d, 0x40f89b2d }, 6861 { 0x1e, 0x411111f0 }, 6862 { 0x21, 0x0321101f }, 6863 { }, 6864 }, 6865 }, 6866 [ALC280_FIXUP_HP_GPIO4] = { 6867 .type = HDA_FIXUP_FUNC, 6868 .v.func = alc280_fixup_hp_gpio4, 6869 }, 6870 [ALC286_FIXUP_HP_GPIO_LED] = { 6871 .type = HDA_FIXUP_FUNC, 6872 .v.func = alc286_fixup_hp_gpio_led, 6873 }, 6874 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = { 6875 .type = HDA_FIXUP_FUNC, 6876 .v.func = alc280_fixup_hp_gpio2_mic_hotkey, 6877 }, 6878 [ALC280_FIXUP_HP_DOCK_PINS] = { 6879 .type = HDA_FIXUP_PINS, 6880 .v.pins = (const struct hda_pintbl[]) { 6881 { 0x1b, 0x21011020 }, /* line-out */ 6882 { 0x1a, 0x01a1903c }, /* headset mic */ 6883 { 0x18, 0x2181103f }, /* line-in */ 6884 { }, 6885 }, 6886 .chained = true, 6887 .chain_id = ALC280_FIXUP_HP_GPIO4 6888 }, 6889 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { 6890 .type = HDA_FIXUP_PINS, 6891 .v.pins = (const struct hda_pintbl[]) { 6892 { 0x1b, 0x21011020 }, /* line-out */ 6893 { 0x18, 0x2181103f }, /* line-in */ 6894 { }, 6895 }, 6896 .chained = true, 6897 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED 6898 }, 6899 [ALC280_FIXUP_HP_9480M] = { 6900 .type = HDA_FIXUP_FUNC, 6901 .v.func = alc280_fixup_hp_9480m, 6902 }, 6903 [ALC288_FIXUP_DELL_HEADSET_MODE] = { 6904 .type = HDA_FIXUP_FUNC, 6905 .v.func = alc_fixup_headset_mode_dell_alc288, 6906 .chained = true, 6907 .chain_id = ALC255_FIXUP_MIC_MUTE_LED 6908 }, 6909 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = { 6910 .type = HDA_FIXUP_PINS, 6911 .v.pins = (const struct hda_pintbl[]) { 6912 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6913 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 6914 { } 6915 }, 6916 .chained = true, 6917 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE 6918 }, 6919 [ALC288_FIXUP_DISABLE_AAMIX] = { 6920 .type = HDA_FIXUP_FUNC, 6921 .v.func = alc_fixup_disable_aamix, 6922 .chained = true, 6923 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE 6924 }, 6925 [ALC288_FIXUP_DELL_XPS_13] = { 6926 .type = HDA_FIXUP_FUNC, 6927 .v.func = alc_fixup_dell_xps13, 6928 .chained = true, 6929 .chain_id = ALC288_FIXUP_DISABLE_AAMIX 6930 }, 6931 [ALC292_FIXUP_DISABLE_AAMIX] = { 6932 .type = HDA_FIXUP_FUNC, 6933 .v.func = alc_fixup_disable_aamix, 6934 .chained = true, 6935 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE 6936 }, 6937 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = { 6938 .type = HDA_FIXUP_FUNC, 6939 .v.func = alc_fixup_disable_aamix, 6940 .chained = true, 6941 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE 6942 }, 6943 [ALC292_FIXUP_DELL_E7X_AAMIX] = { 6944 .type = HDA_FIXUP_FUNC, 6945 .v.func = alc_fixup_dell_xps13, 6946 .chained = true, 6947 .chain_id = ALC292_FIXUP_DISABLE_AAMIX 6948 }, 6949 [ALC292_FIXUP_DELL_E7X] = { 6950 .type = HDA_FIXUP_FUNC, 6951 .v.func = alc_fixup_micmute_led, 6952 /* micmute fixup must be applied at last */ 6953 .chained_before = true, 6954 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, 6955 }, 6956 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { 6957 .type = HDA_FIXUP_PINS, 6958 .v.pins = (const struct hda_pintbl[]) { 6959 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */ 6960 { } 6961 }, 6962 .chained_before = true, 6963 .chain_id = ALC269_FIXUP_HEADSET_MODE, 6964 }, 6965 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = { 6966 .type = HDA_FIXUP_PINS, 6967 .v.pins = (const struct hda_pintbl[]) { 6968 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6969 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 6970 { } 6971 }, 6972 .chained = true, 6973 .chain_id = ALC269_FIXUP_HEADSET_MODE 6974 }, 6975 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { 6976 .type = HDA_FIXUP_PINS, 6977 .v.pins = (const struct hda_pintbl[]) { 6978 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 6979 { } 6980 }, 6981 .chained = true, 6982 .chain_id = ALC269_FIXUP_HEADSET_MODE 6983 }, 6984 [ALC275_FIXUP_DELL_XPS] = { 6985 .type = HDA_FIXUP_VERBS, 6986 .v.verbs = (const struct hda_verb[]) { 6987 /* Enables internal speaker */ 6988 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f}, 6989 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0}, 6990 {0x20, AC_VERB_SET_COEF_INDEX, 0x30}, 6991 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1}, 6992 {} 6993 } 6994 }, 6995 [ALC293_FIXUP_LENOVO_SPK_NOISE] = { 6996 .type = HDA_FIXUP_FUNC, 6997 .v.func = alc_fixup_disable_aamix, 6998 .chained = true, 6999 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 7000 }, 7001 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = { 7002 .type = HDA_FIXUP_FUNC, 7003 .v.func = alc233_fixup_lenovo_line2_mic_hotkey, 7004 }, 7005 [ALC255_FIXUP_DELL_SPK_NOISE] = { 7006 .type = HDA_FIXUP_FUNC, 7007 .v.func = alc_fixup_disable_aamix, 7008 .chained = true, 7009 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 7010 }, 7011 [ALC225_FIXUP_DISABLE_MIC_VREF] = { 7012 .type = HDA_FIXUP_FUNC, 7013 .v.func = alc_fixup_disable_mic_vref, 7014 .chained = true, 7015 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE 7016 }, 7017 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = { 7018 .type = HDA_FIXUP_VERBS, 7019 .v.verbs = (const struct hda_verb[]) { 7020 /* Disable pass-through path for FRONT 14h */ 7021 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, 7022 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, 7023 {} 7024 }, 7025 .chained = true, 7026 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF 7027 }, 7028 [ALC280_FIXUP_HP_HEADSET_MIC] = { 7029 .type = HDA_FIXUP_FUNC, 7030 .v.func = alc_fixup_disable_aamix, 7031 .chained = true, 7032 .chain_id = ALC269_FIXUP_HEADSET_MIC, 7033 }, 7034 [ALC221_FIXUP_HP_FRONT_MIC] = { 7035 .type = HDA_FIXUP_PINS, 7036 .v.pins = (const struct hda_pintbl[]) { 7037 { 0x19, 0x02a19020 }, /* Front Mic */ 7038 { } 7039 }, 7040 }, 7041 [ALC292_FIXUP_TPT460] = { 7042 .type = HDA_FIXUP_FUNC, 7043 .v.func = alc_fixup_tpt440_dock, 7044 .chained = true, 7045 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, 7046 }, 7047 [ALC298_FIXUP_SPK_VOLUME] = { 7048 .type = HDA_FIXUP_FUNC, 7049 .v.func = alc298_fixup_speaker_volume, 7050 .chained = true, 7051 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, 7052 }, 7053 [ALC295_FIXUP_DISABLE_DAC3] = { 7054 .type = HDA_FIXUP_FUNC, 7055 .v.func = alc295_fixup_disable_dac3, 7056 }, 7057 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = { 7058 .type = HDA_FIXUP_FUNC, 7059 .v.func = alc285_fixup_speaker2_to_dac1, 7060 .chained = true, 7061 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 7062 }, 7063 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { 7064 .type = HDA_FIXUP_PINS, 7065 .v.pins = (const struct hda_pintbl[]) { 7066 { 0x1b, 0x90170151 }, 7067 { } 7068 }, 7069 .chained = true, 7070 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 7071 }, 7072 [ALC269_FIXUP_ATIV_BOOK_8] = { 7073 .type = HDA_FIXUP_FUNC, 7074 .v.func = alc_fixup_auto_mute_via_amp, 7075 .chained = true, 7076 .chain_id = ALC269_FIXUP_NO_SHUTUP 7077 }, 7078 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { 7079 .type = HDA_FIXUP_PINS, 7080 .v.pins = (const struct hda_pintbl[]) { 7081 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7082 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ 7083 { } 7084 }, 7085 .chained = true, 7086 .chain_id = ALC269_FIXUP_HEADSET_MODE 7087 }, 7088 [ALC256_FIXUP_ASUS_HEADSET_MODE] = { 7089 .type = HDA_FIXUP_FUNC, 7090 .v.func = alc_fixup_headset_mode, 7091 }, 7092 [ALC256_FIXUP_ASUS_MIC] = { 7093 .type = HDA_FIXUP_PINS, 7094 .v.pins = (const struct hda_pintbl[]) { 7095 { 0x13, 0x90a60160 }, /* use as internal mic */ 7096 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 7097 { } 7098 }, 7099 .chained = true, 7100 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 7101 }, 7102 [ALC256_FIXUP_ASUS_AIO_GPIO2] = { 7103 .type = HDA_FIXUP_FUNC, 7104 /* Set up GPIO2 for the speaker amp */ 7105 .v.func = alc_fixup_gpio4, 7106 }, 7107 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = { 7108 .type = HDA_FIXUP_PINS, 7109 .v.pins = (const struct hda_pintbl[]) { 7110 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7111 { } 7112 }, 7113 .chained = true, 7114 .chain_id = ALC269_FIXUP_HEADSET_MIC 7115 }, 7116 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = { 7117 .type = HDA_FIXUP_VERBS, 7118 .v.verbs = (const struct hda_verb[]) { 7119 /* Enables internal speaker */ 7120 {0x20, AC_VERB_SET_COEF_INDEX, 0x40}, 7121 {0x20, AC_VERB_SET_PROC_COEF, 0x8800}, 7122 {} 7123 }, 7124 .chained = true, 7125 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE 7126 }, 7127 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { 7128 .type = HDA_FIXUP_FUNC, 7129 .v.func = alc233_alc662_fixup_lenovo_dual_codecs, 7130 .chained = true, 7131 .chain_id = ALC269_FIXUP_GPIO2 7132 }, 7133 [ALC233_FIXUP_ACER_HEADSET_MIC] = { 7134 .type = HDA_FIXUP_VERBS, 7135 .v.verbs = (const struct hda_verb[]) { 7136 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 7137 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 7138 { } 7139 }, 7140 .chained = true, 7141 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE 7142 }, 7143 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { 7144 .type = HDA_FIXUP_PINS, 7145 .v.pins = (const struct hda_pintbl[]) { 7146 /* Change the mic location from front to right, otherwise there are 7147 two front mics with the same name, pulseaudio can't handle them. 7148 This is just a temporary workaround, after applying this fixup, 7149 there will be one "Front Mic" and one "Mic" in this machine. 7150 */ 7151 { 0x1a, 0x04a19040 }, 7152 { } 7153 }, 7154 }, 7155 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { 7156 .type = HDA_FIXUP_PINS, 7157 .v.pins = (const struct hda_pintbl[]) { 7158 { 0x16, 0x0101102f }, /* Rear Headset HP */ 7159 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */ 7160 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */ 7161 { 0x1b, 0x02011020 }, 7162 { } 7163 }, 7164 .chained = true, 7165 .chain_id = ALC225_FIXUP_S3_POP_NOISE 7166 }, 7167 [ALC225_FIXUP_S3_POP_NOISE] = { 7168 .type = HDA_FIXUP_FUNC, 7169 .v.func = alc225_fixup_s3_pop_noise, 7170 .chained = true, 7171 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 7172 }, 7173 [ALC700_FIXUP_INTEL_REFERENCE] = { 7174 .type = HDA_FIXUP_VERBS, 7175 .v.verbs = (const struct hda_verb[]) { 7176 /* Enables internal speaker */ 7177 {0x20, AC_VERB_SET_COEF_INDEX, 0x45}, 7178 {0x20, AC_VERB_SET_PROC_COEF, 0x5289}, 7179 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A}, 7180 {0x20, AC_VERB_SET_PROC_COEF, 0x001b}, 7181 {0x58, AC_VERB_SET_COEF_INDEX, 0x00}, 7182 {0x58, AC_VERB_SET_PROC_COEF, 0x3888}, 7183 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f}, 7184 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b}, 7185 {} 7186 } 7187 }, 7188 [ALC274_FIXUP_DELL_BIND_DACS] = { 7189 .type = HDA_FIXUP_FUNC, 7190 .v.func = alc274_fixup_bind_dacs, 7191 .chained = true, 7192 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE 7193 }, 7194 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { 7195 .type = HDA_FIXUP_PINS, 7196 .v.pins = (const struct hda_pintbl[]) { 7197 { 0x1b, 0x0401102f }, 7198 { } 7199 }, 7200 .chained = true, 7201 .chain_id = ALC274_FIXUP_DELL_BIND_DACS 7202 }, 7203 [ALC298_FIXUP_TPT470_DOCK_FIX] = { 7204 .type = HDA_FIXUP_FUNC, 7205 .v.func = alc_fixup_tpt470_dock, 7206 .chained = true, 7207 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE 7208 }, 7209 [ALC298_FIXUP_TPT470_DOCK] = { 7210 .type = HDA_FIXUP_FUNC, 7211 .v.func = alc_fixup_tpt470_dacs, 7212 .chained = true, 7213 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX 7214 }, 7215 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = { 7216 .type = HDA_FIXUP_PINS, 7217 .v.pins = (const struct hda_pintbl[]) { 7218 { 0x14, 0x0201101f }, 7219 { } 7220 }, 7221 .chained = true, 7222 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE 7223 }, 7224 [ALC255_FIXUP_DELL_HEADSET_MIC] = { 7225 .type = HDA_FIXUP_PINS, 7226 .v.pins = (const struct hda_pintbl[]) { 7227 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7228 { } 7229 }, 7230 .chained = true, 7231 .chain_id = ALC269_FIXUP_HEADSET_MIC 7232 }, 7233 [ALC295_FIXUP_HP_X360] = { 7234 .type = HDA_FIXUP_FUNC, 7235 .v.func = alc295_fixup_hp_top_speakers, 7236 .chained = true, 7237 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 7238 }, 7239 [ALC221_FIXUP_HP_HEADSET_MIC] = { 7240 .type = HDA_FIXUP_PINS, 7241 .v.pins = (const struct hda_pintbl[]) { 7242 { 0x19, 0x0181313f}, 7243 { } 7244 }, 7245 .chained = true, 7246 .chain_id = ALC269_FIXUP_HEADSET_MIC 7247 }, 7248 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = { 7249 .type = HDA_FIXUP_FUNC, 7250 .v.func = alc285_fixup_invalidate_dacs, 7251 .chained = true, 7252 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 7253 }, 7254 [ALC295_FIXUP_HP_AUTO_MUTE] = { 7255 .type = HDA_FIXUP_FUNC, 7256 .v.func = alc_fixup_auto_mute_via_amp, 7257 }, 7258 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = { 7259 .type = HDA_FIXUP_PINS, 7260 .v.pins = (const struct hda_pintbl[]) { 7261 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7262 { } 7263 }, 7264 .chained = true, 7265 .chain_id = ALC269_FIXUP_HEADSET_MIC 7266 }, 7267 [ALC294_FIXUP_ASUS_MIC] = { 7268 .type = HDA_FIXUP_PINS, 7269 .v.pins = (const struct hda_pintbl[]) { 7270 { 0x13, 0x90a60160 }, /* use as internal mic */ 7271 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 7272 { } 7273 }, 7274 .chained = true, 7275 .chain_id = ALC269_FIXUP_HEADSET_MIC 7276 }, 7277 [ALC294_FIXUP_ASUS_HEADSET_MIC] = { 7278 .type = HDA_FIXUP_PINS, 7279 .v.pins = (const struct hda_pintbl[]) { 7280 { 0x19, 0x01a1103c }, /* use as headset mic */ 7281 { } 7282 }, 7283 .chained = true, 7284 .chain_id = ALC269_FIXUP_HEADSET_MIC 7285 }, 7286 [ALC294_FIXUP_ASUS_SPK] = { 7287 .type = HDA_FIXUP_VERBS, 7288 .v.verbs = (const struct hda_verb[]) { 7289 /* Set EAPD high */ 7290 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, 7291 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, 7292 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 7293 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, 7294 { } 7295 }, 7296 .chained = true, 7297 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 7298 }, 7299 [ALC295_FIXUP_CHROME_BOOK] = { 7300 .type = HDA_FIXUP_FUNC, 7301 .v.func = alc295_fixup_chromebook, 7302 .chained = true, 7303 .chain_id = ALC225_FIXUP_HEADSET_JACK 7304 }, 7305 [ALC225_FIXUP_HEADSET_JACK] = { 7306 .type = HDA_FIXUP_FUNC, 7307 .v.func = alc_fixup_headset_jack, 7308 }, 7309 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { 7310 .type = HDA_FIXUP_PINS, 7311 .v.pins = (const struct hda_pintbl[]) { 7312 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7313 { } 7314 }, 7315 .chained = true, 7316 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 7317 }, 7318 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = { 7319 .type = HDA_FIXUP_VERBS, 7320 .v.verbs = (const struct hda_verb[]) { 7321 /* Disable PCBEEP-IN passthrough */ 7322 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 }, 7323 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 }, 7324 { } 7325 }, 7326 .chained = true, 7327 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE 7328 }, 7329 [ALC255_FIXUP_ACER_HEADSET_MIC] = { 7330 .type = HDA_FIXUP_PINS, 7331 .v.pins = (const struct hda_pintbl[]) { 7332 { 0x19, 0x03a11130 }, 7333 { 0x1a, 0x90a60140 }, /* use as internal mic */ 7334 { } 7335 }, 7336 .chained = true, 7337 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC 7338 }, 7339 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { 7340 .type = HDA_FIXUP_PINS, 7341 .v.pins = (const struct hda_pintbl[]) { 7342 { 0x16, 0x01011020 }, /* Rear Line out */ 7343 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ 7344 { } 7345 }, 7346 .chained = true, 7347 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE 7348 }, 7349 [ALC225_FIXUP_WYSE_AUTO_MUTE] = { 7350 .type = HDA_FIXUP_FUNC, 7351 .v.func = alc_fixup_auto_mute_via_amp, 7352 .chained = true, 7353 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF 7354 }, 7355 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { 7356 .type = HDA_FIXUP_FUNC, 7357 .v.func = alc_fixup_disable_mic_vref, 7358 .chained = true, 7359 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 7360 }, 7361 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = { 7362 .type = HDA_FIXUP_VERBS, 7363 .v.verbs = (const struct hda_verb[]) { 7364 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f }, 7365 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 }, 7366 { } 7367 }, 7368 .chained = true, 7369 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE 7370 }, 7371 [ALC256_FIXUP_ASUS_HEADSET_MIC] = { 7372 .type = HDA_FIXUP_PINS, 7373 .v.pins = (const struct hda_pintbl[]) { 7374 { 0x19, 0x03a11020 }, /* headset mic with jack detect */ 7375 { } 7376 }, 7377 .chained = true, 7378 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 7379 }, 7380 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = { 7381 .type = HDA_FIXUP_PINS, 7382 .v.pins = (const struct hda_pintbl[]) { 7383 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */ 7384 { } 7385 }, 7386 .chained = true, 7387 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 7388 }, 7389 [ALC299_FIXUP_PREDATOR_SPK] = { 7390 .type = HDA_FIXUP_PINS, 7391 .v.pins = (const struct hda_pintbl[]) { 7392 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */ 7393 { } 7394 } 7395 }, 7396 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = { 7397 .type = HDA_FIXUP_PINS, 7398 .v.pins = (const struct hda_pintbl[]) { 7399 { 0x19, 0x04a11040 }, 7400 { 0x21, 0x04211020 }, 7401 { } 7402 }, 7403 .chained = true, 7404 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 7405 }, 7406 [ALC289_FIXUP_DELL_SPK2] = { 7407 .type = HDA_FIXUP_PINS, 7408 .v.pins = (const struct hda_pintbl[]) { 7409 { 0x17, 0x90170130 }, /* bass spk */ 7410 { } 7411 }, 7412 .chained = true, 7413 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE 7414 }, 7415 [ALC289_FIXUP_DUAL_SPK] = { 7416 .type = HDA_FIXUP_FUNC, 7417 .v.func = alc285_fixup_speaker2_to_dac1, 7418 .chained = true, 7419 .chain_id = ALC289_FIXUP_DELL_SPK2 7420 }, 7421 [ALC294_FIXUP_SPK2_TO_DAC1] = { 7422 .type = HDA_FIXUP_FUNC, 7423 .v.func = alc285_fixup_speaker2_to_dac1, 7424 .chained = true, 7425 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 7426 }, 7427 [ALC294_FIXUP_ASUS_DUAL_SPK] = { 7428 .type = HDA_FIXUP_FUNC, 7429 /* The GPIO must be pulled to initialize the AMP */ 7430 .v.func = alc_fixup_gpio4, 7431 .chained = true, 7432 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 7433 }, 7434 [ALC285_FIXUP_THINKPAD_X1_GEN7] = { 7435 .type = HDA_FIXUP_FUNC, 7436 .v.func = alc285_fixup_thinkpad_x1_gen7, 7437 .chained = true, 7438 .chain_id = ALC269_FIXUP_THINKPAD_ACPI 7439 }, 7440 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = { 7441 .type = HDA_FIXUP_FUNC, 7442 .v.func = alc_fixup_headset_jack, 7443 .chained = true, 7444 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7 7445 }, 7446 [ALC294_FIXUP_ASUS_HPE] = { 7447 .type = HDA_FIXUP_VERBS, 7448 .v.verbs = (const struct hda_verb[]) { 7449 /* Set EAPD high */ 7450 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 7451 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, 7452 { } 7453 }, 7454 .chained = true, 7455 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 7456 }, 7457 [ALC294_FIXUP_ASUS_GX502_PINS] = { 7458 .type = HDA_FIXUP_PINS, 7459 .v.pins = (const struct hda_pintbl[]) { 7460 { 0x19, 0x03a11050 }, /* front HP mic */ 7461 { 0x1a, 0x01a11830 }, /* rear external mic */ 7462 { 0x21, 0x03211020 }, /* front HP out */ 7463 { } 7464 }, 7465 .chained = true, 7466 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS 7467 }, 7468 [ALC294_FIXUP_ASUS_GX502_VERBS] = { 7469 .type = HDA_FIXUP_VERBS, 7470 .v.verbs = (const struct hda_verb[]) { 7471 /* set 0x15 to HP-OUT ctrl */ 7472 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 }, 7473 /* unmute the 0x15 amp */ 7474 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 }, 7475 { } 7476 }, 7477 .chained = true, 7478 .chain_id = ALC294_FIXUP_ASUS_GX502_HP 7479 }, 7480 [ALC294_FIXUP_ASUS_GX502_HP] = { 7481 .type = HDA_FIXUP_FUNC, 7482 .v.func = alc294_fixup_gx502_hp, 7483 }, 7484 [ALC294_FIXUP_ASUS_COEF_1B] = { 7485 .type = HDA_FIXUP_VERBS, 7486 .v.verbs = (const struct hda_verb[]) { 7487 /* Set bit 10 to correct noisy output after reboot from 7488 * Windows 10 (due to pop noise reduction?) 7489 */ 7490 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b }, 7491 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b }, 7492 { } 7493 }, 7494 }, 7495 [ALC285_FIXUP_HP_GPIO_LED] = { 7496 .type = HDA_FIXUP_FUNC, 7497 .v.func = alc285_fixup_hp_gpio_led, 7498 }, 7499 [ALC285_FIXUP_HP_MUTE_LED] = { 7500 .type = HDA_FIXUP_FUNC, 7501 .v.func = alc285_fixup_hp_mute_led, 7502 }, 7503 [ALC236_FIXUP_HP_MUTE_LED] = { 7504 .type = HDA_FIXUP_FUNC, 7505 .v.func = alc236_fixup_hp_mute_led, 7506 }, 7507 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { 7508 .type = HDA_FIXUP_VERBS, 7509 .v.verbs = (const struct hda_verb[]) { 7510 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 }, 7511 { } 7512 }, 7513 }, 7514 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = { 7515 .type = HDA_FIXUP_PINS, 7516 .v.pins = (const struct hda_pintbl[]) { 7517 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7518 { } 7519 }, 7520 .chained = true, 7521 .chain_id = ALC269_FIXUP_HEADSET_MODE 7522 }, 7523 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = { 7524 .type = HDA_FIXUP_PINS, 7525 .v.pins = (const struct hda_pintbl[]) { 7526 { 0x14, 0x90100120 }, /* use as internal speaker */ 7527 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */ 7528 { 0x1a, 0x01011020 }, /* use as line out */ 7529 { }, 7530 }, 7531 .chained = true, 7532 .chain_id = ALC269_FIXUP_HEADSET_MIC 7533 }, 7534 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = { 7535 .type = HDA_FIXUP_PINS, 7536 .v.pins = (const struct hda_pintbl[]) { 7537 { 0x18, 0x02a11030 }, /* use as headset mic */ 7538 { } 7539 }, 7540 .chained = true, 7541 .chain_id = ALC269_FIXUP_HEADSET_MIC 7542 }, 7543 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = { 7544 .type = HDA_FIXUP_PINS, 7545 .v.pins = (const struct hda_pintbl[]) { 7546 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */ 7547 { } 7548 }, 7549 .chained = true, 7550 .chain_id = ALC269_FIXUP_HEADSET_MIC 7551 }, 7552 [ALC289_FIXUP_ASUS_GA401] = { 7553 .type = HDA_FIXUP_PINS, 7554 .v.pins = (const struct hda_pintbl[]) { 7555 { 0x19, 0x03a11020 }, /* headset mic with jack detect */ 7556 { } 7557 }, 7558 }, 7559 [ALC289_FIXUP_ASUS_GA502] = { 7560 .type = HDA_FIXUP_PINS, 7561 .v.pins = (const struct hda_pintbl[]) { 7562 { 0x19, 0x03a11020 }, /* headset mic with jack detect */ 7563 { } 7564 }, 7565 }, 7566 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { 7567 .type = HDA_FIXUP_PINS, 7568 .v.pins = (const struct hda_pintbl[]) { 7569 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ 7570 { } 7571 }, 7572 .chained = true, 7573 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE 7574 }, 7575 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = { 7576 .type = HDA_FIXUP_FUNC, 7577 .v.func = alc285_fixup_hp_gpio_amp_init, 7578 .chained = true, 7579 .chain_id = ALC285_FIXUP_HP_GPIO_LED 7580 }, 7581 [ALC269_FIXUP_CZC_B20] = { 7582 .type = HDA_FIXUP_PINS, 7583 .v.pins = (const struct hda_pintbl[]) { 7584 { 0x12, 0x411111f0 }, 7585 { 0x14, 0x90170110 }, /* speaker */ 7586 { 0x15, 0x032f1020 }, /* HP out */ 7587 { 0x17, 0x411111f0 }, 7588 { 0x18, 0x03ab1040 }, /* mic */ 7589 { 0x19, 0xb7a7013f }, 7590 { 0x1a, 0x0181305f }, 7591 { 0x1b, 0x411111f0 }, 7592 { 0x1d, 0x411111f0 }, 7593 { 0x1e, 0x411111f0 }, 7594 { } 7595 }, 7596 .chain_id = ALC269_FIXUP_DMIC, 7597 }, 7598 [ALC269_FIXUP_CZC_TMI] = { 7599 .type = HDA_FIXUP_PINS, 7600 .v.pins = (const struct hda_pintbl[]) { 7601 { 0x12, 0x4000c000 }, 7602 { 0x14, 0x90170110 }, /* speaker */ 7603 { 0x15, 0x0421401f }, /* HP out */ 7604 { 0x17, 0x411111f0 }, 7605 { 0x18, 0x04a19020 }, /* mic */ 7606 { 0x19, 0x411111f0 }, 7607 { 0x1a, 0x411111f0 }, 7608 { 0x1b, 0x411111f0 }, 7609 { 0x1d, 0x40448505 }, 7610 { 0x1e, 0x411111f0 }, 7611 { 0x20, 0x8000ffff }, 7612 { } 7613 }, 7614 .chain_id = ALC269_FIXUP_DMIC, 7615 }, 7616 [ALC269_FIXUP_CZC_L101] = { 7617 .type = HDA_FIXUP_PINS, 7618 .v.pins = (const struct hda_pintbl[]) { 7619 { 0x12, 0x40000000 }, 7620 { 0x14, 0x01014010 }, /* speaker */ 7621 { 0x15, 0x411111f0 }, /* HP out */ 7622 { 0x16, 0x411111f0 }, 7623 { 0x18, 0x01a19020 }, /* mic */ 7624 { 0x19, 0x02a19021 }, 7625 { 0x1a, 0x0181302f }, 7626 { 0x1b, 0x0221401f }, 7627 { 0x1c, 0x411111f0 }, 7628 { 0x1d, 0x4044c601 }, 7629 { 0x1e, 0x411111f0 }, 7630 { } 7631 }, 7632 .chain_id = ALC269_FIXUP_DMIC, 7633 }, 7634 [ALC269_FIXUP_LEMOTE_A1802] = { 7635 .type = HDA_FIXUP_PINS, 7636 .v.pins = (const struct hda_pintbl[]) { 7637 { 0x12, 0x40000000 }, 7638 { 0x14, 0x90170110 }, /* speaker */ 7639 { 0x17, 0x411111f0 }, 7640 { 0x18, 0x03a19040 }, /* mic1 */ 7641 { 0x19, 0x90a70130 }, /* mic2 */ 7642 { 0x1a, 0x411111f0 }, 7643 { 0x1b, 0x411111f0 }, 7644 { 0x1d, 0x40489d2d }, 7645 { 0x1e, 0x411111f0 }, 7646 { 0x20, 0x0003ffff }, 7647 { 0x21, 0x03214020 }, 7648 { } 7649 }, 7650 .chain_id = ALC269_FIXUP_DMIC, 7651 }, 7652 [ALC269_FIXUP_LEMOTE_A190X] = { 7653 .type = HDA_FIXUP_PINS, 7654 .v.pins = (const struct hda_pintbl[]) { 7655 { 0x14, 0x99130110 }, /* speaker */ 7656 { 0x15, 0x0121401f }, /* HP out */ 7657 { 0x18, 0x01a19c20 }, /* rear mic */ 7658 { 0x19, 0x99a3092f }, /* front mic */ 7659 { 0x1b, 0x0201401f }, /* front lineout */ 7660 { } 7661 }, 7662 .chain_id = ALC269_FIXUP_DMIC, 7663 }, 7664 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = { 7665 .type = HDA_FIXUP_PINS, 7666 .v.pins = (const struct hda_pintbl[]) { 7667 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 7668 { } 7669 }, 7670 .chained = true, 7671 .chain_id = ALC269_FIXUP_HEADSET_MODE 7672 }, 7673 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = { 7674 .type = HDA_FIXUP_VERBS, 7675 .v.verbs = (const struct hda_verb[]) { 7676 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 7677 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 7678 { } 7679 }, 7680 .chained = true, 7681 .chain_id = ALC289_FIXUP_ASUS_GA401 7682 }, 7683 [ALC274_FIXUP_HP_MIC] = { 7684 .type = HDA_FIXUP_VERBS, 7685 .v.verbs = (const struct hda_verb[]) { 7686 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, 7687 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, 7688 { } 7689 }, 7690 }, 7691 [ALC274_FIXUP_HP_HEADSET_MIC] = { 7692 .type = HDA_FIXUP_FUNC, 7693 .v.func = alc274_fixup_hp_headset_mic, 7694 .chained = true, 7695 .chain_id = ALC274_FIXUP_HP_MIC 7696 }, 7697 [ALC256_FIXUP_ASUS_HPE] = { 7698 .type = HDA_FIXUP_VERBS, 7699 .v.verbs = (const struct hda_verb[]) { 7700 /* Set EAPD high */ 7701 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, 7702 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 }, 7703 { } 7704 }, 7705 .chained = true, 7706 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC 7707 }, 7708 }; 7709 7710 static const struct snd_pci_quirk alc269_fixup_tbl[] = { 7711 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC), 7712 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 7713 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 7714 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), 7715 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 7716 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 7717 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), 7718 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), 7719 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 7720 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 7721 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), 7722 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), 7723 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC), 7724 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), 7725 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 7726 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE), 7727 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK), 7728 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), 7729 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), 7730 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 7731 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 7732 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 7733 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), 7734 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), 7735 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), 7736 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 7737 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 7738 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), 7739 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), 7740 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), 7741 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X), 7742 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X), 7743 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER), 7744 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 7745 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 7746 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 7747 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), 7748 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK), 7749 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X), 7750 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X), 7751 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK), 7752 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7753 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7754 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), 7755 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 7756 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), 7757 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 7758 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7759 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7760 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 7761 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 7762 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 7763 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 7764 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 7765 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), 7766 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE), 7767 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP), 7768 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME), 7769 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME), 7770 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3), 7771 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER), 7772 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE), 7773 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 7774 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 7775 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), 7776 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), 7777 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), 7778 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), 7779 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), 7780 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), 7781 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK), 7782 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK), 7783 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 7784 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 7785 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7786 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 7787 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 7788 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), 7789 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), 7790 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), 7791 /* ALC282 */ 7792 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7793 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7794 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7795 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 7796 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 7797 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 7798 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 7799 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), 7800 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7801 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7802 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7803 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7804 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED), 7805 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS), 7806 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS), 7807 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7808 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7809 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7810 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7811 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7812 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M), 7813 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7814 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7815 /* ALC290 */ 7816 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7817 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7818 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7819 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7820 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7821 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7822 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7823 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7824 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7825 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), 7826 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7827 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7828 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7829 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7830 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7831 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7832 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 7833 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7834 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7835 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7836 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7837 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7838 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7839 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7840 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7841 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7842 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7843 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7844 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 7845 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), 7846 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 7847 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 7848 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 7849 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), 7850 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), 7851 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 7852 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 7853 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 7854 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 7855 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 7856 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), 7857 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), 7858 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT), 7859 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED), 7860 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED), 7861 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED), 7862 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 7863 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 7864 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7865 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), 7866 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 7867 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 7868 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7869 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 7870 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), 7871 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), 7872 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), 7873 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), 7874 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), 7875 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), 7876 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), 7877 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), 7878 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), 7879 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), 7880 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), 7881 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), 7882 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), 7883 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), 7884 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 7885 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), 7886 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), 7887 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), 7888 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 7889 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7890 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), 7891 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), 7892 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 7893 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), 7894 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), 7895 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), 7896 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), 7897 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), 7898 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 7899 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 7900 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), 7901 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 7902 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 7903 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), 7904 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 7905 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 7906 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX), 7907 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK), 7908 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT), 7909 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN), 7910 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), 7911 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), 7912 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), 7913 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), 7914 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 7915 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), 7916 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), 7917 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7918 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7919 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7920 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7921 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7922 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), 7923 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 7924 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 7925 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), 7926 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), 7927 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 7928 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 7929 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 7930 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), 7931 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC), 7932 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), 7933 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 7934 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), 7935 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), 7936 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), 7937 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), 7938 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), 7939 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), 7940 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), 7941 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), 7942 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), 7943 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), 7944 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), 7945 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440), 7946 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), 7947 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), 7948 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK), 7949 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), 7950 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), 7951 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7952 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), 7953 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), 7954 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), 7955 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7956 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7957 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460), 7958 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), 7959 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK), 7960 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7961 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7962 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460), 7963 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7964 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7965 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7966 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7967 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 7968 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK), 7969 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 7970 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 7971 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 7972 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 7973 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 7974 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 7975 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 7976 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 7977 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 7978 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 7979 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 7980 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), 7981 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 7982 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7983 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), 7984 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK), 7985 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7986 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), 7987 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), 7988 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), 7989 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), 7990 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), 7991 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460), 7992 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460), 7993 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460), 7994 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7995 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7996 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7997 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7998 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 7999 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 8000 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), 8001 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 8002 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), 8003 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), 8004 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), 8005 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), 8006 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ 8007 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 8008 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), 8009 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE), 8010 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), 8011 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), 8012 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), 8013 8014 #if 0 8015 /* Below is a quirk table taken from the old code. 8016 * Basically the device should work as is without the fixup table. 8017 * If BIOS doesn't give a proper info, enable the corresponding 8018 * fixup entry. 8019 */ 8020 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 8021 ALC269_FIXUP_AMIC), 8022 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC), 8023 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC), 8024 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC), 8025 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC), 8026 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC), 8027 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC), 8028 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC), 8029 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC), 8030 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC), 8031 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC), 8032 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC), 8033 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC), 8034 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC), 8035 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC), 8036 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC), 8037 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC), 8038 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC), 8039 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC), 8040 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC), 8041 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC), 8042 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC), 8043 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC), 8044 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC), 8045 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC), 8046 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC), 8047 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC), 8048 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC), 8049 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC), 8050 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC), 8051 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC), 8052 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC), 8053 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC), 8054 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC), 8055 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC), 8056 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC), 8057 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC), 8058 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC), 8059 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC), 8060 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC), 8061 #endif 8062 {} 8063 }; 8064 8065 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = { 8066 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC), 8067 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), 8068 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), 8069 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI), 8070 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED), 8071 {} 8072 }; 8073 8074 static const struct hda_model_fixup alc269_fixup_models[] = { 8075 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, 8076 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, 8077 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"}, 8078 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"}, 8079 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, 8080 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"}, 8081 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, 8082 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, 8083 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, 8084 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, 8085 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 8086 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, 8087 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 8088 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, 8089 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"}, 8090 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"}, 8091 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, 8092 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, 8093 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, 8094 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, 8095 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, 8096 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"}, 8097 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"}, 8098 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, 8099 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"}, 8100 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"}, 8101 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"}, 8102 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"}, 8103 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"}, 8104 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"}, 8105 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"}, 8106 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"}, 8107 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"}, 8108 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"}, 8109 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"}, 8110 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"}, 8111 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"}, 8112 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"}, 8113 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"}, 8114 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"}, 8115 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"}, 8116 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"}, 8117 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"}, 8118 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"}, 8119 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"}, 8120 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"}, 8121 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"}, 8122 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"}, 8123 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"}, 8124 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"}, 8125 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"}, 8126 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"}, 8127 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"}, 8128 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"}, 8129 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"}, 8130 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"}, 8131 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"}, 8132 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"}, 8133 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"}, 8134 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"}, 8135 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"}, 8136 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"}, 8137 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"}, 8138 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"}, 8139 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"}, 8140 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"}, 8141 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"}, 8142 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"}, 8143 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 8144 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"}, 8145 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"}, 8146 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"}, 8147 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"}, 8148 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"}, 8149 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"}, 8150 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"}, 8151 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"}, 8152 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"}, 8153 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"}, 8154 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"}, 8155 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"}, 8156 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"}, 8157 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"}, 8158 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"}, 8159 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"}, 8160 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"}, 8161 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"}, 8162 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"}, 8163 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"}, 8164 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"}, 8165 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"}, 8166 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"}, 8167 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"}, 8168 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"}, 8169 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"}, 8170 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"}, 8171 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"}, 8172 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"}, 8173 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"}, 8174 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"}, 8175 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"}, 8176 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, 8177 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, 8178 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, 8179 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, 8180 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, 8181 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, 8182 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, 8183 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, 8184 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"}, 8185 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, 8186 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"}, 8187 {} 8188 }; 8189 #define ALC225_STANDARD_PINS \ 8190 {0x21, 0x04211020} 8191 8192 #define ALC256_STANDARD_PINS \ 8193 {0x12, 0x90a60140}, \ 8194 {0x14, 0x90170110}, \ 8195 {0x21, 0x02211020} 8196 8197 #define ALC282_STANDARD_PINS \ 8198 {0x14, 0x90170110} 8199 8200 #define ALC290_STANDARD_PINS \ 8201 {0x12, 0x99a30130} 8202 8203 #define ALC292_STANDARD_PINS \ 8204 {0x14, 0x90170110}, \ 8205 {0x15, 0x0221401f} 8206 8207 #define ALC295_STANDARD_PINS \ 8208 {0x12, 0xb7a60130}, \ 8209 {0x14, 0x90170110}, \ 8210 {0x21, 0x04211020} 8211 8212 #define ALC298_STANDARD_PINS \ 8213 {0x12, 0x90a60130}, \ 8214 {0x21, 0x03211020} 8215 8216 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { 8217 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC, 8218 {0x14, 0x01014020}, 8219 {0x17, 0x90170110}, 8220 {0x18, 0x02a11030}, 8221 {0x19, 0x0181303F}, 8222 {0x21, 0x0221102f}), 8223 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 8224 {0x12, 0x90a601c0}, 8225 {0x14, 0x90171120}, 8226 {0x21, 0x02211030}), 8227 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 8228 {0x14, 0x90170110}, 8229 {0x1b, 0x90a70130}, 8230 {0x21, 0x03211020}), 8231 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 8232 {0x1a, 0x90a70130}, 8233 {0x1b, 0x90170110}, 8234 {0x21, 0x03211020}), 8235 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 8236 ALC225_STANDARD_PINS, 8237 {0x12, 0xb7a60130}, 8238 {0x14, 0x901701a0}), 8239 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 8240 ALC225_STANDARD_PINS, 8241 {0x12, 0xb7a60130}, 8242 {0x14, 0x901701b0}), 8243 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 8244 ALC225_STANDARD_PINS, 8245 {0x12, 0xb7a60150}, 8246 {0x14, 0x901701a0}), 8247 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 8248 ALC225_STANDARD_PINS, 8249 {0x12, 0xb7a60150}, 8250 {0x14, 0x901701b0}), 8251 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, 8252 ALC225_STANDARD_PINS, 8253 {0x12, 0xb7a60130}, 8254 {0x1b, 0x90170110}), 8255 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8256 {0x1b, 0x01111010}, 8257 {0x1e, 0x01451130}, 8258 {0x21, 0x02211020}), 8259 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 8260 {0x12, 0x90a60140}, 8261 {0x14, 0x90170110}, 8262 {0x19, 0x02a11030}, 8263 {0x21, 0x02211020}), 8264 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 8265 {0x14, 0x90170110}, 8266 {0x19, 0x02a11030}, 8267 {0x1a, 0x02a11040}, 8268 {0x1b, 0x01014020}, 8269 {0x21, 0x0221101f}), 8270 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 8271 {0x14, 0x90170110}, 8272 {0x19, 0x02a11030}, 8273 {0x1a, 0x02a11040}, 8274 {0x1b, 0x01011020}, 8275 {0x21, 0x0221101f}), 8276 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION, 8277 {0x14, 0x90170110}, 8278 {0x19, 0x02a11020}, 8279 {0x1a, 0x02a11030}, 8280 {0x21, 0x0221101f}), 8281 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 8282 {0x14, 0x90170110}, 8283 {0x21, 0x02211020}), 8284 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8285 {0x14, 0x90170130}, 8286 {0x21, 0x02211040}), 8287 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8288 {0x12, 0x90a60140}, 8289 {0x14, 0x90170110}, 8290 {0x21, 0x02211020}), 8291 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8292 {0x12, 0x90a60160}, 8293 {0x14, 0x90170120}, 8294 {0x21, 0x02211030}), 8295 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8296 {0x14, 0x90170110}, 8297 {0x1b, 0x02011020}, 8298 {0x21, 0x0221101f}), 8299 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8300 {0x14, 0x90170110}, 8301 {0x1b, 0x01011020}, 8302 {0x21, 0x0221101f}), 8303 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8304 {0x14, 0x90170130}, 8305 {0x1b, 0x01014020}, 8306 {0x21, 0x0221103f}), 8307 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8308 {0x14, 0x90170130}, 8309 {0x1b, 0x01011020}, 8310 {0x21, 0x0221103f}), 8311 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8312 {0x14, 0x90170130}, 8313 {0x1b, 0x02011020}, 8314 {0x21, 0x0221103f}), 8315 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8316 {0x14, 0x90170150}, 8317 {0x1b, 0x02011020}, 8318 {0x21, 0x0221105f}), 8319 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8320 {0x14, 0x90170110}, 8321 {0x1b, 0x01014020}, 8322 {0x21, 0x0221101f}), 8323 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8324 {0x12, 0x90a60160}, 8325 {0x14, 0x90170120}, 8326 {0x17, 0x90170140}, 8327 {0x21, 0x0321102f}), 8328 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8329 {0x12, 0x90a60160}, 8330 {0x14, 0x90170130}, 8331 {0x21, 0x02211040}), 8332 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8333 {0x12, 0x90a60160}, 8334 {0x14, 0x90170140}, 8335 {0x21, 0x02211050}), 8336 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8337 {0x12, 0x90a60170}, 8338 {0x14, 0x90170120}, 8339 {0x21, 0x02211030}), 8340 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8341 {0x12, 0x90a60170}, 8342 {0x14, 0x90170130}, 8343 {0x21, 0x02211040}), 8344 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8345 {0x12, 0x90a60170}, 8346 {0x14, 0x90171130}, 8347 {0x21, 0x02211040}), 8348 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8349 {0x12, 0x90a60170}, 8350 {0x14, 0x90170140}, 8351 {0x21, 0x02211050}), 8352 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8353 {0x12, 0x90a60180}, 8354 {0x14, 0x90170130}, 8355 {0x21, 0x02211040}), 8356 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8357 {0x12, 0x90a60180}, 8358 {0x14, 0x90170120}, 8359 {0x21, 0x02211030}), 8360 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8361 {0x1b, 0x01011020}, 8362 {0x21, 0x02211010}), 8363 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 8364 {0x14, 0x90170110}, 8365 {0x1b, 0x90a70130}, 8366 {0x21, 0x04211020}), 8367 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC, 8368 {0x14, 0x90170110}, 8369 {0x1b, 0x90a70130}, 8370 {0x21, 0x03211020}), 8371 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 8372 {0x12, 0x90a60130}, 8373 {0x14, 0x90170110}, 8374 {0x21, 0x03211020}), 8375 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 8376 {0x12, 0x90a60130}, 8377 {0x14, 0x90170110}, 8378 {0x21, 0x04211020}), 8379 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE, 8380 {0x1a, 0x90a70130}, 8381 {0x1b, 0x90170110}, 8382 {0x21, 0x03211020}), 8383 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC, 8384 {0x17, 0x90170110}, 8385 {0x19, 0x03a11030}, 8386 {0x21, 0x03211020}), 8387 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, 8388 {0x12, 0x90a60130}, 8389 {0x14, 0x90170110}, 8390 {0x15, 0x0421101f}, 8391 {0x1a, 0x04a11020}), 8392 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, 8393 {0x12, 0x90a60140}, 8394 {0x14, 0x90170110}, 8395 {0x15, 0x0421101f}, 8396 {0x18, 0x02811030}, 8397 {0x1a, 0x04a1103f}, 8398 {0x1b, 0x02011020}), 8399 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8400 ALC282_STANDARD_PINS, 8401 {0x12, 0x99a30130}, 8402 {0x19, 0x03a11020}, 8403 {0x21, 0x0321101f}), 8404 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8405 ALC282_STANDARD_PINS, 8406 {0x12, 0x99a30130}, 8407 {0x19, 0x03a11020}, 8408 {0x21, 0x03211040}), 8409 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8410 ALC282_STANDARD_PINS, 8411 {0x12, 0x99a30130}, 8412 {0x19, 0x03a11030}, 8413 {0x21, 0x03211020}), 8414 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8415 ALC282_STANDARD_PINS, 8416 {0x12, 0x99a30130}, 8417 {0x19, 0x04a11020}, 8418 {0x21, 0x0421101f}), 8419 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED, 8420 ALC282_STANDARD_PINS, 8421 {0x12, 0x90a60140}, 8422 {0x19, 0x04a11030}, 8423 {0x21, 0x04211020}), 8424 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8425 ALC282_STANDARD_PINS, 8426 {0x12, 0x90a60130}, 8427 {0x21, 0x0321101f}), 8428 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8429 {0x12, 0x90a60160}, 8430 {0x14, 0x90170120}, 8431 {0x21, 0x02211030}), 8432 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8433 ALC282_STANDARD_PINS, 8434 {0x12, 0x90a60130}, 8435 {0x19, 0x03a11020}, 8436 {0x21, 0x0321101f}), 8437 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, 8438 {0x12, 0x90a60130}, 8439 {0x14, 0x90170110}, 8440 {0x19, 0x04a11040}, 8441 {0x21, 0x04211020}), 8442 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE, 8443 {0x12, 0x90a60130}, 8444 {0x17, 0x90170110}, 8445 {0x21, 0x02211020}), 8446 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, 8447 {0x12, 0x90a60120}, 8448 {0x14, 0x90170110}, 8449 {0x21, 0x0321101f}), 8450 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8451 ALC290_STANDARD_PINS, 8452 {0x15, 0x04211040}, 8453 {0x18, 0x90170112}, 8454 {0x1a, 0x04a11020}), 8455 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8456 ALC290_STANDARD_PINS, 8457 {0x15, 0x04211040}, 8458 {0x18, 0x90170110}, 8459 {0x1a, 0x04a11020}), 8460 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8461 ALC290_STANDARD_PINS, 8462 {0x15, 0x0421101f}, 8463 {0x1a, 0x04a11020}), 8464 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8465 ALC290_STANDARD_PINS, 8466 {0x15, 0x04211020}, 8467 {0x1a, 0x04a11040}), 8468 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8469 ALC290_STANDARD_PINS, 8470 {0x14, 0x90170110}, 8471 {0x15, 0x04211020}, 8472 {0x1a, 0x04a11040}), 8473 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8474 ALC290_STANDARD_PINS, 8475 {0x14, 0x90170110}, 8476 {0x15, 0x04211020}, 8477 {0x1a, 0x04a11020}), 8478 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1, 8479 ALC290_STANDARD_PINS, 8480 {0x14, 0x90170110}, 8481 {0x15, 0x0421101f}, 8482 {0x1a, 0x04a11020}), 8483 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 8484 ALC292_STANDARD_PINS, 8485 {0x12, 0x90a60140}, 8486 {0x16, 0x01014020}, 8487 {0x19, 0x01a19030}), 8488 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 8489 ALC292_STANDARD_PINS, 8490 {0x12, 0x90a60140}, 8491 {0x16, 0x01014020}, 8492 {0x18, 0x02a19031}, 8493 {0x19, 0x01a1903e}), 8494 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 8495 ALC292_STANDARD_PINS, 8496 {0x12, 0x90a60140}), 8497 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 8498 ALC292_STANDARD_PINS, 8499 {0x13, 0x90a60140}, 8500 {0x16, 0x21014020}, 8501 {0x19, 0x21a19030}), 8502 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, 8503 ALC292_STANDARD_PINS, 8504 {0x13, 0x90a60140}), 8505 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC, 8506 {0x14, 0x90170110}, 8507 {0x1b, 0x90a70130}, 8508 {0x21, 0x04211020}), 8509 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 8510 {0x12, 0x90a60130}, 8511 {0x17, 0x90170110}, 8512 {0x21, 0x03211020}), 8513 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 8514 {0x12, 0x90a60130}, 8515 {0x17, 0x90170110}, 8516 {0x21, 0x04211020}), 8517 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 8518 {0x12, 0x90a60130}, 8519 {0x17, 0x90170110}, 8520 {0x21, 0x03211020}), 8521 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 8522 {0x12, 0x90a60120}, 8523 {0x17, 0x90170110}, 8524 {0x21, 0x04211030}), 8525 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 8526 {0x12, 0x90a60130}, 8527 {0x17, 0x90170110}, 8528 {0x21, 0x03211020}), 8529 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE, 8530 {0x12, 0x90a60130}, 8531 {0x17, 0x90170110}, 8532 {0x21, 0x03211020}), 8533 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 8534 {0x14, 0x90170110}, 8535 {0x21, 0x04211020}), 8536 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 8537 {0x14, 0x90170110}, 8538 {0x21, 0x04211030}), 8539 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8540 ALC295_STANDARD_PINS, 8541 {0x17, 0x21014020}, 8542 {0x18, 0x21a19030}), 8543 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8544 ALC295_STANDARD_PINS, 8545 {0x17, 0x21014040}, 8546 {0x18, 0x21a19050}), 8547 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 8548 ALC295_STANDARD_PINS), 8549 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 8550 ALC298_STANDARD_PINS, 8551 {0x17, 0x90170110}), 8552 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 8553 ALC298_STANDARD_PINS, 8554 {0x17, 0x90170140}), 8555 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 8556 ALC298_STANDARD_PINS, 8557 {0x17, 0x90170150}), 8558 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME, 8559 {0x12, 0xb7a60140}, 8560 {0x13, 0xb7a60150}, 8561 {0x17, 0x90170110}, 8562 {0x1a, 0x03011020}, 8563 {0x21, 0x03211030}), 8564 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE, 8565 {0x12, 0xb7a60140}, 8566 {0x17, 0x90170110}, 8567 {0x1a, 0x03a11030}, 8568 {0x21, 0x03211020}), 8569 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 8570 ALC225_STANDARD_PINS, 8571 {0x12, 0xb7a60130}, 8572 {0x17, 0x90170110}), 8573 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC, 8574 {0x14, 0x01014010}, 8575 {0x17, 0x90170120}, 8576 {0x18, 0x02a11030}, 8577 {0x19, 0x02a1103f}, 8578 {0x21, 0x0221101f}), 8579 {} 8580 }; 8581 8582 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match 8583 * more machines, don't need to match all valid pins, just need to match 8584 * all the pins defined in the tbl. Just because of this reason, it is possible 8585 * that a single machine matches multiple tbls, so there is one limitation: 8586 * at most one tbl is allowed to define for the same vendor and same codec 8587 */ 8588 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { 8589 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 8590 {0x19, 0x40000000}, 8591 {0x1b, 0x40000000}), 8592 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8593 {0x19, 0x40000000}, 8594 {0x1a, 0x40000000}), 8595 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 8596 {0x19, 0x40000000}, 8597 {0x1a, 0x40000000}), 8598 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, 8599 {0x19, 0x40000000}, 8600 {0x1a, 0x40000000}), 8601 {} 8602 }; 8603 8604 static void alc269_fill_coef(struct hda_codec *codec) 8605 { 8606 struct alc_spec *spec = codec->spec; 8607 int val; 8608 8609 if (spec->codec_variant != ALC269_TYPE_ALC269VB) 8610 return; 8611 8612 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { 8613 alc_write_coef_idx(codec, 0xf, 0x960b); 8614 alc_write_coef_idx(codec, 0xe, 0x8817); 8615 } 8616 8617 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { 8618 alc_write_coef_idx(codec, 0xf, 0x960b); 8619 alc_write_coef_idx(codec, 0xe, 0x8814); 8620 } 8621 8622 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { 8623 /* Power up output pin */ 8624 alc_update_coef_idx(codec, 0x04, 0, 1<<11); 8625 } 8626 8627 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { 8628 val = alc_read_coef_idx(codec, 0xd); 8629 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) { 8630 /* Capless ramp up clock control */ 8631 alc_write_coef_idx(codec, 0xd, val | (1<<10)); 8632 } 8633 val = alc_read_coef_idx(codec, 0x17); 8634 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) { 8635 /* Class D power on reset */ 8636 alc_write_coef_idx(codec, 0x17, val | (1<<7)); 8637 } 8638 } 8639 8640 /* HP */ 8641 alc_update_coef_idx(codec, 0x4, 0, 1<<11); 8642 } 8643 8644 /* 8645 */ 8646 static int patch_alc269(struct hda_codec *codec) 8647 { 8648 struct alc_spec *spec; 8649 int err; 8650 8651 err = alc_alloc_spec(codec, 0x0b); 8652 if (err < 0) 8653 return err; 8654 8655 spec = codec->spec; 8656 spec->gen.shared_mic_vref_pin = 0x18; 8657 codec->power_save_node = 0; 8658 8659 #ifdef CONFIG_PM 8660 codec->patch_ops.suspend = alc269_suspend; 8661 codec->patch_ops.resume = alc269_resume; 8662 #endif 8663 spec->shutup = alc_default_shutup; 8664 spec->init_hook = alc_default_init; 8665 8666 switch (codec->core.vendor_id) { 8667 case 0x10ec0269: 8668 spec->codec_variant = ALC269_TYPE_ALC269VA; 8669 switch (alc_get_coef0(codec) & 0x00f0) { 8670 case 0x0010: 8671 if (codec->bus->pci && 8672 codec->bus->pci->subsystem_vendor == 0x1025 && 8673 spec->cdefine.platform_type == 1) 8674 err = alc_codec_rename(codec, "ALC271X"); 8675 spec->codec_variant = ALC269_TYPE_ALC269VB; 8676 break; 8677 case 0x0020: 8678 if (codec->bus->pci && 8679 codec->bus->pci->subsystem_vendor == 0x17aa && 8680 codec->bus->pci->subsystem_device == 0x21f3) 8681 err = alc_codec_rename(codec, "ALC3202"); 8682 spec->codec_variant = ALC269_TYPE_ALC269VC; 8683 break; 8684 case 0x0030: 8685 spec->codec_variant = ALC269_TYPE_ALC269VD; 8686 break; 8687 default: 8688 alc_fix_pll_init(codec, 0x20, 0x04, 15); 8689 } 8690 if (err < 0) 8691 goto error; 8692 spec->shutup = alc269_shutup; 8693 spec->init_hook = alc269_fill_coef; 8694 alc269_fill_coef(codec); 8695 break; 8696 8697 case 0x10ec0280: 8698 case 0x10ec0290: 8699 spec->codec_variant = ALC269_TYPE_ALC280; 8700 break; 8701 case 0x10ec0282: 8702 spec->codec_variant = ALC269_TYPE_ALC282; 8703 spec->shutup = alc282_shutup; 8704 spec->init_hook = alc282_init; 8705 break; 8706 case 0x10ec0233: 8707 case 0x10ec0283: 8708 spec->codec_variant = ALC269_TYPE_ALC283; 8709 spec->shutup = alc283_shutup; 8710 spec->init_hook = alc283_init; 8711 break; 8712 case 0x10ec0284: 8713 case 0x10ec0292: 8714 spec->codec_variant = ALC269_TYPE_ALC284; 8715 break; 8716 case 0x10ec0293: 8717 spec->codec_variant = ALC269_TYPE_ALC293; 8718 break; 8719 case 0x10ec0286: 8720 case 0x10ec0288: 8721 spec->codec_variant = ALC269_TYPE_ALC286; 8722 break; 8723 case 0x10ec0298: 8724 spec->codec_variant = ALC269_TYPE_ALC298; 8725 break; 8726 case 0x10ec0235: 8727 case 0x10ec0255: 8728 spec->codec_variant = ALC269_TYPE_ALC255; 8729 spec->shutup = alc256_shutup; 8730 spec->init_hook = alc256_init; 8731 break; 8732 case 0x10ec0236: 8733 case 0x10ec0256: 8734 spec->codec_variant = ALC269_TYPE_ALC256; 8735 spec->shutup = alc256_shutup; 8736 spec->init_hook = alc256_init; 8737 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ 8738 break; 8739 case 0x10ec0257: 8740 spec->codec_variant = ALC269_TYPE_ALC257; 8741 spec->shutup = alc256_shutup; 8742 spec->init_hook = alc256_init; 8743 spec->gen.mixer_nid = 0; 8744 break; 8745 case 0x10ec0215: 8746 case 0x10ec0245: 8747 case 0x10ec0285: 8748 case 0x10ec0287: 8749 case 0x10ec0289: 8750 spec->codec_variant = ALC269_TYPE_ALC215; 8751 spec->shutup = alc225_shutup; 8752 spec->init_hook = alc225_init; 8753 spec->gen.mixer_nid = 0; 8754 break; 8755 case 0x10ec0225: 8756 case 0x10ec0295: 8757 case 0x10ec0299: 8758 spec->codec_variant = ALC269_TYPE_ALC225; 8759 spec->shutup = alc225_shutup; 8760 spec->init_hook = alc225_init; 8761 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */ 8762 break; 8763 case 0x10ec0234: 8764 case 0x10ec0274: 8765 case 0x10ec0294: 8766 spec->codec_variant = ALC269_TYPE_ALC294; 8767 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */ 8768 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ 8769 spec->init_hook = alc294_init; 8770 break; 8771 case 0x10ec0300: 8772 spec->codec_variant = ALC269_TYPE_ALC300; 8773 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */ 8774 break; 8775 case 0x10ec0623: 8776 spec->codec_variant = ALC269_TYPE_ALC623; 8777 break; 8778 case 0x10ec0700: 8779 case 0x10ec0701: 8780 case 0x10ec0703: 8781 case 0x10ec0711: 8782 spec->codec_variant = ALC269_TYPE_ALC700; 8783 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */ 8784 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ 8785 spec->init_hook = alc294_init; 8786 break; 8787 8788 } 8789 8790 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { 8791 spec->has_alc5505_dsp = 1; 8792 spec->init_hook = alc5505_dsp_init; 8793 } 8794 8795 alc_pre_init(codec); 8796 8797 snd_hda_pick_fixup(codec, alc269_fixup_models, 8798 alc269_fixup_tbl, alc269_fixups); 8799 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); 8800 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); 8801 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, 8802 alc269_fixups); 8803 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 8804 8805 alc_auto_parse_customize_define(codec); 8806 8807 if (has_cdefine_beep(codec)) 8808 spec->gen.beep_nid = 0x01; 8809 8810 /* automatic parse from the BIOS config */ 8811 err = alc269_parse_auto_config(codec); 8812 if (err < 0) 8813 goto error; 8814 8815 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) { 8816 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT); 8817 if (err < 0) 8818 goto error; 8819 } 8820 8821 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 8822 8823 return 0; 8824 8825 error: 8826 alc_free(codec); 8827 return err; 8828 } 8829 8830 /* 8831 * ALC861 8832 */ 8833 8834 static int alc861_parse_auto_config(struct hda_codec *codec) 8835 { 8836 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 }; 8837 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 }; 8838 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids); 8839 } 8840 8841 /* Pin config fixes */ 8842 enum { 8843 ALC861_FIXUP_FSC_AMILO_PI1505, 8844 ALC861_FIXUP_AMP_VREF_0F, 8845 ALC861_FIXUP_NO_JACK_DETECT, 8846 ALC861_FIXUP_ASUS_A6RP, 8847 ALC660_FIXUP_ASUS_W7J, 8848 }; 8849 8850 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */ 8851 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec, 8852 const struct hda_fixup *fix, int action) 8853 { 8854 struct alc_spec *spec = codec->spec; 8855 unsigned int val; 8856 8857 if (action != HDA_FIXUP_ACT_INIT) 8858 return; 8859 val = snd_hda_codec_get_pin_target(codec, 0x0f); 8860 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))) 8861 val |= AC_PINCTL_IN_EN; 8862 val |= AC_PINCTL_VREF_50; 8863 snd_hda_set_pin_ctl(codec, 0x0f, val); 8864 spec->gen.keep_vref_in_automute = 1; 8865 } 8866 8867 /* suppress the jack-detection */ 8868 static void alc_fixup_no_jack_detect(struct hda_codec *codec, 8869 const struct hda_fixup *fix, int action) 8870 { 8871 if (action == HDA_FIXUP_ACT_PRE_PROBE) 8872 codec->no_jack_detect = 1; 8873 } 8874 8875 static const struct hda_fixup alc861_fixups[] = { 8876 [ALC861_FIXUP_FSC_AMILO_PI1505] = { 8877 .type = HDA_FIXUP_PINS, 8878 .v.pins = (const struct hda_pintbl[]) { 8879 { 0x0b, 0x0221101f }, /* HP */ 8880 { 0x0f, 0x90170310 }, /* speaker */ 8881 { } 8882 } 8883 }, 8884 [ALC861_FIXUP_AMP_VREF_0F] = { 8885 .type = HDA_FIXUP_FUNC, 8886 .v.func = alc861_fixup_asus_amp_vref_0f, 8887 }, 8888 [ALC861_FIXUP_NO_JACK_DETECT] = { 8889 .type = HDA_FIXUP_FUNC, 8890 .v.func = alc_fixup_no_jack_detect, 8891 }, 8892 [ALC861_FIXUP_ASUS_A6RP] = { 8893 .type = HDA_FIXUP_FUNC, 8894 .v.func = alc861_fixup_asus_amp_vref_0f, 8895 .chained = true, 8896 .chain_id = ALC861_FIXUP_NO_JACK_DETECT, 8897 }, 8898 [ALC660_FIXUP_ASUS_W7J] = { 8899 .type = HDA_FIXUP_VERBS, 8900 .v.verbs = (const struct hda_verb[]) { 8901 /* ASUS W7J needs a magic pin setup on unused NID 0x10 8902 * for enabling outputs 8903 */ 8904 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, 8905 { } 8906 }, 8907 } 8908 }; 8909 8910 static const struct snd_pci_quirk alc861_fixup_tbl[] = { 8911 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J), 8912 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J), 8913 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP), 8914 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F), 8915 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT), 8916 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F), 8917 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F), 8918 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505), 8919 {} 8920 }; 8921 8922 /* 8923 */ 8924 static int patch_alc861(struct hda_codec *codec) 8925 { 8926 struct alc_spec *spec; 8927 int err; 8928 8929 err = alc_alloc_spec(codec, 0x15); 8930 if (err < 0) 8931 return err; 8932 8933 spec = codec->spec; 8934 if (has_cdefine_beep(codec)) 8935 spec->gen.beep_nid = 0x23; 8936 8937 #ifdef CONFIG_PM 8938 spec->power_hook = alc_power_eapd; 8939 #endif 8940 8941 alc_pre_init(codec); 8942 8943 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups); 8944 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 8945 8946 /* automatic parse from the BIOS config */ 8947 err = alc861_parse_auto_config(codec); 8948 if (err < 0) 8949 goto error; 8950 8951 if (!spec->gen.no_analog) { 8952 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); 8953 if (err < 0) 8954 goto error; 8955 } 8956 8957 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 8958 8959 return 0; 8960 8961 error: 8962 alc_free(codec); 8963 return err; 8964 } 8965 8966 /* 8967 * ALC861-VD support 8968 * 8969 * Based on ALC882 8970 * 8971 * In addition, an independent DAC 8972 */ 8973 static int alc861vd_parse_auto_config(struct hda_codec *codec) 8974 { 8975 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 }; 8976 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 8977 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids); 8978 } 8979 8980 enum { 8981 ALC660VD_FIX_ASUS_GPIO1, 8982 ALC861VD_FIX_DALLAS, 8983 }; 8984 8985 /* exclude VREF80 */ 8986 static void alc861vd_fixup_dallas(struct hda_codec *codec, 8987 const struct hda_fixup *fix, int action) 8988 { 8989 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 8990 snd_hda_override_pin_caps(codec, 0x18, 0x00000734); 8991 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c); 8992 } 8993 } 8994 8995 /* reset GPIO1 */ 8996 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec, 8997 const struct hda_fixup *fix, int action) 8998 { 8999 struct alc_spec *spec = codec->spec; 9000 9001 if (action == HDA_FIXUP_ACT_PRE_PROBE) 9002 spec->gpio_mask |= 0x02; 9003 alc_fixup_gpio(codec, action, 0x01); 9004 } 9005 9006 static const struct hda_fixup alc861vd_fixups[] = { 9007 [ALC660VD_FIX_ASUS_GPIO1] = { 9008 .type = HDA_FIXUP_FUNC, 9009 .v.func = alc660vd_fixup_asus_gpio1, 9010 }, 9011 [ALC861VD_FIX_DALLAS] = { 9012 .type = HDA_FIXUP_FUNC, 9013 .v.func = alc861vd_fixup_dallas, 9014 }, 9015 }; 9016 9017 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = { 9018 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS), 9019 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), 9020 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS), 9021 {} 9022 }; 9023 9024 /* 9025 */ 9026 static int patch_alc861vd(struct hda_codec *codec) 9027 { 9028 struct alc_spec *spec; 9029 int err; 9030 9031 err = alc_alloc_spec(codec, 0x0b); 9032 if (err < 0) 9033 return err; 9034 9035 spec = codec->spec; 9036 if (has_cdefine_beep(codec)) 9037 spec->gen.beep_nid = 0x23; 9038 9039 spec->shutup = alc_eapd_shutup; 9040 9041 alc_pre_init(codec); 9042 9043 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups); 9044 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 9045 9046 /* automatic parse from the BIOS config */ 9047 err = alc861vd_parse_auto_config(codec); 9048 if (err < 0) 9049 goto error; 9050 9051 if (!spec->gen.no_analog) { 9052 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 9053 if (err < 0) 9054 goto error; 9055 } 9056 9057 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 9058 9059 return 0; 9060 9061 error: 9062 alc_free(codec); 9063 return err; 9064 } 9065 9066 /* 9067 * ALC662 support 9068 * 9069 * ALC662 is almost identical with ALC880 but has cleaner and more flexible 9070 * configuration. Each pin widget can choose any input DACs and a mixer. 9071 * Each ADC is connected from a mixer of all inputs. This makes possible 9072 * 6-channel independent captures. 9073 * 9074 * In addition, an independent DAC for the multi-playback (not used in this 9075 * driver yet). 9076 */ 9077 9078 /* 9079 * BIOS auto configuration 9080 */ 9081 9082 static int alc662_parse_auto_config(struct hda_codec *codec) 9083 { 9084 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 }; 9085 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 }; 9086 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 }; 9087 const hda_nid_t *ssids; 9088 9089 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 || 9090 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 || 9091 codec->core.vendor_id == 0x10ec0671) 9092 ssids = alc663_ssids; 9093 else 9094 ssids = alc662_ssids; 9095 return alc_parse_auto_config(codec, alc662_ignore, ssids); 9096 } 9097 9098 static void alc272_fixup_mario(struct hda_codec *codec, 9099 const struct hda_fixup *fix, int action) 9100 { 9101 if (action != HDA_FIXUP_ACT_PRE_PROBE) 9102 return; 9103 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT, 9104 (0x3b << AC_AMPCAP_OFFSET_SHIFT) | 9105 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | 9106 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | 9107 (0 << AC_AMPCAP_MUTE_SHIFT))) 9108 codec_warn(codec, "failed to override amp caps for NID 0x2\n"); 9109 } 9110 9111 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { 9112 { .channels = 2, 9113 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, 9114 { .channels = 4, 9115 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, 9116 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */ 9117 { } 9118 }; 9119 9120 /* override the 2.1 chmap */ 9121 static void alc_fixup_bass_chmap(struct hda_codec *codec, 9122 const struct hda_fixup *fix, int action) 9123 { 9124 if (action == HDA_FIXUP_ACT_BUILD) { 9125 struct alc_spec *spec = codec->spec; 9126 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps; 9127 } 9128 } 9129 9130 /* avoid D3 for keeping GPIO up */ 9131 static unsigned int gpio_led_power_filter(struct hda_codec *codec, 9132 hda_nid_t nid, 9133 unsigned int power_state) 9134 { 9135 struct alc_spec *spec = codec->spec; 9136 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data) 9137 return AC_PWRST_D0; 9138 return power_state; 9139 } 9140 9141 static void alc662_fixup_led_gpio1(struct hda_codec *codec, 9142 const struct hda_fixup *fix, int action) 9143 { 9144 struct alc_spec *spec = codec->spec; 9145 9146 alc_fixup_hp_gpio_led(codec, action, 0x01, 0); 9147 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 9148 spec->mute_led_polarity = 1; 9149 codec->power_filter = gpio_led_power_filter; 9150 } 9151 } 9152 9153 static void alc662_usi_automute_hook(struct hda_codec *codec, 9154 struct hda_jack_callback *jack) 9155 { 9156 struct alc_spec *spec = codec->spec; 9157 int vref; 9158 msleep(200); 9159 snd_hda_gen_hp_automute(codec, jack); 9160 9161 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0; 9162 msleep(100); 9163 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 9164 vref); 9165 } 9166 9167 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec, 9168 const struct hda_fixup *fix, int action) 9169 { 9170 struct alc_spec *spec = codec->spec; 9171 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 9172 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 9173 spec->gen.hp_automute_hook = alc662_usi_automute_hook; 9174 } 9175 } 9176 9177 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec, 9178 struct hda_jack_callback *cb) 9179 { 9180 /* surround speakers at 0x1b already get muted automatically when 9181 * headphones are plugged in, but we have to mute/unmute the remaining 9182 * channels manually: 9183 * 0x15 - front left/front right 9184 * 0x18 - front center/ LFE 9185 */ 9186 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) { 9187 snd_hda_set_pin_ctl_cache(codec, 0x15, 0); 9188 snd_hda_set_pin_ctl_cache(codec, 0x18, 0); 9189 } else { 9190 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT); 9191 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT); 9192 } 9193 } 9194 9195 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec, 9196 const struct hda_fixup *fix, int action) 9197 { 9198 /* Pin 0x1b: shared headphones jack and surround speakers */ 9199 if (!is_jack_detectable(codec, 0x1b)) 9200 return; 9201 9202 switch (action) { 9203 case HDA_FIXUP_ACT_PRE_PROBE: 9204 snd_hda_jack_detect_enable_callback(codec, 0x1b, 9205 alc662_aspire_ethos_mute_speakers); 9206 /* subwoofer needs an extra GPIO setting to become audible */ 9207 alc_setup_gpio(codec, 0x02); 9208 break; 9209 case HDA_FIXUP_ACT_INIT: 9210 /* Make sure to start in a correct state, i.e. if 9211 * headphones have been plugged in before powering up the system 9212 */ 9213 alc662_aspire_ethos_mute_speakers(codec, NULL); 9214 break; 9215 } 9216 } 9217 9218 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec, 9219 const struct hda_fixup *fix, int action) 9220 { 9221 struct alc_spec *spec = codec->spec; 9222 9223 static const struct hda_pintbl pincfgs[] = { 9224 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */ 9225 { 0x1b, 0x0181304f }, 9226 { } 9227 }; 9228 9229 switch (action) { 9230 case HDA_FIXUP_ACT_PRE_PROBE: 9231 spec->gen.mixer_nid = 0; 9232 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC; 9233 snd_hda_apply_pincfgs(codec, pincfgs); 9234 break; 9235 case HDA_FIXUP_ACT_INIT: 9236 alc_write_coef_idx(codec, 0x19, 0xa054); 9237 break; 9238 } 9239 } 9240 9241 static const struct coef_fw alc668_coefs[] = { 9242 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), 9243 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), 9244 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), 9245 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), 9246 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), 9247 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), 9248 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), 9249 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), 9250 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), 9251 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), 9252 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), 9253 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), 9254 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), 9255 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), 9256 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), 9257 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), 9258 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), 9259 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), 9260 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), 9261 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), 9262 {} 9263 }; 9264 9265 static void alc668_restore_default_value(struct hda_codec *codec) 9266 { 9267 alc_process_coef_fw(codec, alc668_coefs); 9268 } 9269 9270 enum { 9271 ALC662_FIXUP_ASPIRE, 9272 ALC662_FIXUP_LED_GPIO1, 9273 ALC662_FIXUP_IDEAPAD, 9274 ALC272_FIXUP_MARIO, 9275 ALC662_FIXUP_CZC_ET26, 9276 ALC662_FIXUP_CZC_P10T, 9277 ALC662_FIXUP_SKU_IGNORE, 9278 ALC662_FIXUP_HP_RP5800, 9279 ALC662_FIXUP_ASUS_MODE1, 9280 ALC662_FIXUP_ASUS_MODE2, 9281 ALC662_FIXUP_ASUS_MODE3, 9282 ALC662_FIXUP_ASUS_MODE4, 9283 ALC662_FIXUP_ASUS_MODE5, 9284 ALC662_FIXUP_ASUS_MODE6, 9285 ALC662_FIXUP_ASUS_MODE7, 9286 ALC662_FIXUP_ASUS_MODE8, 9287 ALC662_FIXUP_NO_JACK_DETECT, 9288 ALC662_FIXUP_ZOTAC_Z68, 9289 ALC662_FIXUP_INV_DMIC, 9290 ALC662_FIXUP_DELL_MIC_NO_PRESENCE, 9291 ALC668_FIXUP_DELL_MIC_NO_PRESENCE, 9292 ALC662_FIXUP_HEADSET_MODE, 9293 ALC668_FIXUP_HEADSET_MODE, 9294 ALC662_FIXUP_BASS_MODE4_CHMAP, 9295 ALC662_FIXUP_BASS_16, 9296 ALC662_FIXUP_BASS_1A, 9297 ALC662_FIXUP_BASS_CHMAP, 9298 ALC668_FIXUP_AUTO_MUTE, 9299 ALC668_FIXUP_DELL_DISABLE_AAMIX, 9300 ALC668_FIXUP_DELL_XPS13, 9301 ALC662_FIXUP_ASUS_Nx50, 9302 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, 9303 ALC668_FIXUP_ASUS_Nx51, 9304 ALC668_FIXUP_MIC_COEF, 9305 ALC668_FIXUP_ASUS_G751, 9306 ALC891_FIXUP_HEADSET_MODE, 9307 ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 9308 ALC662_FIXUP_ACER_VERITON, 9309 ALC892_FIXUP_ASROCK_MOBO, 9310 ALC662_FIXUP_USI_FUNC, 9311 ALC662_FIXUP_USI_HEADSET_MODE, 9312 ALC662_FIXUP_LENOVO_MULTI_CODECS, 9313 ALC669_FIXUP_ACER_ASPIRE_ETHOS, 9314 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET, 9315 ALC671_FIXUP_HP_HEADSET_MIC2, 9316 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, 9317 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, 9318 }; 9319 9320 static const struct hda_fixup alc662_fixups[] = { 9321 [ALC662_FIXUP_ASPIRE] = { 9322 .type = HDA_FIXUP_PINS, 9323 .v.pins = (const struct hda_pintbl[]) { 9324 { 0x15, 0x99130112 }, /* subwoofer */ 9325 { } 9326 } 9327 }, 9328 [ALC662_FIXUP_LED_GPIO1] = { 9329 .type = HDA_FIXUP_FUNC, 9330 .v.func = alc662_fixup_led_gpio1, 9331 }, 9332 [ALC662_FIXUP_IDEAPAD] = { 9333 .type = HDA_FIXUP_PINS, 9334 .v.pins = (const struct hda_pintbl[]) { 9335 { 0x17, 0x99130112 }, /* subwoofer */ 9336 { } 9337 }, 9338 .chained = true, 9339 .chain_id = ALC662_FIXUP_LED_GPIO1, 9340 }, 9341 [ALC272_FIXUP_MARIO] = { 9342 .type = HDA_FIXUP_FUNC, 9343 .v.func = alc272_fixup_mario, 9344 }, 9345 [ALC662_FIXUP_CZC_ET26] = { 9346 .type = HDA_FIXUP_PINS, 9347 .v.pins = (const struct hda_pintbl[]) { 9348 {0x12, 0x403cc000}, 9349 {0x14, 0x90170110}, /* speaker */ 9350 {0x15, 0x411111f0}, 9351 {0x16, 0x411111f0}, 9352 {0x18, 0x01a19030}, /* mic */ 9353 {0x19, 0x90a7013f}, /* int-mic */ 9354 {0x1a, 0x01014020}, 9355 {0x1b, 0x0121401f}, 9356 {0x1c, 0x411111f0}, 9357 {0x1d, 0x411111f0}, 9358 {0x1e, 0x40478e35}, 9359 {} 9360 }, 9361 .chained = true, 9362 .chain_id = ALC662_FIXUP_SKU_IGNORE 9363 }, 9364 [ALC662_FIXUP_CZC_P10T] = { 9365 .type = HDA_FIXUP_VERBS, 9366 .v.verbs = (const struct hda_verb[]) { 9367 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, 9368 {} 9369 } 9370 }, 9371 [ALC662_FIXUP_SKU_IGNORE] = { 9372 .type = HDA_FIXUP_FUNC, 9373 .v.func = alc_fixup_sku_ignore, 9374 }, 9375 [ALC662_FIXUP_HP_RP5800] = { 9376 .type = HDA_FIXUP_PINS, 9377 .v.pins = (const struct hda_pintbl[]) { 9378 { 0x14, 0x0221201f }, /* HP out */ 9379 { } 9380 }, 9381 .chained = true, 9382 .chain_id = ALC662_FIXUP_SKU_IGNORE 9383 }, 9384 [ALC662_FIXUP_ASUS_MODE1] = { 9385 .type = HDA_FIXUP_PINS, 9386 .v.pins = (const struct hda_pintbl[]) { 9387 { 0x14, 0x99130110 }, /* speaker */ 9388 { 0x18, 0x01a19c20 }, /* mic */ 9389 { 0x19, 0x99a3092f }, /* int-mic */ 9390 { 0x21, 0x0121401f }, /* HP out */ 9391 { } 9392 }, 9393 .chained = true, 9394 .chain_id = ALC662_FIXUP_SKU_IGNORE 9395 }, 9396 [ALC662_FIXUP_ASUS_MODE2] = { 9397 .type = HDA_FIXUP_PINS, 9398 .v.pins = (const struct hda_pintbl[]) { 9399 { 0x14, 0x99130110 }, /* speaker */ 9400 { 0x18, 0x01a19820 }, /* mic */ 9401 { 0x19, 0x99a3092f }, /* int-mic */ 9402 { 0x1b, 0x0121401f }, /* HP out */ 9403 { } 9404 }, 9405 .chained = true, 9406 .chain_id = ALC662_FIXUP_SKU_IGNORE 9407 }, 9408 [ALC662_FIXUP_ASUS_MODE3] = { 9409 .type = HDA_FIXUP_PINS, 9410 .v.pins = (const struct hda_pintbl[]) { 9411 { 0x14, 0x99130110 }, /* speaker */ 9412 { 0x15, 0x0121441f }, /* HP */ 9413 { 0x18, 0x01a19840 }, /* mic */ 9414 { 0x19, 0x99a3094f }, /* int-mic */ 9415 { 0x21, 0x01211420 }, /* HP2 */ 9416 { } 9417 }, 9418 .chained = true, 9419 .chain_id = ALC662_FIXUP_SKU_IGNORE 9420 }, 9421 [ALC662_FIXUP_ASUS_MODE4] = { 9422 .type = HDA_FIXUP_PINS, 9423 .v.pins = (const struct hda_pintbl[]) { 9424 { 0x14, 0x99130110 }, /* speaker */ 9425 { 0x16, 0x99130111 }, /* speaker */ 9426 { 0x18, 0x01a19840 }, /* mic */ 9427 { 0x19, 0x99a3094f }, /* int-mic */ 9428 { 0x21, 0x0121441f }, /* HP */ 9429 { } 9430 }, 9431 .chained = true, 9432 .chain_id = ALC662_FIXUP_SKU_IGNORE 9433 }, 9434 [ALC662_FIXUP_ASUS_MODE5] = { 9435 .type = HDA_FIXUP_PINS, 9436 .v.pins = (const struct hda_pintbl[]) { 9437 { 0x14, 0x99130110 }, /* speaker */ 9438 { 0x15, 0x0121441f }, /* HP */ 9439 { 0x16, 0x99130111 }, /* speaker */ 9440 { 0x18, 0x01a19840 }, /* mic */ 9441 { 0x19, 0x99a3094f }, /* int-mic */ 9442 { } 9443 }, 9444 .chained = true, 9445 .chain_id = ALC662_FIXUP_SKU_IGNORE 9446 }, 9447 [ALC662_FIXUP_ASUS_MODE6] = { 9448 .type = HDA_FIXUP_PINS, 9449 .v.pins = (const struct hda_pintbl[]) { 9450 { 0x14, 0x99130110 }, /* speaker */ 9451 { 0x15, 0x01211420 }, /* HP2 */ 9452 { 0x18, 0x01a19840 }, /* mic */ 9453 { 0x19, 0x99a3094f }, /* int-mic */ 9454 { 0x1b, 0x0121441f }, /* HP */ 9455 { } 9456 }, 9457 .chained = true, 9458 .chain_id = ALC662_FIXUP_SKU_IGNORE 9459 }, 9460 [ALC662_FIXUP_ASUS_MODE7] = { 9461 .type = HDA_FIXUP_PINS, 9462 .v.pins = (const struct hda_pintbl[]) { 9463 { 0x14, 0x99130110 }, /* speaker */ 9464 { 0x17, 0x99130111 }, /* speaker */ 9465 { 0x18, 0x01a19840 }, /* mic */ 9466 { 0x19, 0x99a3094f }, /* int-mic */ 9467 { 0x1b, 0x01214020 }, /* HP */ 9468 { 0x21, 0x0121401f }, /* HP */ 9469 { } 9470 }, 9471 .chained = true, 9472 .chain_id = ALC662_FIXUP_SKU_IGNORE 9473 }, 9474 [ALC662_FIXUP_ASUS_MODE8] = { 9475 .type = HDA_FIXUP_PINS, 9476 .v.pins = (const struct hda_pintbl[]) { 9477 { 0x14, 0x99130110 }, /* speaker */ 9478 { 0x12, 0x99a30970 }, /* int-mic */ 9479 { 0x15, 0x01214020 }, /* HP */ 9480 { 0x17, 0x99130111 }, /* speaker */ 9481 { 0x18, 0x01a19840 }, /* mic */ 9482 { 0x21, 0x0121401f }, /* HP */ 9483 { } 9484 }, 9485 .chained = true, 9486 .chain_id = ALC662_FIXUP_SKU_IGNORE 9487 }, 9488 [ALC662_FIXUP_NO_JACK_DETECT] = { 9489 .type = HDA_FIXUP_FUNC, 9490 .v.func = alc_fixup_no_jack_detect, 9491 }, 9492 [ALC662_FIXUP_ZOTAC_Z68] = { 9493 .type = HDA_FIXUP_PINS, 9494 .v.pins = (const struct hda_pintbl[]) { 9495 { 0x1b, 0x02214020 }, /* Front HP */ 9496 { } 9497 } 9498 }, 9499 [ALC662_FIXUP_INV_DMIC] = { 9500 .type = HDA_FIXUP_FUNC, 9501 .v.func = alc_fixup_inv_dmic, 9502 }, 9503 [ALC668_FIXUP_DELL_XPS13] = { 9504 .type = HDA_FIXUP_FUNC, 9505 .v.func = alc_fixup_dell_xps13, 9506 .chained = true, 9507 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX 9508 }, 9509 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = { 9510 .type = HDA_FIXUP_FUNC, 9511 .v.func = alc_fixup_disable_aamix, 9512 .chained = true, 9513 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE 9514 }, 9515 [ALC668_FIXUP_AUTO_MUTE] = { 9516 .type = HDA_FIXUP_FUNC, 9517 .v.func = alc_fixup_auto_mute_via_amp, 9518 .chained = true, 9519 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE 9520 }, 9521 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = { 9522 .type = HDA_FIXUP_PINS, 9523 .v.pins = (const struct hda_pintbl[]) { 9524 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 9525 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */ 9526 { } 9527 }, 9528 .chained = true, 9529 .chain_id = ALC662_FIXUP_HEADSET_MODE 9530 }, 9531 [ALC662_FIXUP_HEADSET_MODE] = { 9532 .type = HDA_FIXUP_FUNC, 9533 .v.func = alc_fixup_headset_mode_alc662, 9534 }, 9535 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { 9536 .type = HDA_FIXUP_PINS, 9537 .v.pins = (const struct hda_pintbl[]) { 9538 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 9539 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 9540 { } 9541 }, 9542 .chained = true, 9543 .chain_id = ALC668_FIXUP_HEADSET_MODE 9544 }, 9545 [ALC668_FIXUP_HEADSET_MODE] = { 9546 .type = HDA_FIXUP_FUNC, 9547 .v.func = alc_fixup_headset_mode_alc668, 9548 }, 9549 [ALC662_FIXUP_BASS_MODE4_CHMAP] = { 9550 .type = HDA_FIXUP_FUNC, 9551 .v.func = alc_fixup_bass_chmap, 9552 .chained = true, 9553 .chain_id = ALC662_FIXUP_ASUS_MODE4 9554 }, 9555 [ALC662_FIXUP_BASS_16] = { 9556 .type = HDA_FIXUP_PINS, 9557 .v.pins = (const struct hda_pintbl[]) { 9558 {0x16, 0x80106111}, /* bass speaker */ 9559 {} 9560 }, 9561 .chained = true, 9562 .chain_id = ALC662_FIXUP_BASS_CHMAP, 9563 }, 9564 [ALC662_FIXUP_BASS_1A] = { 9565 .type = HDA_FIXUP_PINS, 9566 .v.pins = (const struct hda_pintbl[]) { 9567 {0x1a, 0x80106111}, /* bass speaker */ 9568 {} 9569 }, 9570 .chained = true, 9571 .chain_id = ALC662_FIXUP_BASS_CHMAP, 9572 }, 9573 [ALC662_FIXUP_BASS_CHMAP] = { 9574 .type = HDA_FIXUP_FUNC, 9575 .v.func = alc_fixup_bass_chmap, 9576 }, 9577 [ALC662_FIXUP_ASUS_Nx50] = { 9578 .type = HDA_FIXUP_FUNC, 9579 .v.func = alc_fixup_auto_mute_via_amp, 9580 .chained = true, 9581 .chain_id = ALC662_FIXUP_BASS_1A 9582 }, 9583 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { 9584 .type = HDA_FIXUP_FUNC, 9585 .v.func = alc_fixup_headset_mode_alc668, 9586 .chain_id = ALC662_FIXUP_BASS_CHMAP 9587 }, 9588 [ALC668_FIXUP_ASUS_Nx51] = { 9589 .type = HDA_FIXUP_PINS, 9590 .v.pins = (const struct hda_pintbl[]) { 9591 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 9592 { 0x1a, 0x90170151 }, /* bass speaker */ 9593 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 9594 {} 9595 }, 9596 .chained = true, 9597 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, 9598 }, 9599 [ALC668_FIXUP_MIC_COEF] = { 9600 .type = HDA_FIXUP_VERBS, 9601 .v.verbs = (const struct hda_verb[]) { 9602 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 }, 9603 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 }, 9604 {} 9605 }, 9606 }, 9607 [ALC668_FIXUP_ASUS_G751] = { 9608 .type = HDA_FIXUP_PINS, 9609 .v.pins = (const struct hda_pintbl[]) { 9610 { 0x16, 0x0421101f }, /* HP */ 9611 {} 9612 }, 9613 .chained = true, 9614 .chain_id = ALC668_FIXUP_MIC_COEF 9615 }, 9616 [ALC891_FIXUP_HEADSET_MODE] = { 9617 .type = HDA_FIXUP_FUNC, 9618 .v.func = alc_fixup_headset_mode, 9619 }, 9620 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = { 9621 .type = HDA_FIXUP_PINS, 9622 .v.pins = (const struct hda_pintbl[]) { 9623 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ 9624 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 9625 { } 9626 }, 9627 .chained = true, 9628 .chain_id = ALC891_FIXUP_HEADSET_MODE 9629 }, 9630 [ALC662_FIXUP_ACER_VERITON] = { 9631 .type = HDA_FIXUP_PINS, 9632 .v.pins = (const struct hda_pintbl[]) { 9633 { 0x15, 0x50170120 }, /* no internal speaker */ 9634 { } 9635 } 9636 }, 9637 [ALC892_FIXUP_ASROCK_MOBO] = { 9638 .type = HDA_FIXUP_PINS, 9639 .v.pins = (const struct hda_pintbl[]) { 9640 { 0x15, 0x40f000f0 }, /* disabled */ 9641 { 0x16, 0x40f000f0 }, /* disabled */ 9642 { } 9643 } 9644 }, 9645 [ALC662_FIXUP_USI_FUNC] = { 9646 .type = HDA_FIXUP_FUNC, 9647 .v.func = alc662_fixup_usi_headset_mic, 9648 }, 9649 [ALC662_FIXUP_USI_HEADSET_MODE] = { 9650 .type = HDA_FIXUP_PINS, 9651 .v.pins = (const struct hda_pintbl[]) { 9652 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */ 9653 { 0x18, 0x01a1903d }, 9654 { } 9655 }, 9656 .chained = true, 9657 .chain_id = ALC662_FIXUP_USI_FUNC 9658 }, 9659 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { 9660 .type = HDA_FIXUP_FUNC, 9661 .v.func = alc233_alc662_fixup_lenovo_dual_codecs, 9662 }, 9663 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = { 9664 .type = HDA_FIXUP_FUNC, 9665 .v.func = alc662_fixup_aspire_ethos_hp, 9666 }, 9667 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = { 9668 .type = HDA_FIXUP_PINS, 9669 .v.pins = (const struct hda_pintbl[]) { 9670 { 0x15, 0x92130110 }, /* front speakers */ 9671 { 0x18, 0x99130111 }, /* center/subwoofer */ 9672 { 0x1b, 0x11130012 }, /* surround plus jack for HP */ 9673 { } 9674 }, 9675 .chained = true, 9676 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET 9677 }, 9678 [ALC671_FIXUP_HP_HEADSET_MIC2] = { 9679 .type = HDA_FIXUP_FUNC, 9680 .v.func = alc671_fixup_hp_headset_mic2, 9681 }, 9682 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = { 9683 .type = HDA_FIXUP_PINS, 9684 .v.pins = (const struct hda_pintbl[]) { 9685 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */ 9686 { } 9687 }, 9688 .chained = true, 9689 .chain_id = ALC662_FIXUP_USI_FUNC 9690 }, 9691 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = { 9692 .type = HDA_FIXUP_PINS, 9693 .v.pins = (const struct hda_pintbl[]) { 9694 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */ 9695 { 0x1b, 0x0221144f }, 9696 { } 9697 }, 9698 .chained = true, 9699 .chain_id = ALC662_FIXUP_USI_FUNC 9700 }, 9701 }; 9702 9703 static const struct snd_pci_quirk alc662_fixup_tbl[] = { 9704 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), 9705 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), 9706 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), 9707 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), 9708 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), 9709 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), 9710 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), 9711 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 9712 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE), 9713 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE), 9714 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 9715 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 9716 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13), 9717 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13), 9718 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13), 9719 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 9720 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 9721 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 9722 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 9723 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 9724 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 9725 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2), 9726 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE), 9727 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50), 9728 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A), 9729 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50), 9730 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751), 9731 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), 9732 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), 9733 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), 9734 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), 9735 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), 9736 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), 9737 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), 9738 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT), 9739 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), 9740 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 9741 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), 9742 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), 9743 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 9744 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 9745 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), 9746 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68), 9747 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON), 9748 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26), 9749 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), 9750 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS), 9751 9752 #if 0 9753 /* Below is a quirk table taken from the old code. 9754 * Basically the device should work as is without the fixup table. 9755 * If BIOS doesn't give a proper info, enable the corresponding 9756 * fixup entry. 9757 */ 9758 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1), 9759 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3), 9760 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1), 9761 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3), 9762 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 9763 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9764 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 9765 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1), 9766 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1), 9767 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9768 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7), 9769 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7), 9770 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8), 9771 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3), 9772 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1), 9773 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9774 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2), 9775 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1), 9776 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9777 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 9778 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 9779 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9780 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1), 9781 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3), 9782 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2), 9783 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9784 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5), 9785 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6), 9786 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9787 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1), 9788 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9789 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9790 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3), 9791 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3), 9792 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1), 9793 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1), 9794 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1), 9795 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1), 9796 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1), 9797 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2), 9798 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2), 9799 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1), 9800 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 9801 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3), 9802 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1), 9803 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1), 9804 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1), 9805 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2), 9806 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1), 9807 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4), 9808 #endif 9809 {} 9810 }; 9811 9812 static const struct hda_model_fixup alc662_fixup_models[] = { 9813 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"}, 9814 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"}, 9815 {.id = ALC272_FIXUP_MARIO, .name = "mario"}, 9816 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"}, 9817 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"}, 9818 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"}, 9819 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"}, 9820 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"}, 9821 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"}, 9822 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, 9823 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, 9824 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, 9825 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"}, 9826 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, 9827 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"}, 9828 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, 9829 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"}, 9830 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"}, 9831 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"}, 9832 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"}, 9833 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"}, 9834 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"}, 9835 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"}, 9836 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"}, 9837 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"}, 9838 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"}, 9839 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"}, 9840 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"}, 9841 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"}, 9842 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"}, 9843 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, 9844 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"}, 9845 {} 9846 }; 9847 9848 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 9849 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 9850 {0x17, 0x02211010}, 9851 {0x18, 0x01a19030}, 9852 {0x1a, 0x01813040}, 9853 {0x21, 0x01014020}), 9854 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE, 9855 {0x16, 0x01813030}, 9856 {0x17, 0x02211010}, 9857 {0x18, 0x01a19040}, 9858 {0x21, 0x01014020}), 9859 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE, 9860 {0x14, 0x01014010}, 9861 {0x18, 0x01a19020}, 9862 {0x1a, 0x0181302f}, 9863 {0x1b, 0x0221401f}), 9864 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 9865 {0x12, 0x99a30130}, 9866 {0x14, 0x90170110}, 9867 {0x15, 0x0321101f}, 9868 {0x16, 0x03011020}), 9869 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 9870 {0x12, 0x99a30140}, 9871 {0x14, 0x90170110}, 9872 {0x15, 0x0321101f}, 9873 {0x16, 0x03011020}), 9874 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 9875 {0x12, 0x99a30150}, 9876 {0x14, 0x90170110}, 9877 {0x15, 0x0321101f}, 9878 {0x16, 0x03011020}), 9879 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE, 9880 {0x14, 0x90170110}, 9881 {0x15, 0x0321101f}, 9882 {0x16, 0x03011020}), 9883 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE, 9884 {0x12, 0x90a60130}, 9885 {0x14, 0x90170110}, 9886 {0x15, 0x0321101f}), 9887 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 9888 {0x14, 0x01014010}, 9889 {0x17, 0x90170150}, 9890 {0x19, 0x02a11060}, 9891 {0x1b, 0x01813030}, 9892 {0x21, 0x02211020}), 9893 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 9894 {0x14, 0x01014010}, 9895 {0x18, 0x01a19040}, 9896 {0x1b, 0x01813030}, 9897 {0x21, 0x02211020}), 9898 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2, 9899 {0x14, 0x01014020}, 9900 {0x17, 0x90170110}, 9901 {0x18, 0x01a19050}, 9902 {0x1b, 0x01813040}, 9903 {0x21, 0x02211030}), 9904 {} 9905 }; 9906 9907 /* 9908 */ 9909 static int patch_alc662(struct hda_codec *codec) 9910 { 9911 struct alc_spec *spec; 9912 int err; 9913 9914 err = alc_alloc_spec(codec, 0x0b); 9915 if (err < 0) 9916 return err; 9917 9918 spec = codec->spec; 9919 9920 spec->shutup = alc_eapd_shutup; 9921 9922 /* handle multiple HPs as is */ 9923 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 9924 9925 alc_fix_pll_init(codec, 0x20, 0x04, 15); 9926 9927 switch (codec->core.vendor_id) { 9928 case 0x10ec0668: 9929 spec->init_hook = alc668_restore_default_value; 9930 break; 9931 } 9932 9933 alc_pre_init(codec); 9934 9935 snd_hda_pick_fixup(codec, alc662_fixup_models, 9936 alc662_fixup_tbl, alc662_fixups); 9937 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true); 9938 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 9939 9940 alc_auto_parse_customize_define(codec); 9941 9942 if (has_cdefine_beep(codec)) 9943 spec->gen.beep_nid = 0x01; 9944 9945 if ((alc_get_coef0(codec) & (1 << 14)) && 9946 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 && 9947 spec->cdefine.platform_type == 1) { 9948 err = alc_codec_rename(codec, "ALC272X"); 9949 if (err < 0) 9950 goto error; 9951 } 9952 9953 /* automatic parse from the BIOS config */ 9954 err = alc662_parse_auto_config(codec); 9955 if (err < 0) 9956 goto error; 9957 9958 if (!spec->gen.no_analog && spec->gen.beep_nid) { 9959 switch (codec->core.vendor_id) { 9960 case 0x10ec0662: 9961 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 9962 break; 9963 case 0x10ec0272: 9964 case 0x10ec0663: 9965 case 0x10ec0665: 9966 case 0x10ec0668: 9967 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 9968 break; 9969 case 0x10ec0273: 9970 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); 9971 break; 9972 } 9973 if (err < 0) 9974 goto error; 9975 } 9976 9977 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); 9978 9979 return 0; 9980 9981 error: 9982 alc_free(codec); 9983 return err; 9984 } 9985 9986 /* 9987 * ALC680 support 9988 */ 9989 9990 static int alc680_parse_auto_config(struct hda_codec *codec) 9991 { 9992 return alc_parse_auto_config(codec, NULL, NULL); 9993 } 9994 9995 /* 9996 */ 9997 static int patch_alc680(struct hda_codec *codec) 9998 { 9999 int err; 10000 10001 /* ALC680 has no aa-loopback mixer */ 10002 err = alc_alloc_spec(codec, 0); 10003 if (err < 0) 10004 return err; 10005 10006 /* automatic parse from the BIOS config */ 10007 err = alc680_parse_auto_config(codec); 10008 if (err < 0) { 10009 alc_free(codec); 10010 return err; 10011 } 10012 10013 return 0; 10014 } 10015 10016 /* 10017 * patch entries 10018 */ 10019 static const struct hda_device_id snd_hda_id_realtek[] = { 10020 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), 10021 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), 10022 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269), 10023 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), 10024 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269), 10025 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269), 10026 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269), 10027 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269), 10028 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269), 10029 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269), 10030 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269), 10031 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269), 10032 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269), 10033 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260), 10034 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262), 10035 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268), 10036 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268), 10037 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269), 10038 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269), 10039 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662), 10040 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269), 10041 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269), 10042 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269), 10043 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269), 10044 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269), 10045 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269), 10046 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269), 10047 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269), 10048 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269), 10049 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269), 10050 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269), 10051 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269), 10052 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269), 10053 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269), 10054 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269), 10055 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), 10056 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), 10057 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), 10058 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), 10059 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269), 10060 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269), 10061 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), 10062 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), 10063 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), 10064 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd), 10065 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882), 10066 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662), 10067 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662), 10068 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662), 10069 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662), 10070 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662), 10071 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662), 10072 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662), 10073 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662), 10074 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680), 10075 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269), 10076 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269), 10077 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269), 10078 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269), 10079 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662), 10080 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880), 10081 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882), 10082 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882), 10083 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882), 10084 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882), 10085 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882), 10086 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882), 10087 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882), 10088 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882), 10089 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882), 10090 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), 10091 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), 10092 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), 10093 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), 10094 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), 10095 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), 10096 {} /* terminator */ 10097 }; 10098 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); 10099 10100 MODULE_LICENSE("GPL"); 10101 MODULE_DESCRIPTION("Realtek HD-audio codec"); 10102 10103 static struct hda_codec_driver realtek_driver = { 10104 .id = snd_hda_id_realtek, 10105 }; 10106 10107 module_hda_codec_driver(realtek_driver); 10108