diff options
| author | Keerthy <j-keerthy@ti.com> | 2016-06-01 16:19:07 +0530 |
|---|---|---|
| committer | Ben Hutchings <ben@decadent.org.uk> | 2016-11-20 01:16:47 +0000 |
| commit | a05cd914b6a76bab7fe48b60833b26222d787d1f (patch) | |
| tree | d98df902a3578da9bcec660ee550c52a0e482117 /include/linux/input-polldev.h | |
| parent | 554ab54b84651317f90c3b40a38365ae9ad671d8 (diff) | |
rtc: ds1307: Fix relying on reset value for weekday
commit e29385fab0bf94017fac130ee32f5bb2daf74417 upstream.
The reset value of weekday is 0x1. This is wrong since
the reset values of the day/month/year make up to Jan 1 2001.
When computed weekday comes out to be Monday. On a scale
of 1-7(Sunday - Saturday) it should be 0x2. So we should not
be relying on the reset value.
Hence compute the wday using the current date/month/year values.
Check if reset wday is any different from the computed wday,
If different then set the wday which we computed using
date/month/year values.
Document Referred:
http://ww1.microchip.com/downloads/en/DeviceDoc/20002266F.pdf
Fixes: 1d1945d261a2af "drivers/rtc/rtc-ds1307.c: add alarm support for mcp7941x chips"
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[bwh: Backported to 3.16:
- No 64-time rtc_time functions available
- Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/linux/input-polldev.h')
0 files changed, 0 insertions, 0 deletions
