Skip to content

Commit

Permalink
rtc: ds1685: Add range
Browse files Browse the repository at this point in the history
Useful range is 2000-2099 because leap year fails on centuries.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
  • Loading branch information
Alexandre Belloni committed May 31, 2018
1 parent a2ae832 commit c36b52e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/rtc/rtc-ds1685.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c36b52e

Please sign in to comment.