OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:20 +0000 (14:50 +0100)
commit8ea53f91d41909f1af9719dceb8c86afc3107bba
tree02effface6bce64f138d1aaf228eab4c869eddaf
parent57738dd2709835fc45682afa0885a870d62ca51e
rtc: ds1307: rx8130: Fix alarm handling

[ 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>
drivers/rtc/rtc-ds1307.c