Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260602
b: refs/heads/master
c: cde21de
h: refs/heads/master
v: v3
  • Loading branch information
Linus Walleij committed Jun 23, 2011
1 parent 4aef44d commit 30a063c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c5314877edd2ea9cccca0ca87c9a439a8d356c14
refs/heads/master: cde21de148a5bf474bbde59ebf046992fab3c77b
33 changes: 12 additions & 21 deletions trunk/arch/arm/mach-u300/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#include <asm/mach/time.h>
#include <asm/mach/irq.h>

/* Be able to sleep for atleast 4 seconds (usually more) */
#define APPTIMER_MIN_RANGE 4

/*
* APP side special timer registers
* This timer contains four timers which can fire an interrupt each.
Expand Down Expand Up @@ -309,11 +306,11 @@ static int u300_set_next_event(unsigned long cycles,

/* Use general purpose timer 1 as clock event */
static struct clock_event_device clockevent_u300_1mhz = {
.name = "GPT1",
.rating = 300, /* Reasonably fast and accurate clock event */
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.set_next_event = u300_set_next_event,
.set_mode = u300_set_mode,
.name = "GPT1",
.rating = 300, /* Reasonably fast and accurate clock event */
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.set_next_event = u300_set_next_event,
.set_mode = u300_set_mode,
};

/* Clock event timer interrupt handler */
Expand All @@ -328,9 +325,9 @@ static irqreturn_t u300_timer_interrupt(int irq, void *dev_id)
}

static struct irqaction u300_timer_irq = {
.name = "U300 Timer Tick",
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
.handler = u300_timer_interrupt,
.name = "U300 Timer Tick",
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
.handler = u300_timer_interrupt,
};

/*
Expand Down Expand Up @@ -413,16 +410,10 @@ static void __init u300_timer_init(void)
"GPT2", rate, 300, 32, clocksource_mmio_readl_up))
pr_err("timer: failed to initialize U300 clock source\n");

clockevents_calc_mult_shift(&clockevent_u300_1mhz,
rate, APPTIMER_MIN_RANGE);
/* 32bit counter, so 32bits delta is max */
clockevent_u300_1mhz.max_delta_ns =
clockevent_delta2ns(0xffffffff, &clockevent_u300_1mhz);
/* This timer is slow enough to set for 1 cycle == 1 MHz */
clockevent_u300_1mhz.min_delta_ns =
clockevent_delta2ns(1, &clockevent_u300_1mhz);
clockevent_u300_1mhz.cpumask = cpumask_of(0);
clockevents_register_device(&clockevent_u300_1mhz);
/* Configure and register the clockevent */
clockevents_config_and_register(&clockevent_u300_1mhz, rate,
1, 0xffffffff);

/*
* TODO: init and register the rest of the timers too, they can be
* used by hrtimers!
Expand Down

0 comments on commit 30a063c

Please sign in to comment.