summaryrefslogtreecommitdiff
path: root/include/linux/rtc.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2023-08-18 01:55:31 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2023-08-28 00:50:22 +0300
commit781589e40ac5f929f58824c15448e1ba49c3ac32 (patch)
treeb8d8345f185aab323dad6ea7089d4735604aea81 /include/linux/rtc.h
parentf45d32d2cd183c09b6c9aa8689a91d6f2760b557 (diff)
downloadlinux-781589e40ac5f929f58824c15448e1ba49c3ac32.tar.xz
rtc: Add support for limited alarm timer offsets
Some alarm timers are based on time offsets, not on absolute times. In some situations, the amount of time that can be scheduled in the future is limited. This may result in a refusal to suspend the system, causing substantial battery drain. Some RTC alarm drivers remedy the situation by setting the alarm time to the maximum supported time if a request for an out-of-range timeout is made. This is not really desirable since it may result in unexpected early wakeups. To reduce the impact of this problem, let RTC drivers report the maximum supported alarm timer offset. The code setting alarm timers can then decide if it wants to reject setting alarm timers to a larger value, if it wants to implement recurring alarms until the actually requested alarm time is met, or if it wants to accept the limited alarm time. Only introduce the necessary variable into struct rtc_device. Code to set and use the variable will follow with subsequent patches. Cc: Brian Norris <briannorris@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20230817225537.4053865-2-linux@roeck-us.net Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'include/linux/rtc.h')
-rw-r--r--include/linux/rtc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 1fd9c6a21ebe..4c0bcbeb1f00 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -146,6 +146,7 @@ struct rtc_device {
time64_t range_min;
timeu64_t range_max;
+ timeu64_t alarm_offset_max;
time64_t start_secs;
time64_t offset_secs;
bool set_start_time;