Stephen Boyd [Sat, 14 Feb 2026 18:23:51 +0000 (10:23 -0800)]
Merge branches 'clk-imx', 'clk-divider', 'clk-rockchip' and 'clk-microchip' into clk-next
* clk-imx:
clk: imx: fracn-gppll: Add 241.90 MHz Support
clk: imx: fracn-gppll: Add 332.60 MHz Support
* clk-divider:
rtc: ac100: convert from divider_round_rate() to divider_determine_rate()
clk: zynqmp: divider: convert from divider_round_rate() to divider_determine_rate()
clk: x86: cgu: convert from divider_round_rate() to divider_determine_rate()
clk: versaclock3: convert from divider_round_rate() to divider_determine_rate()
clk: stm32: stm32-core: convert from divider_round_rate_parent() to divider_determine_rate()
clk: stm32: stm32-core: convert from divider_ro_round_rate() to divider_ro_determine_rate()
clk: sprd: div: convert from divider_round_rate() to divider_determine_rate()
clk: sophgo: sg2042-clkgen: convert from divider_round_rate() to divider_determine_rate()
clk: nxp: lpc32xx: convert from divider_round_rate() to divider_determine_rate()
clk: nuvoton: ma35d1-divider: convert from divider_round_rate() to divider_determine_rate()
clk: milbeaut: convert from divider_round_rate() to divider_determine_rate()
clk: milbeaut: convert from divider_ro_round_rate() to divider_ro_determine_rate()
clk: loongson1: convert from divider_round_rate() to divider_determine_rate()
clk: hisilicon: clkdivider-hi6220: convert from divider_round_rate() to divider_determine_rate()
clk: bm1880: convert from divider_round_rate() to divider_determine_rate()
clk: bm1880: convert from divider_ro_round_rate() to divider_ro_determine_rate()
clk: actions: owl-divider: convert from divider_round_rate() to divider_determine_rate()
clk: actions: owl-composite: convert from owl_divider_helper_round_rate() to divider_determine_rate()
clk: sunxi-ng: convert from divider_round_rate_parent() to divider_determine_rate()
clk: sophgo: cv18xx-ip: convert from divider_round_rate() to divider_determine_rate()
* clk-rockchip:
clk: rockchip: Fix error pointer check after rockchip_clk_register_gate_link()
* clk-microchip:
dt-bindings: clock: mpfs-clkcfg: Add pic64gx compatibility
dt-bindings: clock: mpfs-ccc: Add pic64gx compatibility
clk: microchip: drop POLARFIRE from ARCH_MICROCHIP_POLARFIRE
clk: microchip: core: remove unused include asm/traps.h
clk: microchip: core: correct return value on *_get_parent()
clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops
Stephen Boyd [Sat, 14 Feb 2026 18:23:37 +0000 (10:23 -0800)]
Merge branches 'clk-amlogic', 'clk-thead', 'clk-mediatek' and 'clk-samsung' into clk-next
* clk-amlogic:
clk: meson: gxbb: use the existing HHI_HDMI_PLL_CNTL3 macro
clk: meson: g12a: Limit the HDMI PLL OD to /4
clk: meson: gxbb: Limit the HDMI PLL OD to /4 on GXL/GXM SoCs
clk: amlogic: remove potentially unsafe flags from S4 video clocks
clk: amlogic: add video-related clocks for S4 SoC
dt-bindings: clock: add video clock indices for Amlogic S4 SoC
clk: meson: t7: add t7 clock peripherals controller driver
clk: meson: t7: add support for the T7 SoC PLL clock
dt-bindings: clock: add Amlogic T7 peripherals clock controller
dt-bindings: clock: add Amlogic T7 SCMI clock controller
dt-bindings: clock: add Amlogic T7 PLL clock controller
* clk-thead:
clk: thead: th1520-ap: Support CPU frequency scaling
clk: thead: th1520-ap: Add macro to define multiplexers with flags
clk: thead: th1520-ap: Support setting PLL rates
clk: thead: th1520-ap: Add C910 bus clock
clk: thead: th1520-ap: Poll for PLL lock and wait for stability
dt-bindings: clock: thead,th1520-clk-ap: Add ID for C910 bus clock
* clk-mediatek:
Revert "clk: Respect CLK_OPS_PARENT_ENABLE during recalc"
clk: mediatek: Fix error handling in runtime PM setup
clk: mediatek: don't select clk-mt8192 for all ARM64 builds
clk: mediatek: Add mfg_eb as parent to mt8196 mfgpll clocks
clk: mediatek: Refactor pllfh registration to pass device
clk: mediatek: Pass device to clk_hw_register for PLLs
clk: mediatek: Refactor pll registration to pass device
clk: Respect CLK_OPS_PARENT_ENABLE during recalc
dt-bindings: clock: mediatek,mt7622-pciesys: Remove syscon compatible
clk: mediatek: Drop __initconst from gates
* clk-samsung:
clk: samsung: gs101: add support for Display Process Unit (DPU) clocks
dt-bindings: samsung: exynos-sysreg: add gs101 dpu compatible
dt-bindings: clock: google,gs101-clock: Add DPU clock management unit
dt-bindings: clock: google,gs101-clock: fix alphanumeric ordering
clk: samsung: fix sysreg save/restore when PM is enabled for CMU
clk: samsung: avoid warning message on legacy Exynos (auto clock gating)
clk: samsung: gs101: Enable auto_clock_gate mode for each gs101 CMU
clk: samsung: Implement automatic clock gating mode for CMUs
dt-bindings: clock: google,gs101-clock: add samsung,sysreg property as required
clk: samsung: exynosautov920: add clock support
dt-bindings: clock: exynosautov920: add MFD clock definitions
Stephen Boyd [Sat, 14 Feb 2026 18:23:04 +0000 (10:23 -0800)]
Merge branches 'clk-renesas', 'clk-cleanup', 'clk-spacemit' and 'clk-tegra' into clk-next
* clk-renesas: (25 commits)
dt-bindings: clk: rs9: Fix DIF pattern match
clk: rs9: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841
clk: renesas: Add missing log message terminators
clk: renesas: rzg2l: Remove DSI clock rate restrictions
clk: renesas: rzv2h: Deassert reset on assert timeout
clk: renesas: rzg2l: Deassert reset on assert timeout
clk: renesas: cpg-mssr: Unlock before reset verification
clk: renesas: r9a09g056: Add entries for CANFD
clk: renesas: r9a09g057: Add entries for CANFD
clk: renesas: r9a09g077: Add CANFD clocks
clk: renesas: cpg-mssr: Handle RZ/T2H register layout in PM callbacks
dt-bindings: clock: renesas,r9a09g077/87: Add PCLKCAN ID
clk: renesas: cpg-mssr: Simplify pointer math in cpg_rzt2h_mstp_read()
clk: renesas: r9a09g056: Add clock and reset entries for TSU
clk: renesas: r9a09g057: Add entries for RSCIs
clk: renesas: r9a09g056: Add entries for RSCIs
clk: renesas: r9a09g056: Add entries for the RSPIs
clk: renesas: r9a09g056: Add entries for ICU
clk: renesas: r9a09g056: Add entries for the DMACs
...
* clk-cleanup:
clk: Disable KUNIT_UML_PCI
clk: zynqmp: pll: Fix zynqmp_clk_divider_determine_rate kerneldoc
clk: zynqmp: divider: Fix zynqmp_clk_divider_determine_rate kerneldoc
clk: tegra: tegra124-emc: fix device leak on set_rate()
clk: Annotate #else and #endif
clk: Merge prepare and unprepare sections
clk: Move clk_{save,restore}_context() to COMMON_CLK section
clk: clk-apple-nco: Add "apple,t8103-nco" compatible
clk: versatile: impd1: Simplify with scoped for each OF child loop
clk: scpi: Simplify with scoped for each OF child loop
clk: lmk04832: Simplify with scoped for each OF child loop
* clk-spacemit:
clk: spacemit: k3: add the clock tree
clk: spacemit: k3: extract common header
clk: spacemit: ccu_pll: add plla type clock
clk: spacemit: ccu_mix: add inverted enable gate clock
dt-bindings: soc: spacemit: k3: add clock support
clk: spacemit: add platform SoC prefix to reset name
clk: spacemit: extract common ccu functions
reset: spacemit: fix auxiliary device id
clk: spacemit: prepare common ccu header
clk: spacemit: Hide common clock driver from user controller
clk: spacemit: Respect Kconfig setting when building modules
* clk-tegra:
clk: tegra30: Add CSI pad clock gates
clk: tegra: Set CSUS as vi_sensor's gate for Tegra20, Tegra30 and Tegra114
clk: tegra20: Reparent dsi clock to pll_d_out0
clk: tegra: tegra124-emc: Simplify with scoped for each OF child loop
clk: tegra: Adjust callbacks in tegra_clock_pm
clk: tegra: tegra124-emc: Fix potential memory leak in tegra124_clk_register_emc()
Stephen Boyd [Wed, 28 Jan 2026 19:01:34 +0000 (11:01 -0800)]
Revert "clk: Respect CLK_OPS_PARENT_ENABLE during recalc"
This reverts commit
669917676e93fca5ea3c66fc9539830312bec58e.
It's been shown to cause problems on i.MX and STM32 platforms
where the board doesn't boot. In one case, a clk with
CLK_IS_CRITICAL and CLK_OPS_PARENT_ENABLE is being registered
causing the parent to be enabled, the rate recalculated, and then
the parent is disabled causing the critical clk being registered
to stop clocking.
A fix for that would be to calculate the rate of the clk after
enabling the critical clk itself, but that wouldn't fix another
problem where a clk with CLK_OPS_PARENT_ENABLE is registered
before the parent is registered. In this case the hardware access
in the clk_ops::recalc_rate() function would fail if the parent
is disabled.
There are even more problems exposed by this patch because it
introduces logic that disables clks earlier in system boot than
has existed previously. Historically we've not disabled clks
until late init (clk_disable_unused) under the assumption that
clks have been registered enough to have a consistent view of the
clk tree. The clk_disable_unused logic doesn't work very well
though, leading to quite a few devices booting with
clk_ignore_unused on the kernel command line.
Long story short, disabling clks during clk registration is full
of pitfalls. Revert this commit until a proper solution can be
found.
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Closes: https://lore.kernel.org/r/
6239343.lOV4Wx5bFT@steina-w
Reported-by: Mark Brown <broonie@kernel.org>
Closes: https://lore.kernel.org/r/
036da7ce-6487-4a6e-9b15-
97c6d3bcdcec@sirena.org.uk
Cc: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: Brian Masney <bmasney@redhat.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Tested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Peng Fan [Mon, 22 Dec 2025 07:06:33 +0000 (15:06 +0800)]
clk: Disable KUNIT_UML_PCI
commit
031cdd3bc3f3 ("kunit: Enable PCI on UML without triggering WARN()")
enables KUNIT_UML_PCI, but clk driver could not work with it.
Deselect KUNIT_UML_PCI to avoid the failure. Dump as below:
WARNING: CPU: 0 PID: 227 at lib/logic_iomem.c:141 __raw_readl+0xac/0xe0
CPU: 0 UID: 0 PID: 227 Comm: kunit_try_catch Tainted: G
Tainted: [N]=TEST
Stack:
a0883d00 00000001 00000000 ffffff00
603ef142 60044832 6002598b 00000000
00000000 600211b3 00000001 00000000
Call Trace:
[<
6032534c>] ? __raw_readl+0xac/0xe0
[<
60044832>] ? dump_stack_lvl+0x57/0x73
[<
6002598b>] ? _printk+0x0/0x61
[<
600211b3>] ? __warn.cold+0x61/0xeb
[<
600212cc>] ? warn_slowpath_fmt+0x8f/0x9c
[<
6002123d>] ? warn_slowpath_fmt+0x0/0x9c
[<
6032534c>] ? __raw_readl+0xac/0xe0
[<
6002123d>] ? warn_slowpath_fmt+0x0/0x9c
[<
6029e2ad>] ? clk_gate_endisable+0xcd/0x110
[<
6029e315>] ? clk_gate_enable+0x15/0x20
[<
6028795e>] ? clk_core_enable+0x6e/0xf0
[<
60289f1f>] ? clk_enable+0x4f/0xa0
[<
602a06af>] ? clk_gate_test_enable+0xbf/0x360
[<
60053df9>] ? os_nsecs+0x29/0x40
[<
600cd300>] ? ktime_get_ts64+0x0/0x130
[<
600816c0>] ? to_kthread+0x0/0x50
[<
602507bb>] ? kunit_try_run_case+0x7b/0x100
[<
600816c0>] ? to_kthread+0x0/0x50
[<
60252aa0>] ? kunit_generic_run_threadfn_adapter+0x0/0x30
[<
60252ab2>] ? kunit_generic_run_threadfn_adapter+0x12/0x30
[<
60082091>] ? kthread+0xf1/0x270
[<
60047591>] ? new_thread_handler+0x41/0x60
---[ end trace
0000000000000000 ]---
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Marek Vasut [Tue, 14 Oct 2025 10:46:03 +0000 (12:46 +0200)]
dt-bindings: clk: rs9: Fix DIF pattern match
The pattern match [0-19] is incorrect and does not cover range of 0..19,
use pattern 1?[0-9] to cover range 0..19 instead. Update the example to
validate all parts of the pattern match and prevent such failures in the
future.
Fixes:
26c1bc67aa2f ("dt-bindings: clk: rs9: Add Renesas 9-series I2C PCIe clock generator")
Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Geert Uytterhoeven [Wed, 21 Jan 2026 11:03:11 +0000 (12:03 +0100)]
clk: rs9: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert the Renesas 9-series PCIe clock generator driver from
SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations from its suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Marek Vasut [Wed, 21 Jan 2026 23:26:38 +0000 (00:26 +0100)]
clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841
The 9FGV0841 has 8 outputs and registers 8 struct clk_hw, make sure
there are 8 slots for those newly registered clk_hw pointers, else
there is going to be out of bounds write when pointers 4..7 are set
into struct rs9_driver_data .clk_dif[4..7] field.
Since there are other structure members past this struct clk_hw
pointer array, writing to .clk_dif[4..7] fields corrupts both
the struct rs9_driver_data content and data around it, sometimes
without crashing the kernel. However, the kernel does surely
crash when the driver is unbound or during suspend.
Fix this, increase the struct clk_hw pointer array size to the
maximum output count of 9FGV0841, which is the biggest chip that
is supported by this driver.
Cc: stable@vger.kernel.org
Fixes:
f0e5e1800204 ("clk: rs9: Add support for 9FGV0841")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Closes: https://lore.kernel.org/CAMuHMdVyQpOBT+Ho+mXY07fndFN9bKJdaaWGn91WOFnnYErLyg@mail.gmail.com
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Stephen Boyd [Mon, 2 Feb 2026 18:57:51 +0000 (10:57 -0800)]
Merge tag 'clk-microchip-6.20' of https://git./linux/kernel/git/at91/linux into clk-microchip
Pull Microchip clk driver updates from Claudiu Beznea:
- clean up microchip/clk-core.c to:
-- fix a sparse warning related to multiple initializations of
pic32_sclk_ops.determine_rate()
-- correct the return values of roclk_get_parent() and sclk_get_parent()
-- drop an unused include header
- adjust the PolarFire driver Kconfig section as the driver is now used by
non-PolarFire devices
- update the documentation for the Microchip PIC64GX SoC clock controller
* tag 'clk-microchip-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux:
dt-bindings: clock: mpfs-clkcfg: Add pic64gx compatibility
dt-bindings: clock: mpfs-ccc: Add pic64gx compatibility
clk: microchip: drop POLARFIRE from ARCH_MICROCHIP_POLARFIRE
clk: microchip: core: remove unused include asm/traps.h
clk: microchip: core: correct return value on *_get_parent()
clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops
Stephen Boyd [Mon, 2 Feb 2026 19:03:30 +0000 (11:03 -0800)]
Merge tag 'v6.20-rockchip-clk-1' of https://git./linux/kernel/git/mmind/linux-rockchip into clk-rockchip
Pull a Rockchip clk driver update from Heiko Stuebner:
Additional check for an error pointer and not only for NULL when a
gatelink is added.
* tag 'v6.20-rockchip-clk-1' of https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
clk: rockchip: Fix error pointer check after rockchip_clk_register_gate_link()
Krzysztof Kozlowski [Wed, 24 Dec 2025 11:42:12 +0000 (12:42 +0100)]
clk: zynqmp: pll: Fix zynqmp_clk_divider_determine_rate kerneldoc
After renaming round_rate->determine, kerneldoc does not match anymore,
causing W=1 warnings:
pll.c:102 function parameter 'req' not described in 'zynqmp_pll_determine_rate'
pll.c:102 expecting prototype for zynqmp_pll_round_rate(). Prototype was for zynqmp_pll_determine_rate() instead
Fixes:
193650c7a873 ("clk: zynqmp: pll: convert from round_rate() to determine_rate()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Krzysztof Kozlowski [Wed, 24 Dec 2025 11:42:11 +0000 (12:42 +0100)]
clk: zynqmp: divider: Fix zynqmp_clk_divider_determine_rate kerneldoc
After renaming round_rate->determine, kerneldoc does not match anymore,
causing W=1 warnings:
Warning: drivers/clk/zynqmp/divider.c:122 function parameter 'req' not described in 'zynqmp_clk_divider_determine_rate'
Warning: drivers/clk/zynqmp/divider.c:122 expecting prototype for zynqmp_clk_divider_round_rate(). Prototype was for zynqmp_clk_divider_determine_rate() instead
Fixes:
0f9cf96a01fd ("clk: zynqmp: divider: convert from round_rate() to determine_rate()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Stephen Boyd [Fri, 23 Jan 2026 18:38:18 +0000 (10:38 -0800)]
Merge tag 'clk-imx-6.20' of git://git./linux/kernel/git/abelvesa/linux into clk-imx
Pull i.MX clk driver updates from Abel Vesa:
- Add support for 241.90 MHz and 332.60 MHz to the fractional-N
General-Purpose PLL (GPPLL) i.MX driver
* tag 'clk-imx-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux:
clk: imx: fracn-gppll: Add 241.90 MHz Support
clk: imx: fracn-gppll: Add 332.60 MHz Support
Stephen Boyd [Fri, 23 Jan 2026 02:54:16 +0000 (18:54 -0800)]
Merge tag 'clk-divider-round-rate-v6.20-v2' of https://github.com/masneyb/linux into clk-divider
Pull divider_round_rate() and friends removal series from Brian Masney:
Here's a series that lays the groundwork to rid of the deprecated APIs
divider_round_rate(), divider_round_rate_parent(), and
divider_ro_round_rate_parent() since these functions are just wrappers
for the determine_rate variant.
We need to wait for some other changes to land in Linus's tree via the
phy tree before we can actually remove these functions. We should be
able to do that during the next development cycle.
Note that when I converted some of these drivers from round_rate to
determine_rate, this was mistakenly converted to the following in some
cases:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value. So this series fixes those bugs and removes
the deprecated APIs all in one go.
Note that this also contains a clk-specific change to
drivers/rtc/rtc-ac100.c, and that patch carrys an Acked-by from
Alexandre.
* tag 'clk-divider-round-rate-v6.20-v2' of https://github.com/masneyb/linux:
rtc: ac100: convert from divider_round_rate() to divider_determine_rate()
clk: zynqmp: divider: convert from divider_round_rate() to divider_determine_rate()
clk: x86: cgu: convert from divider_round_rate() to divider_determine_rate()
clk: versaclock3: convert from divider_round_rate() to divider_determine_rate()
clk: stm32: stm32-core: convert from divider_round_rate_parent() to divider_determine_rate()
clk: stm32: stm32-core: convert from divider_ro_round_rate() to divider_ro_determine_rate()
clk: sprd: div: convert from divider_round_rate() to divider_determine_rate()
clk: sophgo: sg2042-clkgen: convert from divider_round_rate() to divider_determine_rate()
clk: nxp: lpc32xx: convert from divider_round_rate() to divider_determine_rate()
clk: nuvoton: ma35d1-divider: convert from divider_round_rate() to divider_determine_rate()
clk: milbeaut: convert from divider_round_rate() to divider_determine_rate()
clk: milbeaut: convert from divider_ro_round_rate() to divider_ro_determine_rate()
clk: loongson1: convert from divider_round_rate() to divider_determine_rate()
clk: hisilicon: clkdivider-hi6220: convert from divider_round_rate() to divider_determine_rate()
clk: bm1880: convert from divider_round_rate() to divider_determine_rate()
clk: bm1880: convert from divider_ro_round_rate() to divider_ro_determine_rate()
clk: actions: owl-divider: convert from divider_round_rate() to divider_determine_rate()
clk: actions: owl-composite: convert from owl_divider_helper_round_rate() to divider_determine_rate()
clk: sunxi-ng: convert from divider_round_rate_parent() to divider_determine_rate()
clk: sophgo: cv18xx-ip: convert from divider_round_rate() to divider_determine_rate()
Stephen Boyd [Fri, 23 Jan 2026 02:09:44 +0000 (18:09 -0800)]
Merge tag 'samsung-clk-6.20' of https://git./linux/kernel/git/krzk/linux into clk-samsung
Pull Samsung clk driver updates from Krzysztof Kozlowski:
1. Add new clock controllers:
- MFD for ExynosAutov920 SoC,
- Display Process Unit (DPU) for Google GS101 SoC.
2. Implement automatic clock gating mode (HWACG) for Google GS101 SoC
clock controllers (but also used on almost all modern Exynos SoC),
opposed to currently used mode - manual mode.
Background on HW automatic clock gating from Peter Griffin in cover letter:
This series addresses an issue with Samsung Exynos based upstream clock driver
whereby the upstream clock driver sets all the clock gates into "manual mode"
(which uses a bit that is documented as reserved in the gate registers).
Another issue with the current "manual clock gating" approach upstream is
there are many bus/interconnect clocks whose relationships to the IPs
are not well documented or defined in the specs. When adding a new CMU until
now we have tried to label these clocks appropriately with CLK_IS_CRITICAL and
CLK_IGNORE_UNUSED but doing so is both error prone and time consuming. If
your lucky disabling a critical bus clock causes an immediate hang. Other
clocks however aren't so obvious and show up through random instability
some period of time later.
Fortunately each CMU (at least on newer Exynos) provides a "hardware
automatic clock gating" HWACG feature that is used by the downstream
Samsung clock drivers. Hardware automatic clock gating uses a hardware
interface between the CMU and IP to control all clocks required by the
IP. This interface is called Q-channel, and is part of the Arm AMBA low
power interface specification [1].
The advantage of using this Qchannel hardware interface for
enabling/disabling the clocks is that it takes care of all clocks
(including bus/interconnect) ones for the IP automatically thereby reducing
the dynamic power.
Whilst each clock component (GATE, MUX, DIV, QCH etc) has a HWACG enable
bit there are also some "global enable override" bits for the entire CMU in
the CMU_CONTROLLER_OPTION register.
This series makes use of those "global enable" override bits to enable auto
clock mode for the entire CMU and every component within it. Through
experimentation we can see that setting the "manual mode" reserved gate bit
on a particular gate register overides the global enable bits. So the code
is updated accordingly not to do that.
Auto clock mode has been implemented as a "opt in" by setting a new
auto_clock_gate flag in the CMU static data. The intention is existing
platforms in manual mode should not be effected by any of these changes.
If auto_clock_mode flag is set and the option_offset field is specified
then the global enable override bits will be written for the
CMU (to avoid relying on any prior bootstage configuration). Again if auto
mode is enabled the code no longer sets MANUAL and clears HWACG bits on
each gate register.
To ensure compatibility with older DTs (that specified an incorrect CMU
size) the resource size is checked and the driver falls back to manual
clock gate mode in such cases. As the CLK_IGNORE_UNUSED and CLK_IS_CRITICAL
flags are required for manual clock gate mode, the patch removing these
flags has been dropped from v2. I tested with an old DT and we successfully
switch to manual clock gate mode and the system correctly boots.
To have dynamic root clock gating (drcg) of bus components and memclk
enabled, it is required to set the bus_component_drcg and memclk registers
in the correspondingly named sysreg controller. If auto clock mode is
enabled the clock driver will now attempt to get the sysreg syscon via the
samsung,sysreg property (as used by other Exynos drivers upstream) and set
the registers accordingly. The suspend/resume code paths are also updated
to handle saving/restoring registers using a regmap. Note cmu_top is an
exception and does not have a corresondingly named sysreg_top.
As all clock gates are currently exposed in the gs101 drivers and DT, we
continue to register all of these gates in auto clock mode, but with some new
samsung_auto_clk_gate_ops. As clk enable and clk disable are now handled by
Q-channel interface the .enable and .disable implementations are
no-ops. However by using some CMU qchannel debug registers we can report
the current clock status (enabled or disabled) of every clock gate in the
system. This has the nice effect of still being able to dump the entire
clock tree from /sys/kernel/debug/clk/clk_summary and see a live view of
every auto clock in the system.
With the infrastructure in place, all the CMUs registered in clk-gs101 are
now updated to enable auto clock mode. From dumping
/sys/kernel/debug/clk/clk_summary it is possible to see that after enabling
auto clock mode approximately 305 clocks are enabled, and 299 are now
disabled. This number goes up and down a bit by 3-5 clocks just on a idle
system sat at a console.
With auto clock mode enabled it is now also possible to boot without the
clk_ignore_unused kernel command line property for the first time!
For future CMUs in gs101 I propose we continue to expose all gates, but
register the CMU in "auto mode". For new device drivers or updates to
existing dt bindings related to clocks to support gs101 I suggest we only
use the "obviously correct" clock(s). By "obviously correct" I mean a clock
has the IP name in the clock register name, but not try to deduce other
obsucurely named bus/interconnect clocks which will now all be handled
automatically. Note it is still possible to test whether the "obviously
correct" clock is indeed correct by putting the individual gate in manual
mode and disabling the clock (e.g. by using devmem).
* tag 'samsung-clk-6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
clk: samsung: gs101: add support for Display Process Unit (DPU) clocks
dt-bindings: samsung: exynos-sysreg: add gs101 dpu compatible
dt-bindings: clock: google,gs101-clock: Add DPU clock management unit
dt-bindings: clock: google,gs101-clock: fix alphanumeric ordering
clk: samsung: fix sysreg save/restore when PM is enabled for CMU
clk: samsung: avoid warning message on legacy Exynos (auto clock gating)
clk: samsung: gs101: Enable auto_clock_gate mode for each gs101 CMU
clk: samsung: Implement automatic clock gating mode for CMUs
dt-bindings: clock: google,gs101-clock: add samsung,sysreg property as required
clk: samsung: exynosautov920: add clock support
dt-bindings: clock: exynosautov920: add MFD clock definitions
Haotian Zhang [Sun, 23 Nov 2025 15:43:15 +0000 (23:43 +0800)]
clk: mediatek: Fix error handling in runtime PM setup
devm_pm_runtime_enable() can fail due to memory allocation. The current
code ignores its return value, and when pm_runtime_resume_and_get() fails,
it returns directly without unmapping the shared_io region.
Add error handling for devm_pm_runtime_enable(). Reorder cleanup labels
to properly unmap shared_io on pm_runtime_resume_and_get() failure.
Fixes:
2f7b1d8b5505 ("clk: mediatek: Do a runtime PM get on controllers during probe")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Bartosz Golaszewski [Mon, 22 Dec 2025 15:02:35 +0000 (16:02 +0100)]
clk: mediatek: don't select clk-mt8192 for all ARM64 builds
This option defaults to y for ARCH64 meaning it's built even if we don't
want anything related to mediatek. Make the default condition stricter
and only build it if ARCH_MEDIATEK is selected.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Nicolas Frattaroli [Mon, 15 Dec 2025 10:24:02 +0000 (11:24 +0100)]
clk: mediatek: Add mfg_eb as parent to mt8196 mfgpll clocks
All the MFGPLL require MFG_EB to be on for any operation on them, and
they only tick when MFG_EB is on as well, therefore making this a
parent-child relationship.
This dependency wasn't clear during the initial upstreaming of these
clock controllers, as it only made itself known when I could observe
the effects of the clock by bringing up a different piece of hardware.
Add a new PLL_PARENT_EN flag to mediatek's clk-pll.h, and check for it
when initialising the pll to then translate it into the actual
CLK_OPS_PARENT_ENABLE flag.
Then add the mfg_eb parent to the mfgpll clocks, and set the new
PLL_PARENT_EN flag.
Fixes:
03dc02f8c7dc ("clk: mediatek: Add MT8196 mfg clock support")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Nicolas Frattaroli [Mon, 15 Dec 2025 10:24:01 +0000 (11:24 +0100)]
clk: mediatek: Refactor pllfh registration to pass device
After refactoring all of PLL to pass the device, it's now fairly easy to
refactor pllfh and its users, as pllfh registration wraps PLL
registration.
Do this refactor and move all of the pllfh users to pass the device as
well.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Nicolas Frattaroli [Mon, 15 Dec 2025 10:24:00 +0000 (11:24 +0100)]
clk: mediatek: Pass device to clk_hw_register for PLLs
Passing the struct device pointer to clk_hw_register allows for runtime
power management to work for the registered clock controllers. However,
the mediatek PLL clocks do not do this.
Change this by adding a struct device pointer argument to
mtk_clk_register_pll, and fix up the only other user of it. Also add a
new member to the struct mtk_clk_pll for the struct device pointer,
which is set by mtk_clk_register_pll and is used by
mtk_clk_register_pll_ops.
If mtk_clk_register_pll is called with a NULL struct device pointer,
then everything still works as expected; the clock core will simply
treat them as previously, i.e. without runtime power management.
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Nicolas Frattaroli [Mon, 15 Dec 2025 10:23:59 +0000 (11:23 +0100)]
clk: mediatek: Refactor pll registration to pass device
As it stands, mtk_clk_register_plls takes a struct device_node pointer
as its first argument. This is a tragic happenstance, as it's trivial to
get the device_node from a struct device, but the opposite not so much.
The struct device is a much more useful thing to have passed down.
Refactor mtk_clk_register_plls to take a struct device pointer instead
of a struct device_node pointer, and fix up all users of this function.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Nicolas Frattaroli [Mon, 15 Dec 2025 10:23:58 +0000 (11:23 +0100)]
clk: Respect CLK_OPS_PARENT_ENABLE during recalc
When CLK_OPS_PARENT_ENABLE was introduced, it guarded various clock
operations, such as setting the rate or switching parents. However,
another operation that can and often does touch actual hardware state is
recalc_rate, which may also be affected by such a dependency.
Add parent enables/disables where the recalc_rate op is called directly.
Fixes:
fc8726a2c021 ("clk: core: support clocks which requires parents enable (part 2)")
Fixes:
a4b3518d146f ("clk: core: support clocks which requires parents enable (part 1)")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
AngeloGioacchino Del Regno [Tue, 13 Jan 2026 11:00:08 +0000 (12:00 +0100)]
dt-bindings: clock: mediatek,mt7622-pciesys: Remove syscon compatible
The PCIESYS register space contains a pure clock controller, which
has no system controller register, so this definitely doesn't need
any "syscon" compatible.
As a side note, luckily no devicetree ever added the syscon string
to PCIESYS clock controller node compatibles, so this also resolves
a dtbs_check warning for mt7622.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Sjoerd Simons [Tue, 23 Dec 2025 11:05:17 +0000 (12:05 +0100)]
clk: mediatek: Drop __initconst from gates
Since commit
8ceff24a754a ("clk: mediatek: clk-gate: Refactor
mtk_clk_register_gate to use mtk_gate struct") the mtk_gate structs
are no longer just used for initialization/registration, but also at
runtime. So drop __initconst annotations.
Fixes:
8ceff24a754a ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Laura Nao <laura.nao@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Johan Hovold [Fri, 21 Nov 2025 16:40:03 +0000 (17:40 +0100)]
clk: tegra: tegra124-emc: fix device leak on set_rate()
Make sure to drop the reference taken when looking up the EMC device and
its driver data on first set_rate().
Note that holding a reference to a device does not prevent its driver
data from going away so there is no point in keeping the reference.
Fixes:
2db04f16b589 ("clk: tegra: Add EMC clock driver")
Fixes:
6d6ef58c2470 ("clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver")
Cc: stable@vger.kernel.org # 4.2: 6d6ef58c2470
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Brian Masney [Thu, 22 Jan 2026 12:47:16 +0000 (07:47 -0500)]
rtc: ac100: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:41 +0000 (16:16 -0500)]
clk: zynqmp: divider: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
0f9cf96a01fd ("clk: zynqmp: divider: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:40 +0000 (16:16 -0500)]
clk: x86: cgu: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
f7a6bed91a19 ("clk: x86: cgu: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:39 +0000 (16:16 -0500)]
clk: versaclock3: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
9e3372b2ebac ("clk: versaclock3: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:38 +0000 (16:16 -0500)]
clk: stm32: stm32-core: convert from divider_round_rate_parent() to divider_determine_rate()
The divider_round_rate_parent() function is now deprecated, so let's
migrate to divider_determine_rate() instead so that this deprecated API
can be removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
cd1cb38836c0 ("clk: stm32: stm32-core: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:37 +0000 (16:16 -0500)]
clk: stm32: stm32-core: convert from divider_ro_round_rate() to divider_ro_determine_rate()
The divider_ro_round_rate() function is now deprecated, so let's migrate
to divider_ro_determine_rate() instead so that this deprecated API can
be removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
cd1cb38836c0 ("clk: stm32: stm32-core: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:36 +0000 (16:16 -0500)]
clk: sprd: div: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
deb4740a5ff8 ("clk: sprd: div: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:35 +0000 (16:16 -0500)]
clk: sophgo: sg2042-clkgen: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Note that this commit also removes a debugging message that's not really
needed.
Fixes:
9a3b6993613d ("clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()")
Tested-by: Chen Wang <unicorn_wang@outlook.com>
Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:31 +0000 (16:16 -0500)]
clk: nxp: lpc32xx: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
0879768df240 ("clk: nxp: lpc32xx: convert from round_rate() to determine_rate()")
Tested-by: Vladimir Zapolskiy <vz@mleia.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:30 +0000 (16:16 -0500)]
clk: nuvoton: ma35d1-divider: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
215f8aa095a1 ("clk: nuvoton: ma35d1-divider: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:29 +0000 (16:16 -0500)]
clk: milbeaut: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
7b45988fcf78 ("clk: milbeaut: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:28 +0000 (16:16 -0500)]
clk: milbeaut: convert from divider_ro_round_rate() to divider_ro_determine_rate()
The divider_ro_round_rate() function is now deprecated, so let's migrate
to divider_ro_determine_rate() instead so that this deprecated API can
be removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
fe67c682f91c ("clk: milbeaut: convert from divider_round_rate() to divider_determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:27 +0000 (16:16 -0500)]
clk: loongson1: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
bb40a2ef4fc9 ("clk: loongson1: convert from round_rate() to determine_rate()")
Reviewed-by: Keguang Zhang <keguang.zhang@gmail.com>
Tested-by: Keguang Zhang <keguang.zhang@gmail.com> # on LS1B & LS1C
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:26 +0000 (16:16 -0500)]
clk: hisilicon: clkdivider-hi6220: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
619a6210f398 ("clk: hisilicon: clkdivider-hi6220: convert from round_rate() to determine_rate()")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:25 +0000 (16:16 -0500)]
clk: bm1880: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
64613d7fb42f ("clk: bm1880: convert from round_rate() to determine_rate()")
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:24 +0000 (16:16 -0500)]
clk: bm1880: convert from divider_ro_round_rate() to divider_ro_determine_rate()
The divider_ro_round_rate() function is now deprecated, so let's migrate
to divider_ro_determine_rate() instead so that this deprecated API can
be removed.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
cf1d95fa0c64 ("clk: bm1880: convert from divider_round_rate() to divider_determine_rate()")
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:23 +0000 (16:16 -0500)]
clk: actions: owl-divider: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed. Additionally, owl_divider_helper_round_rate() is no longer used,
so let's drop that from the header file as well.
Note that when the main function itself was migrated to use
determine_rate, this was mistakenly converted to:
req->rate = divider_round_rate(...)
This is invalid in the case when an error occurs since it can set the
rate to a negative value.
Fixes:
1b04e12a8bcc ("clk: actions: owl-divider: convert from round_rate() to determine_rate()")
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:22 +0000 (16:16 -0500)]
clk: actions: owl-composite: convert from owl_divider_helper_round_rate() to divider_determine_rate()
owl_divider_helper_round_rate() is just a wrapper for
divider_round_rate(), which is deprecated. Let's migrate to
divider_determine_rate() instead so that this deprecated API can be
removed.
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:20 +0000 (16:16 -0500)]
clk: sunxi-ng: convert from divider_round_rate_parent() to divider_determine_rate()
The divider_round_rate_parent() function is now deprecated, so let's
migrate to divider_determine_rate() instead so that this deprecated API
can be removed. Also go ahead and convert all of the driver from round
rate type to determine rate that accepts a 'struct clk_rate_request' to
simplify the overall driver code.
Acked-by: Chen-Yu Tsai <wens@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Brian Masney [Thu, 8 Jan 2026 21:16:19 +0000 (16:16 -0500)]
clk: sophgo: cv18xx-ip: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate
to divider_determine_rate() instead so that this deprecated API can be
removed. Also go ahead and convert all of the driver from round rate
type to determine rate that accepts a 'struct clk_rate_request' to
simplify the overall driver code.
Signed-off-by: Brian Masney <bmasney@redhat.com>
Stephen Boyd [Wed, 21 Jan 2026 19:25:45 +0000 (11:25 -0800)]
Merge tag 'clk-meson-v6.20-1' of https://github.com/BayLibre/clk-meson into clk-amlogic
Pull Amlogic clk driver updates from Jerome Brunet:
- Add support for Amlogic t7 clock controllers
- Add video clocks on Amlogic s4
- HDMI PLL post divider fixes on Amlogic gx/g12 SoCs
* tag 'clk-meson-v6.20-1' of https://github.com/BayLibre/clk-meson:
clk: meson: gxbb: use the existing HHI_HDMI_PLL_CNTL3 macro
clk: meson: g12a: Limit the HDMI PLL OD to /4
clk: meson: gxbb: Limit the HDMI PLL OD to /4 on GXL/GXM SoCs
clk: amlogic: remove potentially unsafe flags from S4 video clocks
clk: amlogic: add video-related clocks for S4 SoC
dt-bindings: clock: add video clock indices for Amlogic S4 SoC
clk: meson: t7: add t7 clock peripherals controller driver
clk: meson: t7: add support for the T7 SoC PLL clock
dt-bindings: clock: add Amlogic T7 peripherals clock controller
dt-bindings: clock: add Amlogic T7 SCMI clock controller
dt-bindings: clock: add Amlogic T7 PLL clock controller
Stephen Boyd [Wed, 21 Jan 2026 19:23:30 +0000 (11:23 -0800)]
Merge tag 'thead-clk-for-v6.20' of https://git./linux/kernel/git/fustini/linux into clk-thead
Pull T-HEAD clock driver updates from Drew Fustini:
There is just one set of changes for thead this cycle. They add support
for CPU scaling on the T-HEAD TH1520 by allowing the PLL rate used for
the CPU cluster to be reconfigured. The changes have been tested in
linux-next.
Signed-off-by: Drew Fustini <fustini@kernel.org>
* tag 'thead-clk-for-v6.20' of https://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux:
clk: thead: th1520-ap: Support CPU frequency scaling
clk: thead: th1520-ap: Add macro to define multiplexers with flags
clk: thead: th1520-ap: Support setting PLL rates
clk: thead: th1520-ap: Add C910 bus clock
clk: thead: th1520-ap: Poll for PLL lock and wait for stability
dt-bindings: clock: thead,th1520-clk-ap: Add ID for C910 bus clock
Stephen Boyd [Wed, 21 Jan 2026 19:16:11 +0000 (11:16 -0800)]
Merge tag 'for-6.20-clk' of git://git./linux/kernel/git/tegra/linux into clk-tegra
Pull Tegra clk driver updates from Thierry Reding:
This series updates the Tegra clock driver to improve hardware support
and code correctness. Key changes include fixing camera and display
clock hierarchies for Tegra20/30 (adding CSI pad gates, reparenting
DSI/CSUS), resolving a memory leak in the Tegra124 EMC driver, and
optimizing system suspend/resume callbacks to remove redundant runtime
PM overhead.
* tag 'for-6.20-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
clk: tegra30: Add CSI pad clock gates
clk: tegra: Set CSUS as vi_sensor's gate for Tegra20, Tegra30 and Tegra114
clk: tegra20: Reparent dsi clock to pll_d_out0
clk: tegra: tegra124-emc: Simplify with scoped for each OF child loop
clk: tegra: Adjust callbacks in tegra_clock_pm
clk: tegra: tegra124-emc: Fix potential memory leak in tegra124_clk_register_emc()
Stephen Boyd [Wed, 21 Jan 2026 19:04:31 +0000 (11:04 -0800)]
Merge tag 'spacemit-clk-for-6.20-1' of https://github.com/spacemit-com/linux into clk-spacemit
Pull SpacemiT clock driver updates from Yixun Lan:
- Allow SpacemiT driver to be built as module
- Refactor SpacemiT driver to extract common code
- Add support for SpacemiT K3 SoC clk hardware
* tag 'spacemit-clk-for-6.20-1' of https://github.com/spacemit-com/linux:
clk: spacemit: k3: add the clock tree
clk: spacemit: k3: extract common header
clk: spacemit: ccu_pll: add plla type clock
clk: spacemit: ccu_mix: add inverted enable gate clock
dt-bindings: soc: spacemit: k3: add clock support
clk: spacemit: add platform SoC prefix to reset name
clk: spacemit: extract common ccu functions
reset: spacemit: fix auxiliary device id
clk: spacemit: prepare common ccu header
clk: spacemit: Hide common clock driver from user controller
clk: spacemit: Respect Kconfig setting when building modules
Stephen Boyd [Wed, 21 Jan 2026 18:56:09 +0000 (10:56 -0800)]
Merge tag 'renesas-clk-for-v6.20-tag2' of git://git./linux/kernel/git/geert/renesas-drivers into clk-renesas
Pull Renesas clk driver updates from Geert Uytterhoeven:
- Fix s2ram on Renesas RZ/T2H and RZ/N2H
- Add CAN-FD clocks and resets on Renesas RZ/T2H, RZ/N2H,
RZ/V2H, and RZ/V2N
* tag 'renesas-clk-for-v6.20-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
clk: renesas: Add missing log message terminators
clk: renesas: rzg2l: Remove DSI clock rate restrictions
clk: renesas: rzv2h: Deassert reset on assert timeout
clk: renesas: rzg2l: Deassert reset on assert timeout
clk: renesas: cpg-mssr: Unlock before reset verification
clk: renesas: r9a09g056: Add entries for CANFD
clk: renesas: r9a09g057: Add entries for CANFD
clk: renesas: r9a09g077: Add CANFD clocks
clk: renesas: cpg-mssr: Handle RZ/T2H register layout in PM callbacks
dt-bindings: clock: renesas,r9a09g077/87: Add PCLKCAN ID
clk: renesas: cpg-mssr: Simplify pointer math in cpg_rzt2h_mstp_read()
Marco Felsch [Tue, 13 Jan 2026 14:52:42 +0000 (15:52 +0100)]
clk: imx: fracn-gppll: Add 241.90 MHz Support
Some parallel panels have a pixelclk of 24.19 MHz. Add support for
241.90 MHz so a by 10 divider can be used to derive the exact pixelclk.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20260113-v6-18-topic-clk-fracn-gppll-v3-2-45da70f43c98@pengutronix.de
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Marco Felsch [Tue, 13 Jan 2026 14:52:41 +0000 (15:52 +0100)]
clk: imx: fracn-gppll: Add 332.60 MHz Support
Some parallel panels have a pixelclk of 33.260 MHz. Add support for
332.60 MHz so a by 10 divider can be used to derive the exact pixelclk.
Reviewed-by: Primoz Fiser <primoz.fiser@norik.com>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20260113-v6-18-topic-clk-fracn-gppll-v3-1-45da70f43c98@pengutronix.de
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Peter Griffin [Tue, 13 Jan 2026 10:59:01 +0000 (10:59 +0000)]
clk: samsung: gs101: add support for Display Process Unit (DPU) clocks
cmu_dpu is the clock management unit used for the Display Process Unit
block. It generates clocks for image scaler, compressor etc.
Add support for the muxes, dividers and gates in cmu_dpu.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260113-dpu-clocks-v3-4-cb85424f2c72@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Peter Griffin [Tue, 13 Jan 2026 10:59:00 +0000 (10:59 +0000)]
dt-bindings: samsung: exynos-sysreg: add gs101 dpu compatible
Add dedicated compatibles for gs101 dpu sysreg controllers to the
documentation.
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260113-dpu-clocks-v3-3-cb85424f2c72@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Krzysztof Kozlowski [Sat, 17 Jan 2026 19:29:51 +0000 (20:29 +0100)]
Merge branch 'for-v6.20/dt-bindings-clk' into next/clk
Merge DT binding headers from topic branch, used by the driver.
Peter Griffin [Tue, 13 Jan 2026 10:58:59 +0000 (10:58 +0000)]
dt-bindings: clock: google,gs101-clock: Add DPU clock management unit
Add dt schema documentation and clock IDs for the Display Process Unit
(DPU) clock management unit (CMU). This CMU feeds IPs such as image scaler,
enhancer and compressor.
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260113-dpu-clocks-v3-2-cb85424f2c72@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Peter Griffin [Tue, 13 Jan 2026 10:58:58 +0000 (10:58 +0000)]
dt-bindings: clock: google,gs101-clock: fix alphanumeric ordering
Ensure children of cmu_top have alphanumeric ordering. Top is special as it
feeds all the other children CMUs. This ordering then matches the
clk-gs101.c file.
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260113-dpu-clocks-v3-1-cb85424f2c72@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
André Draszik [Fri, 9 Jan 2026 17:27:24 +0000 (17:27 +0000)]
clk: samsung: fix sysreg save/restore when PM is enabled for CMU
Currently, sysreg registers of a CMU that has PM and automatic clock
gating enabled are not saved / restored during runtime PM (RPM) or
s2idle. During normal suspend, they are accessed too late, after the
CMU (and potentially power domain) have been shut down, causing an
SError.
The reason is that these registers are registered to be saved/restored
via a syscore suspend handler which doesn't run during RPM or s2idle.
During normal suspend, this handler runs after the CMU has been shut
down. This registration happens as part of
samsung_clk_extended_sleep_init() via samsung_en_dyn_root_clk_gating().
When PM is enabled for a CMU, registers must be saved/restored via
exynos_arm64_cmu_suspend() / exynos_arm64_cmu_resume() respectively
instead. These use their own data structures and are unrelated to
anything that samsung_clk_extended_sleep_init() does. Calling it
unconditionally from samsung_en_dyn_root_clk_gating() therefore isn't
useful.
Update the code to prepare sysreg save / restore in a similar way to
how it handles other clock registers in the PM case already.
exynos_arm64_cmu_suspend() / exynos_arm64_cmu_resume() already handle
sysreg save/restore, just the setup was incorrect.
Fixes:
298fac4f4b96 ("clk: samsung: Implement automatic clock gating mode for CMUs")
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://patch.msgid.link/20260109-clk-samsung-autoclk-updates-v1-2-2394dcf242a9@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
André Draszik [Fri, 9 Jan 2026 17:27:23 +0000 (17:27 +0000)]
clk: samsung: avoid warning message on legacy Exynos (auto clock gating)
We currently print a warning message that the IO memory size is not
compatible with automatic clock gating for many Exynos-based boards,
including legacy ones, even if not requested to enable automatic clock
gating in the first place.
Change the test in question to avoid that warning.
Fixes:
298fac4f4b96 ("clk: samsung: Implement automatic clock gating mode for CMUs")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/all/
8b2c412d-3e1e-4be0-a9d5-
ef67f6f0d409@samsung.com/
Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://patch.msgid.link/20260109-clk-samsung-autoclk-updates-v1-1-2394dcf242a9@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Svyatoslav Ryhel [Wed, 22 Oct 2025 14:20:31 +0000 (17:20 +0300)]
clk: tegra30: Add CSI pad clock gates
Tegra30 has CSI pad bits in both PLLD and PLLD2 clocks that are required
for the correct work of the CSI block. Add CSI pad A and pad B clock gates
with PLLD/PLLD2 parents, respectively. Add a plld2 spinlock, like one plld
uses, to prevent simultaneous access since both the PLLDx and CSIx_PAD
clocks use the same registers
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra20, parallel camera
Signed-off-by: Thierry Reding <treding@nvidia.com>
Svyatoslav Ryhel [Wed, 22 Oct 2025 14:20:29 +0000 (17:20 +0300)]
clk: tegra: Set CSUS as vi_sensor's gate for Tegra20, Tegra30 and Tegra114
The CSUS clock is a clock gate for the output clock signal primarily
sourced from the VI_SENSOR clock. This clock signal is used as an input
MCLK clock for cameras.
Unlike later Tegra SoCs, the Tegra 20 can change its CSUS parent, which is
why csus_mux is added in a similar way to how CDEV1 and CDEV2 are handled.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # tegra20, parallel camera
Signed-off-by: Thierry Reding <treding@nvidia.com>
Svyatoslav Ryhel [Thu, 4 Dec 2025 06:17:00 +0000 (08:17 +0200)]
clk: tegra20: Reparent dsi clock to pll_d_out0
Reparent DSI clock to PLLD_OUT0 instead of directly descend from PLLD.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Krzysztof Kozlowski [Fri, 2 Jan 2026 12:50:20 +0000 (13:50 +0100)]
clk: tegra: tegra124-emc: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Rafael J. Wysocki [Tue, 6 Jan 2026 12:19:47 +0000 (13:19 +0100)]
clk: tegra: Adjust callbacks in tegra_clock_pm
System suspend and resume callbacks run after the core has bumped
up the runtime PM usage counters of all devices, so these callbacks
need not worry about runtime PM reference counting.
Accordingly, to eliminate useless overhead related to runtime PM
usage counter manipulation, set the suspend callback pointer in
tegra_clock_pm to a wrapper around pm_runtime_resume() called
tegra_clock_suspend() and do not set the resume callback in it at all.
This will also facilitate a planned change of the pm_runtime_put()
return type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Haoxiang Li [Thu, 15 Jan 2026 05:05:42 +0000 (13:05 +0800)]
clk: tegra: tegra124-emc: Fix potential memory leak in tegra124_clk_register_emc()
If clk_register() fails, call kfree to release "tegra".
Fixes:
2db04f16b589 ("clk: tegra: Add EMC clock driver")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Geert Uytterhoeven [Thu, 15 Jan 2026 12:36:56 +0000 (13:36 +0100)]
clk: renesas: Add missing log message terminators
Complete printed messages should be terminated by newline characters.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/cd0b3624066b80ed0bb00d489c99e2c1a06d755f.1768480559.git.geert+renesas@glider.be
Chris Brandt [Mon, 24 Nov 2025 13:10:02 +0000 (08:10 -0500)]
clk: renesas: rzg2l: Remove DSI clock rate restrictions
Convert the limited MIPI clock calculations to a full range of settings
based on math including H/W limitation validation.
Since the required DSI division setting must be specified from external
sources before calculations, expose a new API to set it.
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Tested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251124131003.992554-2-chris.brandt@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Pierre-Henry Moussay [Tue, 13 Jan 2026 22:11:47 +0000 (22:11 +0000)]
dt-bindings: clock: mpfs-clkcfg: Add pic64gx compatibility
pic64gx has a clock controller compatible with mpfs-clkcfg. Don't permit
the deprecated configuration that was never supported for this SoC.
Signed-off-by: Pierre-Henry Moussay <pierre-henry.moussay@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Co-developed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20260113-glue-justifier-566ffab2ffd3@spud
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Pierre-Henry Moussay [Tue, 13 Jan 2026 22:11:46 +0000 (22:11 +0000)]
dt-bindings: clock: mpfs-ccc: Add pic64gx compatibility
pic64gx SoC Clock Conditioning Circuitry is compatibles
with the Polarfire SoC
Signed-off-by: Pierre-Henry Moussay <pierre-henry.moussay@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20260113-guise-conceded-88030697b831@spud
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Conor Dooley [Tue, 13 Jan 2026 22:11:45 +0000 (22:11 +0000)]
clk: microchip: drop POLARFIRE from ARCH_MICROCHIP_POLARFIRE
This driver is used by non-polarfire devices now, and the ARCH_MICROCHIP
symbol has been defined for some time on RISCV so drop it without any
functional change.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20260113-doing-surplus-dc45866f71d4@spud
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Geert Uytterhoeven [Mon, 1 Dec 2025 09:42:28 +0000 (10:42 +0100)]
clk: Annotate #else and #endif
Annotate the #else and #endif keywords in large #ifdef/#else/#endif
sections, to improve readability.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Geert Uytterhoeven [Mon, 1 Dec 2025 09:42:27 +0000 (10:42 +0100)]
clk: Merge prepare and unprepare sections
<linux/clk.h> contains two consecutive #ifdef/#else/#endif sections
that check for CONFIG_HAVE_CLK_PREPARE: one for prepare-related
functionality, and a second for unprepare-related functionality.
Reduce #ifdef clutter by merging them.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Geert Uytterhoeven [Mon, 1 Dec 2025 09:42:26 +0000 (10:42 +0100)]
clk: Move clk_{save,restore}_context() to COMMON_CLK section
The clk_save_context() and clk_restore_context() helpers are only
implemented by the Common Clock Framework. They are not available when
using legacy clock frameworks. Dummy implementations are provided, but
only if no clock support is available at all.
Hence when CONFIG_HAVE_CLK=y, but CONFIG_COMMON_CLK is not enabled:
m68k-linux-gnu-ld: drivers/net/phy/air_en8811h.o: in function `en8811h_resume':
air_en8811h.c:(.text+0x83e): undefined reference to `clk_restore_context'
m68k-linux-gnu-ld: drivers/net/phy/air_en8811h.o: in function `en8811h_suspend':
air_en8811h.c:(.text+0x856): undefined reference to `clk_save_context'
Fix this by moving forward declarations and dummy implementions from the
HAVE_CLK to the COMMON_CLK section.
Fixes:
8b95d1ce3300c411 ("clk: Add functions to save/restore clock context en-masse")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/
202511301553.eaEz1nEW-lkp@intel.com/
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Janne Grunau [Wed, 31 Dec 2025 12:22:00 +0000 (13:22 +0100)]
clk: clk-apple-nco: Add "apple,t8103-nco" compatible
After discussion with the devicetree maintainers we agreed to not extend
lists with the generic compatible "apple,nco" anymore [1]. Use
"apple,t8103-nco" as base compatible as it is the SoC the driver and
bindings were written for.
[1]: https://lore.kernel.org/asahi/
12ab93b7-1fc2-4ce0-926e-
c8141cfe81bf@kernel.org/
Fixes:
6641057d5dba ("clk: clk-apple-nco: Add driver for Apple NCO")
Cc: stable@vger.kernel.org
Acked-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Krzysztof Kozlowski [Wed, 24 Dec 2025 11:22:42 +0000 (12:22 +0100)]
clk: versatile: impd1: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Krzysztof Kozlowski [Wed, 24 Dec 2025 11:22:41 +0000 (12:22 +0100)]
clk: scpi: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Krzysztof Kozlowski [Wed, 24 Dec 2025 11:22:40 +0000 (12:22 +0100)]
clk: lmk04832: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Stephen Boyd [Fri, 16 Jan 2026 02:31:49 +0000 (18:31 -0800)]
Merge tag 'renesas-clk-for-v6.20-tag1' of git://git./linux/kernel/git/geert/renesas-drivers into clk-renesas
Pull Renesas clk driver updates from Geert Uytterhoeven:
- Add Expanded Serial Peripheral Interface (xSPI) clocks and resets on
Renesas RZ/T21H and RZ/N2H
- Add DMAC, interrupt controller (ICU), SPI, and thermal (TSU) clocks
and resets on Renesas RZ/V2N
- Add more serial (RSCI) clocks and resets on Renesas RZ/V2H and RZ/V2N
* tag 'renesas-clk-for-v6.20-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
clk: renesas: r9a09g056: Add clock and reset entries for TSU
clk: renesas: r9a09g057: Add entries for RSCIs
clk: renesas: r9a09g056: Add entries for RSCIs
clk: renesas: r9a09g056: Add entries for the RSPIs
clk: renesas: r9a09g056: Add entries for ICU
clk: renesas: r9a09g056: Add entries for the DMACs
clk: renesas: r9a09g077: Propagate rate changes through mux parents
clk: renesas: r9a09g077: Add xSPI core and module clocks
clk: renesas: rzg2l: Select correct div round macro
clk: renesas: rzg2l: Fix intin variable size
dt-bindings: clock: renesas,r9a09g077/87: Add XSPI0/1 IDs
Yao Zi [Thu, 20 Nov 2025 13:14:15 +0000 (13:14 +0000)]
clk: thead: th1520-ap: Support CPU frequency scaling
On TH1520 SoC, c910_clk feeds the CPU cluster. It could be glitchlessly
reparented to one of the two PLLs: either to cpu_pll0 indirectly through
c910_i0_clk, or to cpu_pll1 directly.
To achieve glitchless rate change, customized clock operations are
implemented for c910_clk: on rate change, the PLL not currently in use
is configured to the requested rate first, then c910_clk reparents to
it.
Additionally, c910_bus_clk, which in turn takes c910_clk as parent,
has a frequency limit of 750MHz. A clock notifier is registered on
c910_clk to adjust c910_bus_clk on c910_clk rate change.
Reviewed-by: Drew Fustini <fustini@kernel.org>
Signed-off-by: Yao Zi <ziyao@disroot.org>
Signed-off-by: Drew Fustini <fustini@kernel.org>
Brian Masney [Fri, 5 Dec 2025 19:46:29 +0000 (14:46 -0500)]
clk: microchip: core: remove unused include asm/traps.h
The asm/traps.h include file is not actually used, so let's go ahead and
remove it.
Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20251205-clk-microchip-fixes-v3-3-a02190705e47@redhat.com
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Brian Masney [Fri, 5 Dec 2025 19:46:28 +0000 (14:46 -0500)]
clk: microchip: core: correct return value on *_get_parent()
roclk_get_parent() and sclk_get_parent() has the possibility of
returning -EINVAL, however the framework expects this call to always
succeed since the return value is unsigned.
If there is no parent map defined, then the current value programmed in
the hardware is used. Let's use that same value in the case where
-EINVAL is currently returned.
This index is only used by clk_core_get_parent_by_index(), and it
validates that it doesn't overflow the number of available parents.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/
202512050233.R9hAWsJN-lkp@intel.com/
Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://lore.kernel.org/r/20251205-clk-microchip-fixes-v3-2-a02190705e47@redhat.com
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Brian Masney [Fri, 5 Dec 2025 19:46:27 +0000 (14:46 -0500)]
clk: microchip: core: remove duplicate determine_rate on pic32_sclk_ops
pic32_sclk_ops previously had a sclk_round_rate() member, and this was
recently converted over to sclk_determine_rate() with the help of a
Coccinelle semantic patch. pic32_sclk_ops now has two conflicting
determine_rate ops members.
Prior to the conversion, pic32_sclk_ops already had a determine_rate
member that points to __clk_mux_determine_rate(). When both the
round_rate() and determine_rate() ops are defined, the clk core only
uses the determine_rate() op. Let's go ahead and drop the recently
converted sclk_determine_rate() to match the previous functionality
prior to the conversion.
Fixes:
e9f039c08cdc ("clk: microchip: core: convert from round_rate() to determine_rate()")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/
202511222115.uvHrP95A-lkp@intel.com/
Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://lore.kernel.org/r/20251205-clk-microchip-fixes-v3-1-a02190705e47@redhat.com
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Miaoqian Lin [Tue, 5 Aug 2025 03:03:58 +0000 (07:03 +0400)]
clk: rockchip: Fix error pointer check after rockchip_clk_register_gate_link()
Replace NULL check with IS_ERR_OR_NULL() check after calling
rockchip_clk_register_gate_link() since this function
returns error pointers (ERR_PTR).
Fixes:
c62fa612cfa6 ("clk: rockchip: implement linked gate clock support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://patch.msgid.link/20250805030358.3665878-1-linmq006@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Biju Das [Thu, 8 Jan 2026 12:34:28 +0000 (12:34 +0000)]
clk: renesas: rzv2h: Deassert reset on assert timeout
If the assert() fails due to timeout error, set the reset register bit
back to deasserted state. This change is needed especially for handling
assert error in suspend() callback that expect the device to be in
operational state in case of failure.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260108123433.104464-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Biju Das [Thu, 8 Jan 2026 12:34:27 +0000 (12:34 +0000)]
clk: renesas: rzg2l: Deassert reset on assert timeout
If the assert() fails due to timeout error, set the reset register bit
back to deasserted state. This change is needed especially for handling
assert error in suspend() callback that expect the device to be in
operational state in case of failure.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260108123433.104464-2-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Lad Prabhakar [Mon, 5 Jan 2026 14:06:25 +0000 (14:06 +0000)]
clk: renesas: cpg-mssr: Unlock before reset verification
Move spin_unlock_irqrestore() before verifying the reset result and
printing errors. The verification condition only uses local variables
and does not require locking.
Reported-by: Pavel Machek <pavel@nabladev.com>
Closes: https://lore.kernel.org/all/aVujAQJSDn6WyORK@duo.ucw.cz/
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260105140625.2590685-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Lad Prabhakar [Wed, 24 Dec 2025 16:50:49 +0000 (16:50 +0000)]
clk: renesas: r9a09g056: Add entries for CANFD
Add clock and reset entries for the CANFD IP.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251224165049.3384870-5-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Lad Prabhakar [Wed, 24 Dec 2025 16:50:48 +0000 (16:50 +0000)]
clk: renesas: r9a09g057: Add entries for CANFD
Add clock and reset entries for the CANFD IP.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251224165049.3384870-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Lad Prabhakar [Wed, 24 Dec 2025 16:50:47 +0000 (16:50 +0000)]
clk: renesas: r9a09g077: Add CANFD clocks
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have a CANFD
peripheral which has three input clocks PCLKM (peripheral clock),
PCLKH (RAM clock) and PCLKCAN (CANFD clock).
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251224165049.3384870-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Geert Uytterhoeven [Fri, 9 Jan 2026 10:25:29 +0000 (11:25 +0100)]
Merge tag 'renesas-r9a09g077-dt-binding-defs-tag6' into renesas-clk-for-v6.20
Renesas RZ/T2H and RZ/N2H PCLKCAN Clock DT Binding Definitions
PCLKCAN Clock DT binding definitions for the Renesas RZ/T2H (R9A09G077)
and RZ/N2H (R9A09G087) SoCs, shared by driver and DT source files.
Cosmin Tanislav [Thu, 27 Nov 2025 14:56:54 +0000 (16:56 +0200)]
clk: renesas: cpg-mssr: Handle RZ/T2H register layout in PM callbacks
The register layout for RZ/T2H is not handled inside
cpg_mssr_suspend_noirq() and cpg_mssr_resume_noirq(), causing a memory
abort because the wrong code path is taken, as shown below.
Explicitly handle the RZ/T2H register layout in cpg_mssr_suspend_noirq()
and cpg_mssr_resume_noirq(), similar to how it is done inside
cpg_mstp_clock_is_enabled() and cpg_mstp_clock_endisable().
[ 90.052296] Mem abort info:
[ 90.055420] ESR = 0x0000000096000007
[ 90.059553] EC = 0x25: DABT (current EL), IL = 32 bits
[ 90.065697] SET = 0, FnV = 0
[ 90.069211] EA = 0, S1PTW = 0
[ 90.072834] FSC = 0x07: level 3 translation fault
[ 90.078109] Data abort info:
[ 90.081405] ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[ 90.087427] CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 90.093169] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[ 90.099008] swapper pgtable: 4k pages, 48-bit VAs, pgdp=
00000000c60b4000
[ 90.106756] [
ffff800082816318] pgd=
0000000000000000, p4d=
10000000c69ef003, pud=
10000000c69f0003, pmd=
100000024002b403, pte=
0000000000000000
[ 90.120727] Internal error: Oops:
0000000096000007 [#1] SMP
[ 90.127058] Modules linked in: sha256 cfg80211 spi_nor at24 renesas_usbhs bluetooth ecdh_generic ecc rfkill rzt2h_adc spi_rzv2h_rspi industrialio_adc gpio_keys fuse drm backlight ipv6
[ 90.145201] CPU: 0 UID: 0 PID: 307 Comm: sh Not tainted 6.18.0-rc1-next-
20251016+ #47 PREEMPT
[ 90.155006] Hardware name: Renesas RZ/T2H EVK Board based on r9a09g077m44 (DT)
[ 90.163041] pstate:
20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 90.170777] pc : cpg_mssr_suspend_noirq+0x4c/0xc0
[ 90.175983] lr : device_suspend_noirq+0x6c/0x22c
[ 90.181309] sp :
ffff8000838d3af0
[ 90.185026] x29:
ffff8000838d3af0 x28:
ffff8000825c016f x27:
ffff8000825c01a0
[ 90.192973] x26:
ffff8000809feeec x25:
ffff8000827bebb8 x24:
0000000000000002
[ 90.200815] x23:
ffff8000825c0190 x22:
0000000000000002 x21:
0000000000000000
[ 90.209058] x20:
ffff8000827bebb8 x19:
ffff000180128010 x18:
ffff00033ef92a80
[ 90.217100] x17:
ffff000180051700 x16:
0000000000000001 x15:
ffff000187afc310
[ 90.224847] x14:
0000000000000254 x13:
0000000000000001 x12:
0000000000000001
[ 90.232793] x11:
00000000000000c0 x10:
0000000000000ab0 x9 :
ffff8000838d38b0
[ 90.240540] x8 :
ffff000186387410 x7 :
0000000000000001 x6 :
0000000000000000
[ 90.248600] x5 :
ffff0001803240d4 x4 :
0000000000000003 x3 :
ffff0001803240d0
[ 90.256460] x2 :
ffff800082816318 x1 :
000000000000000c x0 :
ffff000180324000
[ 90.264208] Call trace:
[ 90.267019] cpg_mssr_suspend_noirq+0x4c/0xc0 (P)
[ 90.272450] device_suspend_noirq+0x6c/0x22c
[ 90.277375] dpm_noirq_suspend_devices+0x1a8/0x2a0
[ 90.282902] dpm_suspend_noirq+0x24/0xa0
[ 90.287428] suspend_devices_and_enter+0x310/0x590
[ 90.292790] pm_suspend+0x1b4/0x200
[ 90.296811] state_store+0x80/0xf4
[ 90.300676] kobj_attr_store+0x18/0x34
[ 90.305002] sysfs_kf_write+0x7c/0x94
[ 90.309232] kernfs_fop_write_iter+0x12c/0x200
[ 90.314115] vfs_write+0x240/0x380
[ 90.318041] ksys_write+0x64/0x100
[ 90.321862] __arm64_sys_write+0x18/0x24
[ 90.326013] invoke_syscall.constprop.0+0x40/0xf0
[ 90.331445] el0_svc_common.constprop.0+0xb8/0xd8
[ 90.336554] do_el0_svc+0x1c/0x28
[ 90.340375] el0_svc+0x34/0xe8
[ 90.343900] el0t_64_sync_handler+0xa0/0xe4
[ 90.348426] el0t_64_sync+0x198/0x19c
[ 90.352609] Code:
8b040042 b9409004 7100049f 54000240 (
b9400042)
[ 90.359639] ---[ end trace
0000000000000000 ]---
Fixes:
065fe720eec6 ("clk: renesas: Add support for R9A09G077 SoC")
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251127145654.3253992-3-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Yixun Lan [Sun, 2 Nov 2025 13:17:17 +0000 (21:17 +0800)]
clk: spacemit: k3: add the clock tree
Add clock support to SpacemiT K3 SoC, the clock tree consist of several
blocks which are APBC, APBS, APMU, DCIU, MPUM.
Link: https://lore.kernel.org/r/20260108-k3-clk-v5-5-42a11b74ad58@gentoo.org
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Yixun Lan [Fri, 9 Jan 2026 02:47:51 +0000 (10:47 +0800)]
Merge tag 'spacemit-clkrst-v6.20-3' into spacemit-clk-for-6.20
Yixun Lan [Sat, 20 Dec 2025 13:28:15 +0000 (21:28 +0800)]
clk: spacemit: k3: extract common header
Extracting common header file, which will be shared by clock and reset
drivers. So will make it easy to add reset driver for K3 SoC later.
Link: https://lore.kernel.org/r/20260108-k3-clk-v5-4-42a11b74ad58@gentoo.org
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Yixun Lan [Mon, 27 Oct 2025 13:41:24 +0000 (21:41 +0800)]
clk: spacemit: ccu_pll: add plla type clock
Introduce a new clock PLLA for SpacemiT's K3 SoC which has a different
register layout comparing to previous PPL type. And, It is configured
by swcr1, swcr3 and swcr2 BIT[15:8].
Link: https://lore.kernel.org/r/20260108-k3-clk-v5-3-42a11b74ad58@gentoo.org
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Yixun Lan [Fri, 31 Oct 2025 12:40:46 +0000 (20:40 +0800)]
clk: spacemit: ccu_mix: add inverted enable gate clock
K3 SoC has the clock IP which support to write value 0 for enabling the
clock, while write 1 for disabling it, thus the enable BIT is inverted.
So, introduce a flag to support the inverted gate clock.
Link: https://lore.kernel.org/r/20260108-k3-clk-v5-2-42a11b74ad58@gentoo.org
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Yixun Lan [Sat, 1 Nov 2025 12:56:42 +0000 (20:56 +0800)]
dt-bindings: soc: spacemit: k3: add clock support
Add compatible strings for clock drivers to support Spacemit K3 SoC,
also includes all the defined clock IDs.
The SpacemiT K3 SoC clock IP is scattered over several different blocks,
which are APBC, APBS, APMU, DCIU, MPMU, all of them are capable of
generating clock and reset signals. APMU and MPMU have additional Power
Domain management functionality.
Following is a brief list that shows devices managed in each block:
APBC: UART, GPIO, PWM, SPI, TIMER, I2S, IR, DR, TSEN, IPC, CAN
APBS: various PPL clocks control
APMU: CCI, CPU, CSI, ISP, LCD, USB, QSPI, DMA, VPU, GPU, DSI, PCIe, EMAC..
DCID: SRAM, DMA, TCM
MPMU: various PLL1 derived clocks, UART, WATCHDOG, I2S
Link: https://lore.kernel.org/r/20260108-k3-clk-v5-1-42a11b74ad58@gentoo.org
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Yixun Lan [Fri, 9 Jan 2026 02:01:08 +0000 (10:01 +0800)]
Merge tag 'spacemit-clkrst-v6.20-2' into spacemit-clk-for-6.20
Yixun Lan [Sat, 3 Jan 2026 06:14:36 +0000 (14:14 +0800)]
clk: spacemit: add platform SoC prefix to reset name
This change is needed for adding future new SpacemiT K3 reset driver.
Since both K1 and K3 reset code register via the same module which its
name changed to spacemit_ccu, it's necessary to encode the platform/SoC
in the reset auxiliary device name to distinguish them, otherwise two
reset drivers will claim to support same "compatible" auxiliary device
even in the case of only one CCU clock driver got registered, which in
the end lead to a broken reset driver.
This change will introduce a runtime break to reset driver, and will be
fixed in follow-up commit:
ecff77f7c041 ("reset: spacemit: fix auxiliary device id")
Link: https://lore.kernel.org/r/20260108-06-k1-clk-common-v4-3-badf635993d3@gentoo.org
Reviewed-by: Alex Elder <elder@riscstar.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Yixun Lan [Fri, 19 Dec 2025 00:07:23 +0000 (08:07 +0800)]
clk: spacemit: extract common ccu functions
Refactor the probe function of SpacemiT's clock, and extract a common ccu
file, so new clock driver added in the future can share the same code,
which would lower the burden of maintenance. Since this commit changes the
module name from spacemit_ccu_k1 to spacemit_ccu where the auxiliary device
registered, the auxiliary device id need to be adjusted. Idea of the patch
comes from the review of K3 clock driver, please refer to this disucssion[1]
for more detail.
This change will introduce a runtime break to reset driver, and will be
fixed in follow-up commit:
ecff77f7c041 ("reset: spacemit: fix auxiliary device id")
Link: https://lore.kernel.org/all/aTo8sCPpVM1o9PKX@pie/
Link: https://lore.kernel.org/r/20260108-06-k1-clk-common-v4-2-badf635993d3@gentoo.org
Suggested-by: Yao Zi <me@ziyao.cc>
Reviewed-by: Alex Elder <elder@riscstar.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>