Skip to content

Commit e3ea275

Browse files
KailangYangtiwai
authored andcommitted
ALSA: hda/realtek: Update default depop procedure
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>
1 parent 86c96e7 commit e3ea275

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

sound/pci/hda/patch_realtek.c

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

38693869
hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
38703870

3871-
if (hp_pin_sense)
3871+
if (hp_pin_sense) {
38723872
msleep(2);
38733873

3874-
snd_hda_codec_write(codec, hp_pin, 0,
3875-
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3876-
3877-
if (hp_pin_sense)
3878-
msleep(85);
3874+
snd_hda_codec_write(codec, hp_pin, 0,
3875+
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
38793876

3880-
snd_hda_codec_write(codec, hp_pin, 0,
3881-
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3877+
msleep(75);
38823878

3883-
if (hp_pin_sense)
3884-
msleep(100);
3879+
snd_hda_codec_write(codec, hp_pin, 0,
3880+
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
3881+
msleep(75);
3882+
}
38853883
}
38863884

38873885
static void alc_default_shutup(struct hda_codec *codec)
@@ -3897,22 +3895,20 @@ static void alc_default_shutup(struct hda_codec *codec)
38973895

38983896
hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
38993897

3900-
if (hp_pin_sense)
3898+
if (hp_pin_sense) {
39013899
msleep(2);
39023900

3903-
snd_hda_codec_write(codec, hp_pin, 0,
3904-
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3905-
3906-
if (hp_pin_sense)
3907-
msleep(85);
3908-
3909-
if (!spec->no_shutup_pins)
39103901
snd_hda_codec_write(codec, hp_pin, 0,
3911-
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3902+
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
39123903

3913-
if (hp_pin_sense)
3914-
msleep(100);
3904+
msleep(75);
39153905

3906+
if (!spec->no_shutup_pins)
3907+
snd_hda_codec_write(codec, hp_pin, 0,
3908+
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3909+
3910+
msleep(75);
3911+
}
39163912
alc_auto_setup_eapd(codec, false);
39173913
alc_shutup_pins(codec);
39183914
}

0 commit comments

Comments
 (0)