summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/time.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-02-16 14:36:49 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-03-13 10:33:47 +0100
commit30c730f8f90b08d77a73998d2ee34cf1f56e95cc (patch)
tree4b73291db523a77d2ca36a65ba7e0d1a8ff6e56e /arch/arm/plat-mxc/time.c
parenta2865197a5dad23c619c84f44b7fdf7fdbef3f9c (diff)
downloadlinux-30c730f8f90b08d77a73998d2ee34cf1f56e95cc.tar.gz
linux-30c730f8f90b08d77a73998d2ee34cf1f56e95cc.tar.bz2
linux-30c730f8f90b08d77a73998d2ee34cf1f56e95cc.zip
[ARM] MXC: rework timer/clock initialisation
- rename mxc_clocks_init to architecture specific versions. This allows us to have more than one architecture compiled in. - call mxc_timer_init from clock initialisation instead from board code Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/time.c')
-rw-r--r--arch/arm/plat-mxc/time.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 758a1293bcfa..eb93fd1789db 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -34,9 +34,6 @@
static struct clock_event_device clockevent_mxc;
static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
-/* clock source for the timer */
-static struct clk *timer_clk;
-
/* clock source */
static cycle_t mxc_get_cycles(void)
@@ -53,7 +50,7 @@ static struct clocksource clocksource_mxc = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-static int __init mxc_clocksource_init(void)
+static int __init mxc_clocksource_init(struct clk *timer_clk)
{
unsigned int clock;
@@ -177,7 +174,7 @@ static struct clock_event_device clockevent_mxc = {
.rating = 200,
};
-static int __init mxc_clockevent_init(void)
+static int __init mxc_clockevent_init(struct clk *timer_clk)
{
unsigned int clock;
@@ -197,14 +194,8 @@ static int __init mxc_clockevent_init(void)
return 0;
}
-void __init mxc_timer_init(const char *clk_timer)
+void __init mxc_timer_init(struct clk *timer_clk)
{
- timer_clk = clk_get(NULL, clk_timer);
- if (!timer_clk) {
- printk(KERN_ERR"Cannot determine timer clock. Giving up.\n");
- return;
- }
-
clk_enable(timer_clk);
/*
@@ -219,10 +210,9 @@ void __init mxc_timer_init(const char *clk_timer)
TIMER_BASE + MXC_TCTL);
/* init and register the timer to the framework */
- mxc_clocksource_init();
- mxc_clockevent_init();
+ mxc_clocksource_init(timer_clk);
+ mxc_clockevent_init(timer_clk);
/* Make irqs happen */
setup_irq(TIMER_INTERRUPT, &mxc_timer_irq);
}
-