* [PATCH v1 1/1] ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL
@ 2026-11-04 15:58 Stefano Radaelli
2026-11-04 16:26 ` Charles Keepax
2026-11-04 18:37 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Stefano Radaelli @ 2026-11-04 15:58 UTC (permalink / raw)
To: linux-kernel, linux-sound
Cc: pierluigi.p, alexander.h, Stefano Radaelli, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, Charles Keepax,
Kuninori Morimoto, Linus Walleij, Kees Cook,
Uwe Kleine-König (The Capable Hub),
patches
From: Stefano Radaelli <stefano.r@variscite.com>
When switching SYSCLK from MCLK to FLL, DAPM may keep SYSCLK powered
and skip the PRE_PMU event that normally enables the FLL. This leaves
SYSCLK sourced from a disabled FLL and can cause playback to fail.
Enable FLL_OSC_ENA and FLL_ENA before selecting FLL as the SYSCLK
source when WM8904_CLK_SYS_ENA is already set.
On VAR-SOM-MX8X, playing audio at 48 kHz followed immediately by
8 kHz reproduced an I/O error when switching from MCLK to FLL.
With this change, playback succeeds.
Co-developed-by: Alexander Herfurtner <alexander.h@variscite.com>
Signed-off-by: Alexander Herfurtner <alexander.h@variscite.com>
Signed-off-by: Stefano Radaelli <stefano.r@variscite.com>
---
sound/soc/codecs/wm8904.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 96d2e54a2c6a..efa108544927 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -338,6 +338,20 @@ static int wm8904_configure_clocking(struct snd_soc_component *component)
dev_dbg(component->dev, "Using %dHz FLL clock\n",
wm8904->fll_fout);
+ /* The SYSCLK may already be on; if source changes to FLL, ensure
+ * FLL is enabled before selecting it as SYSCLK source.
+ */
+ if (clock2 & WM8904_CLK_SYS_ENA) {
+ snd_soc_component_update_bits(component,
+ WM8904_FLL_CONTROL_1,
+ WM8904_FLL_OSC_ENA,
+ WM8904_FLL_OSC_ENA);
+ snd_soc_component_update_bits(component,
+ WM8904_FLL_CONTROL_1,
+ WM8904_FLL_ENA,
+ WM8904_FLL_ENA);
+ }
+
clock2 |= WM8904_SYSCLK_SRC;
rate = wm8904->fll_fout;
break;
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL
2026-11-04 15:58 [PATCH v1 1/1] ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL Stefano Radaelli
@ 2026-11-04 16:26 ` Charles Keepax
2026-11-04 18:37 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2026-11-04 16:26 UTC (permalink / raw)
To: Stefano Radaelli
Cc: linux-kernel, linux-sound, pierluigi.p, alexander.h,
Stefano Radaelli, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Kuninori Morimoto, Linus Walleij, Kees Cook,
Uwe Kleine-König (The Capable Hub),
patches
On Wed, Nov 04, 2026 at 04:58:32PM +0100, Stefano Radaelli wrote:
> From: Stefano Radaelli <stefano.r@variscite.com>
>
> When switching SYSCLK from MCLK to FLL, DAPM may keep SYSCLK powered
> and skip the PRE_PMU event that normally enables the FLL. This leaves
> SYSCLK sourced from a disabled FLL and can cause playback to fail.
>
> Enable FLL_OSC_ENA and FLL_ENA before selecting FLL as the SYSCLK
> source when WM8904_CLK_SYS_ENA is already set.
>
> On VAR-SOM-MX8X, playing audio at 48 kHz followed immediately by
> 8 kHz reproduced an I/O error when switching from MCLK to FLL.
> With this change, playback succeeds.
>
> Co-developed-by: Alexander Herfurtner <alexander.h@variscite.com>
> Signed-off-by: Alexander Herfurtner <alexander.h@variscite.com>
> Signed-off-by: Stefano Radaelli <stefano.r@variscite.com>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL
2026-11-04 15:58 [PATCH v1 1/1] ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL Stefano Radaelli
2026-11-04 16:26 ` Charles Keepax
@ 2026-11-04 18:37 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-11-04 18:37 UTC (permalink / raw)
To: linux-kernel, linux-sound, Stefano Radaelli
Cc: pierluigi.p, alexander.h, Stefano Radaelli, Liam Girdwood,
Jaroslav Kysela, Takashi Iwai, Charles Keepax, Kuninori Morimoto,
Linus Walleij, Kees Cook, Uwe Kleine-König (The Capable Hub),
patches
On Wed, 04 Nov 2026 16:58:32 +0100, Stefano Radaelli wrote:
> ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL
https://git.kernel.org/broonie/sound/c/b3f452ff1778
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] 3+ messages in thread
end of thread, other threads:[~2026-11-04 23:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 15:58 [PATCH v1 1/1] ASoC: wm8904: Enable FLL when switching an active SYSCLK to FLL Stefano Radaelli
2026-11-04 16:26 ` Charles Keepax
2026-11-04 18:37 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®