summaryrefslogtreecommitdiff
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 65194fe498bb..32aa6763ca1b 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -43,6 +43,10 @@ struct pps_source_info {
struct device *dev;
};
+struct pps_event_time {
+ struct timespec ts_real;
+};
+
/* The main struct */
struct pps_device {
struct pps_source_info info; /* PSS source info */
@@ -88,6 +92,20 @@ extern int pps_register_source(struct pps_source_info *info,
extern void pps_unregister_source(int source);
extern int pps_register_cdev(struct pps_device *pps);
extern void pps_unregister_cdev(struct pps_device *pps);
-extern void pps_event(int source, struct pps_ktime *ts, int event, void *data);
+extern void pps_event(int source, struct pps_event_time *ts, int event,
+ void *data);
+
+static inline void timespec_to_pps_ktime(struct pps_ktime *kt,
+ struct timespec ts)
+{
+ kt->sec = ts.tv_sec;
+ kt->nsec = ts.tv_nsec;
+}
+
+static inline void pps_get_ts(struct pps_event_time *ts)
+{
+ getnstimeofday(&ts->ts_real);
+}
#endif /* LINUX_PPS_KERNEL_H */
+