Skip to contentSkip to conversation

rtc: st-lpc: add range

PATCH In review Alexandre Belloni 2 participants 2 messages May 21, 2018 – May 23, 2018

Subsystems (2)
lore
Share & tools
lore

Alexandre Belloni

author maintainer
#0 lore raw

PATCH v2 1/1 rtc: st-lpc: add range

The RTC has a 64 bit counter.

---
 drivers/rtc/rtc-st-lpc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/rtc/rtc-st-lpc.c +2 -0
index 2f1ef2c28740..bee75ca7ff79 100644
@@ -258,6 +258,8 @@ static int st_rtc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, rtc);
 
 	rtc->rtc_dev->ops = &st_rtc_ops;
+	rtc->rtc_dev->range_max = U64_MAX;
+	do_div(rtc->rtc_dev->range_max, rtc->clkrate);
 
 	ret = rtc_register_device(rtc->rtc_dev);
 	if (ret) {
Signature · 1 line
2.17.0
Acked-by on v2 1/1
#1 lore raw

Hi Alexandre

Quoted 13 lines · Alexandre Belloni

The RTC has a 64 bit counter.

---
  drivers/rtc/rtc-st-lpc.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/rtc/rtc-st-lpc.c +0 -0
index 2f1ef2c28740..bee75ca7ff79 100644

drivers/rtc/rtc-st-lpc.c static int st_rtc_probe(struct platform_device *pdev) · line 265

Quoted 8 lines
drivers/rtc/rtc-st-lpc.c +2 -0
@@ -258,6 +258,8 @@ static int st_rtc_probe(struct platform_device *pdev)
  	platform_set_drvdata(pdev, rtc);
 
  	rtc->rtc_dev->ops = &st_rtc_ops;
+	rtc->rtc_dev->range_max = U64_MAX;
+	do_div(rtc->rtc_dev->range_max, rtc->clkrate);
 
  	ret = rtc_register_device(rtc->rtc_dev);
  	if (ret) {

Patrice