aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-10-18 17:23:36 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-10-18 17:25:52 +0200
commitadb17a053e460f20740d713c4843d6966e66b1b1 (patch)
tree1009fe609d9a5eed07c5d4afd780926f97b448cf /drivers/rtc/class.c
parent7d7234a4fff395ab17b021ec18f852e8ec8703b3 (diff)
downloadlinux-adb17a053e460f20740d713c4843d6966e66b1b1.tar.gz
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/class.c')
-rw-r--r--drivers/rtc/class.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 2e0cbc190a8ae..4b460c61f1d8c 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -232,6 +232,7 @@ static struct rtc_device *rtc_allocate_device(void)
rtc->pie_enabled = 0;
set_bit(RTC_FEATURE_ALARM, rtc->features);
+ set_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features);
return rtc;
}
@@ -389,6 +390,9 @@ int __devm_rtc_register_device(struct module *owner, struct rtc_device *rtc)
if (!rtc->ops->set_alarm)
clear_bit(RTC_FEATURE_ALARM, rtc->features);
+ if (rtc->uie_unsupported)
+ clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features);
+
if (rtc->ops->set_offset)
set_bit(RTC_FEATURE_CORRECTION, rtc->features);