[U-Boot] unassigned-patches/23: [PATCH] RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get().
u-boot at bugs.denx.de
u-boot at bugs.denx.de
Fri Aug 15 15:45:02 CEST 2008
Signed-off-by: Yuri Tikhonov <yur at emcraft.com>
---
Added to GNATS database as unassigned-patches/23
>Responsible: patch-coord
>Message-Id: <1218807733-26929-2-git-send-email-dzu at denx.de>
>In-Reply-To: <1218807733-26929-1-git-send-email-dzu at denx.de>
>References: <1218807733-26929-1-git-send-email-dzu at denx.de>
>Patch-Date: Fri Aug 15 15:42:09 +0200 2008
---
drivers/rtc/rx8025.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/rtc/rx8025.c b/drivers/rtc/rx8025.c
index 64eafe5..6ba9df2 100644
--- a/drivers/rtc/rx8025.c
+++ b/drivers/rtc/rx8025.c
@@ -136,7 +136,11 @@ int rtc_get (struct rtc_time *tmp)
tmp->tm_sec = bcd2bin (sec & 0x7F);
tmp->tm_min = bcd2bin (min & 0x7F);
- tmp->tm_hour = bcd2bin (hour & 0x3F);
+ if (rtc_read(RTC_CTL1_REG_ADDR) & RTC_CTL1_BIT_2412)
+ tmp->tm_hour = bcd2bin (hour & 0x3F);
+ else
+ tmp->tm_hour = bcd2bin (hour & 0x1F) % 12 +
+ ((hour & 0x20) ? 12 : 0);
tmp->tm_mday = bcd2bin (mday & 0x3F);
tmp->tm_mon = bcd2bin (mon & 0x1F);
tmp->tm_year = bcd2bin (year) + ( bcd2bin (year) >= 70 ? 1900 : 2000);
--
1.5.6.1
More information about the U-Boot
mailing list