mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
sys_linux: don't require configurable pin for external PPS
Some PHCs that have a PPS input don't have configurable pins (their function is hardcoded). Accept a negative pin index to skip the pin configuration before requesting external timestamping.
This commit is contained in:
@@ -1008,7 +1008,7 @@ SYS_Linux_SetPHCExtTimestamping(int fd, int pin, int channel,
|
||||
pin_desc.func = enable ? PTP_PF_EXTTS : PTP_PF_NONE;
|
||||
pin_desc.chan = channel;
|
||||
|
||||
if (ioctl(fd, PTP_PIN_SETFUNC, &pin_desc)) {
|
||||
if (pin >= 0 && ioctl(fd, PTP_PIN_SETFUNC, &pin_desc)) {
|
||||
DEBUG_LOG("ioctl(%s) failed : %s", "PTP_PIN_SETFUNC", strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user