summaryrefslogtreecommitdiff
path: root/drivers/rtc/interface.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-10-18 18:23:36 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-10-18 18:25:52 +0300
commitadb17a053e460f20740d713c4843d6966e66b1b1 (patch)
tree1009fe609d9a5eed07c5d4afd780926f97b448cf /drivers/rtc/interface.c
parent7d7234a4fff395ab17b021ec18f852e8ec8703b3 (diff)
downloadlinux-adb17a053e460f20740d713c4843d6966e66b1b1.tar.xz
rtc: expose RTC_FEATURE_UPDATE_INTERRUPT
Set RTC_FEATURE_UPDATE_INTERRUPT by default and clear it when it is not supported. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211018152337.78732-1-alexandre.belloni@bootlin.com
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r--drivers/rtc/interface.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 9a2bd4947007..d005623e6eb3 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -561,7 +561,8 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
if (rtc->uie_rtctimer.enabled == enabled)
goto out;
- if (rtc->uie_unsupported || !test_bit(RTC_FEATURE_ALARM, rtc->features)) {
+ if (!test_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features) ||
+ !test_bit(RTC_FEATURE_ALARM, rtc->features)) {
mutex_unlock(&rtc->ops_lock);
#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
return rtc_dev_update_irq_enable_emul(rtc, enabled);