diff options
author | 2021-01-11 00:17:36 +0100 | |
---|---|---|
committer | 2021-01-16 23:19:26 +0100 | |
commit | 7ae41220ef5831674f446baef19bfe1b31358260 (patch) | |
tree | 65a049a52e23e7d871a57b60b87b53a803900469 /include/linux/rtc.h | |
parent | rtc: s5m: check the return value of s5m8767_rtc_init_reg() (diff) | |
download | linux-7ae41220ef5831674f446baef19bfe1b31358260.tar.gz linux-7ae41220ef5831674f446baef19bfe1b31358260.tar.bz2 linux-7ae41220ef5831674f446baef19bfe1b31358260.zip |
rtc: introduce features bitfield
Introduce a bitfield to allow the drivers to announce the available
features for an RTC.
The main use case would be to better handle alarms, that could be present
or not or have a minute resolution or may need a correct week day to be set.
Use the newly introduced RTC_FEATURE_ALARM bit to then test whether alarms
are available instead of relying on the presence of ops->set_alarm.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210110231752.1418816-2-alexandre.belloni@bootlin.com
Diffstat (limited to 'include/linux/rtc.h')
-rw-r--r-- | include/linux/rtc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 568909449c13..bd611e26291d 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -141,6 +141,8 @@ struct rtc_device { */ unsigned long set_offset_nsec; + unsigned long features[BITS_TO_LONGS(RTC_FEATURE_CNT)]; + time64_t range_min; timeu64_t range_max; time64_t start_secs; |