* Re: [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
2026-02-18 20:18 [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk Detlev Casanova
@ 2026-02-18 21:02 ` Detlev Casanova
2026-02-19 16:51 ` Luca Ceresoli
2026-02-19 9:37 ` Alexandre Belloni
2026-02-19 15:36 ` Mark Brown
2 siblings, 1 reply; 7+ messages in thread
From: Detlev Casanova @ 2026-02-18 21:02 UTC (permalink / raw)
To: linux-kernel, Luca Ceresoli
Cc: Nicolas Frattaroli, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Heiko Stuebner, linux-rockchip, linux-sound,
linux-arm-kernel, kernel, Alexandre Belloni, Thomas Petazzoni
Hi,
This could also use a
Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Luca, feel free to add your Tested-by as well :)
Detlev.
On 2/18/26 15:18, Detlev Casanova wrote:
> 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>
> ---
> sound/soc/rockchip/rockchip_i2s_tdm.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
> index 770b9bfbb384..fc52149ed6ae 100644
> --- a/sound/soc/rockchip/rockchip_i2s_tdm.c
> +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
> @@ -22,6 +22,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
>
> @@ -665,6 +666,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;
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
2026-02-18 21:02 ` Detlev Casanova
@ 2026-02-19 16:51 ` Luca Ceresoli
0 siblings, 0 replies; 7+ messages in thread
From: Luca Ceresoli @ 2026-02-19 16:51 UTC (permalink / raw)
To: Detlev Casanova, linux-kernel
Cc: Nicolas Frattaroli, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Heiko Stuebner, linux-rockchip, linux-sound,
linux-arm-kernel, kernel, Alexandre Belloni, Thomas Petazzoni
Hello Detlev, all,
On Wed Feb 18, 2026 at 10:02 PM CET, Detlev Casanova wrote:
> Hi,
>
> This could also use a
>
> Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> Luca, feel free to add your Tested-by as well :)
Ouch, too late, patch applied already.
Anyway, it looks correct, but I'm going to triple check in a couple days
and get back in the remote case there is any issue.
Thanks for the responsiveness in sending the fix!
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
2026-02-18 20:18 [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk Detlev Casanova
2026-02-18 21:02 ` Detlev Casanova
@ 2026-02-19 9:37 ` Alexandre Belloni
2026-02-19 12:34 ` Mark Brown
2026-02-19 15:36 ` Mark Brown
2 siblings, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2026-02-19 9:37 UTC (permalink / raw)
To: Detlev Casanova
Cc: linux-kernel, Nicolas Frattaroli, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, Heiko Stuebner, linux-rockchip,
linux-sound, linux-arm-kernel, kernel, Thomas Petazzoni,
Luca Ceresoli
Hello,
On 18/02/2026 15:18:34-0500, Detlev Casanova wrote:
> 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>
> ---
> sound/soc/rockchip/rockchip_i2s_tdm.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
> index 770b9bfbb384..fc52149ed6ae 100644
> --- a/sound/soc/rockchip/rockchip_i2s_tdm.c
> +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
> @@ -22,6 +22,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
>
> @@ -665,6 +666,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);
> +
Maybe this could be set as the default value of i2s_tdm->mclk_rx_freq
and i2s_tdm->mclk_tx_freq in rockchip_i2s_tdm_probe instead of relying
on it being 0 and testing later on?
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
2026-02-19 9:37 ` Alexandre Belloni
@ 2026-02-19 12:34 ` Mark Brown
2026-02-19 13:30 ` Alexandre Belloni
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2026-02-19 12:34 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Detlev Casanova, linux-kernel, Nicolas Frattaroli, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Heiko Stuebner, linux-rockchip,
linux-sound, linux-arm-kernel, kernel, Thomas Petazzoni,
Luca Ceresoli
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
On Thu, Feb 19, 2026 at 10:37:18AM +0100, Alexandre Belloni wrote:
> On 18/02/2026 15:18:34-0500, Detlev Casanova wrote:
> > + if (!mclk_rate)
> > + mclk_rate = DEFAULT_MCLK_FS * params_rate(params);
> > +
> Maybe this could be set as the default value of i2s_tdm->mclk_rx_freq
> and i2s_tdm->mclk_tx_freq in rockchip_i2s_tdm_probe instead of relying
> on it being 0 and testing later on?
That makes sense but since this is fixing a regression and I'd like to
get the fix in I'll apply, we can improve things incrementally.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
2026-02-19 12:34 ` Mark Brown
@ 2026-02-19 13:30 ` Alexandre Belloni
0 siblings, 0 replies; 7+ messages in thread
From: Alexandre Belloni @ 2026-02-19 13:30 UTC (permalink / raw)
To: Mark Brown
Cc: Detlev Casanova, linux-kernel, Nicolas Frattaroli, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Heiko Stuebner, linux-rockchip,
linux-sound, linux-arm-kernel, kernel, Thomas Petazzoni,
Luca Ceresoli
On 19/02/2026 12:34:44+0000, Mark Brown wrote:
> On Thu, Feb 19, 2026 at 10:37:18AM +0100, Alexandre Belloni wrote:
> > On 18/02/2026 15:18:34-0500, Detlev Casanova wrote:
>
> > > + if (!mclk_rate)
> > > + mclk_rate = DEFAULT_MCLK_FS * params_rate(params);
> > > +
>
> > Maybe this could be set as the default value of i2s_tdm->mclk_rx_freq
> > and i2s_tdm->mclk_tx_freq in rockchip_i2s_tdm_probe instead of relying
> > on it being 0 and testing later on?
>
> That makes sense but since this is fixing a regression and I'd like to
> get the fix in I'll apply, we can improve things incrementally.
Yeah, actually, Luca pointed that it is actually not a good suggestion
because we need the rate of the stream to be able to set mclk_rate and
we obviously don't have it in probe. So you can definitely apply the
patch as-is.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
2026-02-18 20:18 [PATCH] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk Detlev Casanova
2026-02-18 21:02 ` Detlev Casanova
2026-02-19 9:37 ` Alexandre Belloni
@ 2026-02-19 15:36 ` Mark Brown
2 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2026-02-19 15:36 UTC (permalink / raw)
To: linux-kernel, Detlev Casanova
Cc: Nicolas Frattaroli, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Heiko Stuebner, linux-rockchip, linux-sound, linux-arm-kernel,
kernel, Alexandre Belloni, Thomas Petazzoni, Luca Ceresoli
On Wed, 18 Feb 2026 15:18:34 -0500, Detlev Casanova wrote:
> 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.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: rockchip: i2s-tdm: Use param rate if not provided by set_sysclk
commit: 0783052534f547f8f201dd4554b1df9f1f8615b5
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread