diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-footbridge/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-footbridge/isa-timer.c | 55 |
2 files changed, 4 insertions, 52 deletions
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig index 46adca068f2c..dc26fff22cf0 100644 --- a/arch/arm/mach-footbridge/Kconfig +++ b/arch/arm/mach-footbridge/Kconfig | |||
@@ -5,6 +5,7 @@ menu "Footbridge Implementations" | |||
5 | config ARCH_CATS | 5 | config ARCH_CATS |
6 | bool "CATS" | 6 | bool "CATS" |
7 | select CLKSRC_I8253 | 7 | select CLKSRC_I8253 |
8 | select CLKEVT_I8253 | ||
8 | select FOOTBRIDGE_HOST | 9 | select FOOTBRIDGE_HOST |
9 | select ISA | 10 | select ISA |
10 | select ISA_DMA | 11 | select ISA_DMA |
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c index 71fd96df7f73..c40bb415f4b5 100644 --- a/arch/arm/mach-footbridge/isa-timer.c +++ b/arch/arm/mach-footbridge/isa-timer.c | |||
@@ -5,12 +5,10 @@ | |||
5 | * Copyright (C) 1998 Phil Blundell | 5 | * Copyright (C) 1998 Phil Blundell |
6 | */ | 6 | */ |
7 | #include <linux/clockchips.h> | 7 | #include <linux/clockchips.h> |
8 | #include <linux/clocksource.h> | ||
9 | #include <linux/i8253.h> | 8 | #include <linux/i8253.h> |
10 | #include <linux/init.h> | 9 | #include <linux/init.h> |
11 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
12 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
13 | #include <linux/io.h> | ||
14 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
15 | #include <linux/timex.h> | 13 | #include <linux/timex.h> |
16 | 14 | ||
@@ -19,48 +17,6 @@ | |||
19 | 17 | ||
20 | #include "common.h" | 18 | #include "common.h" |
21 | 19 | ||
22 | static void pit_set_mode(enum clock_event_mode mode, | ||
23 | struct clock_event_device *evt) | ||
24 | { | ||
25 | unsigned long flags; | ||
26 | |||
27 | raw_local_irq_save(flags); | ||
28 | |||
29 | switch (mode) { | ||
30 | case CLOCK_EVT_MODE_PERIODIC: | ||
31 | outb_p(0x34, PIT_MODE); | ||
32 | outb_p(PIT_LATCH & 0xff, PIT_CH0); | ||
33 | outb_p(PIT_LATCH >> 8, PIT_CH0); | ||
34 | break; | ||
35 | |||
36 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
37 | case CLOCK_EVT_MODE_UNUSED: | ||
38 | outb_p(0x30, PIT_MODE); | ||
39 | outb_p(0, PIT_CH0); | ||
40 | outb_p(0, PIT_CH0); | ||
41 | break; | ||
42 | |||
43 | case CLOCK_EVT_MODE_ONESHOT: | ||
44 | case CLOCK_EVT_MODE_RESUME: | ||
45 | break; | ||
46 | } | ||
47 | local_irq_restore(flags); | ||
48 | } | ||
49 | |||
50 | static int pit_set_next_event(unsigned long delta, | ||
51 | struct clock_event_device *evt) | ||
52 | { | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | static struct clock_event_device pit_ce = { | ||
57 | .name = "pit", | ||
58 | .features = CLOCK_EVT_FEAT_PERIODIC, | ||
59 | .set_mode = pit_set_mode, | ||
60 | .set_next_event = pit_set_next_event, | ||
61 | .shift = 32, | ||
62 | }; | ||
63 | |||
64 | static irqreturn_t pit_timer_interrupt(int irq, void *dev_id) | 20 | static irqreturn_t pit_timer_interrupt(int irq, void *dev_id) |
65 | { | 21 | { |
66 | struct clock_event_device *ce = dev_id; | 22 | struct clock_event_device *ce = dev_id; |
@@ -72,20 +28,15 @@ static struct irqaction pit_timer_irq = { | |||
72 | .name = "pit", | 28 | .name = "pit", |
73 | .handler = pit_timer_interrupt, | 29 | .handler = pit_timer_interrupt, |
74 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | 30 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, |
75 | .dev_id = &pit_ce, | 31 | .dev_id = &i8253_clockevent, |
76 | }; | 32 | }; |
77 | 33 | ||
78 | static void __init isa_timer_init(void) | 34 | static void __init isa_timer_init(void) |
79 | { | 35 | { |
80 | pit_ce.cpumask = cpumask_of(smp_processor_id()); | ||
81 | pit_ce.mult = div_sc(PIT_TICK_RATE, NSEC_PER_SEC, pit_ce.shift); | ||
82 | pit_ce.max_delta_ns = clockevent_delta2ns(0x7fff, &pit_ce); | ||
83 | pit_ce.min_delta_ns = clockevent_delta2ns(0x000f, &pit_ce); | ||
84 | |||
85 | clocksource_i8253_init(); | 36 | clocksource_i8253_init(); |
86 | 37 | ||
87 | setup_irq(pit_ce.irq, &pit_timer_irq); | 38 | setup_irq(i8253_clockevent.irq, &pit_timer_irq); |
88 | clockevents_register_device(&pit_ce); | 39 | clockevent_i8253_init(false); |
89 | } | 40 | } |
90 | 41 | ||
91 | struct sys_timer isa_timer = { | 42 | struct sys_timer isa_timer = { |