15 #include <linux/kernel.h>
16 #include <linux/sched.h>
22 #include <asm/machdep.h>
33 #define FREQ ((MCF_CLK / 2) / 64)
34 #define TA(a) (MCFPIT_BASE1 + (a))
35 #define PIT_CYCLES_PER_JIFFY (FREQ / HZ)
45 static void init_cf_pit_timer(
enum clock_event_mode
mode,
46 struct clock_event_device *
evt)
49 case CLOCK_EVT_MODE_PERIODIC:
58 case CLOCK_EVT_MODE_SHUTDOWN:
59 case CLOCK_EVT_MODE_UNUSED:
64 case CLOCK_EVT_MODE_ONESHOT:
72 case CLOCK_EVT_MODE_RESUME:
83 static int cf_pit_next_event(
unsigned long delta,
84 struct clock_event_device *
evt)
92 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
93 .set_mode = init_cf_pit_timer,
94 .set_next_event = cf_pit_next_event,
113 evt->event_handler(evt);
146 .read = pit_read_clk,
156 cf_pit_clockevent.max_delta_ns =
158 cf_pit_clockevent.min_delta_ns =
164 clocksource_register_hz(&pit_clk,
FREQ);