]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitea33af7bf0b8f19a0d323c70e06051e056b42902
tree083aece3ba798a1b885ad57e97babb304a01a0f7
parentde010fe94eb20e48feb7f32d9056728ff698253b
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