aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pps_kernel.h14
-rw-r--r--include/linux/time.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 1aedf50088cf..94048547f29a 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -47,6 +47,9 @@ struct pps_source_info {
47}; 47};
48 48
49struct pps_event_time { 49struct pps_event_time {
50#ifdef CONFIG_NTP_PPS
51 struct timespec ts_raw;
52#endif /* CONFIG_NTP_PPS */
50 struct timespec ts_real; 53 struct timespec ts_real;
51}; 54};
52 55
@@ -97,10 +100,21 @@ static inline void timespec_to_pps_ktime(struct pps_ktime *kt,
97 kt->nsec = ts.tv_nsec; 100 kt->nsec = ts.tv_nsec;
98} 101}
99 102
103#ifdef CONFIG_NTP_PPS
104
105static inline void pps_get_ts(struct pps_event_time *ts)
106{
107 getnstime_raw_and_real(&ts->ts_raw, &ts->ts_real);
108}
109
110#else /* CONFIG_NTP_PPS */
111
100static inline void pps_get_ts(struct pps_event_time *ts) 112static inline void pps_get_ts(struct pps_event_time *ts)
101{ 113{
102 getnstimeofday(&ts->ts_real); 114 getnstimeofday(&ts->ts_real);
103} 115}
104 116
117#endif /* CONFIG_NTP_PPS */
118
105#endif /* LINUX_PPS_KERNEL_H */ 119#endif /* LINUX_PPS_KERNEL_H */
106 120
diff --git a/include/linux/time.h b/include/linux/time.h
index 9f15ac7ab92a..1e6d3b59238d 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -158,6 +158,8 @@ extern unsigned int alarm_setitimer(unsigned int seconds);
158extern int do_getitimer(int which, struct itimerval *value); 158extern int do_getitimer(int which, struct itimerval *value);
159extern void getnstimeofday(struct timespec *tv); 159extern void getnstimeofday(struct timespec *tv);
160extern void getrawmonotonic(struct timespec *ts); 160extern void getrawmonotonic(struct timespec *ts);
161extern void getnstime_raw_and_real(struct timespec *ts_raw,
162 struct timespec *ts_real);
161extern void getboottime(struct timespec *ts); 163extern void getboottime(struct timespec *ts);
162extern void monotonic_to_bootbased(struct timespec *ts); 164extern void monotonic_to_bootbased(struct timespec *ts);
163 165