diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-08 10:33:30 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-23 13:04:51 -0400 |
commit | bfe45e0be88d8a2e408226d473bff60da4a97d1f (patch) | |
tree | 4586e8933a35af1599f314adb73f2bae504b49b5 /arch/arm/plat-mxc | |
parent | 234b6ceddb4fc2a4bc5b9a7670f070f6e69e0868 (diff) |
clocksource: convert ARM 32-bit down counting clocksources
Convert SP804, MXC, Nomadik and Orion 32-bit down-counting clocksources
to generic mmio clocksource infrastructure.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Alessandro Rubini <rubini@unipv.it>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/epit.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c index d69d343ff61f..d3467f818c33 100644 --- a/arch/arm/plat-mxc/epit.c +++ b/arch/arm/plat-mxc/epit.c | |||
@@ -83,26 +83,12 @@ static void epit_irq_acknowledge(void) | |||
83 | __raw_writel(EPITSR_OCIF, timer_base + EPITSR); | 83 | __raw_writel(EPITSR_OCIF, timer_base + EPITSR); |
84 | } | 84 | } |
85 | 85 | ||
86 | static cycle_t epit_read(struct clocksource *cs) | ||
87 | { | ||
88 | return 0 - __raw_readl(timer_base + EPITCNR); | ||
89 | } | ||
90 | |||
91 | static struct clocksource clocksource_epit = { | ||
92 | .name = "epit", | ||
93 | .rating = 200, | ||
94 | .read = epit_read, | ||
95 | .mask = CLOCKSOURCE_MASK(32), | ||
96 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
97 | }; | ||
98 | |||
99 | static int __init epit_clocksource_init(struct clk *timer_clk) | 86 | static int __init epit_clocksource_init(struct clk *timer_clk) |
100 | { | 87 | { |
101 | unsigned int c = clk_get_rate(timer_clk); | 88 | unsigned int c = clk_get_rate(timer_clk); |
102 | 89 | ||
103 | clocksource_register_hz(&clocksource_epit, c); | 90 | return clocksource_mmio_init(timer_base + EPITCNR, "epit", c, 200, 32, |
104 | 91 | clocksource_mmio_readl_down); | |
105 | return 0; | ||
106 | } | 92 | } |
107 | 93 | ||
108 | /* clock event */ | 94 | /* clock event */ |