summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-ds1685.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-31 11:56:43 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-31 23:02:11 +0200
commitc36b52ed18c2b3d84b26cf8bedca0f6649aeb2b8 (patch)
tree03a6b7a4be3fa1cc91b848581ba0bb0fe76cf916 /drivers/rtc/rtc-ds1685.c
parenta2ae8323a8e2c5668ae42493d925da1d68ff0324 (diff)
rtc: ds1685: Add range
Useful range is 2000-2099 because leap year fails on centuries. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-ds1685.c')
-rw-r--r--drivers/rtc/rtc-ds1685.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
index e6390475380f..5c0db6c8134c 100644
--- a/drivers/rtc/rtc-ds1685.c
+++ b/drivers/rtc/rtc-ds1685.c
@@ -2043,6 +2043,10 @@ ds1685_rtc_probe(struct platform_device *pdev)
rtc_dev->ops = &ds1685_rtc_ops;
+ /* Century bit is useless because leap year fails in 1900 and 2100 */
+ rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000;
+ rtc_dev->range_max = RTC_TIMESTAMP_END_2099;
+
/* Maximum periodic rate is 8192Hz (0.122070ms). */
rtc_dev->max_user_freq = RTC_MAX_USER_FREQ;