Skip to contentSkip to conversation

rtc/ds1337.c: Allow to set TCR register

PATCH New Detlev Zundel 2 participants 4 messages Sep 21, 2009 – Sep 23, 2009 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rtc/ds1337.c: Allow to set TCR register

From: Werner Pfister <[email protected]>

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

---
 drivers/rtc/ds1337.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/rtc/ds1337.c +4 -0
index a71ab5d..7abf041 100644
@@ -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
 }
 
 
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 2/2 digsy_mtc: Add TCR register value for RTC (DS1339)

From: Werner Pfister <[email protected]>

---
 include/configs/digsy_mtc.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/digsy_mtc.h +1 -0
index 2bdaaac..7a1a7c3 100644
@@ -244,6 +244,7 @@
  */
 #define CONFIG_RTC_DS1337
 #define CONFIG_SYS_I2C_RTC_ADDR	0x68
+#define CONFIG_SYS_DS1339_TCR_VAL	0xAB	/* diode + 4k resistor */
 
 /*
  * Flash configuration
Signature · 1 line
1.6.0.6
#2 lore raw

PATCH 2/2 digsy_mtc: Add TCR register value for RTC (DS1339)

Dear Detlev Zundel,

Quoted 7 lines · In message <[email protected]> you wrote:

From: Werner Pfister <[email protected]>

---
 include/configs/digsy_mtc.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Mr. Cole's Axiom:
        The sum of the intelligence on the planet is a constant;
        the population is growing.
#3 lore raw

PATCH 1/2 rtc/ds1337.c: Allow to set TCR register

In reply to Detlev Zundel

Dear Detlev Zundel,

Quoted 10 lines · In message <[email protected]> you wrote:

From: Werner Pfister <[email protected]>

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

---
 drivers/rtc/ds1337.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 10 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
As the system comes up, the component builders will from time to time
appear, bearing hot new versions of their pieces -- faster,  smaller,
more complete, or putatively less buggy. The replacement of a working
component  by a new version requires the same systematic testing pro-
cedure that adding a new component does, although it  should  require
less time, for more complete and efficient test cases will usually be
available.           - Frederick Brooks Jr., "The Mythical Man Month"