[PATCH 1/5] ASoC: dwc: Fix bit clock rate in TDM mode

From: phucduc . bui

Date: Fri Nov 06 2026 - 06:34:51 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

The bit clock is computed as rate * data_width * 2, which only fits
a two-slot I2S frame. Use rate * data_width * tdm_slots in TDM mode.

Fixes: 221acc16aee1 ("ASoC: dwc: Add TDM mode support")
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/dwc/dwc-i2s.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index dbda943cfaf3..9007ba1157ac 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -331,7 +331,10 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
}
} else {
u32 bitclk = config->sample_rate *
- config->data_width * 2;
+ config->data_width * 2;
+ if (dev->tdm_slots)
+ bitclk = config->sample_rate *
+ config->data_width * dev->tdm_slots;

ret = clk_set_rate(dev->clk, bitclk);
if (ret) {
--
2.43.0