summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang@linaro.org>2018-01-08 09:04:50 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-03-17 16:20:55 +0300
commit989515647e783221f9737ed1cf519573d26ce99b (patch)
treed908376f5a2c6c0e4455dcb1ee26c3a99f4a342f /include/linux
parent4c4e5df1f346f70802bf4999de13d06dbbdf7a01 (diff)
downloadlinux-989515647e783221f9737ed1cf519573d26ce99b.tar.xz
rtc: Add one offset seconds to expand RTC range
From our investigation for all RTC drivers, 1 driver will be expired before year 2017, 7 drivers will be expired before year 2038, 23 drivers will be expired before year 2069, 72 drivers will be expired before 2100 and 104 drivers will be expired before 2106. Especially for these early expired drivers, we need to expand the RTC range to make the RTC can still work after the expired year. So we can expand the RTC range by adding one offset to the time when reading from hardware, and subtracting it when writing back. For example, if you have an RTC that can do 100 years, and currently is configured to be based in Jan 1 1970, so it can represents times from 1970 to 2069. Then if you change the start year from 1970 to 2000, which means it can represents times from 2000 to 2099. By adding or subtracting the offset produced by moving the wrap point, all times between 1970 and 1999 from RTC hardware could get interpreted as times from 2070 to 2099, but the interpretation of dates between 2000 and 2069 would not change. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/rtc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index c78528c394e5..82a3038f16ab 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -152,6 +152,9 @@ struct rtc_device {
time64_t range_min;
timeu64_t range_max;
+ time64_t start_secs;
+ time64_t offset_secs;
+ bool set_start_time;
#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
struct work_struct uie_task;