]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: mcp795: fix month write resetting date to 1.
authorEmil Bartczak <emilbart@gmail.com>
Wed, 7 Dec 2016 23:27:40 +0000 (00:27 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sun, 18 Dec 2016 23:59:23 +0000 (00:59 +0100)
commit9609c3b10118cafe87677b5127afcc001ee58068
tree3e47d6827ebbb32f5de50893c7b91071457251db
parent9e5f42f8a14d5412e1a781139741c80a260fd59b
rtc: mcp795: fix month write resetting date to 1.

According to Microchip errata some combinations of date and month
values may result in the date being reset to 1, even if the date
is also written with the month (for example 31-07 or 31-08).
As a workaround avoid writing date and month values within the same
Write command. Instead, terminate the Write command after loading
the date and begin a new command to write the month. In addition,
disable the oscillator before loading the new values. This is done
by ensuring both the ST and EXTOSC bits are cleared and waiting for
the OSCON bit to clear.

Signed-off-by: Emil Bartczak <emilbart@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-mcp795.c