#include <rtc.h>
#include <i2c.h>
-#if defined(CONFIG_RTC_RS5C372A) && defined(CONFIG_CMD_DATE)
+#if defined(CONFIG_CMD_DATE)
/*
* Reads are always done starting with register 15, which requires some
* jumping-through-hoops to access the data correctly.
/*
* Get the current time from the RTC
*/
-void
+int
rtc_get (struct rtc_time *tmp)
{
unsigned char buf[RS5C372_RAM_SIZE];
rs5c372_enable();
if (!setup_done)
- return;
+ return -1;
memset(buf, 0, sizeof(buf));
ret = rs5c372_readram(buf, RS5C372_RAM_SIZE);
if (ret != 0) {
printf("%s: failed\n", __FUNCTION__);
- return;
+ return -1;
}
rs5c372_convert_to_time(tmp, buf);
- return;
+ return 0;
}
/*