Modify the phc_ctl utility to add a helpful get_pins_cfg command to display
the current pin configuration.

This is a follow up of a previous v2 I sent a long time ago at [1], but
includes a couple of additional cleanups. First, I modified phc.c to
dynamically check and use PTP_PIN_SETFUNC2 if available, falling back to
PTP_PIN_SETFUNC if its not supported (-ENOTTY return value).

Second, I expose phc_get_caps and use this instead of re-inventing this
again in phc_ctl.c

Finally, the actual implementation is in the 3rd patch. In a similar way to
PTP_PIN_SETFUNC2, I use PTP_PIN_GETFUNC2 and fallback to PTP_PIN_GETFUNC in
the case of -ENOTTY return value, and use the phc.c helper file instead of
open coding equivalent functions.

This version should fix the issues with missing values and also dynamically
supports the newer ioctls when available rather than relying on compiler
time checks.

Jacob Keller (3):
  phc: dynamically try PTP_PIN_SETFUNC2 and fallback to PTP_PIN_SETFUNC
  phc_ctl: use phc_get_caps instead of direct ioctl invocation
  phc_ctl: add get_pins_cfg command to display pin functions

 missing.h | 12 ++++++----
 phc.c     | 21 ++++++++++++-----
 phc.h     | 24 +++++++++++++++++++
 phc_ctl.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 114 insertions(+), 13 deletions(-)

-- 
2.41.0.1.g9857a21e0017.dirty



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to