]> git.hungrycats.org Git - linux/commit
ASoC: sdw_utils: prepare the stream again when resuming
authorAndrey Golovko <andrey.golovko@gmail.com>
Thu, 13 Aug 2026 16:40:00 +0000 (19:40 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 19 Aug 2026 14:22:18 +0000 (15:22 +0100)
commit6fd1b9225de1b09cd8dd79e1ccba8d84b4e94036
treeabf921708f927d07f0d8e7b04327fd68cc3c834f
parentba5401135aa508f0cb5414f269edba1fe90460da
ASoC: sdw_utils: prepare the stream again when resuming

A peripheral loses its Data Port configuration when the controller is
power-gated during system suspend, so the ports have to be prepared
again before the stream can be enabled.  That happens on its own when
userspace calls snd_pcm_prepare() after SNDRV_PCM_STATE_SUSPENDED, but
an application is also allowed to restart the stream with
SNDRV_PCM_IOCTL_RESUME on a card that advertises SNDRV_PCM_INFO_RESUME,
as the AMD ACP platforms do.  That path only reaches the trigger
callback, sdw_enable_stream() writes the channels of ports that were
never prepared, and playback silently produces nothing: the PCM keeps
running, no error is reported anywhere, and the speakers stay quiet
until the stream is torn down and set up again.

Prepare the stream on SNDRV_PCM_TRIGGER_RESUME, before enabling it.
The SoundWire core expects exactly this: sdw_prepare_stream() accepts a
disabled stream and then reapplies the bus parameters without
recomputing them, which it documents as the resume case.

Signed-off-by: Andrey Golovko <andrey.golovko@gmail.com>
Link: https://patch.msgid.link/20260813194000.10412-2-andrey.golovko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdw_utils/soc_sdw_utils.c