aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-isl12057.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-isl12057.c b/drivers/rtc/rtc-isl12057.c
index 455b601d731d..8c3f60737df8 100644
--- a/drivers/rtc/rtc-isl12057.c
+++ b/drivers/rtc/rtc-isl12057.c
@@ -88,7 +88,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
88 tm->tm_min = bcd2bin(regs[ISL12057_REG_RTC_MN]); 88 tm->tm_min = bcd2bin(regs[ISL12057_REG_RTC_MN]);
89 89
90 if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_MIL) { /* AM/PM */ 90 if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_MIL) { /* AM/PM */
91 tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x0f); 91 tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x1f);
92 if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_PM) 92 if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_PM)
93 tm->tm_hour += 12; 93 tm->tm_hour += 12;
94 } else { /* 24 hour mode */ 94 } else { /* 24 hour mode */
@@ -97,7 +97,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
97 97
98 tm->tm_mday = bcd2bin(regs[ISL12057_REG_RTC_DT]); 98 tm->tm_mday = bcd2bin(regs[ISL12057_REG_RTC_DT]);
99 tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1; /* starts at 1 */ 99 tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1; /* starts at 1 */
100 tm->tm_mon = bcd2bin(regs[ISL12057_REG_RTC_MO]) - 1; /* starts at 1 */ 100 tm->tm_mon = bcd2bin(regs[ISL12057_REG_RTC_MO] & 0x1f) - 1; /* ditto */
101 tm->tm_year = bcd2bin(regs[ISL12057_REG_RTC_YR]) + 100; 101 tm->tm_year = bcd2bin(regs[ISL12057_REG_RTC_YR]) + 100;
102} 102}
103 103