Re: [Linuxptp-devel] [PATCH v4 4/4] phc_ctl: add get_pins_cfg command to display pin functions

2023-06-26 Thread Erez
On Mon, 26 Jun 2023 at 21:04, Jacob Keller wrote: > Add a new function to phc_ctl to display the devices pin configuration > data. First, obtain the device capabilities to determine the number of > pins. Then, for each pin, print the name, function, and channel > information. > > Signed-off-by: J

[Linuxptp-devel] [PATCH v4 2/4] phc_ctl: use phc_get_caps instead of direct ioctl invocation

2023-06-26 Thread Jacob Keller
The phc.c file already has phc_get_caps to obtain the capabilities for a PHC clock. Expose this and use it in phc_ctl.c instead of re-implementing it. Signed-off-by: Jacob Keller --- phc.c | 4 +--- phc.h | 11 +++ phc_ctl.c | 3 +-- 3 files changed, 13 insertions(+), 5 deletio

[Linuxptp-devel] [PATCH v4 4/4] phc_ctl: add get_pins_cfg command to display pin functions

2023-06-26 Thread Jacob Keller
Add a new function to phc_ctl to display the devices pin configuration data. First, obtain the device capabilities to determine the number of pins. Then, for each pin, print the name, function, and channel information. Signed-off-by: Jacob Keller --- missing.h | 5 + phc.c | 8 +++

[Linuxptp-devel] [PATCH v4 0/4] add get_pins_cfg command to display pin functions

2023-06-26 Thread Jacob Keller
Extend phc_ctl with a new get_pins_cfg command which calls the PTP_PIN_GETFUNC ioctl on a PHC clock and prints the pin configuration for each pin. Changes since v3: * remove use of PTP_PIN_SETFUNC2 and PTP_PIN_GETFUNC2 at Erez's request * avoid converting PTP_PF_NONE in pin_func_string() * check c

[Linuxptp-devel] [PATCH v4 3/4] phc_ctl: check clkid >= 0 instead of just CLOCK_REALTIME

2023-06-26 Thread Jacob Keller
All PHC have a negative clkid, while the variations of the system clock use positive values. The do_caps() function hard codes a check against CLOCK_REALTIME to avoid executing the PTP_CLOCK_GETCAPS ioctl on a non-PHC clock. Extend this to avoid operating on any system clock, allowing for the pote

[Linuxptp-devel] [PATCH v4 1/4] phc: always use PTP_PIN_SETFUNC instead of depending on kernel headers

2023-06-26 Thread Jacob Keller
The phc_pin_setfunc() call uses PTP_PIN_SETFUNC2, attempting to hew the newer PTP_PIN_SETFUNC2 ioctl. This would break on older kernels which lack this ioctl. However, missing.h then provides a PTP_PIN_SETFUNC2 definition which re-defines the macro to use the original ioctl PTP_PIN_SETFUNC. This i

[Linuxptp-devel] [PATCH] Add notification for changes in PARENT_DATA_SET.

2023-06-26 Thread Miroslav Lichvar
Add a new notification event for pmc clients to receive PARENT_DATA_SET when a change is made there. Signed-off-by: Miroslav Lichvar --- clock.c| 26 +++--- notification.h | 1 + pmc.c | 10 ++ pmc_common.c | 15 +++ 4 files changed, 41