Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 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); |
Andriy Skulysh | 3aa770e | 2006-09-27 16:20:22 +0900 | [diff] [blame] | 9 | int (*start)(void); |
| 10 | int (*stop)(void); |
Paul Mundt | 4588214 | 2006-10-04 13:21:45 +0900 | [diff] [blame] | 11 | #ifndef CONFIG_GENERIC_TIME |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 12 | unsigned long (*get_offset)(void); |
Paul Mundt | 4588214 | 2006-10-04 13:21:45 +0900 | [diff] [blame] | 13 | #endif |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | struct sys_timer { |
| 17 | const char *name; |
| 18 | |
| 19 | struct sys_device dev; |
| 20 | struct sys_timer_ops *ops; |
| 21 | }; |
| 22 | |
| 23 | #define TICK_SIZE (tick_nsec / 1000) |
| 24 | |
Paul Mundt | 710ee0c | 2006-11-05 16:48:42 +0900 | [diff] [blame^] | 25 | extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer; |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 26 | extern struct sys_timer *sys_timer; |
| 27 | |
Paul Mundt | 4588214 | 2006-10-04 13:21:45 +0900 | [diff] [blame] | 28 | #ifndef CONFIG_GENERIC_TIME |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 29 | static inline unsigned long get_timer_offset(void) |
| 30 | { |
| 31 | return sys_timer->ops->get_offset(); |
| 32 | } |
Paul Mundt | 4588214 | 2006-10-04 13:21:45 +0900 | [diff] [blame] | 33 | #endif |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 34 | |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 35 | /* arch/sh/kernel/timers/timer.c */ |
| 36 | struct sys_timer *get_sys_timer(void); |
| 37 | |
| 38 | /* arch/sh/kernel/time.c */ |
Paul Mundt | 35f3c51 | 2006-10-06 15:31:16 +0900 | [diff] [blame] | 39 | void handle_timer_tick(void); |
Paul Mundt | aa01666 | 2006-01-16 22:14:18 -0800 | [diff] [blame] | 40 | |
| 41 | #endif /* __ASM_SH_TIMER_H */ |