ptp: Add .getmaxphase callback to ptp_clock_info
authorRahul Rameshbabu <rrameshbabu@nvidia.com>
Mon, 12 Jun 2023 21:14:56 +0000 (14:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jun 2023 08:02:33 +0000 (09:02 +0100)
commitc3b60ab7a4dff6e6e608e685b70ddc3d6b2aca81
tree5ca798c8795ce133b62d61fc7400919ad9f52dd2
parent3a9a9a6139286584d1199f555fa4f96f592a3217
ptp: Add .getmaxphase callback to ptp_clock_info

Enables advertisement of the maximum offset supported by the phase control
functionality of PHCs. The callback is used to return an error if an offset
not supported by the PHC is used in ADJ_OFFSET. The ioctls
PTP_CLOCK_GETCAPS and PTP_CLOCK_GETCAPS2 now advertise the maximum offset a
PHC's phase control functionality is capable of supporting. Introduce new
sysfs node, max_phase_adjustment.

Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Maciek Machnikowski <maciek@machnikowski.net>
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_chardev.c
drivers/ptp/ptp_clock.c
drivers/ptp/ptp_sysfs.c
include/linux/ptp_clock_kernel.h
include/uapi/linux/ptp_clock.h
tools/testing/selftests/ptp/testptp.c