]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: rv8803: Stop the clock while setting the time
authorBenoît Thébaudeau <benoit@wsystem.com>
Thu, 21 Jul 2016 10:41:31 +0000 (12:41 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 28 Jul 2016 07:59:41 +0000 (09:59 +0200)
commit99c9d143257f846f0058a83a4b6b8dbfde70e486
treef50dc7bde007828d6284a1e79d20d4611da11049
parent6d2ecbd2d602fcd958d7f50444b9cd64224a0809
rtc: rv8803: Stop the clock while setting the time

According to the application manual of the RX8900, the RESET bit must be
set to 1 to prevent a timer update while setting the time. This also
resets the subsecond counter. The application manual of the RV-8803 does
not mention such a requirement, and it says that the 100th Seconds
register is cleared when writing to the Seconds register, but using the
RESET bit for the RV-8803 too should not be an issue and is probably
safer.

This change also ensures that the RESET bit is initialized properly in
all cases. Indeed, all the registers must be initialized if the voltage
has been lower than VLOW2 (triggering V2F), but not low enough to
trigger a POR.

Signed-off-by: Benoît Thébaudeau <benoit@wsystem.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-rv8803.c