]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtc: s35390a: fix reading out alarm
authorUwe Kleine-König <uwe@kleine-koenig.org>
Sat, 2 Jul 2016 15:28:08 +0000 (17:28 +0200)
committerJiri Slaby <jslaby@suse.cz>
Mon, 10 Apr 2017 13:09:44 +0000 (15:09 +0200)
commit19901cad5537c51ae463cc07eb809f33401be344
tree0040e2f866cea0e3c0b9c2901c203c9c743c23f9
parent69caf454cdd1ac75669b3bede89972121e279554
rtc: s35390a: fix reading out alarm

commit f87e904ddd8f0ef120e46045b0addeb1cc88354e upstream.

There are several issues fixed in this patch:

 - When alarm isn't enabled, set .enabled to zero instead of returning
   -EINVAL.
 - Ignore how IRQ1 is configured when determining if IRQ2 is on.
 - The three alarm registers have an enable flag which must be
   evaluated.
 - The chip always triggers when the seconds register gets 0.

Note that the rtc framework however doesn't handle the result correctly
because it doesn't check wday being initialized and so interprets an
alarm being set for 10:00 AM in three days as 10:00 AM tomorrow (or
today if that's not over yet).

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/rtc/rtc-s35390a.c