diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-11-01 10:38:20 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-11-02 12:13:48 -0400 |
commit | dd3db6eb0e47b4480eeea30394d19bd826e64964 (patch) | |
tree | b568e78a08bfc57d2727d6f887235b8abef02f5d /arch/mips/kernel | |
parent | 9aa4cc11b22ec447b42c5df03fdab5eb748971e2 (diff) |
[MIPS] i8253: Cleanup.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/i8253.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c index 5d9830df3595..a925abd8d29e 100644 --- a/arch/mips/kernel/i8253.c +++ b/arch/mips/kernel/i8253.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/delay.h> | 12 | #include <asm/delay.h> |
13 | #include <asm/i8253.h> | 13 | #include <asm/i8253.h> |
14 | #include <asm/io.h> | 14 | #include <asm/io.h> |
15 | #include <asm/time.h> | ||
15 | 16 | ||
16 | static DEFINE_SPINLOCK(i8253_lock); | 17 | static DEFINE_SPINLOCK(i8253_lock); |
17 | 18 | ||
@@ -87,11 +88,10 @@ struct clock_event_device pit_clockevent = { | |||
87 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 88 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
88 | .set_mode = init_pit_timer, | 89 | .set_mode = init_pit_timer, |
89 | .set_next_event = pit_next_event, | 90 | .set_next_event = pit_next_event, |
90 | .shift = 32, | ||
91 | .irq = 0, | 91 | .irq = 0, |
92 | }; | 92 | }; |
93 | 93 | ||
94 | irqreturn_t timer_interrupt(int irq, void *dev_id) | 94 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
95 | { | 95 | { |
96 | pit_clockevent.event_handler(&pit_clockevent); | 96 | pit_clockevent.event_handler(&pit_clockevent); |
97 | 97 | ||
@@ -111,19 +111,20 @@ static struct irqaction irq0 = { | |||
111 | */ | 111 | */ |
112 | void __init setup_pit_timer(void) | 112 | void __init setup_pit_timer(void) |
113 | { | 113 | { |
114 | struct clock_event_device *cd = &pit_clockevent; | ||
115 | unsigned int cpu = smp_processor_id(); | ||
116 | |||
114 | /* | 117 | /* |
115 | * Start pit with the boot cpu mask and make it global after the | 118 | * Start pit with the boot cpu mask and make it global after the |
116 | * IO_APIC has been initialized. | 119 | * IO_APIC has been initialized. |
117 | */ | 120 | */ |
118 | pit_clockevent.cpumask = cpumask_of_cpu(0); | 121 | cd->cpumask = cpumask_of_cpu(cpu); |
119 | pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32); | 122 | clockevent_set_clock(cd, CLOCK_TICK_RATE); |
120 | pit_clockevent.max_delta_ns = | 123 | cd->max_delta_ns = clockevent_delta2ns(0x7FFF, cd); |
121 | clockevent_delta2ns(0x7FFF, &pit_clockevent); | 124 | cd->min_delta_ns = clockevent_delta2ns(0xF, cd); |
122 | pit_clockevent.min_delta_ns = | 125 | clockevents_register_device(cd); |
123 | clockevent_delta2ns(0xF, &pit_clockevent); | 126 | |
124 | clockevents_register_device(&pit_clockevent); | 127 | irq0.mask = cpumask_of_cpu(cpu); |
125 | |||
126 | irq0.mask = cpumask_of_cpu(0); | ||
127 | setup_irq(0, &irq0); | 128 | setup_irq(0, &irq0); |
128 | } | 129 | } |
129 | 130 | ||