diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-01-31 08:57:21 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-02-01 09:01:35 +0100 |
commit | 14a113b4b9bdfb1d84f62cea695c8097a6031fbd (patch) | |
tree | cf788ec52c553e77d661d3d8756b19b7dc2062a1 | |
parent | d437d2cfee4530f3c372a673cff90ee751afe679 (diff) | |
download | barebox-14a113b4b9bdfb1d84f62cea695c8097a6031fbd.tar.gz barebox-14a113b4b9bdfb1d84f62cea695c8097a6031fbd.tar.xz |
clk: mux: export clk_mux_round_rate
Clock drivers may want to implement round rate for their custom clocks
in term of clk_mux_round_rate. Export the function to facilitate this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220131075725.1873026-9-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/clk/clk-mux.c | 5 | ||||
-rw-r--r-- | include/linux/clk.h | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index d608e0e2c5..8463f1ee82 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -110,8 +110,8 @@ static struct clk *clk_mux_best_parent(struct clk *mux, unsigned long rate, return bestparent; } -static long clk_mux_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *prate) +long clk_mux_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) { struct clk *clk = clk_hw_to_clk(hw); unsigned long rrate; @@ -124,6 +124,7 @@ static long clk_mux_round_rate(struct clk_hw *hw, unsigned long rate, return rrate; } +EXPORT_SYMBOL_GPL(clk_mux_round_rate); static int clk_mux_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) diff --git a/include/linux/clk.h b/include/linux/clk.h index 44c0cc7b1f..073c919802 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -668,6 +668,9 @@ int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags, unsigned int val); unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index); +long clk_mux_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate); + struct clk_gate { struct clk_hw hw; void __iomem *reg; |