summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYuri Tikhonov <yur@emcraft.com>2008-08-15 15:42:09 +0200
committerWolfgang Denk <wd@denx.de>2008-09-06 01:22:20 +0200
commit5875d358f025c1b042d8a0f08384b756de7256c9 (patch)
tree033204aa56cc684cb99e5c212d1a9b84cfefa5b8 /drivers
parent3e3c026ed746a284c6f0ef139b26d859939de7e9 (diff)
RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get().
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rx8025.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/rtc/rx8025.c b/drivers/rtc/rx8025.c
index 064138e9eb..fd6aec5feb 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);