Skip to content

Commit 89a4a73

Browse files
KailangYanggregkh
authored andcommitted
ALSA: hda/realtek: Update default depop procedure
[ Upstream commit e3ea275 ] Old procedure has a chance to meet Headphone no output. Fixes: c2d6af5 ("ALSA: hda/realtek - Add default procedure for suspend and resume state") Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://lore.kernel.org/17b717a0a0b04a77aea4a8ec820cba13@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d005400 commit 89a4a73

1 file changed

Lines changed: 17 additions & 21 deletions

File tree

sound/pci/hda/patch_realtek.c

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3537,20 +3537,18 @@ static void alc_default_init(struct hda_codec *codec)
35373537

35383538
hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
35393539

3540-
if (hp_pin_sense)
3540+
if (hp_pin_sense) {
35413541
msleep(2);
35423542

3543-
snd_hda_codec_write(codec, hp_pin, 0,
3544-
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3545-
3546-
if (hp_pin_sense)
3547-
msleep(85);
3543+
snd_hda_codec_write(codec, hp_pin, 0,
3544+
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
35483545

3549-
snd_hda_codec_write(codec, hp_pin, 0,
3550-
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3546+
msleep(75);
35513547

3552-
if (hp_pin_sense)
3553-
msleep(100);
3548+
snd_hda_codec_write(codec, hp_pin, 0,
3549+
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3550+
msleep(75);
3551+
}
35543552
}
35553553

35563554
static void alc_default_shutup(struct hda_codec *codec)
@@ -3566,22 +3564,20 @@ static void alc_default_shutup(struct hda_codec *codec)
35663564

35673565
hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
35683566

3569-
if (hp_pin_sense)
3567+
if (hp_pin_sense) {
35703568
msleep(2);
35713569

3572-
snd_hda_codec_write(codec, hp_pin, 0,
3573-
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3574-
3575-
if (hp_pin_sense)
3576-
msleep(85);
3577-
3578-
if (!spec->no_shutup_pins)
35793570
snd_hda_codec_write(codec, hp_pin, 0,
3580-
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3571+
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
35813572

3582-
if (hp_pin_sense)
3583-
msleep(100);
3573+
msleep(75);
35843574

3575+
if (!spec->no_shutup_pins)
3576+
snd_hda_codec_write(codec, hp_pin, 0,
3577+
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3578+
3579+
msleep(75);
3580+
}
35853581
alc_auto_setup_eapd(codec, false);
35863582
alc_shutup_pins(codec);
35873583
}

0 commit comments

Comments
 (0)