]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ARM: 6296/1: clock U300 intcon and timer properly
authorLinus Walleij <linus.walleij@stericsson.com>
Thu, 5 Aug 2010 06:58:58 +0000 (07:58 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 10 Aug 2010 21:10:55 +0000 (22:10 +0100)
This removes the quirks to clock the U300 VIC and timer by custom
hooks and moves the control out to the clock framework where it
belongs. This is possible now that clocks are available early.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-u300/clock.c
arch/arm/mach-u300/clock.h
arch/arm/mach-u300/core.c
arch/arm/mach-u300/timer.c

index 7836de35893c38e258a9fe9704e3088dc87ac237..7a94729caff9a87e2576a1b5822b6bb452a70ad1 100644 (file)
@@ -1315,25 +1315,6 @@ static void __init clk_register(void)
        clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 }
 
-/*
- * The interrupt controller is enabled before the clock API is registered.
- */
-void u300_enable_intcon_clock(void)
-{
-       clk_enable(&intcon_clk);
-}
-EXPORT_SYMBOL(u300_enable_intcon_clock);
-
-/*
- * The timer is enabled before the clock API is registered.
- */
-void u300_enable_timer_clock(void)
-{
-       clk_enable(&app_timer_clk);
-}
-EXPORT_SYMBOL(u300_enable_timer_clock);
-
-
 #if (defined(CONFIG_DEBUG_FS) && defined(CONFIG_U300_DEBUG))
 /*
  * The following makes it possible to view the status (especially
index fc40c326566fe36883a33cd3fd8c65951aa4402a..c34f3ea3017c4db1b4da624b12c1f800e24a91b0 100644 (file)
@@ -45,8 +45,6 @@ struct clk {
        void (*disable) (struct clk *);
 };
 
-void u300_enable_intcon_clock(void);
-void u300_enable_timer_clock(void);
 int u300_clock_init(void);
 
 #endif
index b189763708247a24013f49af394609f79a5f50e7..ea41c236be0f78cb0e250ff8e6b4e4116339d695 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/amba/bus.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/clk.h>
+#include <linux/err.h>
 #include <mach/coh901318.h>
 
 #include <asm/types.h>
@@ -1477,14 +1479,19 @@ static struct platform_device *platform_devs[] __initdata = {
 void __init u300_init_irq(void)
 {
        u32 mask[2] = {0, 0};
+       struct clk *clk;
        int i;
 
        /* initialize clocking early, we want to clock the INTCON */
        u300_clock_init();
 
+       /* Clock the interrupt controller */
+       clk = clk_get_sys("intcon", NULL);
+       BUG_ON(IS_ERR(clk));
+       clk_enable(clk);
+
        for (i = 0; i < NR_IRQS; i++)
                set_bit(i, (unsigned long *) &mask[0]);
-       u300_enable_intcon_clock();
        vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]);
        vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]);
 }
index 26d26f5100fee6b78cd67d1e3c987aa489452a79..01f161831956e9c7dc02445a34845546f17dffdf 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/clocksource.h>
 #include <linux/types.h>
 #include <linux/io.h>
+#include <linux/clk.h>
+#include <linux/err.h>
 
 #include <mach/hardware.h>
 
@@ -23,7 +25,6 @@
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
-#include "clock.h"
 
 /*
  * APP side special timer registers
@@ -367,7 +368,13 @@ unsigned long long notrace sched_clock(void)
  */
 static void __init u300_timer_init(void)
 {
-       u300_enable_timer_clock();
+       struct clk *clk;
+
+       /* Clock the interrupt controller */
+       clk = clk_get_sys("apptimer", NULL);
+       BUG_ON(IS_ERR(clk));
+       clk_enable(clk);
+
        /*
         * Disable the "OS" and "DD" timers - these are designed for Symbian!
         * Example usage in cnh1601578 cpu subsystem pd_timer_app.c