[PATCH 08/12] clk: mux: export clk_mux_round_rate

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Jan 30 23:57:21 PST 2022


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 at pengutronix.de>
---
 drivers/clk/clk-mux.c | 5 +++--
 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 d608e0e2c565..8463f1ee82c5 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 81bd1ec2dad9..0aa29c4720fe 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;
-- 
2.30.2




More information about the barebox mailing list