]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: ds1307: ensure that any pending alarm is cleared before a new alarm is enabled
authorNicolas Boullis <nboullis@debian.org>
Sun, 10 Apr 2016 11:23:05 +0000 (13:23 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Fri, 20 May 2016 10:33:51 +0000 (12:33 +0200)
commit72e1ade41be3e63175b23a387c431e3fb3f2c736
treea6ffeb2cdca89a68d9979864b31e0c49efc380bf
parentd55f9b5dea44a6606760e3025b49c978ee31eb66
rtc: ds1307: ensure that any pending alarm is cleared before a new alarm is enabled

If a previously-set alarm was disabled and then triggered, it may still
be pending when a new alarm is configured.

Then, if the alarm is enabled before the pending alarm is cleared, then
an interrupt is immediately raised.

Unfortunately, when the alarm is cleared and enabled during the same I²C
block write, the chip (at least the DS1339 I have) considers that the
alarm is enabled before it is cleared, and raises an interrupt.

This patch ensures that the pending alarm is cleared before the alarm is
enabled.

Signed-off-by: Nicolas Boullis <nboullis@debian.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-ds1307.c