aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pps_kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pps_kernel.h')
-rw-r--r--include/linux/pps_kernel.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 65194fe498b..32aa6763ca1 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -43,6 +43,10 @@ struct pps_source_info {
43 struct device *dev; 43 struct device *dev;
44}; 44};
45 45
46struct pps_event_time {
47 struct timespec ts_real;
48};
49
46/* The main struct */ 50/* The main struct */
47struct pps_device { 51struct pps_device {
48 struct pps_source_info info; /* PSS source info */ 52 struct pps_source_info info; /* PSS source info */
@@ -88,6 +92,20 @@ extern int pps_register_source(struct pps_source_info *info,
88extern void pps_unregister_source(int source); 92extern void pps_unregister_source(int source);
89extern int pps_register_cdev(struct pps_device *pps); 93extern int pps_register_cdev(struct pps_device *pps);
90extern void pps_unregister_cdev(struct pps_device *pps); 94extern void pps_unregister_cdev(struct pps_device *pps);
91extern void pps_event(int source, struct pps_ktime *ts, int event, void *data); 95extern void pps_event(int source, struct pps_event_time *ts, int event,
96 void *data);
97
98static inline void timespec_to_pps_ktime(struct pps_ktime *kt,
99 struct timespec ts)
100{
101 kt->sec = ts.tv_sec;
102 kt->nsec = ts.tv_nsec;
103}
104
105static inline void pps_get_ts(struct pps_event_time *ts)
106{
107 getnstimeofday(&ts->ts_real);
108}
92 109
93#endif /* LINUX_PPS_KERNEL_H */ 110#endif /* LINUX_PPS_KERNEL_H */
111