net: microchip: lan743x: add support for PTP pulse width (duty cycle)
authorYuiko Oshino <yuiko.oshino@microchip.com>
Tue, 12 Oct 2021 13:49:53 +0000 (09:49 -0400)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Oct 2021 02:05:18 +0000 (19:05 -0700)
commit4ece1ae440151a2e5af441d2c9b1d8eb3a700670
treef3a5717b93180e72f6641f66247e1f47ca57846b
parent67ca5159dbe2edb5dae7544447b8677d2596933a
net: microchip: lan743x: add support for PTP pulse width (duty cycle)

If the PTP_PEROUT_DUTY_CYCLE flag is set, then check if the
request_on value in ptp_perout_request matches the pre-defined
values or a toggle option.
Return a failure if the value is not supported.

Preserve the old behaviors if the PTP_PEROUT_DUTY_CYCLE flag is not
set.

Tested with an oscilloscope on EVB-LAN7430:
e.g., to output PPS 1sec period 500mS on (high) to GPIO 2.
 ./testptp -L 2,2
 ./testptp -p 1000000000 -w 500000000

Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
Link: https://lore.kernel.org/r/1634046593-64312-1-git-send-email-yuiko.oshino@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan743x_main.h
drivers/net/ethernet/microchip/lan743x_ptp.c