8 #ifndef _LINUX_CLOCKCHIPS_H
9 #define _LINUX_CLOCKCHIPS_H
11 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
18 struct clock_event_device;
21 enum clock_event_mode {
22 CLOCK_EVT_MODE_UNUSED = 0,
23 CLOCK_EVT_MODE_SHUTDOWN,
24 CLOCK_EVT_MODE_PERIODIC,
25 CLOCK_EVT_MODE_ONESHOT,
26 CLOCK_EVT_MODE_RESUME,
30 enum clock_event_nofitiers {
32 CLOCK_EVT_NOTIFY_BROADCAST_ON,
33 CLOCK_EVT_NOTIFY_BROADCAST_OFF,
34 CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
35 CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
36 CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
37 CLOCK_EVT_NOTIFY_SUSPEND,
38 CLOCK_EVT_NOTIFY_RESUME,
39 CLOCK_EVT_NOTIFY_CPU_DYING,
40 CLOCK_EVT_NOTIFY_CPU_DEAD,
46 #define CLOCK_EVT_FEAT_PERIODIC 0x000001
47 #define CLOCK_EVT_FEAT_ONESHOT 0x000002
48 #define CLOCK_EVT_FEAT_KTIME 0x000004
55 #define CLOCK_EVT_FEAT_C3STOP 0x000008
56 #define CLOCK_EVT_FEAT_DUMMY 0x000010
82 struct clock_event_device {
84 int (*set_next_event)(
unsigned long evt,
85 struct clock_event_device *);
87 struct clock_event_device *);
93 enum clock_event_mode
mode;
98 void (*set_mode)(
enum clock_event_mode
mode,
99 struct clock_event_device *);
102 unsigned long min_delta_ticks;
103 unsigned long max_delta_ticks;
123 static inline unsigned long div_sc(
unsigned long ticks,
unsigned long nsec,
129 return (
unsigned long)
tmp;
134 struct clock_event_device *
evt);
139 u32 freq,
unsigned long min_delta,
140 unsigned long max_delta);
145 struct clock_event_device *
new);
147 enum clock_event_mode
mode);
155 clockevents_calc_mult_shift(
struct clock_event_device *
ce,
u32 freq,
u32 minsec)
164 #ifdef CONFIG_GENERIC_CLOCKEVENTS
167 # define clockevents_notify(reason, arg) do { } while (0)
175 #define clockevents_notify(reason, arg) do { } while (0)