diff options
Diffstat (limited to 'include/linux/clockchips.h')
-rw-r--r-- | include/linux/clockchips.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 3a1dbba4d3ae..fc53492b6ad7 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -73,14 +73,15 @@ enum clock_event_nofitiers { | |||
73 | * @list: list head for the management code | 73 | * @list: list head for the management code |
74 | * @mode: operating mode assigned by the management code | 74 | * @mode: operating mode assigned by the management code |
75 | * @next_event: local storage for the next event in oneshot mode | 75 | * @next_event: local storage for the next event in oneshot mode |
76 | * @retries: number of forced programming retries | ||
76 | */ | 77 | */ |
77 | struct clock_event_device { | 78 | struct clock_event_device { |
78 | const char *name; | 79 | const char *name; |
79 | unsigned int features; | 80 | unsigned int features; |
80 | unsigned long max_delta_ns; | 81 | u64 max_delta_ns; |
81 | unsigned long min_delta_ns; | 82 | u64 min_delta_ns; |
82 | unsigned long mult; | 83 | u32 mult; |
83 | int shift; | 84 | u32 shift; |
84 | int rating; | 85 | int rating; |
85 | int irq; | 86 | int irq; |
86 | const struct cpumask *cpumask; | 87 | const struct cpumask *cpumask; |
@@ -93,6 +94,7 @@ struct clock_event_device { | |||
93 | struct list_head list; | 94 | struct list_head list; |
94 | enum clock_event_mode mode; | 95 | enum clock_event_mode mode; |
95 | ktime_t next_event; | 96 | ktime_t next_event; |
97 | unsigned long retries; | ||
96 | }; | 98 | }; |
97 | 99 | ||
98 | /* | 100 | /* |
@@ -116,8 +118,8 @@ static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec, | |||
116 | } | 118 | } |
117 | 119 | ||
118 | /* Clock event layer functions */ | 120 | /* Clock event layer functions */ |
119 | extern unsigned long clockevent_delta2ns(unsigned long latch, | 121 | extern u64 clockevent_delta2ns(unsigned long latch, |
120 | struct clock_event_device *evt); | 122 | struct clock_event_device *evt); |
121 | extern void clockevents_register_device(struct clock_event_device *dev); | 123 | extern void clockevents_register_device(struct clock_event_device *dev); |
122 | 124 | ||
123 | extern void clockevents_exchange_device(struct clock_event_device *old, | 125 | extern void clockevents_exchange_device(struct clock_event_device *old, |
@@ -130,6 +132,13 @@ extern int clockevents_program_event(struct clock_event_device *dev, | |||
130 | 132 | ||
131 | extern void clockevents_handle_noop(struct clock_event_device *dev); | 133 | extern void clockevents_handle_noop(struct clock_event_device *dev); |
132 | 134 | ||
135 | static inline void | ||
136 | clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) | ||
137 | { | ||
138 | return clocks_calc_mult_shift(&ce->mult, &ce->shift, NSEC_PER_SEC, | ||
139 | freq, minsec); | ||
140 | } | ||
141 | |||
133 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 142 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
134 | extern void clockevents_notify(unsigned long reason, void *arg); | 143 | extern void clockevents_notify(unsigned long reason, void *arg); |
135 | #else | 144 | #else |