Currently, Update Interrupt Enable is performed by emulating it with either polling, or alarm interrupts. Some RTCs, however, can directly provide Update Interrupts. Signed-off-by: "Csókás, Bence" <csokas.bence@xxxxxxxxx> --- drivers/rtc/interface.c | 8 ++++++++ include/linux/rtc.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 1b63111cdda2..9e1eac441c54 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -581,6 +581,14 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) #endif } + if (rtc->ops && rtc->ops->update_irq_enable) { + err = rtc->ops->update_irq_enable(rtc->dev.parent, enabled); + if (!err) + rtc->uie_rtctimer.enabled = enabled; + if (err != -EINVAL) + goto out; + } + if (enabled) { struct rtc_time tm; ktime_t now, onesec; diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 5f8e438a0312..63dad8dfe278 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -68,6 +68,7 @@ struct rtc_class_ops { int (*set_offset)(struct device *, long offset); int (*param_get)(struct device *, struct rtc_param *param); int (*param_set)(struct device *, struct rtc_param *param); + int (*update_irq_enable)(struct device *, unsigned int enabled); }; struct rtc_device; -- 2.34.1