aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-w90x900
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-05-08 10:34:39 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-23 13:04:52 -0400
commit6fa5d5f764469daf3c4d21f94cbc1839b3857bbd (patch)
tree4400a5ba43c7147d77dcc270c2b3f5f8f6c349fa /arch/arm/mach-w90x900
parentbfe45e0be88d8a2e408226d473bff60da4a97d1f (diff)
clocksource: convert W90x900 24-bit down counting clocksource
Convert the W90x900 24-bit down-counting clocksource to the generic mmio clocksource infrastructure Acked-by: Wan ZongShun <mcuos.com@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-w90x900')
-rw-r--r--arch/arm/mach-w90x900/time.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
index 4b089cb930dc..a2c4e2d0a0d4 100644
--- a/arch/arm/mach-w90x900/time.c
+++ b/arch/arm/mach-w90x900/time.c
@@ -43,7 +43,6 @@
43#define PRESCALE 0x63 /* Divider = prescale + 1 */ 43#define PRESCALE 0x63 /* Divider = prescale + 1 */
44 44
45#define TDR_SHIFT 24 45#define TDR_SHIFT 24
46#define TDR_MASK ((1 << TDR_SHIFT) - 1)
47 46
48static unsigned int timer0_load; 47static unsigned int timer0_load;
49 48
@@ -143,19 +142,6 @@ static void __init nuc900_clockevents_init(void)
143 clockevents_register_device(&nuc900_clockevent_device); 142 clockevents_register_device(&nuc900_clockevent_device);
144} 143}
145 144
146static cycle_t nuc900_get_cycles(struct clocksource *cs)
147{
148 return (~__raw_readl(REG_TDR1)) & TDR_MASK;
149}
150
151static struct clocksource clocksource_nuc900 = {
152 .name = "nuc900-timer1",
153 .rating = 200,
154 .read = nuc900_get_cycles,
155 .mask = CLOCKSOURCE_MASK(TDR_SHIFT),
156 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
157};
158
159static void __init nuc900_clocksource_init(void) 145static void __init nuc900_clocksource_init(void)
160{ 146{
161 unsigned int val; 147 unsigned int val;
@@ -175,7 +161,8 @@ static void __init nuc900_clocksource_init(void)
175 val |= (COUNTEN | PERIOD | PRESCALE); 161 val |= (COUNTEN | PERIOD | PRESCALE);
176 __raw_writel(val, REG_TCSR1); 162 __raw_writel(val, REG_TCSR1);
177 163
178 clocksource_register_hz(&clocksource_nuc900, rate); 164 clocksource_mmio_init(REG_TDR1, "nuc900-timer1", rate, 200,
165 TDR_SHIFT, clocksource_mmio_readl_down);
179} 166}
180 167
181static void __init nuc900_timer_init(void) 168static void __init nuc900_timer_init(void)