]> git.ipfire.org Git - thirdparty/linux.git/commit
ptp: add debugfs interfaces to loop back the periodic output signal
authorWei Fang <wei.fang@nxp.com>
Fri, 5 Sep 2025 03:07:09 +0000 (11:07 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 Sep 2025 02:28:52 +0000 (19:28 -0700)
commite096a7cc0be126d9376e549a10d71cf16b1a1c1c
treee34c70e0eb4b0b45e1f9e46c34447daa6fabe08b
parentcf71bdf6863f0aebd00aeccce313b8833ee9c7f4
ptp: add debugfs interfaces to loop back the periodic output signal

For some PTP devices, they have the capability to loop back the periodic
output signal for debugging, such as the ptp_qoriq device. So add the
generic interfaces to set the periodic output signal loopback, rather
than each vendor having a different implementation.

Show how many channels support the periodic output signal loopback:
$ cat /sys/kernel/debug/ptp<N>/n_perout_loopback

Enable the loopback of the periodic output signal of channel X:
$ echo <X> 1 > /sys/kernel/debug/ptp<N>/perout_loopback

Disable the loopback of the periodic output signal of channel X:
$ echo <X> 0 > /sys/kernel/debug/ptp<N>/perout_loopback

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20250905030711.1509648-2-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_clock.c
include/linux/ptp_clock_kernel.h