Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: hda/realtek: Update ALC225 depop procedure

Old procedure has a chance to meet Headphone no output.

Fixes: da911b1f5e98 ("ALSA: hda/realtek - update ALC225 depop optimize")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/5a27b016ba9d42b4a4e6dadce50a3ba4@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Kailang Yang and committed by
Takashi Iwai
1fd50509 31917b7b

+39 -48
+39 -48
sound/pci/hda/patch_realtek.c
··· 3768 3768 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3769 3769 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3770 3770 3771 - if (hp1_pin_sense || hp2_pin_sense) 3771 + if (hp1_pin_sense || hp2_pin_sense) { 3772 3772 msleep(2); 3773 + alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3773 3774 3774 - alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3775 + if (hp1_pin_sense) 3776 + snd_hda_codec_write(codec, hp_pin, 0, 3777 + AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3778 + if (hp2_pin_sense) 3779 + snd_hda_codec_write(codec, 0x16, 0, 3780 + AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3781 + msleep(75); 3775 3782 3776 - if (hp1_pin_sense || spec->ultra_low_power) 3777 - snd_hda_codec_write(codec, hp_pin, 0, 3778 - AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3779 - if (hp2_pin_sense) 3780 - snd_hda_codec_write(codec, 0x16, 0, 3781 - AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3783 + if (hp1_pin_sense) 3784 + snd_hda_codec_write(codec, hp_pin, 0, 3785 + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3786 + if (hp2_pin_sense) 3787 + snd_hda_codec_write(codec, 0x16, 0, 3788 + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3782 3789 3783 - if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3784 - msleep(85); 3785 - 3786 - if (hp1_pin_sense || spec->ultra_low_power) 3787 - snd_hda_codec_write(codec, hp_pin, 0, 3788 - AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3789 - if (hp2_pin_sense) 3790 - snd_hda_codec_write(codec, 0x16, 0, 3791 - AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3792 - 3793 - if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3794 - msleep(100); 3795 - 3796 - alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3797 - alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3790 + msleep(75); 3791 + alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3792 + } 3798 3793 } 3799 3794 3800 3795 static void alc225_shutup(struct hda_codec *codec) ··· 3801 3806 if (!hp_pin) 3802 3807 hp_pin = 0x21; 3803 3808 3804 - alc_disable_headset_jack_key(codec); 3805 - /* 3k pull low control for Headset jack. */ 3806 - alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); 3807 - 3808 3809 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3809 3810 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16); 3810 3811 3811 - if (hp1_pin_sense || hp2_pin_sense) 3812 + if (hp1_pin_sense || hp2_pin_sense) { 3813 + alc_disable_headset_jack_key(codec); 3814 + /* 3k pull low control for Headset jack. */ 3815 + alc_update_coef_idx(codec, 0x4a, 0, 3 << 10); 3812 3816 msleep(2); 3813 3817 3814 - if (hp1_pin_sense || spec->ultra_low_power) 3815 - snd_hda_codec_write(codec, hp_pin, 0, 3816 - AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3817 - if (hp2_pin_sense) 3818 - snd_hda_codec_write(codec, 0x16, 0, 3819 - AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3818 + if (hp1_pin_sense) 3819 + snd_hda_codec_write(codec, hp_pin, 0, 3820 + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3821 + if (hp2_pin_sense) 3822 + snd_hda_codec_write(codec, 0x16, 0, 3823 + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3820 3824 3821 - if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3822 - msleep(85); 3825 + msleep(75); 3823 3826 3824 - if (hp1_pin_sense || spec->ultra_low_power) 3825 - snd_hda_codec_write(codec, hp_pin, 0, 3826 - AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3827 - if (hp2_pin_sense) 3828 - snd_hda_codec_write(codec, 0x16, 0, 3829 - AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3827 + if (hp1_pin_sense) 3828 + snd_hda_codec_write(codec, hp_pin, 0, 3829 + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3830 + if (hp2_pin_sense) 3831 + snd_hda_codec_write(codec, 0x16, 0, 3832 + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3830 3833 3831 - if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power) 3832 - msleep(100); 3833 - 3834 + msleep(75); 3835 + alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3836 + alc_enable_headset_jack_key(codec); 3837 + } 3834 3838 alc_auto_setup_eapd(codec, false); 3835 3839 alc_shutup_pins(codec); 3836 3840 if (spec->ultra_low_power) { ··· 3840 3846 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4); 3841 3847 msleep(30); 3842 3848 } 3843 - 3844 - alc_update_coef_idx(codec, 0x4a, 3 << 10, 0); 3845 - alc_enable_headset_jack_key(codec); 3846 3849 } 3847 3850 3848 3851 static void alc_default_init(struct hda_codec *codec)