Re: [PATCH RFC 5/6] ASoC: cs35l36: Implement set_tdm_slot to program RX slot register

David Heidelberg <[email protected]>
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.phone-devel
Message-ID <[email protected]>
On 06/07/2026 10:52, Charles Keepax wrote:
> On Sun, Jul 05, 2026 at 10:06:55PM +0200, David Heidelberg via B4 Relay wrote:
>> From: David Heidelberg <[email protected]>
>>
>> Program ASP_RX1_SLOT with the first set bit of rx_mask so the
>> amplifier listens on the correct TDM slot when configured by
>> machine drivers.
>>
>> Assisted-by: Claude:claude-4.6-opus
>> Signed-off-by: David Heidelberg <[email protected]>
>> ---
>> +static int cs35l36_set_tdm_slot(struct snd_soc_dai *dai,
>> +				    unsigned int tx_mask, unsigned int rx_mask,
>> +				    int slots, int slot_width)
>> +{
>> +	struct cs35l36_private *cs35l36 =
>> +			snd_soc_component_get_drvdata(dai->component);
>> +
>> +	if (rx_mask)
>> +		regmap_update_bits(cs35l36->regmap, CS35L36_ASP_RX1_SLOT,
>> +				   CS35L36_ASP_RX1_SLOT_MASK,
>> +				   ffs(rx_mask) - 1);
> 
> It is more normal for the masks to specify the slot number rather
> than the bit number, it would probably be nicer to stick with
> that convention even though it will complicate the code here a
> little.

Thank you, is there one of the cs*l* series which implements in similar fashion 
as requested?

Thanks
David

> 
> Thanks,
> Charles

-- 
David Heidelberg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.