summaryrefslogtreecommitdiffstats
path: root/kernel/arch/mips/lantiq/clk.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/mips/lantiq/clk.c')
-rw-r--r--kernel/arch/mips/lantiq/clk.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/arch/mips/lantiq/clk.c b/kernel/arch/mips/lantiq/clk.c
index 3fc2e6d70..a0706fd4c 100644
--- a/kernel/arch/mips/lantiq/clk.c
+++ b/kernel/arch/mips/lantiq/clk.c
@@ -99,6 +99,23 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
}
EXPORT_SYMBOL(clk_set_rate);
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+ if (unlikely(!clk_good(clk)))
+ return 0;
+ if (clk->rates && *clk->rates) {
+ unsigned long *r = clk->rates;
+
+ while (*r && (*r != rate))
+ r++;
+ if (!*r) {
+ return clk->rate;
+ }
+ }
+ return rate;
+}
+EXPORT_SYMBOL(clk_round_rate);
+
int clk_enable(struct clk *clk)
{
if (unlikely(!clk_good(clk)))