Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iicbus/isl12xx.c
Show First 20 Lines • Show All 287 Lines • ▼ Show 20 Lines | isl12xx_settime(device_t dev, struct timespec *ts) | ||||
uint8_t ampmflags, sreg; | uint8_t ampmflags, sreg; | ||||
/* | /* | ||||
* 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(); | ||||
ts->tv_nsec = 0; | ts->tv_nsec = 0; | ||||
clock_ts_to_bcd(ts, &bct, sc->use_ampm); | err = clock_ts_to_bcd(ts, &bct, sc->use_ampm); | ||||
if (err) | |||||
return (err); | |||||
clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); | clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); | ||||
/* If the chip is in AM/PM mode, set flags as needed. */ | /* If the chip is in AM/PM mode, set flags as needed. */ | ||||
if (!sc->use_ampm) | if (!sc->use_ampm) | ||||
ampmflags = ISL12XX_24HR_FLAG; | ampmflags = ISL12XX_24HR_FLAG; | ||||
else | else | ||||
ampmflags = bct.ispm ? ISL12XX_PM_FLAG : 0; | ampmflags = bct.ispm ? ISL12XX_PM_FLAG : 0; | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |