rtc: ds1347: properly handle oscillator failures
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 7 Oct 2019 13:47:22 +0000 (15:47 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 7 Oct 2019 13:49:35 +0000 (15:49 +0200)
commitd9dcfa5f7084a0c648d9f0946994f4320a411a40
tree083aece3ba798a1b885ad57e97babb304a01a0f7
parent3ce20a23e2199bd98eb85fbaa524104931cd14dd
rtc: ds1347: properly handle oscillator failures

The comment in the probe function stating that it disables oscillator stop
detection and glitch filtering is incorrect as it sets bits 3 and 4 while
it should be setting 5 and 6 to achieve that. Then, it is safe to assume
that the oscillator failure detection is actually enabled.

Properly handle oscillator failures by returning -EINVAL when the time and
date are know to be incorrect and reset the flag when the time is set.

Link: https://lore.kernel.org/r/20191007134724.15505-8-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ds1347.c