Implement the set_time function. Rather pointless with this RTC, as it

resets when the core resets, but there may be some use for it...
This commit is contained in:
Warner Losh 2006-07-14 21:37:19 +00:00
parent 21caaf799a
commit 375906f555
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160359

View File

@ -223,9 +223,14 @@ at91_rtc_gettime(device_t dev, struct timespec *ts)
static int
at91_rtc_settime(device_t dev, struct timespec *ts)
{
// XXX UGLY XXX
printf("SET TIME\n");
return (EINVAL);
struct at91_rtc_softc *sc;
struct clocktime ct;
sc = device_get_softc(dev);
clock_ts_to_ct(ts, &ct);
WR4(sc, RTC_TIMR, RTC_TIMR_MK(ct.hour, ct.min, ct.sec));
WR4(sc, RTC_CALR, RTC_CALR_MK(ct.year, ct.mon, ct.day, ct.dow));
return (0);
}
static device_method_t at91_rtc_methods[] = {