Commit 93b05269 authored by Hui Wang's avatar Hui Wang Committed by Greg Kroah-Hartman

ALSA: hda - restore the gpio led after resume

commit f475371a upstream.

On some HP laptops, the mute led is controlled by codec gpio.

When some machine resume from s3/s4, the codec gpio data will be
cleared to 0 by BIOS:
Before suspend:
  IO[3]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
After resume:
  IO[3]: enable=1, dir=1, wake=0, sticky=0, data=0, unsol=0

To skip the AFG node to enter D3 can't fix this problem.

A workaround is to restore the gpio data when the system resume
back from s3/s4. It is safe even on the machines without this
problem.

BugLink: https://bugs.launchpad.net/bugs/1358116Tested-by: default avatarFranz Hsieh <franz.hsieh@canonical.com>
Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 90d56ca3
...@@ -3242,6 +3242,15 @@ static int alc269_resume(struct hda_codec *codec) ...@@ -3242,6 +3242,15 @@ static int alc269_resume(struct hda_codec *codec)
snd_hda_codec_resume_cache(codec); snd_hda_codec_resume_cache(codec);
alc_inv_dmic_sync(codec, true); alc_inv_dmic_sync(codec, true);
hda_call_check_power_status(codec, 0x01); hda_call_check_power_status(codec, 0x01);
/* on some machine, the BIOS will clear the codec gpio data when enter
* suspend, and won't restore the data after resume, so we restore it
* in the driver.
*/
if (spec->gpio_led)
snd_hda_codec_write(codec, codec->afg, 0, AC_VERB_SET_GPIO_DATA,
spec->gpio_led);
if (spec->has_alc5505_dsp) if (spec->has_alc5505_dsp)
alc5505_dsp_resume(codec); alc5505_dsp_resume(codec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment