Re: [RFC PATCH 1/3] pps: Add PPS_SETCLOCK ioctl
From: gerik kubiak
Date: Sat Jul 04 2026 - 11:49:44 EST
> Why not merge this patch with patch 3?
Patch 1 was intended to isolate the UAPI changes, but I can merge it
with patch 3 if that is preferred.
Gerik
On Tue, Jun 30, 2026 at 5:39 AM Rodolfo Giometti <giometti@xxxxxxxxxxxx> wrote:
>
> On 27/06/2026 22:50, Gerik Kubiak wrote:
> > 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>
>
> Don't add not needed empty lines.
>
> >
> > #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 *)
>
> Why not merge this patch with patch 3?
>
> >
> > #endif /* _PPS_H_ */
>
> Rodolfo
>
> --
> GNU/Linux Solutions e-mail: giometti@xxxxxxxxxxxx
> Linux Device Driver giometti@xxxxxxxx
> Embedded Systems phone: +39 349 2432127
> UNIX programming