summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-01-29 14:14:51 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-06 12:42:57 +0100
commitfb000f5b9ceb8f15c059f9dba5507c842661b290 (patch)
tree9d6141e8bdaf154ce1a8f2ed4bcb8e2b8b886aaa /sound
parentaec76c5a1507761c0b983ae856ee0e23c01794c2 (diff)
ALSA: hda/realtek - Apply ALC294 hp init also for S4 resume
[ Upstream commit f6ef4e0e284251ff795c541db1129c84515ed044 ] The init sequence for ALC294 headphone stuff is needed not only for the boot up time but also for the resume from hibernation, where the device is switched from the boot kernel without sound driver to the suspended image. Since we record the PM event in the device power_state field, we can now recognize the call pattern and apply the sequence conditionally. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5412952557f7..8d6c5be38736 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3246,7 +3246,9 @@ static void alc294_init(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
- if (!spec->done_hp_init) {
+ /* required only at boot or S4 resume time */
+ if (!spec->done_hp_init ||
+ codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
alc294_hp_init(codec);
spec->done_hp_init = true;
}