[PATCH v2 0/2] soundwire: qcom: Restore and fix set_channel_map support for SWR master

From: Mohammad Rafi Shaik

Date: Thu Nov 05 2026 - 06:18:58 EST


The original support for set_channel_map in the Qualcomm SoundWire master
commit 7796c97df6b1 ("soundwire: qcom: Add set_channel_map api support")
was reverted due to multiple issues reported on sdm845 board, including
kernel crashes and data structure corruption. The root causes included
incorrect port indexing, array size mismatches, and improper handling
of TX/RX channel information. This series reintroduces set_channel_map
support with a corrected and safer implementation, and fixes the sdm845
machine driver to avoid misuse ofthe API.

Add a robust qcom_swrm_set_channel_map() implementation that stores
per-port TX/RX channel masks safely under controller lock. Ensure the
configuration is only applied to valid ports and does not corrupt memory
or overwrite unrelated data. Preserve existing behavior for ports that do
not use set_channel_map, by falling back to the default SoundWire stream
configuration. Fix the sdm845 machine driver to avoid applying SLIMbus
channel maps to SoundWire DAIs.

Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Removed the set_stream hack from the SDM845 machine driver.
- Link to v1: https://lore.kernel.org/all/20260629141633.86657-1-mohammad.rafi.shaik@xxxxxxxxxxxxxxxx/

To: Srinivas Kandagatla <srini@xxxxxxxxxx>
To: Liam Girdwood <lgirdwood@xxxxxxxxx>
To: Mark Brown <broonie@xxxxxxxxxx>
To: Jaroslav Kysela <perex@xxxxxxxx>
To: Takashi Iwai <tiwai@xxxxxxxx>
To: Vinod Koul <vkoul@xxxxxxxxxx>
To: Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx>
To: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxx>
To: Mohammad Rafi Shaik <quic_mohs@xxxxxxxxxxx>
cc: Yongqin Liu <yongqin.liu@xxxxxxxxxx>
cc: Jie Gan <jie.gan@xxxxxxxxxxxxxxxx>
Cc: linux-sound@xxxxxxxxxxxxxxx
Cc: linux-arm-msm@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

---
Mohammad Rafi Shaik (2):
ASoC: qcom: sdm845: apply the SLIMbus channel map to wcd934x only
soundwire: qcom: Add set_channel_map support to SWR master DAI

drivers/soundwire/qcom.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
sound/soc/qcom/sdm845.c | 16 ++++++++++++++
2 files changed, 70 insertions(+)
---
base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4
change-id: 20261105-soundwire_channel_map-e3fb482c04cb

Best regards,
--
Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>