Commit d6f61a47 authored by Alessandro Rubini's avatar Alessandro Rubini

driver: fix use of TDC user_offset at interrupt time

TDC user offset should be applied to all timestamps. The code, however,
didn't do that properly, and fast_tdc mode was missing it.

Now user_offset is applied where the hardware offset is, like it should
have since time zero.

This should have no effect, as user_offset is an option nobody used
so far, as far as we know.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 2112dffc
......@@ -91,6 +91,7 @@ static inline void fd_normalize_time(struct fd_dev *fd, struct fd_time *t)
}
fd_ts_add(t, fd->calib.tdc_zero_offset);
fd_ts_add(t, fd->tdc_user_offset);
}
......@@ -145,8 +146,6 @@ int fd_read_sw_fifo(struct fd_dev *fd, struct zio_channel *chan)
v[FD_ATTR_TDC_OFFSET] = fd->calib.tdc_zero_offset;
v[FD_ATTR_TDC_USER_OFF] = fd->tdc_user_offset;
fd_apply_offset(v + FD_ATTR_TDC_UTC_H, fd->tdc_user_offset);
/* We also need a copy within the device, so sysfs can read it */
memcpy(fd->tdc_attrs, v + FD_ATTR_DEV__LAST, sizeof(fd->tdc_attrs));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment