diff options
| author | Tom Rini <trini@konsulko.com> | 2026-02-02 13:40:50 -0600 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2026-02-02 13:40:50 -0600 |
| commit | fd070b0e71862c0e7f0fa42b7f19e49dfa7037e7 (patch) | |
| tree | 852df5d4d70737729c50840d6e4226baa87f89bf /include/clk.h | |
| parent | 4b287e0a3ae4ab3159584cb5ae12c9b470716be8 (diff) | |
| parent | 90cd316b5a0fce702525ff7980d30e2bd233078d (diff) | |
Merge patch series "clk: support arbitrary clk_register() sequence"DBG/clk-support-arbitrary-clk_register-sequence
Yang Xiwen <forbidden405@outlook.com> says:
Currently, the U-Boot clk framework mandates that clock registration
begins at the root and proceeds to children. This creates an additional
requirement that does not exist in the Linux kernel, making the porting
of clk drivers more difficult.
This series handles the dependency entirely within the clk framework,
allowing drivers the freedom to register clocks in any order.
This is achieved by assigning the parent "lazily". The framework caches
the parent name in the core clk struct and attempts to resolve the
actual parent when clk consumers call clk_get_parent(). The process is
transparent to clk consumers as long as they use standard clk framework
APIs.
I've run `ut dm clk*` and verified these commits do not break any
existing test cases. It also passes the new test case.
This feature is disabled for xPLs by default. I have not found a clean
way to enable this separately for xPLs without introducing a repetitive
Kconfig entry (e.g., xPL_CLK_LAZY_REPARENT), which looks very ugly.
Link: https://lore.kernel.org/r/20260120-clk-reparent-v3-0-0d43d4b362ac@outlook.com
Diffstat (limited to 'include/clk.h')
| -rw-r--r-- | include/clk.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/clk.h b/include/clk.h index 90b42a61867..88db75c56d4 100644 --- a/include/clk.h +++ b/include/clk.h @@ -47,6 +47,7 @@ struct udevice; /** * struct clk - A handle to (allowing control of) a single clock. * @dev: The device which implements the clock signal. + * @parent_name: The name of the parent. * @rate: The clock rate (in HZ). * @flags: Flags used across common clock structure (e.g. %CLK_) * Clock IP blocks specific flags (i.e. mux, div, gate, etc) are defined @@ -72,6 +73,7 @@ struct udevice; */ struct clk { struct udevice *dev; + char *parent_name; long long rate; /* in HZ */ u32 flags; int enable_count; |
