]> git.baikalelectronics.ru Git - kernel.git/commit
testptp: add new options for perout phase and pulse width
authorVladimir Oltean <olteanv@gmail.com>
Mon, 20 Jul 2020 17:55:59 +0000 (20:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2020 01:04:59 +0000 (18:04 -0700)
commite4968615024155d672139d693fa2964ce6b5810e
tree2949bd6caee872feecc40e4d3c7f8112777ea283
parentd4d2cec356c3ca264ad0b65548385a23dd095897
testptp: add new options for perout phase and pulse width

Extend the example program for PTP ancillary functionality with the
ability to configure not only the periodic output's period (frequency),
but also the phase and duty cycle (pulse width) which were newly
introduced.

The ioctl level also needs to be updated to the new PTP_PEROUT_REQUEST2,
since the original PTP_PEROUT_REQUEST doesn't support this
functionality. For an in-tree testing program, not having explicit
backwards compatibility is fine, as it should always be tested with the
current kernel headers and sources.

Tested with an oscilloscope on the felix switch PHC:

echo '2 0' > /sys/class/ptp/ptp1/pins/switch_1588_dat0
./testptp -d /dev/ptp1 -p 1000000000 -w 100000000 -H 1000 -i 0

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/ptp/testptp.c