Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ptp: Add adjust_phase to ptp_clock_caps capability.

Add adjust_phase to ptp_clock_caps capability to allow
user to query if a PHC driver supports adjust phase with
ioctl PTP_CLOCK_GETCAPS command.

Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
Reviewed-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vincent Cheng and committed by
David S. Miller
d3f1cbd2 184ecc9e

+8 -3
+1
drivers/ptp/ptp_chardev.c
··· 136 136 caps.pps = ptp->info->pps; 137 137 caps.n_pins = ptp->info->n_pins; 138 138 caps.cross_timestamping = ptp->info->getcrosststamp != NULL; 139 + caps.adjust_phase = ptp->info->adjphase != NULL; 139 140 if (copy_to_user((void __user *)arg, &caps, sizeof(caps))) 140 141 err = -EFAULT; 141 142 break;
+3 -1
include/uapi/linux/ptp_clock.h
··· 89 89 int n_pins; /* Number of input/output pins. */ 90 90 /* Whether the clock supports precise system-device cross timestamps */ 91 91 int cross_timestamping; 92 - int rsv[13]; /* Reserved for future use. */ 92 + /* Whether the clock supports adjust phase */ 93 + int adjust_phase; 94 + int rsv[12]; /* Reserved for future use. */ 93 95 }; 94 96 95 97 struct ptp_extts_request {
+4 -2
tools/testing/selftests/ptp/testptp.c
··· 269 269 " %d programmable periodic signals\n" 270 270 " %d pulse per second\n" 271 271 " %d programmable pins\n" 272 - " %d cross timestamping\n", 272 + " %d cross timestamping\n" 273 + " %d adjust_phase\n", 273 274 caps.max_adj, 274 275 caps.n_alarm, 275 276 caps.n_ext_ts, 276 277 caps.n_per_out, 277 278 caps.pps, 278 279 caps.n_pins, 279 - caps.cross_timestamping); 280 + caps.cross_timestamping, 281 + caps.adjust_phase); 280 282 } 281 283 } 282 284