summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-da9063.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-21 11:15:56 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-04 10:07:10 +0200
commit5ff404d1496e131f2fccc100cfc153ee2b34b4d3 (patch)
tree02ce1d13ab24ef8b935df4551c00ac88a064e7f9 /drivers/rtc/rtc-da9063.c
parent64bef02c92fa16c9f1d1d1770154f4d74b8f04a0 (diff)
downloadlinux-stable-5ff404d1496e131f2fccc100cfc153ee2b34b4d3.tar.gz
linux-stable-5ff404d1496e131f2fccc100cfc153ee2b34b4d3.tar.bz2
linux-stable-5ff404d1496e131f2fccc100cfc153ee2b34b4d3.zip
rtc: da9063: set range
The DA9062 and DA9063 have a year register that can go up to 0x3F. Acked-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-da9063.c')
-rw-r--r--drivers/rtc/rtc-da9063.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
index 73b38d207d7e..b7052156e851 100644
--- a/drivers/rtc/rtc-da9063.c
+++ b/drivers/rtc/rtc-da9063.c
@@ -464,11 +464,14 @@ static int da9063_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rtc);
- rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, DA9063_DRVNAME_RTC,
- &da9063_rtc_ops, THIS_MODULE);
+ rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc->rtc_dev))
return PTR_ERR(rtc->rtc_dev);
+ rtc->rtc_dev->ops = &da9063_rtc_ops;
+ rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000;
+ rtc->rtc_dev->range_max = RTC_TIMESTAMP_END_2063;
+
da9063_data_to_tm(data, &rtc->alarm_time, rtc);
rtc->rtc_sync = false;
@@ -481,7 +484,7 @@ static int da9063_rtc_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Failed to request ALARM IRQ %d: %d\n",
irq_alarm, ret);
- return ret;
+ return rtc_register_device(rtc->rtc_dev);
}
static struct platform_driver da9063_rtc_driver = {