linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] rtc: ds1511: set range
@ 2024-02-27 23:13 alexandre.belloni
  2024-02-27 23:13 ` [PATCH 2/2] rtc: ds1511: set alarm offset limit alexandre.belloni
  0 siblings, 1 reply; 2+ messages in thread
From: alexandre.belloni @ 2024-02-27 23:13 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

The ds1511 leap year calculation fails in 2100.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-ds1511.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c
index edb8d90812c5..6869d28d34cc 100644
--- a/drivers/rtc/rtc-ds1511.c
+++ b/drivers/rtc/rtc-ds1511.c
@@ -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,
-- 
2.43.0


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

* [PATCH 2/2] rtc: ds1511: set alarm offset limit
  2024-02-27 23:13 [PATCH 1/2] rtc: ds1511: set range alexandre.belloni
@ 2024-02-27 23:13 ` alexandre.belloni
  0 siblings, 0 replies; 2+ messages in thread
From: alexandre.belloni @ 2024-02-27 23:13 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel

From: Alexandre Belloni <alexandre.belloni@bootlin.com>

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

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-ds1511.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c
index 6869d28d34cc..8b087d9556be 100644
--- a/drivers/rtc/rtc-ds1511.c
+++ b/drivers/rtc/rtc-ds1511.c
@@ -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,
-- 
2.43.0


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

end of thread, other threads:[~2024-02-27 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27 23:13 [PATCH 1/2] rtc: ds1511: set range alexandre.belloni
2024-02-27 23:13 ` [PATCH 2/2] rtc: ds1511: set alarm offset limit alexandre.belloni

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).