Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 1 | /* linux/include/linux/clockchips.h |
| 2 | * |
| 3 | * This file contains the structure definitions for clockchips. |
| 4 | * |
| 5 | * If you are not a clockchip, or the time of day code, you should |
| 6 | * not be including this file! |
| 7 | */ |
| 8 | #ifndef _LINUX_CLOCKCHIPS_H |
| 9 | #define _LINUX_CLOCKCHIPS_H |
| 10 | |
Thomas Gleixner | 9f083b7 | 2015-03-25 13:05:19 +0100 | [diff] [blame] | 11 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 12 | |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 13 | # include <linux/clocksource.h> |
| 14 | # include <linux/cpumask.h> |
| 15 | # include <linux/ktime.h> |
| 16 | # include <linux/notifier.h> |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 17 | |
| 18 | struct clock_event_device; |
Thomas Gleixner | ccf33d6 | 2013-04-25 20:31:49 +0000 | [diff] [blame] | 19 | struct module; |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 20 | |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 21 | /* Clock event mode commands for legacy ->set_mode(): OBSOLETE */ |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 22 | enum clock_event_mode { |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 23 | CLOCK_EVT_MODE_UNUSED, |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 24 | CLOCK_EVT_MODE_SHUTDOWN, |
| 25 | CLOCK_EVT_MODE_PERIODIC, |
| 26 | CLOCK_EVT_MODE_ONESHOT, |
Thomas Gleixner | 18de5bc | 2007-07-21 04:37:34 -0700 | [diff] [blame] | 27 | CLOCK_EVT_MODE_RESUME, |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 28 | }; |
Viresh Kumar | bd624d7 | 2015-02-13 08:54:56 +0800 | [diff] [blame] | 29 | |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 30 | /* |
| 31 | * Possible states of a clock event device. |
| 32 | * |
| 33 | * DETACHED: Device is not used by clockevents core. Initial state or can be |
| 34 | * reached from SHUTDOWN. |
| 35 | * SHUTDOWN: Device is powered-off. Can be reached from PERIODIC or ONESHOT. |
| 36 | * PERIODIC: Device is programmed to generate events periodically. Can be |
| 37 | * reached from DETACHED or SHUTDOWN. |
| 38 | * ONESHOT: Device is programmed to generate event only once. Can be reached |
| 39 | * from DETACHED or SHUTDOWN. |
Viresh Kumar | 8fff52f | 2015-04-03 09:04:04 +0530 | [diff] [blame] | 40 | * ONESHOT_STOPPED: Device was programmed in ONESHOT mode and is temporarily |
| 41 | * stopped. |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 42 | */ |
| 43 | enum clock_event_state { |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 44 | CLOCK_EVT_STATE_DETACHED, |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 45 | CLOCK_EVT_STATE_SHUTDOWN, |
| 46 | CLOCK_EVT_STATE_PERIODIC, |
| 47 | CLOCK_EVT_STATE_ONESHOT, |
Viresh Kumar | 8fff52f | 2015-04-03 09:04:04 +0530 | [diff] [blame] | 48 | CLOCK_EVT_STATE_ONESHOT_STOPPED, |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 49 | }; |
| 50 | |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 51 | /* |
| 52 | * Clock event features |
| 53 | */ |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 54 | # define CLOCK_EVT_FEAT_PERIODIC 0x000001 |
| 55 | # define CLOCK_EVT_FEAT_ONESHOT 0x000002 |
| 56 | # define CLOCK_EVT_FEAT_KTIME 0x000004 |
| 57 | |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 58 | /* |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 59 | * x86(64) specific (mis)features: |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 60 | * |
| 61 | * - Clockevent source stops in C3 State and needs broadcast support. |
| 62 | * - Local APIC timer is used as a dummy device. |
| 63 | */ |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 64 | # define CLOCK_EVT_FEAT_C3STOP 0x000008 |
| 65 | # define CLOCK_EVT_FEAT_DUMMY 0x000010 |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 66 | |
Daniel Lezcano | d2348fb | 2013-03-02 11:10:11 +0100 | [diff] [blame] | 67 | /* |
| 68 | * Core shall set the interrupt affinity dynamically in broadcast mode |
| 69 | */ |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 70 | # define CLOCK_EVT_FEAT_DYNIRQ 0x000020 |
| 71 | # define CLOCK_EVT_FEAT_PERCPU 0x000040 |
Daniel Lezcano | d2348fb | 2013-03-02 11:10:11 +0100 | [diff] [blame] | 72 | |
Preeti U Murthy | 5d1638a | 2014-02-07 13:36:32 +0530 | [diff] [blame] | 73 | /* |
| 74 | * Clockevent device is based on a hrtimer for broadcast |
| 75 | */ |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 76 | # define CLOCK_EVT_FEAT_HRTIMER 0x000080 |
Preeti U Murthy | 5d1638a | 2014-02-07 13:36:32 +0530 | [diff] [blame] | 77 | |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 78 | /** |
| 79 | * struct clock_event_device - clock event device descriptor |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 80 | * @event_handler: Assigned by the framework to be called by the low |
| 81 | * level handler of the event source |
Martin Schwidefsky | 65516f8 | 2011-08-23 15:29:43 +0200 | [diff] [blame] | 82 | * @set_next_event: set next event function using a clocksource delta |
| 83 | * @set_next_ktime: set next event function using a direct ktime value |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 84 | * @next_event: local storage for the next event in oneshot mode |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 85 | * @max_delta_ns: maximum delta value in ns |
| 86 | * @min_delta_ns: minimum delta value in ns |
| 87 | * @mult: nanosecond to cycles multiplier |
| 88 | * @shift: nanoseconds to cycles divisor (power of two) |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 89 | * @mode: operating mode, relevant only to ->set_mode(), OBSOLETE |
Thomas Gleixner | be3ef76 | 2015-06-02 14:30:11 +0200 | [diff] [blame] | 90 | * @state_use_accessors:current state of the device, assigned by the core code |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 91 | * @features: features |
| 92 | * @retries: number of forced programming retries |
Viresh Kumar | bd624d7 | 2015-02-13 08:54:56 +0800 | [diff] [blame] | 93 | * @set_mode: legacy set mode function, only for modes <= CLOCK_EVT_MODE_RESUME. |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 94 | * @set_state_periodic: switch state to periodic, if !set_mode |
| 95 | * @set_state_oneshot: switch state to oneshot, if !set_mode |
Viresh Kumar | 8fff52f | 2015-04-03 09:04:04 +0530 | [diff] [blame] | 96 | * @set_state_oneshot_stopped: switch state to oneshot_stopped, if !set_mode |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 97 | * @set_state_shutdown: switch state to shutdown, if !set_mode |
Viresh Kumar | 554ef38 | 2015-02-27 17:21:32 +0530 | [diff] [blame] | 98 | * @tick_resume: resume clkevt device, if !set_mode |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 99 | * @broadcast: function to broadcast events |
Thomas Gleixner | 57f0fcb | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 100 | * @min_delta_ticks: minimum delta value in ticks stored for reconfiguration |
| 101 | * @max_delta_ticks: maximum delta value in ticks stored for reconfiguration |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 102 | * @name: ptr to clock event name |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 103 | * @rating: variable to rate clock event devices |
Sergei Shtylyov | ce0be12 | 2007-05-08 00:31:55 -0700 | [diff] [blame] | 104 | * @irq: IRQ number (only for non CPU local devices) |
Preeti U Murthy | 5d1638a | 2014-02-07 13:36:32 +0530 | [diff] [blame] | 105 | * @bound_on: Bound on CPU |
Sergei Shtylyov | ce0be12 | 2007-05-08 00:31:55 -0700 | [diff] [blame] | 106 | * @cpumask: cpumask to indicate for which CPUs this device works |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 107 | * @list: list head for the management code |
Thomas Gleixner | ccf33d6 | 2013-04-25 20:31:49 +0000 | [diff] [blame] | 108 | * @owner: module reference |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 109 | */ |
| 110 | struct clock_event_device { |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 111 | void (*event_handler)(struct clock_event_device *); |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 112 | int (*set_next_event)(unsigned long evt, struct clock_event_device *); |
| 113 | int (*set_next_ktime)(ktime_t expires, struct clock_event_device *); |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 114 | ktime_t next_event; |
Jon Hunter | 97813f2 | 2009-08-18 12:45:11 -0500 | [diff] [blame] | 115 | u64 max_delta_ns; |
| 116 | u64 min_delta_ns; |
Thomas Gleixner | 23af368 | 2009-11-11 14:05:25 +0000 | [diff] [blame] | 117 | u32 mult; |
| 118 | u32 shift; |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 119 | enum clock_event_mode mode; |
Thomas Gleixner | be3ef76 | 2015-06-02 14:30:11 +0200 | [diff] [blame] | 120 | enum clock_event_state state_use_accessors; |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 121 | unsigned int features; |
| 122 | unsigned long retries; |
| 123 | |
Viresh Kumar | bd624d7 | 2015-02-13 08:54:56 +0800 | [diff] [blame] | 124 | /* |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 125 | * State transition callback(s): Only one of the two groups should be |
Viresh Kumar | bd624d7 | 2015-02-13 08:54:56 +0800 | [diff] [blame] | 126 | * defined: |
| 127 | * - set_mode(), only for modes <= CLOCK_EVT_MODE_RESUME. |
Viresh Kumar | 8fff52f | 2015-04-03 09:04:04 +0530 | [diff] [blame] | 128 | * - set_state_{shutdown|periodic|oneshot|oneshot_stopped}(), tick_resume(). |
Viresh Kumar | bd624d7 | 2015-02-13 08:54:56 +0800 | [diff] [blame] | 129 | */ |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 130 | void (*set_mode)(enum clock_event_mode mode, struct clock_event_device *); |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 131 | int (*set_state_periodic)(struct clock_event_device *); |
| 132 | int (*set_state_oneshot)(struct clock_event_device *); |
Viresh Kumar | 8fff52f | 2015-04-03 09:04:04 +0530 | [diff] [blame] | 133 | int (*set_state_oneshot_stopped)(struct clock_event_device *); |
Viresh Kumar | 77e32c8 | 2015-02-27 17:21:33 +0530 | [diff] [blame] | 134 | int (*set_state_shutdown)(struct clock_event_device *); |
Viresh Kumar | 554ef38 | 2015-02-27 17:21:32 +0530 | [diff] [blame] | 135 | int (*tick_resume)(struct clock_event_device *); |
Viresh Kumar | bd624d7 | 2015-02-13 08:54:56 +0800 | [diff] [blame] | 136 | |
| 137 | void (*broadcast)(const struct cpumask *mask); |
Rafael J. Wysocki | adc78e6 | 2012-08-06 01:40:41 +0200 | [diff] [blame] | 138 | void (*suspend)(struct clock_event_device *); |
| 139 | void (*resume)(struct clock_event_device *); |
Thomas Gleixner | 57f0fcb | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 140 | unsigned long min_delta_ticks; |
| 141 | unsigned long max_delta_ticks; |
| 142 | |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 143 | const char *name; |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 144 | int rating; |
| 145 | int irq; |
Preeti U Murthy | 5d1638a | 2014-02-07 13:36:32 +0530 | [diff] [blame] | 146 | int bound_on; |
Rusty Russell | 320ab2b | 2008-12-13 21:20:26 +1030 | [diff] [blame] | 147 | const struct cpumask *cpumask; |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 148 | struct list_head list; |
Thomas Gleixner | ccf33d6 | 2013-04-25 20:31:49 +0000 | [diff] [blame] | 149 | struct module *owner; |
Thomas Gleixner | 847b2f4 | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 150 | } ____cacheline_aligned; |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 151 | |
Viresh Kumar | 3434d23 | 2015-05-21 13:33:45 +0530 | [diff] [blame] | 152 | /* Helpers to verify state of a clockevent device */ |
| 153 | static inline bool clockevent_state_detached(struct clock_event_device *dev) |
| 154 | { |
Thomas Gleixner | be3ef76 | 2015-06-02 14:30:11 +0200 | [diff] [blame] | 155 | return dev->state_use_accessors == CLOCK_EVT_STATE_DETACHED; |
Viresh Kumar | 3434d23 | 2015-05-21 13:33:45 +0530 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | static inline bool clockevent_state_shutdown(struct clock_event_device *dev) |
| 159 | { |
Thomas Gleixner | be3ef76 | 2015-06-02 14:30:11 +0200 | [diff] [blame] | 160 | return dev->state_use_accessors == CLOCK_EVT_STATE_SHUTDOWN; |
Viresh Kumar | 3434d23 | 2015-05-21 13:33:45 +0530 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | static inline bool clockevent_state_periodic(struct clock_event_device *dev) |
| 164 | { |
Thomas Gleixner | be3ef76 | 2015-06-02 14:30:11 +0200 | [diff] [blame] | 165 | return dev->state_use_accessors == CLOCK_EVT_STATE_PERIODIC; |
Viresh Kumar | 3434d23 | 2015-05-21 13:33:45 +0530 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | static inline bool clockevent_state_oneshot(struct clock_event_device *dev) |
| 169 | { |
Thomas Gleixner | be3ef76 | 2015-06-02 14:30:11 +0200 | [diff] [blame] | 170 | return dev->state_use_accessors == CLOCK_EVT_STATE_ONESHOT; |
Viresh Kumar | 3434d23 | 2015-05-21 13:33:45 +0530 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | static inline bool clockevent_state_oneshot_stopped(struct clock_event_device *dev) |
| 174 | { |
Thomas Gleixner | be3ef76 | 2015-06-02 14:30:11 +0200 | [diff] [blame] | 175 | return dev->state_use_accessors == CLOCK_EVT_STATE_ONESHOT_STOPPED; |
Viresh Kumar | 3434d23 | 2015-05-21 13:33:45 +0530 | [diff] [blame] | 176 | } |
| 177 | |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 178 | /* |
| 179 | * Calculate a multiplication factor for scaled math, which is used to convert |
| 180 | * nanoseconds based values to clock ticks: |
| 181 | * |
| 182 | * clock_ticks = (nanoseconds * factor) >> shift. |
| 183 | * |
| 184 | * div_sc is the rearranged equation to calculate a factor from a given clock |
| 185 | * ticks / nanoseconds ratio: |
| 186 | * |
| 187 | * factor = (clock_ticks << shift) / nanoseconds |
| 188 | */ |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 189 | static inline unsigned long |
| 190 | div_sc(unsigned long ticks, unsigned long nsec, int shift) |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 191 | { |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 192 | u64 tmp = ((u64)ticks) << shift; |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 193 | |
| 194 | do_div(tmp, nsec); |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 195 | |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 196 | return (unsigned long) tmp; |
| 197 | } |
| 198 | |
| 199 | /* Clock event layer functions */ |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 200 | extern u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt); |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 201 | extern void clockevents_register_device(struct clock_event_device *dev); |
Thomas Gleixner | 03e13cf | 2013-04-25 20:31:50 +0000 | [diff] [blame] | 202 | extern int clockevents_unbind_device(struct clock_event_device *ced, int cpu); |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 203 | |
Magnus Damm | e540032 | 2012-05-09 23:39:34 +0900 | [diff] [blame] | 204 | extern void clockevents_config(struct clock_event_device *dev, u32 freq); |
Thomas Gleixner | 57f0fcb | 2011-05-18 21:33:41 +0000 | [diff] [blame] | 205 | extern void clockevents_config_and_register(struct clock_event_device *dev, |
| 206 | u32 freq, unsigned long min_delta, |
| 207 | unsigned long max_delta); |
| 208 | |
Thomas Gleixner | 80b816b | 2011-05-18 21:33:42 +0000 | [diff] [blame] | 209 | extern int clockevents_update_freq(struct clock_event_device *ce, u32 freq); |
| 210 | |
Thomas Gleixner | 7d2f944 | 2009-11-11 14:05:29 +0000 | [diff] [blame] | 211 | static inline void |
| 212 | clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) |
| 213 | { |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 214 | return clocks_calc_mult_shift(&ce->mult, &ce->shift, NSEC_PER_SEC, freq, minsec); |
Thomas Gleixner | 7d2f944 | 2009-11-11 14:05:29 +0000 | [diff] [blame] | 215 | } |
| 216 | |
Rafael J. Wysocki | adc78e6 | 2012-08-06 01:40:41 +0200 | [diff] [blame] | 217 | extern void clockevents_suspend(void); |
| 218 | extern void clockevents_resume(void); |
| 219 | |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 220 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
| 221 | # ifdef CONFIG_ARCH_HAS_TICK_BROADCAST |
Mark Rutland | 12ad100 | 2013-01-14 17:05:22 +0000 | [diff] [blame] | 222 | extern void tick_broadcast(const struct cpumask *mask); |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 223 | # else |
| 224 | # define tick_broadcast NULL |
| 225 | # endif |
Mark Rutland | 12572db | 2013-01-14 17:05:21 +0000 | [diff] [blame] | 226 | extern int tick_receive_broadcast(void); |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 227 | # endif |
Mark Rutland | 12572db | 2013-01-14 17:05:21 +0000 | [diff] [blame] | 228 | |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 229 | # if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) |
Preeti U Murthy | 5d1638a | 2014-02-07 13:36:32 +0530 | [diff] [blame] | 230 | extern void tick_setup_hrtimer_broadcast(void); |
Thomas Gleixner | eaa907c | 2013-03-06 11:18:36 +0000 | [diff] [blame] | 231 | extern int tick_check_broadcast_expired(void); |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 232 | # else |
Thomas Gleixner | eaa907c | 2013-03-06 11:18:36 +0000 | [diff] [blame] | 233 | static inline int tick_check_broadcast_expired(void) { return 0; } |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 234 | static inline void tick_setup_hrtimer_broadcast(void) { } |
| 235 | # endif |
Thomas Gleixner | eaa907c | 2013-03-06 11:18:36 +0000 | [diff] [blame] | 236 | |
Preeti U Murthy | da7e6f4 | 2014-02-07 13:36:06 +0530 | [diff] [blame] | 237 | extern int clockevents_notify(unsigned long reason, void *arg); |
Thomas Gleixner | de68d9b | 2007-10-12 23:04:05 +0200 | [diff] [blame] | 238 | |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 239 | #else /* !CONFIG_GENERIC_CLOCKEVENTS: */ |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 240 | |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 241 | static inline void clockevents_suspend(void) { } |
| 242 | static inline void clockevents_resume(void) { } |
Preeti U Murthy | da7e6f4 | 2014-02-07 13:36:06 +0530 | [diff] [blame] | 243 | static inline int clockevents_notify(unsigned long reason, void *arg) { return 0; } |
Thomas Gleixner | 1991922 | 2013-03-22 10:48:33 +0100 | [diff] [blame] | 244 | static inline int tick_check_broadcast_expired(void) { return 0; } |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 245 | static inline void tick_setup_hrtimer_broadcast(void) { } |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 246 | |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 247 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ |
Thomas Gleixner | d316c57 | 2007-02-16 01:28:00 -0800 | [diff] [blame] | 248 | |
Ingo Molnar | 9eed56e | 2015-04-02 11:26:23 +0200 | [diff] [blame] | 249 | #endif /* _LINUX_CLOCKCHIPS_H */ |