|
@@ -229,6 +229,22 @@ void clk_recalc_rate(struct clk *clk)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(clk_recalc_rate);
|
|
|
|
|
|
+long clk_round_rate(struct clk *clk, unsigned long rate)
|
|
|
+{
|
|
|
+ if (likely(clk->ops && clk->ops->round_rate)) {
|
|
|
+ unsigned long flags, rounded;
|
|
|
+
|
|
|
+ spin_lock_irqsave(&clock_lock, flags);
|
|
|
+ rounded = clk->ops->round_rate(clk, rate);
|
|
|
+ spin_unlock_irqrestore(&clock_lock, flags);
|
|
|
+
|
|
|
+ return rounded;
|
|
|
+ }
|
|
|
+
|
|
|
+ return clk_get_rate(clk);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(clk_round_rate);
|
|
|
+
|
|
|
/*
|
|
|
* Returns a clock. Note that we first try to use device id on the bus
|
|
|
* and clock name. If this fails, we try to use clock name only.
|