Skip to content

Commit 131e01b

Browse files
alcharkgregkh
authored andcommitted
ASoC: rockchip: rockchip_sai: Set slot width for non-TDM mode
[ Upstream commit 8a6391e ] Currently the slot width in non-TDM mode is always kept at the POR value of 32 bits, regardless of the sample width, which doesn't work well for some codecs such as NAU8822. Set the slot width according to the sample width in non-TDM mode, which is what other CPU DAI drivers do. Tested on the following RK3576 configurations: - SAI2 + NAU8822 (codec as the clock master), custom board - SAI1 + ES8388 (codec as the clock master), RK3576 EVB1 - SAI2 + RT5616 (SAI as the clock master), FriendlyElec NanoPi M5 NAU8822 didn't work prior to this patch but works after the patch. Other two configurations work both before and after the patch. Fixes: cc78d1e ("ASoC: rockchip: add Serial Audio Interface (SAI) driver") Signed-off-by: Alexey Charkov <alchark@flipper.net> Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com> Link: https://patch.msgid.link/20260318-sai-slot-width-v1-1-1f68186f71e3@flipper.net Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9c47a36 commit 131e01b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sound/soc/rockchip/rockchip_sai.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,10 @@ static int rockchip_sai_hw_params(struct snd_pcm_substream *substream,
628628

629629
regmap_update_bits(sai->regmap, reg, SAI_XCR_VDW_MASK | SAI_XCR_CSR_MASK, val);
630630

631+
if (!sai->is_tdm)
632+
regmap_update_bits(sai->regmap, reg, SAI_XCR_SBW_MASK,
633+
SAI_XCR_SBW(params_physical_width(params)));
634+
631635
regmap_read(sai->regmap, reg, &val);
632636

633637
slot_width = SAI_XCR_SBW_V(val);

0 commit comments

Comments
 (0)