]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitcc43c3d8ccd033096489e7c193ac63fa3bc1d40b
treef3a5717b93180e72f6641f66247e1f47ca57846b
parentd4c671252d4765db1fc2c20549eac071f9914216
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