25 #include <linux/kernel.h>
26 #include <linux/sched.h>
31 #include <asm/system_misc.h>
33 #include <mach/regs-irq.h>
37 #define KS8695_TMR_OFFSET (0xF0000 + 0xE400)
38 #define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET)
39 #define KS8695_TMR_PA (KS8695_IO_PA + KS8695_TMR_OFFSET)
44 #define KS8695_TMCON (0x00)
45 #define KS8695_T1TC (0x04)
46 #define KS8695_T0TC (0x08)
47 #define KS8695_T1PD (0x0C)
48 #define KS8695_T0PD (0x10)
51 #define TMCON_T1EN (1 << 1)
52 #define TMCON_T0EN (1 << 0)
55 #define T0TC_WATCHDOG (0xff)
57 static void ks8695_set_mode(
enum clock_event_mode
mode,
58 struct clock_event_device *
evt)
62 if (mode == CLOCK_EVT_FEAT_PERIODIC) {
81 static int ks8695_set_next_event(
unsigned long cycles,
82 struct clock_event_device *
evt)
104 static struct clock_event_device clockevent_ks8695 = {
105 .name =
"ks8695_t1tc",
107 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
108 .set_next_event = ks8695_set_next_event,
109 .set_mode = ks8695_set_mode,
117 struct clock_event_device *
evt = &clockevent_ks8695;
119 evt->event_handler(evt);
123 static struct irqaction ks8695_timer_irq = {
124 .name =
"ks8695_tick",
126 .handler = ks8695_timer_interrupt,
129 static void ks8695_timer_setup(
void)
149 static void __init ks8695_timer_init (
void)
151 ks8695_timer_setup();
158 .init = ks8695_timer_init,