]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/clock.c
ARM: OMAP2: Force APLLs always active
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / clock.c
index 26ac49ecb78d6958e189daa01377d6c02934b203..03065074f8084373852a8e1faff97b2b363656ee 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <asm/arch/clock.h>
 #include <asm/arch/sram.h>
+#include <asm/div64.h>
 
 #include "prcm-regs.h"
 #include "memory.h"
@@ -1025,12 +1026,29 @@ static int omap2_select_table_rate(struct clk * clk, unsigned long rate)
  * Omap2 clock reset and init functions
  *-------------------------------------------------------------------------*/
 
+#ifdef CONFIG_OMAP_RESET_CLOCKS
+static void __init omap2_clk_disable_unused(struct clk *clk)
+{
+       u32 regval32;
+
+       regval32 = __raw_readl(clk->enable_reg);
+       if ((regval32 & (1 << clk->enable_bit)) == 0)
+               return;
+
+       printk(KERN_INFO "Disabling unused clock \"%s\"\n", clk->name);
+       _omap2_clk_disable(clk);
+}
+#else
+#define omap2_clk_disable_unused       NULL
+#endif
+
 static struct clk_functions omap2_clk_functions = {
        .clk_enable             = omap2_clk_enable,
        .clk_disable            = omap2_clk_disable,
        .clk_round_rate         = omap2_clk_round_rate,
        .clk_set_rate           = omap2_clk_set_rate,
        .clk_set_parent         = omap2_clk_set_parent,
+       .clk_disable_unused     = omap2_clk_disable_unused,
 };
 
 static void __init omap2_get_crystal_rate(struct clk *osc, struct clk *sys)
@@ -1070,28 +1088,6 @@ void omap2_clk_prepare_for_reboot(void)
        clk_set_rate(vclk, rate);
 }
 
-#ifdef CONFIG_OMAP_RESET_CLOCKS
-static void __init omap2_disable_unused_clocks(void)
-{
-       struct clk *ck;
-       u32 regval32;
-
-       list_for_each_entry(ck, &clocks, node) {
-               if (ck->usecount > 0 || (ck->flags & ALWAYS_ENABLED) ||
-                       ck->enable_reg == 0)
-                       continue;
-
-               regval32 = __raw_readl(ck->enable_reg);
-               if ((regval32 & (1 << ck->enable_bit)) == 0)
-                       continue;
-
-               printk(KERN_INFO "Disabling unused clock \"%s\"\n", ck->name);
-               _omap2_clk_disable(ck);
-       }
-}
-late_initcall(omap2_disable_unused_clocks);
-#endif
-
 /*
  * Switch the MPU rate if specified on cmdline.
  * We cannot do this early until cmdline is parsed.
@@ -1164,8 +1160,8 @@ int __init omap2_clk_init(void)
        clk_enable(&sync_32k_ick);
        clk_enable(&omapctrl_ick);
 
-       /* Force the APLLs active during bootup to avoid disabling and
-        * enabling them unnecessarily. */
+       /* Force the APLLs always active. The clocks are idled
+        * automatically by hardware. */
        clk_enable(&apll96_ck);
        clk_enable(&apll54_ck);
 
@@ -1178,12 +1174,3 @@ int __init omap2_clk_init(void)
 
        return 0;
 }
-
-static int __init omap2_disable_aplls(void)
-{
-       clk_disable(&apll96_ck);
-       clk_disable(&apll54_ck);
-
-       return 0;
-}
-late_initcall(omap2_disable_aplls);