]> git.sur5r.net Git - u-boot/commitdiff
rtc/ds1337.c: Allow to set TCR register
authorWerner Pfister <werner.pfister@intercontrol.de>
Mon, 21 Sep 2009 12:49:55 +0000 (14:49 +0200)
committerTom Rix <Tom.Rix@windriver.com>
Sat, 3 Oct 2009 14:04:32 +0000 (09:04 -0500)
This is needed to correctly start the charging of an attached capacitor
or battery.

Signed-off-by: Werner Pfister <werner.pfister@intercontrol.de>
Signed-off-by: Detlev Zundel <dzu@denx.de>
drivers/rtc/ds1337.c

index a71ab5daa3f9cd86e55efe3a6404ada26b792dd2..7abf041aabd9bf91e759e358f95a0d3e8df561db 100644 (file)
@@ -56,6 +56,7 @@
 #define RTC_YR_REG_ADDR                0x6
 #define RTC_CTL_REG_ADDR       0x0e
 #define RTC_STAT_REG_ADDR      0x0f
+#define RTC_TC_REG_ADDR                0x10
 
 /*
  * RTC control register bits
@@ -169,6 +170,9 @@ int rtc_set (struct rtc_time *tmp)
 void rtc_reset (void)
 {
        rtc_write (RTC_CTL_REG_ADDR, RTC_DS1337_RESET_VAL);
+#ifdef CONFIG_SYS_DS1339_TCR_VAL
+       rtc_write (RTC_TC_REG_ADDR, CONFIG_SYS_DS1339_TCR_VAL);
+#endif
 }