Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264639
b: refs/heads/master
c: 6d8ce71
h: refs/heads/master
i:
  264637: 1cb800f
  264635: 3f8c9b0
  264631: 3f60755
  264623: 75d69f9
  264607: a2881c2
  264575: 8f4e6a9
v: v3
  • Loading branch information
Linus Walleij authored and Russell King committed Oct 17, 2011
1 parent fbe04e2 commit 6e1a253
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 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: 02f5632122ccbb6eb0c3b3f612b564b659defb32
refs/heads/master: 6d8ce7129f6c4c2f8716d6a771d59f263deab898
15 changes: 5 additions & 10 deletions trunk/arch/arm/mach-integrator/integrator_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,10 @@ static int clkevt_set_next_event(unsigned long next, struct clock_event_device *

static struct clock_event_device integrator_clockevent = {
.name = "timer1",
.shift = 34,
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.set_mode = clkevt_set_mode,
.set_next_event = clkevt_set_next_event,
.rating = 300,
.cpumask = cpu_all_mask,
};

static struct irqaction integrator_timer_irq = {
Expand All @@ -415,27 +413,24 @@ static struct irqaction integrator_timer_irq = {

static void integrator_clockevent_init(u32 khz)
{
struct clock_event_device *evt = &integrator_clockevent;
unsigned int ctrl = 0;

/* Calculate and program a divisor */
if (khz * 1000 > 0x100000 * HZ) {
khz /= 256;
ctrl |= TIMER_CTRL_DIV256;
} else if (khz * 1000 > 0x10000 * HZ) {
khz /= 16;
ctrl |= TIMER_CTRL_DIV16;
}

timer_reload = khz * 1000 / HZ;
writel(ctrl, clkevt_base + TIMER_CTRL);

evt->irq = IRQ_TIMERINT1;
evt->mult = div_sc(khz, NSEC_PER_MSEC, evt->shift);
evt->max_delta_ns = clockevent_delta2ns(0xffff, evt);
evt->min_delta_ns = clockevent_delta2ns(0xf, evt);

setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);
clockevents_register_device(evt);
clockevents_config_and_register(&integrator_clockevent,
khz * 1000,
1,
0xffffU);
}

/*
Expand Down

0 comments on commit 6e1a253

Please sign in to comment.