summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-21 19:43:41 -0700
committerSimon Glass <sjg@chromium.org>2016-01-21 20:42:34 -0700
commit64b7faa7f9583d31e954c10de52275cdf2bf0ee1 (patch)
treec8a905f1f6884fa420cd3ea993b4cf9b9422d0c8 /arch/arm
parent4f43673e5ac54c3c2486eee6f1c9cf5e51744f23 (diff)
downloadu-boot-imx-64b7faa7f9583d31e954c10de52275cdf2bf0ee1.zip
u-boot-imx-64b7faa7f9583d31e954c10de52275cdf2bf0ee1.tar.gz
u-boot-imx-64b7faa7f9583d31e954c10de52275cdf2bf0ee1.tar.bz2
rockchip: clock: Add a function to find a clock by ID
The current approach of using uclass_get_device() is error-prone. Another clock (for example a fixed-clock) may cause it to break. Add a function that does a proper search. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/arch-rockchip/clock.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-rockchip/clock.h b/arch/arm/include/asm/arch-rockchip/clock.h
index 8a0376c..a9ea268 100644
--- a/arch/arm/include/asm/arch-rockchip/clock.h
+++ b/arch/arm/include/asm/arch-rockchip/clock.h
@@ -62,4 +62,16 @@ static inline u32 clk_get_divisor(ulong input_rate, uint output_rate)
*/
void *rockchip_get_cru(void);
+/**
+ * rkclk_get_clk() - get a pointer to a given clock
+ *
+ * This is an internal function - use outside the clock subsystem indicates
+ * that work is needed!
+ *
+ * @clk_id: Clock requested
+ * @devp: Returns a pointer to that clock
+ * @return 0 if OK, -ve on error
+ */
+int rkclk_get_clk(enum rk_clk_id clk_id, struct udevice **devp);
+
#endif