]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
rtc: ds1307: rx8130: Fix alarm handling
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 25 Jan 2019 14:35:58 +0000 (15:35 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commita3a734a0f955bc801f31db138e09753cd13e2e06
treec387b9c0378178294872cbc64c6ccf0bfea1486e
parent75a78aa795456c2dd52f293ea332f5fcfa0531bd
rtc: ds1307: rx8130: Fix alarm handling

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 3f929cad943380370b6db31fcb7a38d898d91089 ]

When the EXTENSION.WADA bit is set, register 0x19 contains a bitmap of
week days, not a day of month. As Linux only handles a single alarm
without repetition using day of month is more flexible, so clear this
bit. (Otherwise a value depending on time.tm_wday would have to be
written to register 0x19.)

Also optimize setting the AIE bit to use a single register write instead
of a bulk write of three registers.

Fixes: ee0981be7704 ("rtc: ds1307: Add support for Epson RX8130CE")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/rtc/rtc-ds1307.c