ALSA: hda: Separate runtime and system suspend
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Tue, 27 Oct 2020 13:00:37 +0000 (21:00 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 28 Oct 2020 08:43:08 +0000 (09:43 +0100)
commitf5dac54d9d93826a776dffc848df76746f7135bb
tree084c6e622f1e3c723ce81c804bb23ddd03afa507
parent215a22ed31a1332075866eca07744d442367c04b
ALSA: hda: Separate runtime and system suspend

Both pm_runtime_force_suspend() and pm_runtime_force_resume() have
some implicit checks, so it can make code flow more straightforward if
we separate runtime and system suspend callbacks.

High Definition Audio Specification, 4.5.9.3 Codec Wake From System S3
states that codec can wake the system up from S3 if WAKEEN is toggled.
Since HDA controller has different wakeup settings for runtime and
system susend, we also need to explicitly disable direct-complete which
can be enabled automatically by PCI core. In addition to that, avoid
waking up codec if runtime resume is for system suspend, to not break
direct-complete for codecs.

While at it, also remove AZX_DCAPS_SUSPEND_SPURIOUS_WAKEUP, as the
original bug commit a6630529aecb ("ALSA: hda: Workaround for spurious
wakeups on some Intel platforms") solves doesn't happen with this
patch.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20201027130038.16463-3-kai.heng.feng@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_controller.h
sound/pci/hda/hda_intel.c