rtc: jz4740: rework invalid time detection
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 30 Apr 2019 09:28:20 +0000 (11:28 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 30 Apr 2019 09:50:22 +0000 (11:50 +0200)
commit7fe8fcee0cf90ef9aa4c6a123b8b6c3925ccded1
treeb65c529efa59ec73bb5bc0b8a120222ce01b6ba7
parent3b2dc19ff9a1495cf08752b5a1ba8b986473f39f
rtc: jz4740: rework invalid time detection

The scratchpad register is used to detect an invalid time when power to the
RTC has been lost. Instead of deleting that precious information and set
the time to the UNIX epoch, forward it to userspace.

Tested-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-jz4740.c