Re: [PATCH] soundwire: stream: add multi-direction stream lifecycle API

From: Randy Dunlap

Date: Mon Nov 30 2026 - 18:25:04 EST




On 11/30/26 2:40 PM, Srinivas Kandagatla wrote:
> Add sdw_multi_direction_stream, a lightweight group that aggregates one
> or more sdw_stream_runtimes that share a lifecycle on the bus. New
> entry points:
>
> sdw_multi_direction_stream_alloc / _release / _add
> sdw_prepare_multi_direction_stream
> sdw_enable_multi_direction_stream
> sdw_disable_multi_direction_stream
> sdw_deprepare_multi_direction_stream
>
> A multi-direction stream group with a single constituent behaves
> exactly like the direct sdw_prepare_stream() path, so callers can use
> this API unconditionally without having to branch on how many
> directions a dai_link uses.
>
> Groups with more than one constituent currently iterate the per-stream
> primitives with all-or-nothing rollback on prepare/enable errors.
> This already gives callers a uniform API and well-defined failure
> semantics but still triggers one bank switch per constituent stream.
>
> The follow-up step is to split _sdw_prepare_stream() and
> _sdw_enable_stream() into "params" and "commit" halves so the group
> can program every constituent stream's bus parameters first and then
> trigger a single do_bank_switch() across them. That is left out of
> this change to keep the diff reviewable and because it touches the
> SoundWire core state machine; it can land on top without changing
> the public API introduced here.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxxxxxxxx>
> ---
> Documentation/driver-api/soundwire/stream.rst | 43 ++++
> drivers/soundwire/stream.c | 184 ++++++++++++++++++
> include/linux/soundwire/sdw.h | 37 ++++
> 3 files changed, 264 insertions(+)


> base-commit: 253f86660c1f882fbf554db5eaa34bc5d66dc7e8

Unless my linux-next tree is mucked up, this base-commit is
linux-next-20261130 but the patch does not apply cleanly to it
for a few reasons:

a. The last 3 lines of the context diff are incorrect.
b. The number of lines in the Documentation block is incorrect,
causing a malformed patch [@@ -518,6 +518,49 @@]: 49 should be 50.
c. The number of lines in the source file diff is incorrect,
causing a malformed patch [@@ -1884,6 +1884,208 @@]:
208 should be 237.


Maybe just regenerate the patch?

--
~Randy