* [PATCH] ASoC: rt5640: Handle 0Hz sysclk during stream shutdown
@ 2026-04-06 9:05 Sheetal
2026-04-06 12:04 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Sheetal @ 2026-04-06 9:05 UTC (permalink / raw)
To: Oder Chiou, Liam Girdwood, Mark Brown
Cc: Jaroslav Kysela, Takashi Iwai, Sameer Pujar, Mohan Kumar,
linux-sound, linux-kernel, Sheetal
Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to sysclk when
shutdown") sends a 0Hz sysclk request during stream shutdown to clear
codec rate constraints. The rt5640 codec forwards this 0Hz to
clk_set_rate(), which can cause clock controller firmware faults on
platforms where MCLK is SoC-driven (e.g. Tegra) and 0Hz falls below
the hardware minimum rate.
Handle the 0Hz case by clearing the internal sysclk state and
returning early, avoiding the invalid clk_set_rate() call.
Signed-off-by: Sheetal <sheetal@nvidia.com>
---
This is a follow-up to the discussion on the ignore_zero_sysclk flag:
https://patchwork.ozlabs.org/project/linux-tegra/patch/20260317094910.1582011-2-sheetal@nvidia.com/
Instead of adding a framework flag, handle 0Hz directly in the codec
as suggested by the reviewers.
---
sound/soc/codecs/rt5640.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index db2222e6f2e7..f6c6294e1588 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -1838,6 +1838,11 @@ static int rt5640_set_dai_sysclk(struct snd_soc_dai *dai,
unsigned int pll_bit = 0;
int ret;
+ if (!freq) {
+ rt5640->sysclk = 0;
+ return 0;
+ }
+
switch (clk_id) {
case RT5640_SCLK_S_MCLK:
ret = clk_set_rate(rt5640->mclk, freq);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: rt5640: Handle 0Hz sysclk during stream shutdown
2026-04-06 9:05 [PATCH] ASoC: rt5640: Handle 0Hz sysclk during stream shutdown Sheetal
@ 2026-04-06 12:04 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-04-06 12:04 UTC (permalink / raw)
To: Oder Chiou, Liam Girdwood, Sheetal
Cc: Jaroslav Kysela, Takashi Iwai, Sameer Pujar, Mohan Kumar,
linux-sound, linux-kernel
On Mon, 06 Apr 2026 09:05:47 +0000, Sheetal wrote:
> ASoC: rt5640: Handle 0Hz sysclk during stream shutdown
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1
Thanks!
[1/1] ASoC: rt5640: Handle 0Hz sysclk during stream shutdown
https://git.kernel.org/broonie/sound/c/247d1c13992d
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] 2+ messages in thread
end of thread, other threads:[~2026-04-06 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-06 9:05 [PATCH] ASoC: rt5640: Handle 0Hz sysclk during stream shutdown Sheetal
2026-04-06 12:04 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox