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
This commit is contained in:
Alexandre Belloni
2021-10-18 17:23:36 +02:00
parent 7d7234a4ff
commit adb17a053e
2 changed files with 6 additions and 1 deletions

View File

@@ -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);