summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-09-20 16:39:59 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-20 16:39:59 -0400
commitb85c715c2e6fabdd18c90df878ed2c6e6cd50fc2 (patch)
tree41f8cc32c03500c499e35e641f08f41a41f28ece /include
parentaee77e4accbeb2c86b1d294cd84fec4a12dde3bd (diff)
parent450783747f42dfa3883920acfad4acdd93ce69af (diff)
downloadlinux-b85c715c2e6fabdd18c90df878ed2c6e6cd50fc2.tar.bz2
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Ben Hutchings says: ==================== 1. Extension to PPS/PTP to allow for PHC devices where pulses are subject to a variable but measurable delay. 2. PPS/PTP/PHC support for Solarflare boards with a timestamping peripheral. 3. MTD support for updating the timestamping peripheral on those boards. 4. Fix for potential over-length requests to firmware. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pps_kernel.h9
-rw-r--r--include/linux/ptp_clock_kernel.h10
2 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 94048547f29a..0cc45ae1afd5 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -116,5 +116,14 @@ static inline void pps_get_ts(struct pps_event_time *ts)
#endif /* CONFIG_NTP_PPS */
+/* Subtract known time delay from PPS event time(s) */
+static inline void pps_sub_ts(struct pps_event_time *ts, struct timespec delta)
+{
+ ts->ts_real = timespec_sub(ts->ts_real, delta);
+#ifdef CONFIG_NTP_PPS
+ ts->ts_raw = timespec_sub(ts->ts_raw, delta);
+#endif
+}
+
#endif /* LINUX_PPS_KERNEL_H */
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 945704c2ed65..a644b29f1161 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -21,6 +21,7 @@
#ifndef _PTP_CLOCK_KERNEL_H_
#define _PTP_CLOCK_KERNEL_H_
+#include <linux/pps_kernel.h>
#include <linux/ptp_clock.h>
@@ -110,6 +111,7 @@ enum ptp_clock_events {
PTP_CLOCK_ALARM,
PTP_CLOCK_EXTTS,
PTP_CLOCK_PPS,
+ PTP_CLOCK_PPSUSR,
};
/**
@@ -117,13 +119,17 @@ enum ptp_clock_events {
*
* @type: One of the ptp_clock_events enumeration values.
* @index: Identifies the source of the event.
- * @timestamp: When the event occured.
+ * @timestamp: When the event occurred (%PTP_CLOCK_EXTTS only).
+ * @pps_times: When the event occurred (%PTP_CLOCK_PPSUSR only).
*/
struct ptp_clock_event {
int type;
int index;
- u64 timestamp;
+ union {
+ u64 timestamp;
+ struct pps_event_time pps_times;
+ };
};
/**