diff options
| author | Marek Vasut <[email protected]> | 2025-03-23 16:58:30 +0100 |
|---|---|---|
| committer | Fabio Estevam <[email protected]> | 2025-03-24 08:51:34 -0300 |
| commit | 1054163c4dc79eef2732d1129990d47827ae1c06 (patch) | |
| tree | 18db3793d34e935e2575ecdebee19f050cea9a7a /include | |
| parent | cc9dcba9cce185d8bca2dc5c4b55b21f4505cbe8 (diff) | |
clk: Add clk_resolve_parent_clk()
Add clk_resolve_parent_clk() to resolve parent clock udevice name
based on clock-names DT property. This is used in SoC clock drivers
to look up the clock name in clock tables, which matches a clock
name in DT clock-names property, and convert it into udevice name
which is used by U-Boot clock framework to look up parent clock in
e.g. clk_register() using uclass_get_device_by_name(UCLASS_CLK,
parent_name, &parent);
Signed-off-by: Marek Vasut <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/clk.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clk.h b/include/clk.h index 045e923a529..a6ef4e02692 100644 --- a/include/clk.h +++ b/include/clk.h @@ -351,6 +351,15 @@ static inline int clk_get_by_name_nodev_optional(ofnode node, const char *name, } /** + * clk_resolve_parent_clk - Determine name of clock udevice based on clock-names + * @dev: The client udevice. + * @name: The name of the clock to look up. + * + * Return name of the clock udevice which represents clock with clock-names name. + */ +const char *clk_resolve_parent_clk(struct udevice *dev, const char *name); + +/** * enum clk_defaults_stage - What stage clk_set_defaults() is called at * @CLK_DEFAULTS_PRE: Called before probe. Setting of defaults for clocks owned * by this clock driver will be defered until after probing. |
