Re: [PATCH v1 1/2] ASoC: qcom: sdm845: skip set_channel_map for SDW stream DAIs
From: Mohammad Rafi Shaik
Date: Tue Jul 07 2026 - 00:35:16 EST
On 6/29/2026 7:59 PM, Srinivas Kandagatla wrote:
On 6/29/26 3:16 PM, Mohammad Rafi Shaik wrote:
On sdm845 the SLIM Playback backend lists wcd934x alongside the qcom
SoundWire master and its SWR slave speaker codecs as codec DAIs on the
same link. sdm845_dai_init() was calling set_channel_map with hardcoded
wcd934x SLIM channel numbers for every codec DAI on that link, including
the SoundWire ones, corrupting their channel configuration.
Skip set_channel_map for any DAI that implements .set_stream, as that op
is the distinguishing marker of DAIs that own an SDW stream path — both
the qcom SWR master and SWR slave codecs register it, while wcd934x does
not. This confines the SLIM channel map to wcd934x where it belongs.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>
---
sound/soc/qcom/sdm845.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c
index 0ce9dff4dc52..509d7a551397 100644
--- a/sound/soc/qcom/sdm845.c
+++ b/sound/soc/qcom/sdm845.c
@@ -294,13 +294,26 @@ static int sdm845_dai_init(struct snd_soc_pcm_runtime *rtd)
return 0;
for_each_rtd_codec_dais(rtd, i, codec_dai) {
- rval = snd_soc_dai_set_channel_map(codec_dai,
- ARRAY_SIZE(tx_ch),
- tx_ch,
- ARRAY_SIZE(rx_ch),
- rx_ch);
- if (rval != 0 && rval != -ENOTSUPP)
- return rval;
+ component = codec_dai->component;
+
+ if (!component || !component->dev)
+ continue;
+
+ /*
+ * Only wcd934x (SLIM codec) needs these static channel maps.
+ * DAIs that own an SDW stream — the qcom SWR master and SWR
+ * slave speaker codecs — implement .set_stream; skip them.
+ */
+ if (!codec_dai->driver || !codec_dai->driver->ops ||
+ !codec_dai->driver->ops->set_stream) {
This is totally a hack.
--srini
ACK,
The intention was to apply the static channel mapping only for the WCD934x (SLIM codec) DAIs.
The existing machine driver logic uses hardcoded channel maps which are only applicable to WCD934x, and this path was unintentionally applying them to the SoundWire master DAIs as well, which is not correct.
I agree that the current approach is not ideal. I'll rework this and address it properly in the next version.
Thanks & regards,
Rafi
+ rval = snd_soc_dai_set_channel_map(codec_dai,
+ ARRAY_SIZE(tx_ch),
+ tx_ch,
+ ARRAY_SIZE(rx_ch),
+ rx_ch);
+ if (rval != 0 && rval != -ENOTSUPP)
+ return rval;
+ }
snd_soc_dai_set_sysclk(codec_dai, 0,
WCD934X_DEFAULT_MCLK_RATE,