ebc78db1a9ea8c34c33b5acf7d4224c71b1d2170
[pandora-kernel.git] / include / asm-sh / timer.h
1 #ifndef __ASM_SH_TIMER_H
2 #define __ASM_SH_TIMER_H
3
4 #include <linux/sysdev.h>
5 #include <asm/cpu/timer.h>
6
7 struct sys_timer_ops {
8         int (*init)(void);
9         int (*start)(void);
10         int (*stop)(void);
11 #ifndef CONFIG_GENERIC_TIME
12         unsigned long (*get_offset)(void);
13 #endif
14         unsigned long (*get_frequency)(void);
15 };
16
17 struct sys_timer {
18         const char              *name;
19
20         struct sys_device       dev;
21         struct sys_timer_ops    *ops;
22 };
23
24 #define TICK_SIZE (tick_nsec / 1000)
25
26 extern struct sys_timer tmu_timer;
27 extern struct sys_timer *sys_timer;
28
29 #ifndef CONFIG_GENERIC_TIME
30 static inline unsigned long get_timer_offset(void)
31 {
32         return sys_timer->ops->get_offset();
33 }
34 #endif
35
36 static inline unsigned long get_timer_frequency(void)
37 {
38         return sys_timer->ops->get_frequency();
39 }
40
41 /* arch/sh/kernel/timers/timer.c */
42 struct sys_timer *get_sys_timer(void);
43
44 /* arch/sh/kernel/time.c */
45 void handle_timer_tick(struct pt_regs *);
46
47 #endif /* __ASM_SH_TIMER_H */
48