rtc: brcmstb-waketimer: support level alarm_irq
authorDoug Berger <opendmb@gmail.com>
Wed, 30 Aug 2023 22:47:47 +0000 (15:47 -0700)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 1 Oct 2023 22:13:57 +0000 (00:13 +0200)
commite005a9b35b464be5b2e0194f717e90e7e496785d
treeecd91442e5e300c45d54c1915dc2b2a4d8a5e24e
parentd4277fa4a1a806ab9ec7da994fc3dd1ec25689fe
rtc: brcmstb-waketimer: support level alarm_irq

Some devices (e.g. BCM72112) use an alarm_irq interrupt that is
connected to a level interrupt controller rather than an edge
interrupt controller. In this case, the interrupt cannot be left
enabled by the irq handler while preserving the hardware wake-up
signal on wake capable devices or an interrupt storm will occur.

The alarm_expired flag is introduced to allow the disabling of
the interrupt when an alarm expires and to support balancing the
calls to disable_irq() and enable_irq() in accordance with the
existing design.

Fixes: 24304a87158a ("rtc: brcmstb-waketimer: allow use as non-wake alarm")
Signed-off-by: Doug Berger <opendmb@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20230830224747.1663044-1-opendmb@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-brcmstb-waketimer.c