[RFC PATCH 1/3] pps: Add PPS_SETCLOCK ioctl
From: Gerik Kubiak
Date: Sat Jun 27 2026 - 16:55:01 EST
Add the PPS_SETCLOCK ioctl to the pps driver and an associated
pps_kclock_source structure used as an arugment in the ioctl. This ioctl
allows userspace to specify the clock used in timestamping PPS events.
Adds a pps_kclock_source structure for this ioctl. It contains one value,
clock_id, which holds the requested clock source for subsequent PPS events.
Signed-off-by: Gerik Kubiak <gerikkub@xxxxxxxxx>
---
include/uapi/linux/pps.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/pps.h b/include/uapi/linux/pps.h
index 009ebcd8ced5..db233511c6ef 100644
--- a/include/uapi/linux/pps.h
+++ b/include/uapi/linux/pps.h
@@ -87,6 +87,10 @@ struct pps_kparams {
struct pps_ktime clear_off_tu; /* offset compensation for clear */
};
+struct pps_kclock_source {
+ __u32 clock_id; /* System clock id */
+};
+
/*
* 3.3 Mode bit definitions
*/
@@ -140,6 +144,7 @@ struct pps_bind_args {
int consumer; /* selected kernel consumer */
};
+
#include <linux/ioctl.h>
#define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *)
@@ -147,5 +152,6 @@ struct pps_bind_args {
#define PPS_GETCAP _IOR('p', 0xa3, int *)
#define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *)
#define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *)
+#define PPS_SETCLOCK _IOW('p', 0xa6, struct pps_clock_source *)
#endif /* _PPS_H_ */
--
2.54.0