[U-Boot] [PATCH 1/2] rtc/ds1337.c: Allow to set TCR register

Detlev Zundel dzu at denx.de
Mon Sep 21 14:49:55 CEST 2009


From: Werner Pfister <werner.pfister at intercontrol.de>

This is needed to correctly start the charging of an attached capacitor
or battery.

Signed-off-by: Werner Pfister <werner.pfister at intercontrol.de>
Signed-off-by: Detlev Zundel <dzu at denx.de>
---
 drivers/rtc/ds1337.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/ds1337.c b/drivers/rtc/ds1337.c
index a71ab5d..7abf041 100644
--- a/drivers/rtc/ds1337.c
+++ b/drivers/rtc/ds1337.c
@@ -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
 }
 
 
-- 
1.6.0.6



More information about the U-Boot mailing list