Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk

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>

authored by

Detlev Casanova and committed by
Mark Brown
07830525 80ca1136

+10
+10
sound/soc/rockchip/rockchip_i2s_tdm.c
··· 22 22 23 23 #define DRV_NAME "rockchip-i2s-tdm" 24 24 25 + #define DEFAULT_MCLK_FS 256 25 26 #define CH_GRP_MAX 4 /* The max channel 8 / 2 */ 26 27 #define MULTIPLEX_CH_MAX 10 27 28 ··· 665 664 mclk = i2s_tdm->mclk_rx; 666 665 mclk_rate = i2s_tdm->mclk_rx_freq; 667 666 } 667 + 668 + /* 669 + * When the dai/component driver doesn't need to set mclk-fs for a specific 670 + * clock, it can skip the call to set_sysclk() for that clock. 671 + * In that case, simply use the clock rate from the params and multiply it by 672 + * the default mclk-fs value. 673 + */ 674 + if (!mclk_rate) 675 + mclk_rate = DEFAULT_MCLK_FS * params_rate(params); 668 676 669 677 err = clk_set_rate(mclk, mclk_rate); 670 678 if (err)