aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rs5c348.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-09-05 18:35:48 -0400
committerOlof Johansson <olof@lixom.net>2012-09-05 18:35:48 -0400
commit1875962377574b4edb7b164001e3e341c25290d5 (patch)
tree374a5299403ec21e2d9a66a6548ce876a388b589 /drivers/rtc/rtc-rs5c348.c
parent5cbee140a28c2746449ae31e85738043ae4da927 (diff)
parentc88a79a7789b2909ad1cf69ea2c9142030bbd6f4 (diff)
Merge branch 'soc-core' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt
* 'soc-core' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: mach-shmobile: Add compilation support for dtbs using 'make dtbs' + sync to 3.6-rc3
Diffstat (limited to 'drivers/rtc/rtc-rs5c348.c')
-rw-r--r--drivers/rtc/rtc-rs5c348.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-rs5c348.c b/drivers/rtc/rtc-rs5c348.c
index 77074ccd2850..fd5c7af04ae5 100644
--- a/drivers/rtc/rtc-rs5c348.c
+++ b/drivers/rtc/rtc-rs5c348.c
@@ -122,9 +122,12 @@ rs5c348_rtc_read_time(struct device *dev, struct rtc_time *tm)
122 tm->tm_min = bcd2bin(rxbuf[RS5C348_REG_MINS] & RS5C348_MINS_MASK); 122 tm->tm_min = bcd2bin(rxbuf[RS5C348_REG_MINS] & RS5C348_MINS_MASK);
123 tm->tm_hour = bcd2bin(rxbuf[RS5C348_REG_HOURS] & RS5C348_HOURS_MASK); 123 tm->tm_hour = bcd2bin(rxbuf[RS5C348_REG_HOURS] & RS5C348_HOURS_MASK);
124 if (!pdata->rtc_24h) { 124 if (!pdata->rtc_24h) {
125 tm->tm_hour %= 12; 125 if (rxbuf[RS5C348_REG_HOURS] & RS5C348_BIT_PM) {
126 if (rxbuf[RS5C348_REG_HOURS] & RS5C348_BIT_PM) 126 tm->tm_hour -= 20;
127 tm->tm_hour %= 12;
127 tm->tm_hour += 12; 128 tm->tm_hour += 12;
129 } else
130 tm->tm_hour %= 12;
128 } 131 }
129 tm->tm_wday = bcd2bin(rxbuf[RS5C348_REG_WDAY] & RS5C348_WDAY_MASK); 132 tm->tm_wday = bcd2bin(rxbuf[RS5C348_REG_WDAY] & RS5C348_WDAY_MASK);
130 tm->tm_mday = bcd2bin(rxbuf[RS5C348_REG_DAY] & RS5C348_DAY_MASK); 133 tm->tm_mday = bcd2bin(rxbuf[RS5C348_REG_DAY] & RS5C348_DAY_MASK);