diff options
author | Stefan Roese <sr@denx.de> | 2012-01-20 11:47:47 +0100 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-07-07 14:07:43 +0200 |
commit | 038f3c54ba9a7ab4552943f47efe8f05736b1732 (patch) | |
tree | 8776c22b738eff422af4b26ebd3399220c3e0a71 /drivers/rtc/m41t62.c | |
parent | 4ae8bc4392ec038566276e15c4dfe29f0fe9682f (diff) | |
download | u-boot-imx-038f3c54ba9a7ab4552943f47efe8f05736b1732.zip u-boot-imx-038f3c54ba9a7ab4552943f47efe8f05736b1732.tar.gz u-boot-imx-038f3c54ba9a7ab4552943f47efe8f05736b1732.tar.bz2 |
rtc/m41t62: Add support for M41T82 with HT (Halt Update)
Add support for the M41T82 RTC to the m41t62 driver. The only
difference that needs to be handled by this driver, is to
clear the HT (Halt Update) bit upon reset. This bit is not
used on the M41T62, so its save to clear this bit always.
The M41T82 support will be used by the X600 (SPEAr600)
board support.
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/rtc/m41t62.c')
-rw-r--r-- | drivers/rtc/m41t62.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/rtc/m41t62.c b/drivers/rtc/m41t62.c index 62c2446..8721e74 100644 --- a/drivers/rtc/m41t62.c +++ b/drivers/rtc/m41t62.c @@ -63,6 +63,8 @@ #define M41T62_FEATURE_HT (1 << 0) #define M41T62_FEATURE_BL (1 << 1) +#define M41T80_ALHOUR_HT (1 << 6) /* HT: Halt Update Bit */ + int rtc_get(struct rtc_time *tm) { u8 buf[M41T62_DATETIME_REG_SIZE]; @@ -132,9 +134,15 @@ int rtc_set(struct rtc_time *tm) void rtc_reset(void) { + u8 val; + /* - * Nothing to do + * M41T82: Make sure HT (Halt Update) bit is cleared. + * This bit is 0 in M41T62 so its save to clear it always. */ + i2c_read(CONFIG_SYS_I2C_RTC_ADDR, M41T62_REG_ALARM_HOUR, 1, &val, 1); + val &= ~M41T80_ALHOUR_HT; + i2c_write(CONFIG_SYS_I2C_RTC_ADDR, M41T62_REG_ALARM_HOUR, 1, &val, 1); } #endif |