diff options
author | Ian Lepore <ian@FreeBSD.org> | 2018-03-04 19:32:52 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2018-03-04 19:32:52 +0000 |
commit | 02641ce942cc8f106ea86fef437e732b9d761be9 (patch) | |
tree | 188e29fe7aa316b652bb161ec2a999c63477ac64 | |
parent | fa9d44f62ec884032307aff35dba72c455023fe1 (diff) |
Notes
-rw-r--r-- | sys/dev/iicbus/ds1672.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/iicbus/ds1672.c b/sys/dev/iicbus/ds1672.c index fae7cbf8db951..84b0a11e58b3c 100644 --- a/sys/dev/iicbus/ds1672.c +++ b/sys/dev/iicbus/ds1672.c @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); #define DS1672_CTRL_EOSC (1 << 7) /* Stop/start flag. */ -#define NANOSEC 1000000000 - #define MAX_IIC_DATA_SIZE 4 struct ds1672_softc { @@ -144,8 +142,9 @@ ds1672_gettime(device_t dev, struct timespec *ts) /* counter has seconds since epoch */ ts->tv_sec = (secs[3] << 24) | (secs[2] << 16) | (secs[1] << 8) | (secs[0] << 0); - ts->tv_nsec = NANOSEC / 2; + ts->tv_nsec = 0; } + clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_READ, ts); return (error); } @@ -159,6 +158,8 @@ ds1672_settime(device_t dev, struct timespec *ts) data[2] = (ts->tv_sec >> 16) & 0xff; data[3] = (ts->tv_sec >> 24) & 0xff; + ts->tv_nsec = 0; + clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_WRITE, ts); return (ds1672_write(dev, DS1672_COUNTER, data, 4)); } |