Lines Matching refs:codec

50 static int alc269_parse_auto_config(struct hda_codec *codec)  in alc269_parse_auto_config()  argument
55 struct alc_spec *spec = codec->spec; in alc269_parse_auto_config()
90 return alc_parse_auto_config(codec, alc269_ignore, ssids); in alc269_parse_auto_config()
101 static void alc_headset_btn_callback(struct hda_codec *codec, in alc_headset_btn_callback() argument
120 snd_hda_jack_set_button_state(codec, jack->nid, report); in alc_headset_btn_callback()
123 static void alc_disable_headset_jack_key(struct hda_codec *codec) in alc_disable_headset_jack_key() argument
125 struct alc_spec *spec = codec->spec; in alc_disable_headset_jack_key()
130 switch (codec->core.vendor_id) { in alc_disable_headset_jack_key()
138 alc_write_coef_idx(codec, 0x48, 0x0); in alc_disable_headset_jack_key()
139 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); in alc_disable_headset_jack_key()
140 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0); in alc_disable_headset_jack_key()
147 alc_write_coef_idx(codec, 0x48, 0x0); in alc_disable_headset_jack_key()
148 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); in alc_disable_headset_jack_key()
153 static void alc_enable_headset_jack_key(struct hda_codec *codec) in alc_enable_headset_jack_key() argument
155 struct alc_spec *spec = codec->spec; in alc_enable_headset_jack_key()
160 switch (codec->core.vendor_id) { in alc_enable_headset_jack_key()
168 alc_write_coef_idx(codec, 0x48, 0xd011); in alc_enable_headset_jack_key()
169 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); in alc_enable_headset_jack_key()
170 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8); in alc_enable_headset_jack_key()
177 alc_write_coef_idx(codec, 0x48, 0xd011); in alc_enable_headset_jack_key()
178 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); in alc_enable_headset_jack_key()
183 static void alc_fixup_headset_jack(struct hda_codec *codec, in alc_fixup_headset_jack() argument
186 struct alc_spec *spec = codec->spec; in alc_fixup_headset_jack()
192 snd_hda_jack_detect_enable_callback(codec, 0x55, in alc_fixup_headset_jack()
197 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55, in alc_fixup_headset_jack()
200 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", in alc_fixup_headset_jack()
204 alc_enable_headset_jack_key(codec); in alc_fixup_headset_jack()
209 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) in alc269vb_toggle_power_output() argument
211 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0); in alc269vb_toggle_power_output()
214 static void alc269_shutup(struct hda_codec *codec) in alc269_shutup() argument
216 struct alc_spec *spec = codec->spec; in alc269_shutup()
219 alc269vb_toggle_power_output(codec, 0); in alc269_shutup()
221 (alc_get_coef0(codec) & 0x00ff) == 0x018) { in alc269_shutup()
224 alc_shutup_pins(codec); in alc269_shutup()
260 static void alc282_restore_default_value(struct hda_codec *codec) in alc282_restore_default_value() argument
262 alc_process_coef_fw(codec, alc282_coefs); in alc282_restore_default_value()
265 static void alc282_init(struct hda_codec *codec) in alc282_init() argument
267 struct alc_spec *spec = codec->spec; in alc282_init()
272 alc282_restore_default_value(codec); in alc282_init()
276 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc282_init()
277 coef78 = alc_read_coef_idx(codec, 0x78); in alc282_init()
281 alc_write_coef_idx(codec, 0x78, 0x9004); in alc282_init()
286 snd_hda_codec_write(codec, hp_pin, 0, in alc282_init()
292 snd_hda_codec_write(codec, hp_pin, 0, in alc282_init()
299 alc_write_coef_idx(codec, 0x78, coef78); in alc282_init()
302 static void alc282_shutup(struct hda_codec *codec) in alc282_shutup() argument
304 struct alc_spec *spec = codec->spec; in alc282_shutup()
310 alc269_shutup(codec); in alc282_shutup()
314 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc282_shutup()
315 coef78 = alc_read_coef_idx(codec, 0x78); in alc282_shutup()
316 alc_write_coef_idx(codec, 0x78, 0x9004); in alc282_shutup()
321 snd_hda_codec_write(codec, hp_pin, 0, in alc282_shutup()
328 snd_hda_codec_write(codec, hp_pin, 0, in alc282_shutup()
334 alc_auto_setup_eapd(codec, false); in alc282_shutup()
335 alc_shutup_pins(codec); in alc282_shutup()
336 alc_write_coef_idx(codec, 0x78, coef78); in alc282_shutup()
376 static void alc283_restore_default_value(struct hda_codec *codec) in alc283_restore_default_value() argument
378 alc_process_coef_fw(codec, alc283_coefs); in alc283_restore_default_value()
381 static void alc283_init(struct hda_codec *codec) in alc283_init() argument
383 struct alc_spec *spec = codec->spec; in alc283_init()
387 alc283_restore_default_value(codec); in alc283_init()
393 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc283_init()
397 alc_write_coef_idx(codec, 0x43, 0x9004); in alc283_init()
399 snd_hda_codec_write(codec, hp_pin, 0, in alc283_init()
405 snd_hda_codec_write(codec, hp_pin, 0, in alc283_init()
412 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); in alc283_init()
414 alc_write_coef_idx(codec, 0x43, 0x9614); in alc283_init()
417 static void alc283_shutup(struct hda_codec *codec) in alc283_shutup() argument
419 struct alc_spec *spec = codec->spec; in alc283_shutup()
424 alc269_shutup(codec); in alc283_shutup()
428 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc283_shutup()
430 alc_write_coef_idx(codec, 0x43, 0x9004); in alc283_shutup()
433 alc_write_coef_idx(codec, 0x06, 0x2100); in alc283_shutup()
435 snd_hda_codec_write(codec, hp_pin, 0, in alc283_shutup()
442 snd_hda_codec_write(codec, hp_pin, 0, in alc283_shutup()
445 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); in alc283_shutup()
449 alc_auto_setup_eapd(codec, false); in alc283_shutup()
450 alc_shutup_pins(codec); in alc283_shutup()
451 alc_write_coef_idx(codec, 0x43, 0x9614); in alc283_shutup()
454 static void alc256_init(struct hda_codec *codec) in alc256_init() argument
456 struct alc_spec *spec = codec->spec; in alc256_init()
461 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1); in alc256_init()
462 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2); in alc256_init()
463 alc_update_coef_idx(codec, 0x08, 7<<4, 0); in alc256_init()
464 alc_update_coef_idx(codec, 0x3b, 1<<15, 0); in alc256_init()
465 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); in alc256_init()
474 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc256_init()
478 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ in alc256_init()
480 snd_hda_codec_write(codec, hp_pin, 0, in alc256_init()
485 snd_hda_codec_write(codec, hp_pin, 0, in alc256_init()
489 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ in alc256_init()
491 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); in alc256_init()
492 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ in alc256_init()
493 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); in alc256_init()
500 alc_write_coef_idx(codec, 0x36, 0x5757); in alc256_init()
503 static void alc256_shutup(struct hda_codec *codec) in alc256_shutup() argument
505 struct alc_spec *spec = codec->spec; in alc256_shutup()
512 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ in alc256_shutup()
513 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc256_shutup()
518 snd_hda_codec_write(codec, hp_pin, 0, in alc256_shutup()
529 alc_update_coef_idx(codec, 0x46, 0, 3 << 12); in alc256_shutup()
532 snd_hda_codec_write(codec, hp_pin, 0, in alc256_shutup()
538 alc_auto_setup_eapd(codec, false); in alc256_shutup()
539 alc_shutup_pins(codec); in alc256_shutup()
542 alc_update_coef_idx(codec, 0x03, 1<<1, 0); in alc256_shutup()
543 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4); in alc256_shutup()
544 alc_update_coef_idx(codec, 0x08, 3<<2, 0); in alc256_shutup()
545 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15); in alc256_shutup()
546 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); in alc256_shutup()
551 static void alc285_hp_init(struct hda_codec *codec) in alc285_hp_init() argument
553 struct alc_spec *spec = codec->spec; in alc285_hp_init()
558 alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */ in alc285_hp_init()
559 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */ in alc285_hp_init()
560 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */ in alc285_hp_init()
561 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */ in alc285_hp_init()
562 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */ in alc285_hp_init()
563 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0); in alc285_hp_init()
564 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0); in alc285_hp_init()
566 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); in alc285_hp_init()
569 snd_hda_codec_write(codec, hp_pin, 0, in alc285_hp_init()
573 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14); in alc285_hp_init()
574 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0); in alc285_hp_init()
577 snd_hda_codec_write(codec, hp_pin, 0, in alc285_hp_init()
580 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */ in alc285_hp_init()
581 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880); in alc285_hp_init()
582 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049); in alc285_hp_init()
583 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0); in alc285_hp_init()
585 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */ in alc285_hp_init()
586 val = alc_read_coefex_idx(codec, 0x58, 0x00); in alc285_hp_init()
589 val = alc_read_coefex_idx(codec, 0x58, 0x00); in alc285_hp_init()
592 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */ in alc285_hp_init()
593 alc_update_coef_idx(codec, 0x38, 1<<4, coef38); in alc285_hp_init()
594 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d); in alc285_hp_init()
595 alc_update_coef_idx(codec, 0x36, 3<<13, coef36); in alc285_hp_init()
598 alc_update_coef_idx(codec, 0x4a, 1<<15, 0); in alc285_hp_init()
601 static void alc225_init(struct hda_codec *codec) in alc225_init() argument
603 struct alc_spec *spec = codec->spec; in alc225_init()
608 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2); in alc225_init()
609 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6); in alc225_init()
610 alc_update_coef_idx(codec, 0x33, 1<<11, 0); in alc225_init()
618 is_s3_resume(codec) || in alc225_init()
619 is_s4_resume(codec)) { in alc225_init()
620 alc285_hp_init(codec); in alc225_init()
628 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc225_init()
629 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); in alc225_init()
633 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ in alc225_init()
636 snd_hda_codec_write(codec, hp_pin, 0, in alc225_init()
639 snd_hda_codec_write(codec, 0x16, 0, in alc225_init()
644 snd_hda_codec_write(codec, hp_pin, 0, in alc225_init()
647 snd_hda_codec_write(codec, 0x16, 0, in alc225_init()
651 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); in alc225_init()
652 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ in alc225_init()
656 static void alc225_shutup(struct hda_codec *codec) in alc225_shutup() argument
658 struct alc_spec *spec = codec->spec; in alc225_shutup()
665 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc225_shutup()
666 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); in alc225_shutup()
669 alc_disable_headset_jack_key(codec); in alc225_shutup()
671 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); in alc225_shutup()
675 snd_hda_codec_write(codec, hp_pin, 0, in alc225_shutup()
678 snd_hda_codec_write(codec, 0x16, 0, in alc225_shutup()
684 snd_hda_codec_write(codec, hp_pin, 0, in alc225_shutup()
687 snd_hda_codec_write(codec, 0x16, 0, in alc225_shutup()
691 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); in alc225_shutup()
692 alc_enable_headset_jack_key(codec); in alc225_shutup()
694 alc_auto_setup_eapd(codec, false); in alc225_shutup()
695 alc_shutup_pins(codec); in alc225_shutup()
698 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2); in alc225_shutup()
699 alc_update_coef_idx(codec, 0x0e, 7<<6, 0); in alc225_shutup()
700 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11); in alc225_shutup()
701 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); in alc225_shutup()
706 static void alc222_init(struct hda_codec *codec) in alc222_init() argument
708 struct alc_spec *spec = codec->spec; in alc222_init()
717 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc222_init()
718 hp2_pin_sense = snd_hda_jack_detect(codec, 0x14); in alc222_init()
724 snd_hda_codec_write(codec, hp_pin, 0, in alc222_init()
727 snd_hda_codec_write(codec, 0x14, 0, in alc222_init()
732 snd_hda_codec_write(codec, hp_pin, 0, in alc222_init()
735 snd_hda_codec_write(codec, 0x14, 0, in alc222_init()
742 static void alc222_shutup(struct hda_codec *codec) in alc222_shutup() argument
744 struct alc_spec *spec = codec->spec; in alc222_shutup()
751 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc222_shutup()
752 hp2_pin_sense = snd_hda_jack_detect(codec, 0x14); in alc222_shutup()
758 snd_hda_codec_write(codec, hp_pin, 0, in alc222_shutup()
761 snd_hda_codec_write(codec, 0x14, 0, in alc222_shutup()
767 snd_hda_codec_write(codec, hp_pin, 0, in alc222_shutup()
770 snd_hda_codec_write(codec, 0x14, 0, in alc222_shutup()
775 alc_auto_setup_eapd(codec, false); in alc222_shutup()
776 alc_shutup_pins(codec); in alc222_shutup()
779 static void alc_default_init(struct hda_codec *codec) in alc_default_init() argument
781 struct alc_spec *spec = codec->spec; in alc_default_init()
790 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc_default_init()
795 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_init()
800 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_init()
806 static void alc_default_shutup(struct hda_codec *codec) in alc_default_shutup() argument
808 struct alc_spec *spec = codec->spec; in alc_default_shutup()
813 alc269_shutup(codec); in alc_default_shutup()
817 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); in alc_default_shutup()
822 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_shutup()
828 snd_hda_codec_write(codec, hp_pin, 0, in alc_default_shutup()
833 alc_auto_setup_eapd(codec, false); in alc_default_shutup()
834 alc_shutup_pins(codec); in alc_default_shutup()
837 static void alc294_hp_init(struct hda_codec *codec) in alc294_hp_init() argument
839 struct alc_spec *spec = codec->spec; in alc294_hp_init()
846 snd_hda_codec_write(codec, hp_pin, 0, in alc294_hp_init()
852 snd_hda_codec_write(codec, hp_pin, 0, in alc294_hp_init()
855 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */ in alc294_hp_init()
856 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */ in alc294_hp_init()
859 val = alc_read_coefex_idx(codec, 0x58, 0x01); in alc294_hp_init()
862 val = alc_read_coefex_idx(codec, 0x58, 0x01); in alc294_hp_init()
865 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b); in alc294_hp_init()
869 static void alc294_init(struct hda_codec *codec) in alc294_init() argument
871 struct alc_spec *spec = codec->spec; in alc294_init()
875 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) { in alc294_init()
876 alc294_hp_init(codec); in alc294_init()
879 alc_default_init(codec); in alc294_init()
882 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, in alc5505_coef_set() argument
885 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); in alc5505_coef_set()
886 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */ in alc5505_coef_set()
887 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */ in alc5505_coef_set()
890 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg) in alc5505_coef_get() argument
894 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1); in alc5505_coef_get()
895 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) in alc5505_coef_get()
897 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0) in alc5505_coef_get()
902 static void alc5505_dsp_halt(struct hda_codec *codec) in alc5505_dsp_halt() argument
906 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */ in alc5505_dsp_halt()
907 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */ in alc5505_dsp_halt()
908 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */ in alc5505_dsp_halt()
909 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */ in alc5505_dsp_halt()
910 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */ in alc5505_dsp_halt()
911 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */ in alc5505_dsp_halt()
912 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */ in alc5505_dsp_halt()
913 val = alc5505_coef_get(codec, 0x6220); in alc5505_dsp_halt()
914 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */ in alc5505_dsp_halt()
917 static void alc5505_dsp_back_from_halt(struct hda_codec *codec) in alc5505_dsp_back_from_halt() argument
919 alc5505_coef_set(codec, 0x61b8, 0x04133302); in alc5505_dsp_back_from_halt()
920 alc5505_coef_set(codec, 0x61b0, 0x00005b16); in alc5505_dsp_back_from_halt()
921 alc5505_coef_set(codec, 0x61b4, 0x040a2b02); in alc5505_dsp_back_from_halt()
922 alc5505_coef_set(codec, 0x6230, 0xf80d4011); in alc5505_dsp_back_from_halt()
923 alc5505_coef_set(codec, 0x6220, 0x2002010f); in alc5505_dsp_back_from_halt()
924 alc5505_coef_set(codec, 0x880c, 0x00000004); in alc5505_dsp_back_from_halt()
927 static void alc5505_dsp_init(struct hda_codec *codec) in alc5505_dsp_init() argument
931 alc5505_dsp_halt(codec); in alc5505_dsp_init()
932 alc5505_dsp_back_from_halt(codec); in alc5505_dsp_init()
933 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */ in alc5505_dsp_init()
934 alc5505_coef_set(codec, 0x61b0, 0x5b16); in alc5505_dsp_init()
935 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */ in alc5505_dsp_init()
936 alc5505_coef_set(codec, 0x61b4, 0x04132b02); in alc5505_dsp_init()
937 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/ in alc5505_dsp_init()
938 alc5505_coef_set(codec, 0x61b8, 0x041f3302); in alc5505_dsp_init()
939 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */ in alc5505_dsp_init()
940 alc5505_coef_set(codec, 0x61b8, 0x041b3302); in alc5505_dsp_init()
941 alc5505_coef_set(codec, 0x61b8, 0x04173302); in alc5505_dsp_init()
942 alc5505_coef_set(codec, 0x61b8, 0x04163302); in alc5505_dsp_init()
943 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */ in alc5505_dsp_init()
944 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */ in alc5505_dsp_init()
945 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */ in alc5505_dsp_init()
947 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */ in alc5505_dsp_init()
949 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */ in alc5505_dsp_init()
951 alc5505_coef_set(codec, 0x6220, 0x6002018f); in alc5505_dsp_init()
953 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/ in alc5505_dsp_init()
954 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */ in alc5505_dsp_init()
955 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */ in alc5505_dsp_init()
956 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */ in alc5505_dsp_init()
957 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */ in alc5505_dsp_init()
958 alc5505_coef_set(codec, 0x880c, 0x00000003); in alc5505_dsp_init()
959 alc5505_coef_set(codec, 0x880c, 0x00000010); in alc5505_dsp_init()
962 alc5505_dsp_halt(codec); in alc5505_dsp_init()
967 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */ argument
968 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */ argument
970 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec) argument
971 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec) argument
974 static int alc269_suspend(struct hda_codec *codec) in alc269_suspend() argument
976 struct alc_spec *spec = codec->spec; in alc269_suspend()
979 alc5505_dsp_suspend(codec); in alc269_suspend()
981 return alc_suspend(codec); in alc269_suspend()
984 static int alc269_resume(struct hda_codec *codec) in alc269_resume() argument
986 struct alc_spec *spec = codec->spec; in alc269_resume()
989 alc269vb_toggle_power_output(codec, 0); in alc269_resume()
991 (alc_get_coef0(codec) & 0x00ff) == 0x018) { in alc269_resume()
995 snd_hda_codec_init(codec); in alc269_resume()
998 alc269vb_toggle_power_output(codec, 1); in alc269_resume()
1000 (alc_get_coef0(codec) & 0x00ff) == 0x017) { in alc269_resume()
1004 snd_hda_regmap_sync(codec); in alc269_resume()
1005 hda_call_check_power_status(codec, 0x01); in alc269_resume()
1012 alc_write_gpio_data(codec); in alc269_resume()
1015 alc5505_dsp_resume(codec); in alc269_resume()
1020 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, in alc269_fixup_pincfg_no_hp_to_lineout() argument
1023 struct alc_spec *spec = codec->spec; in alc269_fixup_pincfg_no_hp_to_lineout()
1029 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec, in alc269_fixup_pincfg_U7x7_headset_mic() argument
1033 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21); in alc269_fixup_pincfg_U7x7_headset_mic()
1034 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19); in alc269_fixup_pincfg_U7x7_headset_mic()
1037 snd_hda_codec_set_pincfg(codec, 0x19, in alc269_fixup_pincfg_U7x7_headset_mic()
1042 static void alc269_fixup_hweq(struct hda_codec *codec, in alc269_fixup_hweq() argument
1046 alc_update_coef_idx(codec, 0x1e, 0, 0x80); in alc269_fixup_hweq()
1049 static void alc271_fixup_dmic(struct hda_codec *codec, in alc271_fixup_dmic() argument
1059 if (strcmp(codec->core.chip_name, "ALC271X") && in alc271_fixup_dmic()
1060 strcmp(codec->core.chip_name, "ALC269VB")) in alc271_fixup_dmic()
1062 cfg = snd_hda_codec_get_pincfg(codec, 0x12); in alc271_fixup_dmic()
1064 snd_hda_sequence_write(codec, verbs); in alc271_fixup_dmic()
1068 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec, in alc269vb_fixup_aspire_e1_coef() argument
1073 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000); in alc269vb_fixup_aspire_e1_coef()
1076 static void alc269_fixup_pcm_44k(struct hda_codec *codec, in alc269_fixup_pcm_44k() argument
1079 struct alc_spec *spec = codec->spec; in alc269_fixup_pcm_44k()
1091 static void alc269_fixup_stereo_dmic(struct hda_codec *codec, in alc269_fixup_stereo_dmic() argument
1100 alc_update_coef_idx(codec, 0x07, 0, 0x80); in alc269_fixup_stereo_dmic()
1103 static void alc269_quanta_automute(struct hda_codec *codec) in alc269_quanta_automute() argument
1105 snd_hda_gen_update_outputs(codec); in alc269_quanta_automute()
1107 alc_write_coef_idx(codec, 0x0c, 0x680); in alc269_quanta_automute()
1108 alc_write_coef_idx(codec, 0x0c, 0x480); in alc269_quanta_automute()
1111 static void alc269_fixup_quanta_mute(struct hda_codec *codec, in alc269_fixup_quanta_mute() argument
1114 struct alc_spec *spec = codec->spec; in alc269_fixup_quanta_mute()
1120 static void alc269_x101_hp_automute_hook(struct hda_codec *codec, in alc269_x101_hp_automute_hook() argument
1123 struct alc_spec *spec = codec->spec; in alc269_x101_hp_automute_hook()
1126 snd_hda_gen_hp_automute(codec, jack); in alc269_x101_hp_automute_hook()
1130 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc269_x101_hp_automute_hook()
1133 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc269_x101_hp_automute_hook()
1145 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec, in alc298_huawei_mbx_stereo_seq() argument
1149 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0); in alc298_huawei_mbx_stereo_seq()
1150 alc_write_coef_idx(codec, 0x26, 0xb000); in alc298_huawei_mbx_stereo_seq()
1153 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0); in alc298_huawei_mbx_stereo_seq()
1155 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); in alc298_huawei_mbx_stereo_seq()
1156 alc_write_coef_idx(codec, 0x26, 0xf000); in alc298_huawei_mbx_stereo_seq()
1157 alc_write_coef_idx(codec, 0x23, initval->value_0x23); in alc298_huawei_mbx_stereo_seq()
1160 alc_write_coef_idx(codec, 0x25, initval->value_0x25); in alc298_huawei_mbx_stereo_seq()
1162 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); in alc298_huawei_mbx_stereo_seq()
1163 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); in alc298_huawei_mbx_stereo_seq()
1166 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec, in alc298_fixup_huawei_mbx_stereo() argument
1190 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00); in alc298_fixup_huawei_mbx_stereo()
1191 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80); in alc298_fixup_huawei_mbx_stereo()
1192 alc_write_coef_idx(codec, 0x26, 0xf000); in alc298_fixup_huawei_mbx_stereo()
1193 alc_write_coef_idx(codec, 0x22, 0x31); in alc298_fixup_huawei_mbx_stereo()
1194 alc_write_coef_idx(codec, 0x23, 0x0b); in alc298_fixup_huawei_mbx_stereo()
1195 alc_write_coef_idx(codec, 0x25, 0x00); in alc298_fixup_huawei_mbx_stereo()
1196 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26); in alc298_fixup_huawei_mbx_stereo()
1197 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010); in alc298_fixup_huawei_mbx_stereo()
1200 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init); in alc298_fixup_huawei_mbx_stereo()
1203 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec, in alc269_fixup_x101_headset_mic() argument
1206 struct alc_spec *spec = codec->spec; in alc269_fixup_x101_headset_mic()
1213 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin, in alc_update_vref_led() argument
1222 pinval = snd_hda_codec_get_pin_target(codec, pin); in alc_update_vref_led()
1226 snd_hda_power_up_pm(codec); in alc_update_vref_led()
1227 snd_hda_set_pin_ctl_cache(codec, pin, pinval); in alc_update_vref_led()
1228 snd_hda_power_down_pm(codec); in alc_update_vref_led()
1235 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in vref_mute_led_set() local
1236 struct alc_spec *spec = codec->spec; in vref_mute_led_set()
1238 alc_update_vref_led(codec, spec->mute_led_nid, in vref_mute_led_set()
1244 static unsigned int led_power_filter(struct hda_codec *codec, in led_power_filter() argument
1248 struct alc_spec *spec = codec->spec; in led_power_filter()
1255 snd_hda_set_pin_ctl(codec, nid, in led_power_filter()
1256 snd_hda_codec_get_pin_target(codec, nid)); in led_power_filter()
1258 return snd_hda_gen_path_power_filter(codec, nid, power_state); in led_power_filter()
1261 static void alc269_fixup_hp_mute_led(struct hda_codec *codec, in alc269_fixup_hp_mute_led() argument
1264 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_mute_led()
1278 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); in alc269_fixup_hp_mute_led()
1279 codec->power_filter = led_power_filter; in alc269_fixup_hp_mute_led()
1280 codec_dbg(codec, in alc269_fixup_hp_mute_led()
1287 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, in alc269_fixup_hp_mute_led_micx() argument
1291 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_mute_led_micx()
1296 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set); in alc269_fixup_hp_mute_led_micx()
1297 codec->power_filter = led_power_filter; in alc269_fixup_hp_mute_led_micx()
1301 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, in alc269_fixup_hp_mute_led_mic1() argument
1304 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); in alc269_fixup_hp_mute_led_mic1()
1307 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, in alc269_fixup_hp_mute_led_mic2() argument
1310 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); in alc269_fixup_hp_mute_led_mic2()
1313 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, in alc269_fixup_hp_mute_led_mic3() argument
1316 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); in alc269_fixup_hp_mute_led_mic3()
1319 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec, in alc236_fixup_hp_gpio_led() argument
1322 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01); in alc236_fixup_hp_gpio_led()
1325 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec, in alc269_fixup_hp_gpio_led() argument
1328 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); in alc269_fixup_hp_gpio_led()
1331 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec, in alc285_fixup_hp_gpio_led() argument
1334 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01); in alc285_fixup_hp_gpio_led()
1337 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec, in alc286_fixup_hp_gpio_led() argument
1340 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20); in alc286_fixup_hp_gpio_led()
1343 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec, in alc287_fixup_hp_gpio_led() argument
1346 alc_fixup_hp_gpio_led(codec, action, 0x10, 0); in alc287_fixup_hp_gpio_led()
1349 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec, in alc245_fixup_hp_gpio_led() argument
1352 struct alc_spec *spec = codec->spec; in alc245_fixup_hp_gpio_led()
1356 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); in alc245_fixup_hp_gpio_led()
1363 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in vref_micmute_led_set() local
1364 struct alc_spec *spec = codec->spec; in vref_micmute_led_set()
1366 alc_update_vref_led(codec, spec->cap_mute_led_nid, in vref_micmute_led_set()
1371 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec, in alc269_fixup_hp_gpio_mic1_led() argument
1374 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_gpio_mic1_led()
1376 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); in alc269_fixup_hp_gpio_mic1_led()
1384 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); in alc269_fixup_hp_gpio_mic1_led()
1385 codec->power_filter = led_power_filter; in alc269_fixup_hp_gpio_mic1_led()
1389 static void alc280_fixup_hp_gpio4(struct hda_codec *codec, in alc280_fixup_hp_gpio4() argument
1392 struct alc_spec *spec = codec->spec; in alc280_fixup_hp_gpio4()
1394 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); in alc280_fixup_hp_gpio4()
1397 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); in alc280_fixup_hp_gpio4()
1398 codec->power_filter = led_power_filter; in alc280_fixup_hp_gpio4()
1405 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec, in alc245_fixup_hp_x360_amp() argument
1408 struct alc_spec *spec = codec->spec; in alc245_fixup_hp_x360_amp()
1417 alc_update_gpio_data(codec, 0x01, true); in alc245_fixup_hp_x360_amp()
1419 alc_update_gpio_data(codec, 0x01, false); in alc245_fixup_hp_x360_amp()
1426 struct hda_codec *codec, in alc274_hp_envy_pcm_hook() argument
1432 alc_update_gpio_data(codec, 0x04, true); in alc274_hp_envy_pcm_hook()
1435 alc_update_gpio_data(codec, 0x04, false); in alc274_hp_envy_pcm_hook()
1440 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec, in alc274_fixup_hp_envy_gpio() argument
1444 struct alc_spec *spec = codec->spec; in alc274_fixup_hp_envy_gpio()
1453 static void alc_update_coef_led(struct hda_codec *codec, in alc_update_coef_led() argument
1460 alc_update_coef_idx(codec, led->idx, led->mask, in alc_update_coef_led()
1468 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in coef_mute_led_set() local
1469 struct alc_spec *spec = codec->spec; in coef_mute_led_set()
1471 alc_update_coef_led(codec, &spec->mute_led_coef, in coef_mute_led_set()
1476 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec, in alc285_fixup_hp_mute_led_coefbit() argument
1480 struct alc_spec *spec = codec->spec; in alc285_fixup_hp_mute_led_coefbit()
1488 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); in alc285_fixup_hp_mute_led_coefbit()
1492 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec, in alc236_fixup_hp_mute_led_coefbit() argument
1496 struct alc_spec *spec = codec->spec; in alc236_fixup_hp_mute_led_coefbit()
1504 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); in alc236_fixup_hp_mute_led_coefbit()
1508 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec, in alc236_fixup_hp_mute_led_coefbit2() argument
1511 struct alc_spec *spec = codec->spec; in alc236_fixup_hp_mute_led_coefbit2()
1519 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); in alc236_fixup_hp_mute_led_coefbit2()
1523 static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec, in alc245_fixup_hp_mute_led_coefbit() argument
1527 struct alc_spec *spec = codec->spec; in alc245_fixup_hp_mute_led_coefbit()
1535 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); in alc245_fixup_hp_mute_led_coefbit()
1539 static void alc245_fixup_hp_mute_led_v1_coefbit(struct hda_codec *codec, in alc245_fixup_hp_mute_led_v1_coefbit() argument
1543 struct alc_spec *spec = codec->spec; in alc245_fixup_hp_mute_led_v1_coefbit()
1551 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); in alc245_fixup_hp_mute_led_v1_coefbit()
1559 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent); in coef_micmute_led_set() local
1560 struct alc_spec *spec = codec->spec; in coef_micmute_led_set()
1562 alc_update_coef_led(codec, &spec->mic_led_coef, in coef_micmute_led_set()
1567 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec, in alc285_fixup_hp_coef_micmute_led() argument
1570 struct alc_spec *spec = codec->spec; in alc285_fixup_hp_coef_micmute_led()
1577 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); in alc285_fixup_hp_coef_micmute_led()
1581 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec, in alc285_fixup_hp_gpio_micmute_led() argument
1584 struct alc_spec *spec = codec->spec; in alc285_fixup_hp_gpio_micmute_led()
1588 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); in alc285_fixup_hp_gpio_micmute_led()
1591 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec, in alc236_fixup_hp_coef_micmute_led() argument
1594 struct alc_spec *spec = codec->spec; in alc236_fixup_hp_coef_micmute_led()
1601 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set); in alc236_fixup_hp_coef_micmute_led()
1605 static void alc295_fixup_hp_mute_led_coefbit11(struct hda_codec *codec, in alc295_fixup_hp_mute_led_coefbit11() argument
1608 struct alc_spec *spec = codec->spec; in alc295_fixup_hp_mute_led_coefbit11()
1616 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set); in alc295_fixup_hp_mute_led_coefbit11()
1620 static void alc285_fixup_hp_mute_led(struct hda_codec *codec, in alc285_fixup_hp_mute_led() argument
1623 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); in alc285_fixup_hp_mute_led()
1624 alc285_fixup_hp_coef_micmute_led(codec, fix, action); in alc285_fixup_hp_mute_led()
1627 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec, in alc285_fixup_hp_spectre_x360_mute_led() argument
1630 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); in alc285_fixup_hp_spectre_x360_mute_led()
1631 alc285_fixup_hp_gpio_micmute_led(codec, fix, action); in alc285_fixup_hp_spectre_x360_mute_led()
1634 static void alc236_fixup_hp_mute_led(struct hda_codec *codec, in alc236_fixup_hp_mute_led() argument
1637 alc236_fixup_hp_mute_led_coefbit(codec, fix, action); in alc236_fixup_hp_mute_led()
1638 alc236_fixup_hp_coef_micmute_led(codec, fix, action); in alc236_fixup_hp_mute_led()
1641 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec, in alc236_fixup_hp_micmute_led_vref() argument
1644 struct alc_spec *spec = codec->spec; in alc236_fixup_hp_micmute_led_vref()
1648 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); in alc236_fixup_hp_micmute_led_vref()
1649 codec->power_filter = led_power_filter; in alc236_fixup_hp_micmute_led_vref()
1653 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec, in alc236_fixup_hp_mute_led_micmute_vref() argument
1656 alc236_fixup_hp_mute_led_coefbit(codec, fix, action); in alc236_fixup_hp_mute_led_micmute_vref()
1657 alc236_fixup_hp_micmute_led_vref(codec, fix, action); in alc236_fixup_hp_mute_led_micmute_vref()
1660 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec, in alc298_samsung_write_coef_pack() argument
1663 alc_write_coef_idx(codec, 0x23, coefs[0]); in alc298_samsung_write_coef_pack()
1664 alc_write_coef_idx(codec, 0x25, coefs[1]); in alc298_samsung_write_coef_pack()
1665 alc_write_coef_idx(codec, 0x26, 0xb011); in alc298_samsung_write_coef_pack()
1673 static void alc298_fixup_samsung_amp(struct hda_codec *codec, in alc298_fixup_samsung_amp() argument
1692 alc_write_coef_idx(codec, 0x22, amps[i].nid); in alc298_fixup_samsung_amp()
1695 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]); in alc298_fixup_samsung_amp()
1698 alc298_samsung_write_coef_pack(codec, init_seq[j]); in alc298_fixup_samsung_amp()
1742 static void alc298_samsung_v2_enable_amps(struct hda_codec *codec) in alc298_samsung_v2_enable_amps() argument
1744 struct alc_spec *spec = codec->spec; in alc298_samsung_v2_enable_amps()
1751 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid); in alc298_samsung_v2_enable_amps()
1753 alc298_samsung_write_coef_pack(codec, enable_seq[j]); in alc298_samsung_v2_enable_amps()
1754 codec_dbg(codec, "alc298_samsung_v2: Enabled speaker amp 0x%02x\n", in alc298_samsung_v2_enable_amps()
1759 static void alc298_samsung_v2_disable_amps(struct hda_codec *codec) in alc298_samsung_v2_disable_amps() argument
1761 struct alc_spec *spec = codec->spec; in alc298_samsung_v2_disable_amps()
1768 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid); in alc298_samsung_v2_disable_amps()
1770 alc298_samsung_write_coef_pack(codec, disable_seq[j]); in alc298_samsung_v2_disable_amps()
1771 codec_dbg(codec, "alc298_samsung_v2: Disabled speaker amp 0x%02x\n", in alc298_samsung_v2_disable_amps()
1777 struct hda_codec *codec, in alc298_samsung_v2_playback_hook() argument
1783 alc298_samsung_v2_enable_amps(codec); in alc298_samsung_v2_playback_hook()
1785 alc298_samsung_v2_disable_amps(codec); in alc298_samsung_v2_playback_hook()
1788 static void alc298_samsung_v2_init_amps(struct hda_codec *codec, in alc298_samsung_v2_init_amps() argument
1791 struct alc_spec *spec = codec->spec; in alc298_samsung_v2_init_amps()
1798 alc298_samsung_v2_disable_amps(codec); in alc298_samsung_v2_init_amps()
1802 alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid); in alc298_samsung_v2_init_amps()
1804 alc298_samsung_write_coef_pack(codec, in alc298_samsung_v2_init_amps()
1807 alc_write_coef_idx(codec, 0x89, 0x0); in alc298_samsung_v2_init_amps()
1808 codec_dbg(codec, "alc298_samsung_v2: Initialized speaker amp 0x%02x\n", in alc298_samsung_v2_init_amps()
1816 static void alc298_fixup_samsung_amp_v2_2_amps(struct hda_codec *codec, in alc298_fixup_samsung_amp_v2_2_amps() argument
1820 alc298_samsung_v2_init_amps(codec, 2); in alc298_fixup_samsung_amp_v2_2_amps()
1823 static void alc298_fixup_samsung_amp_v2_4_amps(struct hda_codec *codec, in alc298_fixup_samsung_amp_v2_4_amps() argument
1827 alc298_samsung_v2_init_amps(codec, 4); in alc298_fixup_samsung_amp_v2_4_amps()
1830 static void gpio2_mic_hotkey_event(struct hda_codec *codec, in gpio2_mic_hotkey_event() argument
1833 struct alc_spec *spec = codec->spec; in gpio2_mic_hotkey_event()
1843 static int alc_register_micmute_input_device(struct hda_codec *codec) in alc_register_micmute_input_device() argument
1845 struct alc_spec *spec = codec->spec; in alc_register_micmute_input_device()
1850 codec_err(codec, "Out of memory (input_allocate_device)\n"); in alc_register_micmute_input_device()
1865 codec_err(codec, "input_register_device failed\n"); in alc_register_micmute_input_device()
1879 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec, in alc280_fixup_hp_gpio2_mic_hotkey() argument
1882 struct alc_spec *spec = codec->spec; in alc280_fixup_hp_gpio2_mic_hotkey()
1884 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10); in alc280_fixup_hp_gpio2_mic_hotkey()
1887 if (alc_register_micmute_input_device(codec) != 0) in alc280_fixup_hp_gpio2_mic_hotkey()
1893 snd_hda_codec_write_cache(codec, codec->core.afg, 0, in alc280_fixup_hp_gpio2_mic_hotkey()
1895 snd_hda_jack_detect_enable_callback(codec, codec->core.afg, in alc280_fixup_hp_gpio2_mic_hotkey()
1913 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec, in alc233_fixup_lenovo_line2_mic_hotkey() argument
1916 struct alc_spec *spec = codec->spec; in alc233_fixup_lenovo_line2_mic_hotkey()
1918 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); in alc233_fixup_lenovo_line2_mic_hotkey()
1921 if (alc_register_micmute_input_device(codec) != 0) in alc233_fixup_lenovo_line2_mic_hotkey()
1924 snd_hda_jack_detect_enable_callback(codec, 0x1b, in alc233_fixup_lenovo_line2_mic_hotkey()
1939 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, in alc269_fixup_hp_line1_mic1_led() argument
1942 struct alc_spec *spec = codec->spec; in alc269_fixup_hp_line1_mic1_led()
1944 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a); in alc269_fixup_hp_line1_mic1_led()
1947 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set); in alc269_fixup_hp_line1_mic1_led()
1951 static void alc233_fixup_lenovo_low_en_micmute_led(struct hda_codec *codec, in alc233_fixup_lenovo_low_en_micmute_led() argument
1954 struct alc_spec *spec = codec->spec; in alc233_fixup_lenovo_low_en_micmute_led()
1958 alc233_fixup_lenovo_line2_mic_hotkey(codec, fix, action); in alc233_fixup_lenovo_low_en_micmute_led()
1961 static void alc255_set_default_jack_type(struct hda_codec *codec) in alc255_set_default_jack_type() argument
1980 switch (codec->core.vendor_id) { in alc255_set_default_jack_type()
1982 alc_process_coef_fw(codec, alc255fw); in alc255_set_default_jack_type()
1988 alc_process_coef_fw(codec, alc256fw); in alc255_set_default_jack_type()
1994 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec, in alc_fixup_headset_mode_alc255() argument
1998 alc255_set_default_jack_type(codec); in alc_fixup_headset_mode_alc255()
2000 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc255()
2003 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec, in alc_fixup_headset_mode_alc255_no_hp_mic() argument
2007 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode_alc255_no_hp_mic()
2009 alc255_set_default_jack_type(codec); in alc_fixup_headset_mode_alc255_no_hp_mic()
2012 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_alc255_no_hp_mic()
2015 static void alc288_update_headset_jack_cb(struct hda_codec *codec, in alc288_update_headset_jack_cb() argument
2018 struct alc_spec *spec = codec->spec; in alc288_update_headset_jack_cb()
2020 alc_update_headset_jack_cb(codec, jack); in alc288_update_headset_jack_cb()
2022 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present); in alc288_update_headset_jack_cb()
2025 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec, in alc_fixup_headset_mode_dell_alc288() argument
2028 alc_fixup_headset_mode(codec, fix, action); in alc_fixup_headset_mode_dell_alc288()
2030 struct alc_spec *spec = codec->spec; in alc_fixup_headset_mode_dell_alc288()
2038 static void alc_fixup_no_shutup(struct hda_codec *codec, in alc_fixup_no_shutup() argument
2042 struct alc_spec *spec = codec->spec; in alc_fixup_no_shutup()
2048 static void alc_fixup_tpt440_dock(struct hda_codec *codec, in alc_fixup_tpt440_dock() argument
2056 struct alc_spec *spec = codec->spec; in alc_fixup_tpt440_dock()
2060 codec->power_save_node = 0; /* avoid click noises */ in alc_fixup_tpt440_dock()
2061 snd_hda_apply_pincfgs(codec, pincfgs); in alc_fixup_tpt440_dock()
2065 static void alc_fixup_tpt470_dock(struct hda_codec *codec, in alc_fixup_tpt470_dock() argument
2073 struct alc_spec *spec = codec->spec; in alc_fixup_tpt470_dock()
2077 snd_hda_apply_pincfgs(codec, pincfgs); in alc_fixup_tpt470_dock()
2080 snd_hda_codec_write(codec, 0x17, 0, in alc_fixup_tpt470_dock()
2083 snd_hda_codec_write(codec, 0x19, 0, in alc_fixup_tpt470_dock()
2088 static void alc_fixup_tpt470_dacs(struct hda_codec *codec, in alc_fixup_tpt470_dacs() argument
2099 struct alc_spec *spec = codec->spec; in alc_fixup_tpt470_dacs()
2105 static void alc295_fixup_asus_dacs(struct hda_codec *codec, in alc295_fixup_asus_dacs() argument
2111 struct alc_spec *spec = codec->spec; in alc295_fixup_asus_dacs()
2117 static void alc271_hp_gate_mic_jack(struct hda_codec *codec, in alc271_hp_gate_mic_jack() argument
2121 struct alc_spec *spec = codec->spec; in alc271_hp_gate_mic_jack()
2124 int mic_pin = alc_find_ext_mic_pin(codec); in alc271_hp_gate_mic_jack()
2129 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin); in alc271_hp_gate_mic_jack()
2133 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, in alc269_fixup_limit_int_mic_boost() argument
2137 struct alc_spec *spec = codec->spec; in alc269_fixup_limit_int_mic_boost()
2153 defcfg = snd_hda_codec_get_pincfg(codec, nid); in alc269_fixup_limit_int_mic_boost()
2157 snd_hda_override_amp_caps(codec, nid, HDA_INPUT, in alc269_fixup_limit_int_mic_boost()
2165 static void alc283_hp_automute_hook(struct hda_codec *codec, in alc283_hp_automute_hook() argument
2168 struct alc_spec *spec = codec->spec; in alc283_hp_automute_hook()
2172 snd_hda_gen_hp_automute(codec, jack); in alc283_hp_automute_hook()
2177 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc283_hp_automute_hook()
2181 static void alc283_fixup_chromebook(struct hda_codec *codec, in alc283_fixup_chromebook() argument
2184 struct alc_spec *spec = codec->spec; in alc283_fixup_chromebook()
2188 snd_hda_override_wcaps(codec, 0x03, 0); in alc283_fixup_chromebook()
2195 alc_update_coef_idx(codec, 0x06, 0x000c, 0); in alc283_fixup_chromebook()
2197 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4); in alc283_fixup_chromebook()
2202 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec, in alc283_fixup_sense_combo_jack() argument
2205 struct alc_spec *spec = codec->spec; in alc283_fixup_sense_combo_jack()
2214 alc_update_coef_idx(codec, 0x06, 0x000c, 0); in alc283_fixup_sense_combo_jack()
2220 static void asus_tx300_automute(struct hda_codec *codec) in asus_tx300_automute() argument
2222 struct alc_spec *spec = codec->spec; in asus_tx300_automute()
2223 snd_hda_gen_update_outputs(codec); in asus_tx300_automute()
2224 if (snd_hda_jack_detect(codec, 0x1b)) in asus_tx300_automute()
2228 static void alc282_fixup_asus_tx300(struct hda_codec *codec, in alc282_fixup_asus_tx300() argument
2231 struct alc_spec *spec = codec->spec; in alc282_fixup_asus_tx300()
2241 alc_setup_gpio(codec, 0x04); in alc282_fixup_asus_tx300()
2242 snd_hda_apply_pincfgs(codec, dock_pins); in alc282_fixup_asus_tx300()
2245 snd_hda_jack_detect_enable_callback(codec, 0x1b, in alc282_fixup_asus_tx300()
2255 rename_ctl(codec, "Speaker Playback Switch", in alc282_fixup_asus_tx300()
2257 rename_ctl(codec, "Bass Speaker Playback Switch", in alc282_fixup_asus_tx300()
2263 static void alc290_fixup_mono_speakers(struct hda_codec *codec, in alc290_fixup_mono_speakers() argument
2271 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1); in alc290_fixup_mono_speakers()
2272 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1); in alc290_fixup_mono_speakers()
2276 static void alc298_fixup_speaker_volume(struct hda_codec *codec, in alc298_fixup_speaker_volume() argument
2288 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1); in alc298_fixup_speaker_volume()
2293 static void alc295_fixup_disable_dac3(struct hda_codec *codec, in alc295_fixup_disable_dac3() argument
2298 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc295_fixup_disable_dac3()
2303 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec, in alc285_fixup_speaker2_to_dac1() argument
2308 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc285_fixup_speaker2_to_dac1()
2313 static void alc294_fixup_bass_speaker_15(struct hda_codec *codec, in alc294_fixup_bass_speaker_15() argument
2318 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn); in alc294_fixup_bass_speaker_15()
2319 snd_hda_gen_add_micmute_led_cdev(codec, NULL); in alc294_fixup_bass_speaker_15()
2324 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec, in alc280_hp_gpio4_automute_hook() argument
2327 struct alc_spec *spec = codec->spec; in alc280_hp_gpio4_automute_hook()
2329 snd_hda_gen_hp_automute(codec, jack); in alc280_hp_gpio4_automute_hook()
2331 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity, in alc280_hp_gpio4_automute_hook()
2341 static void alc280_fixup_hp_9480m(struct hda_codec *codec, in alc280_fixup_hp_9480m() argument
2345 struct alc_spec *spec = codec->spec; in alc280_fixup_hp_9480m()
2347 alc_fixup_hp_gpio_led(codec, action, 0x08, 0); in alc280_fixup_hp_9480m()
2356 static void alc275_fixup_gpio4_off(struct hda_codec *codec, in alc275_fixup_gpio4_off() argument
2360 struct alc_spec *spec = codec->spec; in alc275_fixup_gpio4_off()
2375 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec, in alc285_fixup_thinkpad_x1_gen7() argument
2382 struct alc_spec *spec = codec->spec; in alc285_fixup_thinkpad_x1_gen7()
2386 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc285_fixup_thinkpad_x1_gen7()
2396 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume"); in alc285_fixup_thinkpad_x1_gen7()
2397 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume"); in alc285_fixup_thinkpad_x1_gen7()
2402 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, in alc225_fixup_s3_pop_noise() argument
2408 codec->power_save_node = 1; in alc225_fixup_s3_pop_noise()
2412 static void alc274_fixup_bind_dacs(struct hda_codec *codec, in alc274_fixup_bind_dacs() argument
2415 struct alc_spec *spec = codec->spec; in alc274_fixup_bind_dacs()
2426 codec->power_save_node = 0; in alc274_fixup_bind_dacs()
2430 static void alc274_fixup_hp_aio_bind_dacs(struct hda_codec *codec, in alc274_fixup_hp_aio_bind_dacs() argument
2442 struct alc_spec *spec = codec->spec; in alc274_fixup_hp_aio_bind_dacs()
2444 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc274_fixup_hp_aio_bind_dacs()
2449 static void alc289_fixup_asus_ga401(struct hda_codec *codec, in alc289_fixup_asus_ga401() argument
2455 struct alc_spec *spec = codec->spec; in alc289_fixup_asus_ga401()
2462 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec, in alc285_fixup_invalidate_dacs() argument
2468 snd_hda_override_wcaps(codec, 0x03, 0); in alc285_fixup_invalidate_dacs()
2471 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) in alc_combo_jack_hp_jd_restart() argument
2473 switch (codec->core.vendor_id) { in alc_combo_jack_hp_jd_restart()
2479 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ in alc_combo_jack_hp_jd_restart()
2480 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); in alc_combo_jack_hp_jd_restart()
2489 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ in alc_combo_jack_hp_jd_restart()
2490 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); in alc_combo_jack_hp_jd_restart()
2495 static void alc295_fixup_chromebook(struct hda_codec *codec, in alc295_fixup_chromebook() argument
2498 struct alc_spec *spec = codec->spec; in alc295_fixup_chromebook()
2505 alc_combo_jack_hp_jd_restart(codec); in alc295_fixup_chromebook()
2510 static void alc256_fixup_chromebook(struct hda_codec *codec, in alc256_fixup_chromebook() argument
2513 struct alc_spec *spec = codec->spec; in alc256_fixup_chromebook()
2517 if (codec->core.subsystem_id == 0x10280d76) in alc256_fixup_chromebook()
2527 static void alc_fixup_disable_mic_vref(struct hda_codec *codec, in alc_fixup_disable_mic_vref() argument
2531 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); in alc_fixup_disable_mic_vref()
2535 static void alc294_gx502_toggle_output(struct hda_codec *codec, in alc294_gx502_toggle_output() argument
2541 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) in alc294_gx502_toggle_output()
2542 alc_write_coef_idx(codec, 0x10, 0x8a20); in alc294_gx502_toggle_output()
2544 alc_write_coef_idx(codec, 0x10, 0x0a20); in alc294_gx502_toggle_output()
2547 static void alc294_fixup_gx502_hp(struct hda_codec *codec, in alc294_fixup_gx502_hp() argument
2551 if (!is_jack_detectable(codec, 0x21)) in alc294_fixup_gx502_hp()
2556 snd_hda_jack_detect_enable_callback(codec, 0x21, in alc294_fixup_gx502_hp()
2563 alc294_gx502_toggle_output(codec, NULL); in alc294_fixup_gx502_hp()
2568 static void alc294_gu502_toggle_output(struct hda_codec *codec, in alc294_gu502_toggle_output() argument
2574 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT) in alc294_gu502_toggle_output()
2575 alc_write_coef_idx(codec, 0x10, 0x8420); in alc294_gu502_toggle_output()
2577 alc_write_coef_idx(codec, 0x10, 0x0a20); in alc294_gu502_toggle_output()
2580 static void alc294_fixup_gu502_hp(struct hda_codec *codec, in alc294_fixup_gu502_hp() argument
2583 if (!is_jack_detectable(codec, 0x21)) in alc294_fixup_gu502_hp()
2588 snd_hda_jack_detect_enable_callback(codec, 0x21, in alc294_fixup_gu502_hp()
2592 alc294_gu502_toggle_output(codec, NULL); in alc294_fixup_gu502_hp()
2597 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec, in alc285_fixup_hp_gpio_amp_init() argument
2604 alc_write_coef_idx(codec, 0x65, 0x0); in alc285_fixup_hp_gpio_amp_init()
2607 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec, in alc274_fixup_hp_headset_mic() argument
2612 alc_combo_jack_hp_jd_restart(codec); in alc274_fixup_hp_headset_mic()
2617 static void alc_fixup_no_int_mic(struct hda_codec *codec, in alc_fixup_no_int_mic() argument
2620 struct alc_spec *spec = codec->spec; in alc_fixup_no_int_mic()
2625 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); in alc_fixup_no_int_mic()
2629 alc_combo_jack_hp_jd_restart(codec); in alc_fixup_no_int_mic()
2637 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec, in alc285_fixup_hp_spectre_x360_eb1() argument
2642 struct alc_spec *spec = codec->spec; in alc285_fixup_hp_spectre_x360_eb1()
2650 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04); in alc285_fixup_hp_spectre_x360_eb1()
2658 snd_hda_apply_pincfgs(codec, pincfgs); in alc285_fixup_hp_spectre_x360_eb1()
2660 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); in alc285_fixup_hp_spectre_x360_eb1()
2661 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc285_fixup_hp_spectre_x360_eb1()
2665 alc_update_gpio_data(codec, 0x01, true); in alc285_fixup_hp_spectre_x360_eb1()
2667 alc_update_gpio_data(codec, 0x01, false); in alc285_fixup_hp_spectre_x360_eb1()
2673 static void alc285_fixup_hp_spectre_x360_df1(struct hda_codec *codec, in alc285_fixup_hp_spectre_x360_df1() argument
2677 struct alc_spec *spec = codec->spec; in alc285_fixup_hp_spectre_x360_df1()
2686 alc285_fixup_hp_mute_led_coefbit(codec, fix, action); in alc285_fixup_hp_spectre_x360_df1()
2693 snd_hda_apply_pincfgs(codec, pincfgs); in alc285_fixup_hp_spectre_x360_df1()
2695 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); in alc285_fixup_hp_spectre_x360_df1()
2696 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc285_fixup_hp_spectre_x360_df1()
2700 alc_update_gpio_data(codec, 0x01, true); in alc285_fixup_hp_spectre_x360_df1()
2702 alc_update_gpio_data(codec, 0x01, false); in alc285_fixup_hp_spectre_x360_df1()
2707 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec, in alc285_fixup_hp_spectre_x360() argument
2718 snd_hda_apply_pincfgs(codec, pincfgs); in alc285_fixup_hp_spectre_x360()
2720 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc285_fixup_hp_spectre_x360()
2725 static void alc285_fixup_hp_envy_x360(struct hda_codec *codec, in alc285_fixup_hp_envy_x360() argument
2751 snd_hda_apply_pincfgs(codec, pincfgs); in alc285_fixup_hp_envy_x360()
2754 alc295_fixup_disable_dac3(codec, fix, action); in alc285_fixup_hp_envy_x360()
2757 snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0); in alc285_fixup_hp_envy_x360()
2760 snd_hda_jack_set_gating_jack(codec, 0x19, 0x21); in alc285_fixup_hp_envy_x360()
2763 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50); in alc285_fixup_hp_envy_x360()
2766 alc_process_coef_fw(codec, coefs); in alc285_fixup_hp_envy_x360()
2769 rename_ctl(codec, "Bass Speaker Playback Volume", in alc285_fixup_hp_envy_x360()
2771 rename_ctl(codec, "Front Playback Switch", in alc285_fixup_hp_envy_x360()
2773 rename_ctl(codec, "Bass Speaker Playback Switch", in alc285_fixup_hp_envy_x360()
2779 static void alc285_fixup_hp_beep(struct hda_codec *codec, in alc285_fixup_hp_beep() argument
2783 codec->beep_just_power_on = true; in alc285_fixup_hp_beep()
2791 alc_update_coef_idx(codec, 0x36, 0x7070, BIT(13)); in alc285_fixup_hp_beep()
2793 snd_hda_enable_beep_device(codec, 1); in alc285_fixup_hp_beep()
2796 dev_warn_once(hda_codec_dev(codec), in alc285_fixup_hp_beep()
2806 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec, in alc_fixup_thinkpad_acpi() argument
2809 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */ in alc_fixup_thinkpad_acpi()
2810 hda_fixup_thinkpad_acpi(codec, fix, action); in alc_fixup_thinkpad_acpi()
2816 static void alc_fixup_ideapad_acpi(struct hda_codec *codec, in alc_fixup_ideapad_acpi() argument
2819 hda_fixup_ideapad_acpi(codec, fix, action); in alc_fixup_ideapad_acpi()
2823 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec, in alc287_fixup_legion_15imhg05_speakers() argument
2827 struct alc_spec *spec = codec->spec; in alc287_fixup_legion_15imhg05_speakers()
2978 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action) in cs35l41_fixup_spi_two() argument
2980 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2); in cs35l41_fixup_spi_two()
2983 static void cs35l41_fixup_spi_one(struct hda_codec *codec, const struct hda_fixup *fix, int action) in cs35l41_fixup_spi_one() argument
2985 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 1); in cs35l41_fixup_spi_one()
2988 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action) in cs35l41_fixup_spi_four() argument
2990 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4); in cs35l41_fixup_spi_four()
3038 static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec, in alc256_fixup_acer_sfg16_micmute_led() argument
3041 alc_fixup_hp_gpio_led(codec, action, 0, 0x04); in alc256_fixup_acer_sfg16_micmute_led()
3058 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec, in alc256_fixup_set_coef_defaults() argument
3070 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs); in alc256_fixup_set_coef_defaults()
3080 static void alc233_fixup_no_audio_jack(struct hda_codec *codec, in alc233_fixup_no_audio_jack() argument
3091 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs); in alc233_fixup_no_audio_jack()
3094 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec, in alc256_fixup_mic_no_presence_and_resume() argument
3103 if (codec->core.vendor_id == 0x10ec0256) { in alc256_fixup_mic_no_presence_and_resume()
3104 alc_update_coef_idx(codec, 0x10, 1<<9, 0); in alc256_fixup_mic_no_presence_and_resume()
3105 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120); in alc256_fixup_mic_no_presence_and_resume()
3107 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c); in alc256_fixup_mic_no_presence_and_resume()
3111 static void alc256_decrease_headphone_amp_val(struct hda_codec *codec, in alc256_decrease_headphone_amp_val() argument
3120 caps = query_amp_caps(codec, 0x3, HDA_OUTPUT); in alc256_decrease_headphone_amp_val()
3126 if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps)) in alc256_decrease_headphone_amp_val()
3127 codec_warn(codec, "failed to override amp caps for NID 0x3\n"); in alc256_decrease_headphone_amp_val()
3130 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec, in alc_fixup_dell4_mic_no_presence_quiet() argument
3134 struct alc_spec *spec = codec->spec; in alc_fixup_dell4_mic_no_presence_quiet()
3138 alc269_fixup_limit_int_mic_boost(codec, fix, action); in alc_fixup_dell4_mic_no_presence_quiet()
3147 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); in alc_fixup_dell4_mic_no_presence_quiet()
3148 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ); in alc_fixup_dell4_mic_no_presence_quiet()
3165 static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec, in alc287_fixup_yoga9_14iap7_bass_spk_pin() argument
3191 struct alc_spec *spec = codec->spec; in alc287_fixup_yoga9_14iap7_bass_spk_pin()
3194 hda_fixup_ideapad_acpi(codec, fix, action); in alc287_fixup_yoga9_14iap7_bass_spk_pin()
3198 snd_hda_apply_pincfgs(codec, pincfgs); in alc287_fixup_yoga9_14iap7_bass_spk_pin()
3199 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc287_fixup_yoga9_14iap7_bass_spk_pin()
3205 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec, in alc295_fixup_dell_inspiron_top_speakers() argument
3220 struct alc_spec *spec = codec->spec; in alc295_fixup_dell_inspiron_top_speakers()
3222 alc_fixup_no_shutup(codec, fix, action); in alc295_fixup_dell_inspiron_top_speakers()
3226 snd_hda_apply_pincfgs(codec, pincfgs); in alc295_fixup_dell_inspiron_top_speakers()
3227 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc295_fixup_dell_inspiron_top_speakers()
3234 static void alc287_fixup_bind_dacs(struct hda_codec *codec, in alc287_fixup_bind_dacs() argument
3237 struct alc_spec *spec = codec->spec; in alc287_fixup_bind_dacs()
3246 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc287_fixup_bind_dacs()
3250 snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, in alc287_fixup_bind_dacs()
3256 static void alc2xx_fixup_headset_mic(struct hda_codec *codec, in alc2xx_fixup_headset_mic() argument
3259 struct alc_spec *spec = codec->spec; in alc2xx_fixup_headset_mic()
3267 snd_hda_apply_pincfgs(codec, pincfgs); in alc2xx_fixup_headset_mic()
3268 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12); in alc2xx_fixup_headset_mic()
3274 static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec, in alc245_fixup_hp_spectre_x360_eu0xxx() argument
3296 snd_hda_apply_pincfgs(codec, pincfgs); in alc245_fixup_hp_spectre_x360_eu0xxx()
3297 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc245_fixup_hp_spectre_x360_eu0xxx()
3301 cs35l41_fixup_i2c_two(codec, fix, action); in alc245_fixup_hp_spectre_x360_eu0xxx()
3302 alc245_fixup_hp_mute_led_coefbit(codec, fix, action); in alc245_fixup_hp_spectre_x360_eu0xxx()
3303 alc245_fixup_hp_gpio_led(codec, fix, action); in alc245_fixup_hp_spectre_x360_eu0xxx()
3307 static void alc245_fixup_hp_spectre_x360_16_aa0xxx(struct hda_codec *codec, in alc245_fixup_hp_spectre_x360_16_aa0xxx() argument
3316 struct alc_spec *spec = codec->spec; in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3333 snd_hda_apply_pincfgs(codec, pincfgs); in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3334 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3338 alc_update_gpio_data(codec, 0x01, true); in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3340 alc_update_gpio_data(codec, 0x01, false); in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3344 cs35l41_fixup_i2c_two(codec, fix, action); in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3345 alc245_fixup_hp_mute_led_coefbit(codec, fix, action); in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3346 alc245_fixup_hp_gpio_led(codec, fix, action); in alc245_fixup_hp_spectre_x360_16_aa0xxx()
3349 static void alc245_fixup_hp_zbook_firefly_g12a(struct hda_codec *codec, in alc245_fixup_hp_zbook_firefly_g12a() argument
3352 struct alc_spec *spec = codec->spec; in alc245_fixup_hp_zbook_firefly_g12a()
3358 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); in alc245_fixup_hp_zbook_firefly_g12a()
3362 cs35l41_fixup_i2c_two(codec, fix, action); in alc245_fixup_hp_zbook_firefly_g12a()
3363 alc245_fixup_hp_mute_led_coefbit(codec, fix, action); in alc245_fixup_hp_zbook_firefly_g12a()
3364 alc285_fixup_hp_coef_micmute_led(codec, fix, action); in alc245_fixup_hp_zbook_firefly_g12a()
3371 struct hda_codec *codec, in alc287_alc1318_playback_pcm_hook() argument
3377 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */ in alc287_alc1318_playback_pcm_hook()
3380 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */ in alc287_alc1318_playback_pcm_hook()
3385 static void alc287_s4_power_gpio3_default(struct hda_codec *codec) in alc287_s4_power_gpio3_default() argument
3387 if (is_s4_suspend(codec)) { in alc287_s4_power_gpio3_default()
3388 alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */ in alc287_s4_power_gpio3_default()
3392 static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec, in alc287_fixup_lenovo_thinkpad_with_alc1318() argument
3395 struct alc_spec *spec = codec->spec; in alc287_fixup_lenovo_thinkpad_with_alc1318()
3405 alc_update_coef_idx(codec, 0x10, 1<<11, 1<<11); in alc287_fixup_lenovo_thinkpad_with_alc1318()
3406 alc_process_coef_fw(codec, coefs); in alc287_fixup_lenovo_thinkpad_with_alc1318()
3415 static void alc283_fixup_dell_hp_resume(struct hda_codec *codec, in alc283_fixup_dell_hp_resume() argument
3419 alc_write_coef_idx(codec, 0xd, 0x2800); in alc283_fixup_dell_hp_resume()
3743 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec, in alc298_fixup_lenovo_c940_duet7() argument
3749 if (codec->core.vendor_id == 0x10ec0298) in alc298_fixup_lenovo_c940_duet7()
3753 __snd_hda_apply_fixup(codec, id, action, 0); in alc298_fixup_lenovo_c940_duet7()
7819 static void alc269_fill_coef(struct hda_codec *codec) in alc269_fill_coef() argument
7821 struct alc_spec *spec = codec->spec; in alc269_fill_coef()
7827 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) { in alc269_fill_coef()
7828 alc_write_coef_idx(codec, 0xf, 0x960b); in alc269_fill_coef()
7829 alc_write_coef_idx(codec, 0xe, 0x8817); in alc269_fill_coef()
7832 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) { in alc269_fill_coef()
7833 alc_write_coef_idx(codec, 0xf, 0x960b); in alc269_fill_coef()
7834 alc_write_coef_idx(codec, 0xe, 0x8814); in alc269_fill_coef()
7837 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) { in alc269_fill_coef()
7839 alc_update_coef_idx(codec, 0x04, 0, 1<<11); in alc269_fill_coef()
7842 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) { in alc269_fill_coef()
7843 val = alc_read_coef_idx(codec, 0xd); in alc269_fill_coef()
7846 alc_write_coef_idx(codec, 0xd, val | (1<<10)); in alc269_fill_coef()
7848 val = alc_read_coef_idx(codec, 0x17); in alc269_fill_coef()
7851 alc_write_coef_idx(codec, 0x17, val | (1<<7)); in alc269_fill_coef()
7856 alc_update_coef_idx(codec, 0x4, 0, 1<<11); in alc269_fill_coef()
7859 static void alc269_remove(struct hda_codec *codec) in alc269_remove() argument
7861 struct alc_spec *spec = codec->spec; in alc269_remove()
7866 snd_hda_gen_remove(codec); in alc269_remove()
7871 static int alc269_probe(struct hda_codec *codec, const struct hda_device_id *id) in alc269_probe() argument
7876 err = alc_alloc_spec(codec, 0x0b); in alc269_probe()
7880 spec = codec->spec; in alc269_probe()
7882 codec->power_save_node = 0; in alc269_probe()
7888 switch (codec->core.vendor_id) { in alc269_probe()
7891 switch (alc_get_coef0(codec) & 0x00f0) { in alc269_probe()
7893 if (codec->bus->pci && in alc269_probe()
7894 codec->bus->pci->subsystem_vendor == 0x1025 && in alc269_probe()
7896 err = alc_codec_rename(codec, "ALC271X"); in alc269_probe()
7900 if (codec->bus->pci && in alc269_probe()
7901 codec->bus->pci->subsystem_vendor == 0x17aa && in alc269_probe()
7902 codec->bus->pci->subsystem_device == 0x21f3) in alc269_probe()
7903 err = alc_codec_rename(codec, "ALC3202"); in alc269_probe()
7910 alc_fix_pll_init(codec, 0x20, 0x04, 15); in alc269_probe()
7916 alc269_fill_coef(codec); in alc269_probe()
7962 if (codec->core.vendor_id == 0x10ec0236 && in alc269_probe()
7963 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD) in alc269_probe()
7977 if (alc_get_coef0(codec) & 0x0010) in alc269_probe()
8004 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ in alc269_probe()
8023 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */ in alc269_probe()
8029 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { in alc269_probe()
8034 alc_pre_init(codec); in alc269_probe()
8036 snd_hda_pick_fixup(codec, alc269_fixup_models, in alc269_probe()
8042 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 && in alc269_probe()
8043 codec->core.vendor_id == 0x10ec0294) { in alc269_probe()
8044 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n"); in alc269_probe()
8045 codec->fixup_id = HDA_FIXUP_ID_NOT_SET; in alc269_probe()
8048 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true); in alc269_probe()
8049 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false); in alc269_probe()
8050 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, in alc269_probe()
8057 find_cirrus_companion_amps(codec); in alc269_probe()
8059 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); in alc269_probe()
8061 alc_auto_parse_customize_define(codec); in alc269_probe()
8063 if (has_cdefine_beep(codec)) in alc269_probe()
8067 err = alc269_parse_auto_config(codec); in alc269_probe()
8077 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); in alc269_probe()
8082 alc269_remove(codec); in alc269_probe()