[PATCH v3 0/3] soundwire: qcom: add multi-master support
From: Srinivas Kandagatla
Date: Mon Nov 23 2026 - 12:14:35 EST
This patch series adds support to the multi-master in existing soundwire
controller driver.
On Qualcomm Glymur SoC, both TX and RX soundwire controllers are wired
up in multi master mode connecting to an SDCA compliant Tambora codec.
One of the two controllers (tx,rx) act as primary controller in this
instance its tx which provides clock and control and some data lines and
other controller instance in this case rx act as dependent controller
providing extra data lanes to primary controller. This is called multi
master mode in Qualcomm Soundwire controller.
Multi Master mode allows synchronous transport across two independent
soundwire masters. This includes synchronized clock-stop, clock-resume,
clock scaling and bank switch between both masters, the Primary master
will ensure that.
>From the slave's point of view there is still one SoundWire bus with
one clock and one control lane; the extra DATA lanes just come from
a different pad on the SoC.
Currently the bindings are added in a way that its possible to add more
than one dependent, however to keep things simple the driver only
supports single dependent for now. The primary rejects a second claim
with -EBUSY if the dependent is already paired, so any future misconfig
is caught at probe time rather than silently cross-wiring.
Topology (2+2 lane example):
Primary IP Dependent IP
+-----------------+ +-----------------+
| MM_SYNC <=====+=================+=====> MM_SYNC |
| | | |
| SWR_CLK ---+ | | |
| CTRL ---+ | | |
| DATA0 ---+ | | DATA0 ---+ |
| DATA1 ---+ | | DATA1 ---+ |
+--------------|--+ +------------|----+
| |
v v
+-----------+-----------+ +---------+---------+
| SWR_CLK, CTRL, | | bus DATA2, |
| bus DATA0, DATA1 | | DATA3 |
+-----------+-----------+ +---------+---------+
| |
+----------------+----------------+
|
v
+--------------+
| Slave |
+--------------+
Patch 1 adds two new DT properties qcom,multi-master-mode and
qcom,multi-master-peer for describing the pair.
Patch 2 wires up the primary and dependent roles in the driver.
Patch 3 programs SWRM_V3_MM_SYNC_CONFIG on both sides so their frame
generators lock to a single SWR_CLK.
Tested on Glymur (SC8480XP) CRD with WCD9378 in compute mode. HPH
playback and mic capture both work.
Two further patches (broadcast fan-out and SSP-period programming) will
follow as a separate series once this core lands.
Changes since v2:
- Collapse is_primary/is_dependent to enum qcom_swrm_mm_role
{NONE, PRIMARY, DEPENDENT} [Pierre, Vinod]
- Reject a second multi-master pairing at probe with -EBUSY
(primary already paired or dependent already claimed) [Vinod]
- Gate the dependent hclk through its own runtime PM and keep it
active via DL_FLAG_RPM_ACTIVE on the device link; fixes the
stranded-hclk leak and the double clk_disable on teardown
[Sashiko]
- Hold device_lock() across the peer drvdata read to close the
UAF window against a concurrent sysfs unbind [Sashiko]
- WARN_ON_ONCE() on peer_dpn_offset underflow in
qcom_swrm_port_target() [Sashiko]
- Commit log for 2/3 now explains the lane -> port mapping and
how the dependent is driven via runtime PM [Pierre]
- Rebased on next-20261120
v2: https://lore.kernel.org/all/20261001093806.634862-1-srinivas.kandagatla@xxxxxxxxxxxxxxxx
v1: https://lore.kernel.org/all/cover.1789114385.git.srinivas.kandagatla@xxxxxxxxxxxxxxxx
Srinivas Kandagatla (3):
dt-bindings: soundwire: qcom: describe multi-master
soundwire: qcom: add multi-master support
soundwire: qcom: program MM_SYNC for multi-master
.../bindings/soundwire/qcom,soundwire.yaml | 109 +++++-
drivers/soundwire/qcom.c | 337 +++++++++++++++++-
2 files changed, 418 insertions(+), 28 deletions(-)
base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726
--
2.53.0