summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-integrator/integrator_ap.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-05-08 15:35:22 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-23 18:04:52 +0100
commitc5039f52329ff796d7fea9024e5615abee02dbfb (patch)
tree2434fede52e85f2a2315cfce76600fa777d98715 /arch/arm/mach-integrator/integrator_ap.c
parent6fa5d5f764469daf3c4d21f94cbc1839b3857bbd (diff)
downloadlinux-c5039f52329ff796d7fea9024e5615abee02dbfb.tar.gz
linux-c5039f52329ff796d7fea9024e5615abee02dbfb.tar.bz2
linux-c5039f52329ff796d7fea9024e5615abee02dbfb.zip
clocksource: convert Integrator/AP 16-bit down counting clocksource
Convert the Integrator/AP 16-bit down-counting clocksource to the generic clocksource infrastructure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator/integrator_ap.c')
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index d3e96451529c..6b151288f66c 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -335,25 +335,9 @@ static void __init ap_init(void)
static unsigned long timer_reload;
-static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE;
-
-static cycle_t timersp_read(struct clocksource *cs)
-{
- return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff);
-}
-
-static struct clocksource clocksource_timersp = {
- .name = "timer2",
- .rating = 200,
- .read = timersp_read,
- .mask = CLOCKSOURCE_MASK(16),
- .flags = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
static void integrator_clocksource_init(u32 khz)
{
- struct clocksource *cs = &clocksource_timersp;
- void __iomem *base = clksrc_base;
+ void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
u32 ctrl = TIMER_CTRL_ENABLE;
if (khz >= 1500) {
@@ -364,7 +348,8 @@ static void integrator_clocksource_init(u32 khz)
writel(ctrl, base + TIMER_CTRL);
writel(0xffff, base + TIMER_LOAD);
- clocksource_register_khz(cs, khz);
+ clocksource_mmio_init(base + TIMER_VALUE, "timer2",
+ khz * 1000, 200, 16, clocksource_mmio_readl_down);
}
static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;