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 ALC256 depop procedure

Old procedure has a chance to meet Headphone no output.

Fixes: 4a219ef8f370 ("ALSA: hda/realtek - Add ALC256 HP depop function")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Link: https://lore.kernel.org/463c5f93715d4714967041a0a8cec28e@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Kailang Yang and committed by
Takashi Iwai
cc3d0b5d 0e84b414

+19 -23
+19 -23
sound/pci/hda/patch_realtek.c
··· 3613 3613 3614 3614 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3615 3615 3616 - if (hp_pin_sense) 3616 + if (hp_pin_sense) { 3617 3617 msleep(2); 3618 + alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3618 3619 3619 - alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3620 - 3621 - snd_hda_codec_write(codec, hp_pin, 0, 3622 - AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3623 - 3624 - if (hp_pin_sense || spec->ultra_low_power) 3625 - msleep(85); 3626 - 3627 - snd_hda_codec_write(codec, hp_pin, 0, 3620 + snd_hda_codec_write(codec, hp_pin, 0, 3628 3621 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); 3629 3622 3630 - if (hp_pin_sense || spec->ultra_low_power) 3631 - msleep(100); 3623 + msleep(75); 3632 3624 3625 + snd_hda_codec_write(codec, hp_pin, 0, 3626 + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); 3627 + 3628 + msleep(75); 3629 + alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3630 + } 3633 3631 alc_update_coef_idx(codec, 0x46, 3 << 12, 0); 3634 - alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ 3635 3632 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */ 3636 3633 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15); 3637 3634 /* ··· 3652 3655 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ 3653 3656 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); 3654 3657 3655 - if (hp_pin_sense) 3658 + if (hp_pin_sense) { 3656 3659 msleep(2); 3657 3660 3658 - snd_hda_codec_write(codec, hp_pin, 0, 3661 + snd_hda_codec_write(codec, hp_pin, 0, 3659 3662 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); 3660 3663 3661 - if (hp_pin_sense || spec->ultra_low_power) 3662 - msleep(85); 3664 + msleep(75); 3663 3665 3664 3666 /* 3k pull low control for Headset jack. */ 3665 3667 /* NOTE: call this before clearing the pin, otherwise codec stalls */ 3666 3668 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly 3667 3669 * when booting with headset plugged. So skip setting it for the codec alc257 3668 3670 */ 3669 - if (spec->en_3kpull_low) 3670 - alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3671 + if (spec->en_3kpull_low) 3672 + alc_update_coef_idx(codec, 0x46, 0, 3 << 12); 3671 3673 3672 - if (!spec->no_shutup_pins) 3673 - snd_hda_codec_write(codec, hp_pin, 0, 3674 + if (!spec->no_shutup_pins) 3675 + snd_hda_codec_write(codec, hp_pin, 0, 3674 3676 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); 3675 3677 3676 - if (hp_pin_sense || spec->ultra_low_power) 3677 - msleep(100); 3678 + msleep(75); 3679 + } 3678 3680 3679 3681 alc_auto_setup_eapd(codec, false); 3680 3682 alc_shutup_pins(codec);