aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-u300/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-u300/timer.c')
-rw-r--r--arch/arm/mach-u300/timer.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 18d7fa0603c..5f51bdeef0e 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -27,9 +27,6 @@
27#include <asm/mach/time.h> 27#include <asm/mach/time.h>
28#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
29 29
30/* Be able to sleep for atleast 4 seconds (usually more) */
31#define APPTIMER_MIN_RANGE 4
32
33/* 30/*
34 * APP side special timer registers 31 * APP side special timer registers
35 * This timer contains four timers which can fire an interrupt each. 32 * This timer contains four timers which can fire an interrupt each.
@@ -309,11 +306,11 @@ static int u300_set_next_event(unsigned long cycles,
309 306
310/* Use general purpose timer 1 as clock event */ 307/* Use general purpose timer 1 as clock event */
311static struct clock_event_device clockevent_u300_1mhz = { 308static struct clock_event_device clockevent_u300_1mhz = {
312 .name = "GPT1", 309 .name = "GPT1",
313 .rating = 300, /* Reasonably fast and accurate clock event */ 310 .rating = 300, /* Reasonably fast and accurate clock event */
314 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 311 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
315 .set_next_event = u300_set_next_event, 312 .set_next_event = u300_set_next_event,
316 .set_mode = u300_set_mode, 313 .set_mode = u300_set_mode,
317}; 314};
318 315
319/* Clock event timer interrupt handler */ 316/* Clock event timer interrupt handler */
@@ -328,9 +325,9 @@ static irqreturn_t u300_timer_interrupt(int irq, void *dev_id)
328} 325}
329 326
330static struct irqaction u300_timer_irq = { 327static struct irqaction u300_timer_irq = {
331 .name = "U300 Timer Tick", 328 .name = "U300 Timer Tick",
332 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 329 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
333 .handler = u300_timer_interrupt, 330 .handler = u300_timer_interrupt,
334}; 331};
335 332
336/* 333/*
@@ -413,16 +410,10 @@ static void __init u300_timer_init(void)
413 "GPT2", rate, 300, 32, clocksource_mmio_readl_up)) 410 "GPT2", rate, 300, 32, clocksource_mmio_readl_up))
414 pr_err("timer: failed to initialize U300 clock source\n"); 411 pr_err("timer: failed to initialize U300 clock source\n");
415 412
416 clockevents_calc_mult_shift(&clockevent_u300_1mhz, 413 /* Configure and register the clockevent */
417 rate, APPTIMER_MIN_RANGE); 414 clockevents_config_and_register(&clockevent_u300_1mhz, rate,
418 /* 32bit counter, so 32bits delta is max */ 415 1, 0xffffffff);
419 clockevent_u300_1mhz.max_delta_ns = 416
420 clockevent_delta2ns(0xffffffff, &clockevent_u300_1mhz);
421 /* This timer is slow enough to set for 1 cycle == 1 MHz */
422 clockevent_u300_1mhz.min_delta_ns =
423 clockevent_delta2ns(1, &clockevent_u300_1mhz);
424 clockevent_u300_1mhz.cpumask = cpumask_of(0);
425 clockevents_register_device(&clockevent_u300_1mhz);
426 /* 417 /*
427 * TODO: init and register the rest of the timers too, they can be 418 * TODO: init and register the rest of the timers too, they can be
428 * used by hrtimers! 419 * used by hrtimers!