30 static unsigned int gt641xx_base_clock;
34 gt641xx_base_clock =
clock;
48 static int gt641xx_timer0_set_next_event(
unsigned long delta,
49 struct clock_event_device *
evt)
67 static void gt641xx_timer0_set_mode(
enum clock_event_mode
mode,
68 struct clock_event_device *
evt)
78 case CLOCK_EVT_MODE_PERIODIC:
81 case CLOCK_EVT_MODE_ONESHOT:
93 static void gt641xx_timer0_event_handler(
struct clock_event_device *
dev)
97 static struct clock_event_device gt641xx_timer0_clockevent = {
98 .name =
"gt641xx-timer0",
99 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
101 .set_next_event = gt641xx_timer0_set_next_event,
102 .set_mode = gt641xx_timer0_set_mode,
103 .event_handler = gt641xx_timer0_event_handler,
108 struct clock_event_device *
cd = >641xx_timer0_clockevent;
110 cd->event_handler(cd);
115 static struct irqaction gt641xx_timer0_irqaction = {
116 .handler = gt641xx_timer0_interrupt,
118 .name =
"gt641xx_timer0",
121 static int __init gt641xx_timer0_clockevent_init(
void)
123 struct clock_event_device *
cd;
125 if (!gt641xx_base_clock)
130 cd = >641xx_timer0_clockevent;
131 cd->rating = 200 + gt641xx_base_clock / 10000000;
132 clockevent_set_clock(cd, gt641xx_base_clock);