• Uwe Kleine-König's avatar
    rtc: s35390a: fix reading out alarm · f87e904d
    Uwe Kleine-König authored
    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: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
    f87e904d
rtc-s35390a.c 11.1 KB