aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/alarmtimer.h5
-rw-r--r--include/linux/clocksource.h5
-rw-r--r--include/linux/mc146818rtc.h1
-rw-r--r--include/linux/pm-trace.h9
-rw-r--r--include/linux/ptp_clock_kernel.h65
-rw-r--r--include/linux/time.h2
-rw-r--r--include/linux/timekeeping.h1
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
16enum alarmtimer_restart { 21enum 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
8extern int pm_trace_enabled; 8extern int pm_trace_enabled;
9extern bool pm_trace_rtc_abused;
10
11static inline bool pm_trace_rtc_valid(void)
12{
13 return !pm_trace_rtc_abused;
14}
9 15
10static inline int pm_trace_is_enabled(void) 16static 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
33static inline bool pm_trace_rtc_valid(void) { return true; }
27static inline int pm_trace_is_enabled(void) { return 0; } 34static 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
131struct ptp_clock; 131struct 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
145extern 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
154extern int ptp_clock_unregister(struct ptp_clock *ptp);
155
156
157enum ptp_clock_events { 133enum 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
172extern 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
181extern 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);
210int ptp_find_pin(struct ptp_clock *ptp, 211int 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
215static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
216 struct device *parent)
217{ return NULL; }
218static inline int ptp_clock_unregister(struct ptp_clock *ptp)
219{ return 0; }
220static inline void ptp_clock_event(struct ptp_clock *ptp,
221 struct ptp_clock_event *event)
222{ }
223static inline int ptp_clock_index(struct ptp_clock *ptp)
224{ return -1; }
225static 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);
173extern int do_getitimer(int which, struct itimerval *value); 173extern int do_getitimer(int which, struct itimerval *value);
174 174
175extern unsigned int alarm_setitimer(unsigned int seconds);
176
177extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); 175extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags);
178 176
179struct tms; 177struct 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
250extern u64 ktime_get_mono_fast_ns(void); 250extern u64 ktime_get_mono_fast_ns(void);
251extern u64 ktime_get_raw_fast_ns(void); 251extern u64 ktime_get_raw_fast_ns(void);
252extern 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