Commit Graph

6 Commits (9dcd6c31e7840d6916a4ff4d948faf3a87ddff0a)

Author SHA1 Message Date
Dimitrios Katsaros a5da8c4b71 Added support for opening POSIX clock devices
I have reduced the requirements for the -p option to accept
any type of device. With this it should be possible to use
ptp4l to syncronize any clock device that implements the kernel
POSIX clock interface.

[ RC - Initialize struct timex. ]

Signed-off-by: Dimitrios Katsaros <patcherwork@gmail.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2019-01-06 19:41:45 -08:00
Ken ICHIKAWA 67c925f459 Don't return bogus clock id
phc_open() can open any device and return clkid even if the device is not phc
for example /dev/kvm and so on.
As a result, phc2sys keeps running with reading bogus clock as below:
 # phc2sys -s /dev/kvm -O 0 -q -m
 phc2sys[687019.699]: failed to read clock: Invalid argument
 phc2sys[687020.699]: failed to read clock: Invalid argument
 phc2sys[687021.699]: failed to read clock: Invalid argument
 phc2sys[687022.699]: failed to read clock: Invalid argument
 ...

This patch fixes that problem.

Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
2013-06-06 17:00:25 +02:00
Jiri Benc 4004273cd8 phc2sys: enable PPS output from PHC
PPS output from a PHC has to be enabled by PTP_ENABLE_PPS ioctl. Call
the ioctl when both PHC device and PPS device are specified and PPS is
supported by the PHC.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
2013-04-19 17:52:25 +02:00
Richard Cochran d7bcdca7a9 Clamp maximum adjustment to numerical limit.
On 32 bit platforms, a PHC driver might allow a larger adjustment than
can fit into the 'long' type used in the clock_adjtime interface. This
patch fixes the issue by using the smaller of the two maxima.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-05-05 12:49:45 +02:00
Richard Cochran 5b8fa684ae phc: Add a method to query the maximum adjustment.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-12 18:58:59 +01:00
Richard Cochran 11e0446c0e Add code to open and close PHC devices.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-01 18:00:16 +01:00