aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/ptp_clock.h
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2014-03-20 17:21:52 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-21 14:21:13 -0400
commit6092315dfdec5185881605d15a0e200d6e90eb66 (patch)
tree8b018970396a2e2380fe51ed14d2f860ce6010e1 /include/uapi/linux/ptp_clock.h
parenta85ae0e97879f51bccd8511668b07d346d98b3eb (diff)
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 {
50 int n_ext_ts; /* Number of external time stamp channels. */ 50 int n_ext_ts; /* Number of external time stamp channels. */
51 int n_per_out; /* Number of programmable periodic signals. */ 51 int n_per_out; /* Number of programmable periodic signals. */
52 int pps; /* Whether the clock supports a PPS callback. */ 52 int pps; /* Whether the clock supports a PPS callback. */
53 int rsv[15]; /* Reserved for future use. */ 53 int n_pins; /* Number of input/output pins. */
54 int rsv[14]; /* Reserved for future use. */
54}; 55};
55 56
56struct ptp_extts_request { 57struct ptp_extts_request {
@@ -80,6 +81,40 @@ struct ptp_sys_offset {
80 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; 81 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
81}; 82};
82 83
84enum ptp_pin_function {
85 PTP_PF_NONE,
86 PTP_PF_EXTTS,
87 PTP_PF_PEROUT,
88 PTP_PF_PHYSYNC,
89};
90
91struct ptp_pin_desc {
92 /*
93 * Hardware specific human readable pin name. This field is
94 * set by the kernel during the PTP_PIN_GETFUNC ioctl and is
95 * ignored for the PTP_PIN_SETFUNC ioctl.
96 */
97 char name[64];
98 /*
99 * Pin index in the range of zero to ptp_clock_caps.n_pins - 1.
100 */
101 unsigned int index;
102 /*
103 * Which of the PTP_PF_xxx functions to use on this pin.
104 */
105 unsigned int func;
106 /*
107 * The specific channel to use for this function.
108 * This corresponds to the 'index' field of the
109 * PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls.
110 */
111 unsigned int chan;
112 /*
113 * Reserved for future use.
114 */
115 unsigned int rsv[5];
116};
117
83#define PTP_CLK_MAGIC '=' 118#define PTP_CLK_MAGIC '='
84 119
85#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) 120#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
@@ -87,6 +122,8 @@ struct ptp_sys_offset {
87#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) 122#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
88#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) 123#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int)
89#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset) 124#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
125#define PTP_PIN_GETFUNC _IOWR(PTP_CLK_MAGIC, 6, struct ptp_pin_desc)
126#define PTP_PIN_SETFUNC _IOW(PTP_CLK_MAGIC, 7, struct ptp_pin_desc)
90 127
91struct ptp_extts_event { 128struct ptp_extts_event {
92 struct ptp_clock_time t; /* Time event occured. */ 129 struct ptp_clock_time t; /* Time event occured. */