Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iicbus/ds1307.c
Show First 20 Lines • Show All 510 Lines • ▼ Show 20 Lines | ds1307_settime(device_t dev, struct timespec *ts) | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
/* | /* | ||||
* We request a timespec with no resolution-adjustment. That also | * We request a timespec with no resolution-adjustment. That also | ||||
* disables utc adjustment, so apply that ourselves. | * disables utc adjustment, so apply that ourselves. | ||||
*/ | */ | ||||
ts->tv_sec -= utc_offset(); | ts->tv_sec -= utc_offset(); | ||||
clock_ts_to_bcd(ts, &bct, sc->sc_use_ampm); | error = clock_ts_to_bcd(ts, &bct, sc->sc_use_ampm); | ||||
if (error) | |||||
return (error); | |||||
clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_WRITE, &bct); | clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_WRITE, &bct); | ||||
/* | /* | ||||
* If the chip is in AM/PM mode, adjust hour and set flags as needed. | * If the chip is in AM/PM mode, adjust hour and set flags as needed. | ||||
* The AM/PM bit polarity and position is different on the EPSON. | * The AM/PM bit polarity and position is different on the EPSON. | ||||
*/ | */ | ||||
if (sc->sc_use_ampm) { | if (sc->sc_use_ampm) { | ||||
pmflags = (sc->chiptype != TYPE_EPSON_RX8035) ? | pmflags = (sc->chiptype != TYPE_EPSON_RX8035) ? | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |