diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/alarmtimer.h | 5 | ||||
| -rw-r--r-- | include/linux/clocksource.h | 5 | ||||
| -rw-r--r-- | include/linux/mc146818rtc.h | 1 | ||||
| -rw-r--r-- | include/linux/pm-trace.h | 9 | ||||
| -rw-r--r-- | include/linux/ptp_clock_kernel.h | 65 | ||||
| -rw-r--r-- | include/linux/time.h | 2 | ||||
| -rw-r--r-- | include/linux/timekeeping.h | 1 |
7 files changed, 60 insertions, 28 deletions
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h index 9d8031257a90..c70aac13244a 100644 --- a/include/linux/alarmtimer.h +++ b/include/linux/alarmtimer.h | |||
| @@ -10,7 +10,12 @@ enum alarmtimer_type { | |||
| 10 | ALARM_REALTIME, | 10 | ALARM_REALTIME, |
| 11 | ALARM_BOOTTIME, | 11 | ALARM_BOOTTIME, |
| 12 | 12 | ||
| 13 | /* Supported types end here */ | ||
| 13 | ALARM_NUMTYPE, | 14 | ALARM_NUMTYPE, |
| 15 | |||
| 16 | /* Used for tracing information. No usable types. */ | ||
| 17 | ALARM_REALTIME_FREEZER, | ||
| 18 | ALARM_BOOTTIME_FREEZER, | ||
| 14 | }; | 19 | }; |
| 15 | 20 | ||
| 16 | enum alarmtimer_restart { | 21 | enum alarmtimer_restart { |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 08398182f56e..65602d395a52 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -169,7 +169,10 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant) | |||
| 169 | * @mult: cycle to nanosecond multiplier | 169 | * @mult: cycle to nanosecond multiplier |
| 170 | * @shift: cycle to nanosecond divisor (power of two) | 170 | * @shift: cycle to nanosecond divisor (power of two) |
| 171 | * | 171 | * |
| 172 | * Converts cycles to nanoseconds, using the given mult and shift. | 172 | * Converts clocksource cycles to nanoseconds, using the given @mult and @shift. |
| 173 | * The code is optimized for performance and is not intended to work | ||
| 174 | * with absolute clocksource cycles (as those will easily overflow), | ||
| 175 | * but is only intended to be used with relative (delta) clocksource cycles. | ||
| 173 | * | 176 | * |
| 174 | * XXX - This could use some mult_lxl_ll() asm optimization | 177 | * XXX - This could use some mult_lxl_ll() asm optimization |
| 175 | */ | 178 | */ |
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h index a585b4b5fa0e..0661af17a758 100644 --- a/include/linux/mc146818rtc.h +++ b/include/linux/mc146818rtc.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <asm/mc146818rtc.h> /* register access macros */ | 16 | #include <asm/mc146818rtc.h> /* register access macros */ |
| 17 | #include <linux/bcd.h> | 17 | #include <linux/bcd.h> |
| 18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
| 19 | #include <linux/pm-trace.h> | ||
| 19 | 20 | ||
| 20 | #ifdef __KERNEL__ | 21 | #ifdef __KERNEL__ |
| 21 | #include <linux/spinlock.h> /* spinlock_t */ | 22 | #include <linux/spinlock.h> /* spinlock_t */ |
diff --git a/include/linux/pm-trace.h b/include/linux/pm-trace.h index ecbde7a5548e..7b78793f07d7 100644 --- a/include/linux/pm-trace.h +++ b/include/linux/pm-trace.h | |||
| @@ -1,11 +1,17 @@ | |||
| 1 | #ifndef PM_TRACE_H | 1 | #ifndef PM_TRACE_H |
| 2 | #define PM_TRACE_H | 2 | #define PM_TRACE_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 4 | #ifdef CONFIG_PM_TRACE | 5 | #ifdef CONFIG_PM_TRACE |
| 5 | #include <asm/pm-trace.h> | 6 | #include <asm/pm-trace.h> |
| 6 | #include <linux/types.h> | ||
| 7 | 7 | ||
| 8 | extern int pm_trace_enabled; | 8 | extern int pm_trace_enabled; |
| 9 | extern bool pm_trace_rtc_abused; | ||
| 10 | |||
| 11 | static inline bool pm_trace_rtc_valid(void) | ||
| 12 | { | ||
| 13 | return !pm_trace_rtc_abused; | ||
| 14 | } | ||
| 9 | 15 | ||
| 10 | static inline int pm_trace_is_enabled(void) | 16 | static inline int pm_trace_is_enabled(void) |
| 11 | { | 17 | { |
| @@ -24,6 +30,7 @@ extern int show_trace_dev_match(char *buf, size_t size); | |||
| 24 | 30 | ||
| 25 | #else | 31 | #else |
| 26 | 32 | ||
| 33 | static inline bool pm_trace_rtc_valid(void) { return true; } | ||
| 27 | static inline int pm_trace_is_enabled(void) { return 0; } | 34 | static inline int pm_trace_is_enabled(void) { return 0; } |
| 28 | 35 | ||
| 29 | #define TRACE_DEVICE(dev) do { } while (0) | 36 | #define TRACE_DEVICE(dev) do { } while (0) |
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h index b76d47aba564..a026bfd089db 100644 --- a/include/linux/ptp_clock_kernel.h +++ b/include/linux/ptp_clock_kernel.h | |||
| @@ -130,30 +130,6 @@ struct ptp_clock_info { | |||
| 130 | 130 | ||
| 131 | struct ptp_clock; | 131 | struct ptp_clock; |
| 132 | 132 | ||
| 133 | /** | ||
| 134 | * ptp_clock_register() - register a PTP hardware clock driver | ||
| 135 | * | ||
| 136 | * @info: Structure describing the new clock. | ||
| 137 | * @parent: Pointer to the parent device of the new clock. | ||
| 138 | * | ||
| 139 | * Returns a valid pointer on success or PTR_ERR on failure. If PHC | ||
| 140 | * support is missing at the configuration level, this function | ||
| 141 | * returns NULL, and drivers are expected to gracefully handle that | ||
| 142 | * case separately. | ||
| 143 | */ | ||
| 144 | |||
| 145 | extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, | ||
| 146 | struct device *parent); | ||
| 147 | |||
| 148 | /** | ||
| 149 | * ptp_clock_unregister() - unregister a PTP hardware clock driver | ||
| 150 | * | ||
| 151 | * @ptp: The clock to remove from service. | ||
| 152 | */ | ||
| 153 | |||
| 154 | extern int ptp_clock_unregister(struct ptp_clock *ptp); | ||
| 155 | |||
| 156 | |||
| 157 | enum ptp_clock_events { | 133 | enum ptp_clock_events { |
| 158 | PTP_CLOCK_ALARM, | 134 | PTP_CLOCK_ALARM, |
| 159 | PTP_CLOCK_EXTTS, | 135 | PTP_CLOCK_EXTTS, |
| @@ -179,6 +155,31 @@ struct ptp_clock_event { | |||
| 179 | }; | 155 | }; |
| 180 | }; | 156 | }; |
| 181 | 157 | ||
| 158 | #if IS_REACHABLE(CONFIG_PTP_1588_CLOCK) | ||
| 159 | |||
| 160 | /** | ||
| 161 | * ptp_clock_register() - register a PTP hardware clock driver | ||
| 162 | * | ||
| 163 | * @info: Structure describing the new clock. | ||
| 164 | * @parent: Pointer to the parent device of the new clock. | ||
| 165 | * | ||
| 166 | * Returns a valid pointer on success or PTR_ERR on failure. If PHC | ||
| 167 | * support is missing at the configuration level, this function | ||
| 168 | * returns NULL, and drivers are expected to gracefully handle that | ||
| 169 | * case separately. | ||
| 170 | */ | ||
| 171 | |||
| 172 | extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, | ||
| 173 | struct device *parent); | ||
| 174 | |||
| 175 | /** | ||
| 176 | * ptp_clock_unregister() - unregister a PTP hardware clock driver | ||
| 177 | * | ||
| 178 | * @ptp: The clock to remove from service. | ||
| 179 | */ | ||
| 180 | |||
| 181 | extern int ptp_clock_unregister(struct ptp_clock *ptp); | ||
| 182 | |||
| 182 | /** | 183 | /** |
| 183 | * ptp_clock_event() - notify the PTP layer about an event | 184 | * ptp_clock_event() - notify the PTP layer about an event |
| 184 | * | 185 | * |
| @@ -210,4 +211,20 @@ extern int ptp_clock_index(struct ptp_clock *ptp); | |||
| 210 | int ptp_find_pin(struct ptp_clock *ptp, | 211 | int ptp_find_pin(struct ptp_clock *ptp, |
| 211 | enum ptp_pin_function func, unsigned int chan); | 212 | enum ptp_pin_function func, unsigned int chan); |
| 212 | 213 | ||
| 214 | #else | ||
| 215 | static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, | ||
| 216 | struct device *parent) | ||
| 217 | { return NULL; } | ||
| 218 | static inline int ptp_clock_unregister(struct ptp_clock *ptp) | ||
| 219 | { return 0; } | ||
| 220 | static inline void ptp_clock_event(struct ptp_clock *ptp, | ||
| 221 | struct ptp_clock_event *event) | ||
| 222 | { } | ||
| 223 | static inline int ptp_clock_index(struct ptp_clock *ptp) | ||
| 224 | { return -1; } | ||
| 225 | static inline int ptp_find_pin(struct ptp_clock *ptp, | ||
| 226 | enum ptp_pin_function func, unsigned int chan) | ||
| 227 | { return -1; } | ||
| 228 | #endif | ||
| 229 | |||
| 213 | #endif | 230 | #endif |
diff --git a/include/linux/time.h b/include/linux/time.h index 4cea09d94208..23f0f5ce3090 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -172,8 +172,6 @@ extern int do_setitimer(int which, struct itimerval *value, | |||
| 172 | struct itimerval *ovalue); | 172 | struct itimerval *ovalue); |
| 173 | extern int do_getitimer(int which, struct itimerval *value); | 173 | extern int do_getitimer(int which, struct itimerval *value); |
| 174 | 174 | ||
| 175 | extern unsigned int alarm_setitimer(unsigned int seconds); | ||
| 176 | |||
| 177 | extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); | 175 | extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); |
| 178 | 176 | ||
| 179 | struct tms; | 177 | struct tms; |
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 09168c52ab64..361f8bf1429d 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h | |||
| @@ -249,6 +249,7 @@ static inline u64 ktime_get_raw_ns(void) | |||
| 249 | 249 | ||
| 250 | extern u64 ktime_get_mono_fast_ns(void); | 250 | extern u64 ktime_get_mono_fast_ns(void); |
| 251 | extern u64 ktime_get_raw_fast_ns(void); | 251 | extern u64 ktime_get_raw_fast_ns(void); |
| 252 | extern u64 ktime_get_boot_fast_ns(void); | ||
| 252 | 253 | ||
| 253 | /* | 254 | /* |
| 254 | * Timespec interfaces utilizing the ktime based ones | 255 | * Timespec interfaces utilizing the ktime based ones |
