rtc: Add RTC range

Add a way for drivers to inform the core of the supported date/time range.
The core can then check whether the date/time or alarm is in the range
before calling ->set_time, ->set_mmss or ->set_alarm. It returns -ERANGE
when the time is out of range.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Alexandre Belloni
2018-02-17 14:58:40 +01:00
parent 236b718703
commit 71db049e73
4 changed files with 37 additions and 0 deletions

View File

@@ -43,6 +43,14 @@ Contact: linux-rtc@vger.kernel.org
Description:
(RO) The name of the RTC corresponding to this sysfs directory
What: /sys/class/rtc/rtcX/range
Date: January 2018
KernelVersion: 4.16
Contact: linux-rtc@vger.kernel.org
Description:
Valid time range for the RTC, as seconds from epoch, formatted
as [min, max]
What: /sys/class/rtc/rtcX/since_epoch
Date: March 2006
KernelVersion: 2.6.17