feat(clk): add set_rate callback
This callback will be used to set a clock's rate if the underlying clock
driver supports this option. The function's last parameter is an output
parameter, storing the actual frequency set by the clock driver, as it
may not precisely match the requested rate in some cases.
Change-Id: I6a399bf6f64407d5fbff36407561e4bf18104cf1
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
diff --git a/include/drivers/clk.h b/include/drivers/clk.h
index d4cc90d..4db20f8 100644
--- a/include/drivers/clk.h
+++ b/include/drivers/clk.h
@@ -13,6 +13,8 @@
int (*enable)(unsigned long id);
void (*disable)(unsigned long id);
unsigned long (*get_rate)(unsigned long id);
+ int (*set_rate)(unsigned long id, unsigned long rate,
+ unsigned long *orate);
int (*get_parent)(unsigned long id);
int (*set_parent)(unsigned long id, unsigned long parent_id);
bool (*is_enabled)(unsigned long id);
@@ -21,6 +23,7 @@
int clk_enable(unsigned long id);
void clk_disable(unsigned long id);
unsigned long clk_get_rate(unsigned long id);
+int clk_set_rate(unsigned long id, unsigned long rate, unsigned long *orate);
bool clk_is_enabled(unsigned long id);
int clk_get_parent(unsigned long id);
int clk_set_parent(unsigned long id, unsigned long parent_id);