aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/ptp_clock.h
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2014-03-20 22:21:52 +0100
committerDavid S. Miller <davem@davemloft.net>2014-03-21 14:21:13 -0400
commit6092315dfdec5185881605d15a0e200d6e90eb66 (patch)
tree8b018970396a2e2380fe51ed14d2f860ce6010e1 /include/uapi/linux/ptp_clock.h
parentMerge branch 'bcmgenet-next' (diff)
downloadlinux-dev-6092315dfdec5185881605d15a0e200d6e90eb66.tar.xz
linux-dev-6092315dfdec5185881605d15a0e200d6e90eb66.zip
ptp: introduce programmable pins.
This patch adds a pair of new ioctls to the PTP Hardware Clock device interface. Using the ioctls, user space programs can query each pin to find out its current function and also reprogram a different function if desired. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/ptp_clock.h')
-rw-r--r--include/uapi/linux/ptp_clock.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
index b65c834f83e9..f0b7bfe5da92 100644
--- a/include/uapi/linux/ptp_clock.h
+++ b/include/uapi/linux/ptp_clock.h
@@ -50,7 +50,8 @@ struct ptp_clock_caps {
int n_ext_ts; /* Number of external time stamp channels. */
int n_per_out; /* Number of programmable periodic signals. */
int pps; /* Whether the clock supports a PPS callback. */
- int rsv[15]; /* Reserved for future use. */
+ int n_pins; /* Number of input/output pins. */
+ int rsv[14]; /* Reserved for future use. */
};
struct ptp_extts_request {
@@ -80,6 +81,40 @@ struct ptp_sys_offset {
struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
};
+enum ptp_pin_function {
+ PTP_PF_NONE,
+ PTP_PF_EXTTS,
+ PTP_PF_PEROUT,
+ PTP_PF_PHYSYNC,
+};
+
+struct ptp_pin_desc {
+ /*
+ * Hardware specific human readable pin name. This field is
+ * set by the kernel during the PTP_PIN_GETFUNC ioctl and is
+ * ignored for the PTP_PIN_SETFUNC ioctl.
+ */
+ char name[64];
+ /*
+ * Pin index in the range of zero to ptp_clock_caps.n_pins - 1.
+ */
+ unsigned int index;
+ /*
+ * Which of the PTP_PF_xxx functions to use on this pin.
+ */
+ unsigned int func;
+ /*
+ * The specific channel to use for this function.
+ * This corresponds to the 'index' field of the
+ * PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls.
+ */
+ unsigned int chan;
+ /*
+ * Reserved for future use.
+ */
+ unsigned int rsv[5];
+};
+
#define PTP_CLK_MAGIC '='
#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
@@ -87,6 +122,8 @@ struct ptp_sys_offset {
#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int)
#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
+#define PTP_PIN_GETFUNC _IOWR(PTP_CLK_MAGIC, 6, struct ptp_pin_desc)
+#define PTP_PIN_SETFUNC _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)
struct ptp_extts_event {
struct ptp_clock_time t; /* Time event occured. */