|
|
@@ -88,7 +88,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
|
|
|
tm->tm_min = bcd2bin(regs[ISL12057_REG_RTC_MN]);
|
|
|
|
|
|
if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_MIL) { /* AM/PM */
|
|
|
- tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x0f);
|
|
|
+ tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x1f);
|
|
|
if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_PM)
|
|
|
tm->tm_hour += 12;
|
|
|
} else { /* 24 hour mode */
|
|
|
@@ -97,7 +97,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
|
|
|
|
|
|
tm->tm_mday = bcd2bin(regs[ISL12057_REG_RTC_DT]);
|
|
|
tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1; /* starts at 1 */
|
|
|
- tm->tm_mon = bcd2bin(regs[ISL12057_REG_RTC_MO]) - 1; /* starts at 1 */
|
|
|
+ tm->tm_mon = bcd2bin(regs[ISL12057_REG_RTC_MO] & 0x1f) - 1; /* ditto */
|
|
|
tm->tm_year = bcd2bin(regs[ISL12057_REG_RTC_YR]) + 100;
|
|
|
}
|
|
|
|