Skip to content

Commit ca03b7a

Browse files
Villemoesalexandrebelloni
authored andcommitted
rtc: isl12022: specify range_min and range_max
The isl12022 can (only) keep track of times in the range 2000-2099. The data sheet says The calendar registers track date, month, year, and day of the week and are accurate through 2099, with automatic leap year correction. The lower bound of 2000 is obtained by simply observing that its YR register only counts from 00 through 99. Signed-off-by: Rasmus Villemoes <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent a35a2ad commit ca03b7a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/rtc/rtc-isl12022.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ static int isl12022_probe(struct i2c_client *client)
251251
return PTR_ERR(isl12022->rtc);
252252

253253
isl12022->rtc->ops = &isl12022_rtc_ops;
254+
isl12022->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
255+
isl12022->rtc->range_max = RTC_TIMESTAMP_END_2099;
254256

255257
return devm_rtc_register_device(isl12022->rtc);
256258
}

0 commit comments

Comments
 (0)