summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDetlev Casanova <detlev.casanova@collabora.com>2026-02-18 15:18:34 -0500
committerSasha Levin <sashal@kernel.org>2026-03-04 07:20:27 -0500
commitda0959402742b6d054dc7d5defa8606e10091fa0 (patch)
tree255afb86a6d02e618fdd79fcb08803e6b66b0b19 /sound
parent5fed5f6c6a02cc897371e25157ef7f8acb309a6d (diff)
downloadlinux-da0959402742b6d054dc7d5defa8606e10091fa0.tar.gz
linux-da0959402742b6d054dc7d5defa8606e10091fa0.tar.bz2
linux-da0959402742b6d054dc7d5defa8606e10091fa0.zip
ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
[ Upstream commit 0783052534f547f8f201dd4554b1df9f1f8615b5 ] Drivers will not always call set_sysclk() for all clocks, especially when default mclk-fs can be used. When that is the case, use the clock rate set in the params multiplied by the default mclk-fs. Fixes: 5323186e2e8d ("ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback") Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://patch.msgid.link/20260218201834.924358-1-detlev.casanova@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/rockchip/rockchip_i2s_tdm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
index 7ae93cbaea9a..15ef6b6bec2b 100644
--- a/sound/soc/rockchip/rockchip_i2s_tdm.c
+++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
@@ -24,6 +24,7 @@
#define DRV_NAME "rockchip-i2s-tdm"
+#define DEFAULT_MCLK_FS 256
#define CH_GRP_MAX 4 /* The max channel 8 / 2 */
#define MULTIPLEX_CH_MAX 10
@@ -695,6 +696,15 @@ static int rockchip_i2s_tdm_hw_params(struct snd_pcm_substream *substream,
mclk_rate = i2s_tdm->mclk_rx_freq;
}
+ /*
+ * When the dai/component driver doesn't need to set mclk-fs for a specific
+ * clock, it can skip the call to set_sysclk() for that clock.
+ * In that case, simply use the clock rate from the params and multiply it by
+ * the default mclk-fs value.
+ */
+ if (!mclk_rate)
+ mclk_rate = DEFAULT_MCLK_FS * params_rate(params);
+
err = clk_set_rate(mclk, mclk_rate);
if (err)
return err;