Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/dialog/da9063/da9063_rtc.c
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | da9063_rtc_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_ct(ts, &ct); | error = clock_ts_to_ct(ts, &ct); | ||||
if (error) | |||||
return (error); | |||||
DA9063_RTC_LOCK(sc); | DA9063_RTC_LOCK(sc); | ||||
error = da9063_rtc_write_ct(sc, &ct); | error = da9063_rtc_write_ct(sc, &ct); | ||||
DA9063_RTC_UNLOCK(sc); | DA9063_RTC_UNLOCK(sc); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |