summaryrefslogtreecommitdiff
path: root/include/uapi/linux/rtc.h
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-11 00:17:36 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-01-16 23:19:26 +0100
commit7ae41220ef5831674f446baef19bfe1b31358260 (patch)
tree65a049a52e23e7d871a57b60b87b53a803900469 /include/uapi/linux/rtc.h
parent3be95d277484117f248b2f7e8cb8d14cb38dbb04 (diff)
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/uapi/linux/rtc.h')
-rw-r--r--include/uapi/linux/rtc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/uapi/linux/rtc.h b/include/uapi/linux/rtc.h
index fa9aff91cbf2..f950bff75e97 100644
--- a/include/uapi/linux/rtc.h
+++ b/include/uapi/linux/rtc.h
@@ -110,6 +110,11 @@ struct rtc_pll_info {
#define RTC_AF 0x20 /* Alarm interrupt */
#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
+/* feature list */
+#define RTC_FEATURE_ALARM 0
+#define RTC_FEATURE_ALARM_RES_MINUTE 1
+#define RTC_FEATURE_NEED_WEEK_DAY 2
+#define RTC_FEATURE_CNT 3
#define RTC_MAX_FREQ 8192