aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ptp
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-09-03 06:34:58 -0400
committerBen Hutchings <bhutchings@solarflare.com>2012-09-07 16:13:28 -0400
commit220a60a425146b0e37998cc0b3082f0541aad866 (patch)
tree44e48c4489f8e354d17269d41db19d015d9b95fe /drivers/ptp
parentef2c7d7b59708d54213c7556a82d14de9a7e4475 (diff)
pps/ptp: Allow PHC devices to adjust PPS events for known delay
Initial version by Stuart Hodgson <smhodgson@solarflare.com> Some PHC device drivers may deliver PPS events with a significant and variable delay, but still be able to measure precisely what that delay is. Add a pps_sub_ts() function for subtracting a delay from the timestamp(s) in a PPS event, and a PTP event type (PTP_CLOCK_PPSUSR) for which the caller provides a complete PPS event. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/ptp')
-rw-r--r--drivers/ptp/ptp_clock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index 1e528b539a07..966875dcda56 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -300,6 +300,11 @@ void ptp_clock_event(struct ptp_clock *ptp, struct ptp_clock_event *event)
300 pps_get_ts(&evt); 300 pps_get_ts(&evt);
301 pps_event(ptp->pps_source, &evt, PTP_PPS_EVENT, NULL); 301 pps_event(ptp->pps_source, &evt, PTP_PPS_EVENT, NULL);
302 break; 302 break;
303
304 case PTP_CLOCK_PPSUSR:
305 pps_event(ptp->pps_source, &event->pps_times,
306 PTP_PPS_EVENT, NULL);
307 break;
303 } 308 }
304} 309}
305EXPORT_SYMBOL(ptp_clock_event); 310EXPORT_SYMBOL(ptp_clock_event);