ALSA: hda: cs35l41: Rework System Suspend to ensure correct call separation
authorStefan Binding <sbinding@opensource.cirrus.com>
Fri, 21 Jul 2023 15:18:14 +0000 (16:18 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 24 Jul 2023 09:00:04 +0000 (11:00 +0200)
commitc4d0510b81c430249ee69c0554bb7ce4fa3d539e
tree5493d1d36d93ed72ca0d3c73e8c514ed388ceeb5
parent01ecc562936439cf6dd08b5f8c6bbed2704d9f9e
ALSA: hda: cs35l41: Rework System Suspend to ensure correct call separation

In order to correctly pause audio on suspend, amps using external boost
require parts of the pause sequence to be called for all amps before moving
on to the next steps.
For example, as part of pausing the audio, the VSPK GPIO must be disabled,
but since this GPIO is controlled by one amp, but controls the boost for
all amps, it is required to separate the calls.
During playback this is achieved by using the pre and post playback hooks,
however during system suspend, this is not possible, so to separate the
calls, we use both the .prepare and .suspend calls to pause the audio.

Currently, for this reason, we do not restart audio on system resume.
However, we can support this by relying on the playback hook to resume
playback after system suspend.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230721151816.2080453-10-sbinding@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/cs35l41_hda.c