]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: support ptp physical/virtual clocks conversion
authorYangbo Lu <yangbo.lu@nxp.com>
Wed, 30 Jun 2021 08:11:53 +0000 (16:11 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Jul 2021 20:08:18 +0000 (13:08 -0700)
commit52c449a86022104fa268b1349e295313e362aded
treec690dbcde555185b5f7f2634ea8d83edf114bf7d
parent30e9b330567b0bb702c17604b8a661c7e33e4cb0
ptp: support ptp physical/virtual clocks conversion

Support ptp physical/virtual clocks conversion via sysfs.
There will be a new attribute n_vclocks under ptp physical
clock sysfs.

- In default, the value is 0 meaning only ptp physical clock
  is in use.
- Setting the value can create corresponding number of ptp
  virtual clocks to use. But current physical clock is guaranteed
  to stay free running.
- Setting the value back to 0 can delete virtual clocks and back
  use physical clock again.

Another new attribute max_vclocks control the maximum number of
ptp vclocks.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/ABI/testing/sysfs-ptp
drivers/ptp/ptp_clock.c
drivers/ptp/ptp_private.h
drivers/ptp/ptp_sysfs.c