Skip to contentSkip to conversation

rtc: ds1511: set range

PATCH New [email protected] 1 participant 2 messages Feb 27, 2024 Real time clock (RTC)

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/2 rtc: ds1511: set range

From: Alexandre Belloni <[email protected]>

The ds1511 leap year calculation fails in 2100.

---
 drivers/rtc/rtc-ds1511.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-ds1511.c +1 -0
index edb8d90812c5..6869d28d34cc 100644
@@ -322,6 +322,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev)
 		return PTR_ERR(ds1511->rtc);
 
 	ds1511->rtc->ops = &ds1511_rtc_ops;
+	ds1511->rtc->range_max = RTC_TIMESTAMP_END_2099;
 
 	/*
 	 * if the platform has an interrupt in mind for this device,
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 2/2 rtc: ds1511: set alarm offset limit

From: Alexandre Belloni <[email protected]>

The ds1511 can only support alarms up to a month in the future (which we currently limit to 28 days).

---
 drivers/rtc/rtc-ds1511.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-ds1511.c +1 -0
index 6869d28d34cc..8b087d9556be 100644
@@ -323,6 +323,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev)
 
 	ds1511->rtc->ops = &ds1511_rtc_ops;
 	ds1511->rtc->range_max = RTC_TIMESTAMP_END_2099;
+	ds1511->rtc->alarm_offset_max = 28 * 24 * 60 * 60 - 1;
 
 	/*
 	 * if the platform has an interrupt in mind for this device,
Signature · 1 line
2.43.0