linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: da9063: switch to RTC_FEATURE_UPDATE_INTERRUPT
@ 2021-11-09 23:47 Alexandre Belloni
  2021-11-18  9:49 ` Adam Thomson
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Belloni @ 2021-11-09 23:47 UTC (permalink / raw)
  To: Alessandro Zummo, Support Opensource, Alexandre Belloni
  Cc: linux-rtc, linux-kernel

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.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-da9063.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
index d4b72a9fa2ba..54a5e244946b 100644
--- a/drivers/rtc/rtc-da9063.c
+++ b/drivers/rtc/rtc-da9063.c
@@ -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)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] rtc: da9063: switch to RTC_FEATURE_UPDATE_INTERRUPT
  2021-11-09 23:47 [PATCH] rtc: da9063: switch to RTC_FEATURE_UPDATE_INTERRUPT Alexandre Belloni
@ 2021-11-18  9:49 ` Adam Thomson
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Thomson @ 2021-11-18  9:49 UTC (permalink / raw)
  To: Alexandre Belloni, Alessandro Zummo, Support Opensource
  Cc: linux-rtc, linux-kernel

On 09 November 2021 23:48, Alexandre Belloni wrote

> 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.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-18  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 23:47 [PATCH] rtc: da9063: switch to RTC_FEATURE_UPDATE_INTERRUPT Alexandre Belloni
2021-11-18  9:49 ` Adam Thomson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).