[RFC PATCH 2/5] PTP: add a callback for counting timestamp events

From: Felipe Balbi
Date: Tue Jul 16 2019 - 03:20:57 EST


This will be used for frequency discipline adjustments.

Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
---
include/linux/ptp_clock_kernel.h | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 28eb9c792522..1a4e3f916128 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -35,6 +35,16 @@ struct ptp_system_timestamp {
struct timespec64 post_ts;
};

+/**
+ * struct ptp_event_count_tstamp - device time vs event count for frequency discipline
+ */
+struct ptp_event_count_tstamp {
+ unsigned int index;
+
+ struct ptp_clock_time device_time;
+ u64 event_count;
+};
+
/**
* struct ptp_clock_info - decribes a PTP hardware clock
*
@@ -134,6 +144,8 @@ struct ptp_clock_info {
struct ptp_system_timestamp *sts);
int (*getcrosststamp)(struct ptp_clock_info *ptp,
struct system_device_crosststamp *cts);
+ int (*counttstamp)(struct ptp_clock_info *ptp,
+ struct ptp_event_count_tstamp *count);
int (*settime64)(struct ptp_clock_info *p, const struct timespec64 *ts);
int (*enable)(struct ptp_clock_info *ptp,
struct ptp_clock_request *request, int on);
--
2.22.0