mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/2] ASoC: qcom: sdm845: skip set_channel_map for SDW stream DAIs
Date: Tue, 7 Jul 2026 10:04:55 +0530	[thread overview]
Message-ID: <966a4aa9-ba4e-4f09-b151-29a77db4201a@oss.qualcomm.com> (raw)
In-Reply-To: <6cc41123-6d6e-4a93-91c2-5a2035dfccba@oss.qualcomm.com>



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@oss.qualcomm.com>
>> ---
>>   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,
> 


  reply	other threads:[~2026-07-07  4:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 14:16 [PATCH v1 0/2] soundwire: qcom: Restore and fix set_channel_map support for SWR master Mohammad Rafi Shaik
2026-06-29 14:16 ` [PATCH v1 1/2] ASoC: qcom: sdm845: skip set_channel_map for SDW stream DAIs Mohammad Rafi Shaik
2026-06-29 14:29   ` Srinivas Kandagatla
2026-07-07  4:34     ` Mohammad Rafi Shaik [this message]
2026-06-29 14:16 ` [PATCH v1 2/2] soundwire: qcom: Add set_channel_map support to SWR master DAI Mohammad Rafi Shaik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=966a4aa9-ba4e-4f09-b151-29a77db4201a@oss.qualcomm.com \
    --to=mohammad.rafi.shaik@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=quic_mohs@quicinc.com \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®