* copied from ds1337.c
*/
-#include <common.h>
+#include <config.h>
#include <command.h>
#include <dm.h>
+#include <log.h>
#include <rtc.h>
#include <i2c.h>
static
uchar rtc_read (uchar reg)
{
- return (i2c_reg_read (CONFIG_SYS_I2C_RTC_ADDR, reg));
+ return (i2c_reg_read (CFG_SYS_I2C_RTC_ADDR, reg));
}
static void rtc_write (uchar reg, uchar val)
{
- i2c_reg_write (CONFIG_SYS_I2C_RTC_ADDR, reg, val);
+ i2c_reg_write (CFG_SYS_I2C_RTC_ADDR, reg, val);
}
#else
static int ds3231_rtc_get(struct udevice *dev, struct rtc_time *tmp)
struct udevice *dev;
ret = i2c_get_chip_for_busnum(busnum, chip_addr, 1, &dev);
- if (!ret)
+ if (!ret) {
ret = dm_i2c_reg_write(dev, RTC_STAT_REG_ADDR,
RTC_STAT_BIT_BB32KHZ |
RTC_STAT_BIT_EN32KHZ);
+ }
return ret;
}
#endif