sh: comment tidying for sh64->sh migration.
[safe/jmp/linux-2.6] / arch / sh / kernel / cpu / clock.c
index 014f318..b5f1e23 100644 (file)
@@ -83,6 +83,8 @@ static void propagate_rate(struct clk *clk)
                        continue;
                if (likely(clkp->ops && clkp->ops->recalc))
                        clkp->ops->recalc(clkp);
+               if (unlikely(clkp->flags & CLK_RATE_PROPAGATES))
+                       propagate_rate(clkp);
        }
 }
 
@@ -229,6 +231,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.
@@ -278,6 +296,11 @@ arch_init_clk_ops(struct clk_ops **ops, int type)
 {
 }
 
+void __init __attribute__ ((weak))
+arch_clk_init(void)
+{
+}
+
 static int show_clocks(char *buf, char **start, off_t off,
                       int len, int *eof, void *data)
 {
@@ -314,6 +337,8 @@ int __init clk_init(void)
                ret |= clk_register(clk);
        }
 
+       arch_clk_init();
+
        /* Kick the child clocks.. */
        propagate_rate(&master_clk);
        propagate_rate(&bus_clk);