Skip to contentSkip to conversation

rtc: da9063: switch to RTC_FEATURE_UPDATE_INTERRUPT

PATCH In review Alexandre Belloni 2 participants 2 messages Nov 9, 2021 – Nov 18, 2021

Subsystems (2)
lore
Share & tools
lore

Alexandre Belloni

author maintainer
#0 lore raw

PATCH 1/1 rtc: da9063: switch to RTC_FEATURE_UPDATE_INTERRUPT

Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Also, let the core know that the alarm will truncate seconds as it only has a minute resolution.

---
 drivers/rtc/rtc-da9063.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/rtc/rtc-da9063.c +8 -6
index d4b72a9fa2ba..54a5e244946b 100644
@@ -475,12 +475,14 @@ static int da9063_rtc_probe(struct platform_device *pdev)
 	da9063_data_to_tm(data, &rtc->alarm_time, rtc);
 	rtc->rtc_sync = false;
 
-	/*
-	 * TODO: some models have alarms on a minute boundary but still support
-	 * real hardware interrupts. Add this once the core supports it.
-	 */
-	if (config->rtc_data_start != RTC_SEC)
-		rtc->rtc_dev->uie_unsupported = 1;
+	if (config->rtc_data_start != RTC_SEC) {
+		set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtc_dev->features);
+		/*
+		 * TODO: some models have alarms on a minute boundary but still
+		 * support real hardware interrupts.
+		 */
+		clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtc_dev->features);
+	}
 
 	irq_alarm = platform_get_irq_byname(pdev, "ALARM");
 	if (irq_alarm < 0)
Signature · 1 line
2.31.1