]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: ls1x: add range
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 17 May 2018 20:53:27 +0000 (22:53 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 18 May 2018 07:38:22 +0000 (09:38 +0200)
commit757709d269155308c11a766e38ad638d11b811c2
tree2904bd2eba75fd8cf8019c01d9a6ddc8d5f96a05
parente004d5528cff7b30d259d314d14ec04b3ca979db
rtc: ls1x: add range

While the year is encoded on 32 bits in SYS_TOYWRITE1i/SYS_TOYREAD1. The
Loongson 1c datasheet states that the range is from 0 to 99.

The current code exceeds this range and seems to be working, I deduce that
the leap year algorithm will fail in 2100.

Anyway, alarm registers only encode the year on 14 bits so with alarm
support, the range will always be limited to 0 to 16383.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ls1x.c