Skip to content

Commit

Permalink
ALSA: hda/realtek: Update default depop procedure
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
KailangYang authored and tiwai committed Oct 23, 2024
1 parent 86c96e7 commit e3ea275
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -3868,20 +3868,18 @@ static void alc_default_init(struct hda_codec *codec)

hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);

if (hp_pin_sense)
if (hp_pin_sense) {
msleep(2);

snd_hda_codec_write(codec, hp_pin, 0,
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);

if (hp_pin_sense)
msleep(85);
snd_hda_codec_write(codec, hp_pin, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);

snd_hda_codec_write(codec, hp_pin, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
msleep(75);

if (hp_pin_sense)
msleep(100);
snd_hda_codec_write(codec, hp_pin, 0,
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
msleep(75);
}
}

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

hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);

if (hp_pin_sense)
if (hp_pin_sense) {
msleep(2);

snd_hda_codec_write(codec, hp_pin, 0,
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);

if (hp_pin_sense)
msleep(85);

if (!spec->no_shutup_pins)
snd_hda_codec_write(codec, hp_pin, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);

if (hp_pin_sense)
msleep(100);
msleep(75);

if (!spec->no_shutup_pins)
snd_hda_codec_write(codec, hp_pin, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);

msleep(75);
}
alc_auto_setup_eapd(codec, false);
alc_shutup_pins(codec);
}
Expand Down

0 comments on commit e3ea275

Please sign in to comment.