Skip to contentSkip to conversation

ftrtc010.c : enhance code according to original datasheet

PATCH New Macpaul Lin 2 participants 2 messages Oct 19, 2010 – Oct 20, 2010 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrtc010.c : enhance code according to original datasheet

Add missing codes according to original datasheet.
This patch also makes ftrtc010 could be adapted to PCLK and EXT_CLK.

---
 drivers/rtc/ftrtc010.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/rtc/ftrtc010.c +11 -0
index 7738a7a..25e4a7b 100644
@@ -34,6 +34,13 @@ struct ftrtc010 {
 	unsigned int alarm_hour;	/* 0x18 */
 	unsigned int record;		/* 0x1c */
 	unsigned int cr;		/* 0x20 */
+	unsigned int wsec;		/* 0x24 */
+	unsigned int wmin;		/* 0x28 */
+	unsigned int whour;		/* 0x2c */
+	unsigned int wday;		/* 0x30 */
+	unsigned int intr;		/* 0x34 */
+	unsigned int div;		/* 0x38 */
+	unsigned int rev;		/* 0x3c */
 };
 
 /*
@@ -85,7 +92,11 @@ int rtc_get(struct rtc_time *tmp)
 	debug("%s(): record register: %x\n",
 	      __func__, readl(&rtc->record));
 
+#ifdef CONFIG_FTRTC010_PCLK
+	now = (ftrtc010_time() + readl(&rtc->record)) / RTC_DIV_COUNT;
+#else /* CONFIG_FTRTC010_EXTCLK */
 	now = ftrtc010_time() + readl(&rtc->record);
+#endif
 
 	to_tm(now, tmp);
 
Signature · 1 line
1.7.2.2
#1 lore raw

PATCH 1/1 ftrtc010.c : enhance code according to original datasheet

Dear Macpaul Lin,

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

Add missing codes according to original datasheet.
This patch also makes ftrtc010 could be adapted to PCLK and EXT_CLK.

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

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 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
Computers make excellent and efficient servants, but I have  no  wish
to  serve under them. Captain, a starship also runs on loyalty to one
man. And nothing can replace it or him.
	-- Spock, "The Ultimate Computer", stardate 4729.4