OSDN Git Service

rtc: ds1347: set range
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 7 Oct 2019 13:47:21 +0000 (15:47 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 7 Oct 2019 13:49:33 +0000 (15:49 +0200)
The DS1347 handle dates from year 0000 to 9999. Leap years are claimed to
be handled correctly in the datasheet.

Link: https://lore.kernel.org/r/20191007134724.15505-7-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ds1347.c

index 75c522c..22a75b0 100644 (file)
@@ -134,6 +134,8 @@ static int ds1347_probe(struct spi_device *spi)
                return PTR_ERR(rtc);
 
        rtc->ops = &ds1347_rtc_ops;
+       rtc->range_min = RTC_TIMESTAMP_BEGIN_0000;
+       rtc->range_max = RTC_TIMESTAMP_END_9999;
 
        return rtc_register_device(rtc);
 }