diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2021-10-18 17:19:31 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2021-10-18 17:20:50 +0200 |
commit | 0d20e9fb1262b1f9ac895b287db892bc75b05b84 (patch) | |
tree | 3d8e56cfa4e52674c2a8fbb0abb7c9b277676856 /include/uapi/linux | |
parent | a6d8c6e1a5c6fb982964861dc84c0c7cb0151c7c (diff) | |
download | linux-stable-0d20e9fb1262b1f9ac895b287db892bc75b05b84.tar.gz linux-stable-0d20e9fb1262b1f9ac895b287db892bc75b05b84.tar.bz2 linux-stable-0d20e9fb1262b1f9ac895b287db892bc75b05b84.zip |
rtc: add BSM parameter
BSM or Backup Switch Mode is a common feature on RTCs, allowing to select
how the RTC will decide when to switch from its primary power supply to the
backup power supply. It is necessary to be able to set it from userspace as
there are uses cases where it has to be done dynamically.
Supported values are:
RTC_BSM_DISABLED: disabled
RTC_BSM_DIRECT: switching will happen as soon as Vbackup > Vdd
RTC_BSM_LEVEL: switching will happen around a threshold, usually with an
hysteresis
RTC_BSM_STANDBY: switching will not happen until Vdd > Vbackup, this is
useful to ensure the RTC doesn't draw any power until the device is first
powered on.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211018151933.76865-6-alexandre.belloni@bootlin.com
Diffstat (limited to 'include/uapi/linux')
-rw-r--r-- | include/uapi/linux/rtc.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/uapi/linux/rtc.h b/include/uapi/linux/rtc.h index 5debe82439c2..03e5b776e597 100644 --- a/include/uapi/linux/rtc.h +++ b/include/uapi/linux/rtc.h @@ -132,11 +132,18 @@ struct rtc_param { #define RTC_FEATURE_ALARM_RES_2S 3 #define RTC_FEATURE_UPDATE_INTERRUPT 4 #define RTC_FEATURE_CORRECTION 5 -#define RTC_FEATURE_CNT 6 +#define RTC_FEATURE_BACKUP_SWITCH_MODE 6 +#define RTC_FEATURE_CNT 7 /* parameter list */ #define RTC_PARAM_FEATURES 0 #define RTC_PARAM_CORRECTION 1 +#define RTC_PARAM_BACKUP_SWITCH_MODE 2 + +#define RTC_BSM_DISABLED 0 +#define RTC_BSM_DIRECT 1 +#define RTC_BSM_LEVEL 2 +#define RTC_BSM_STANDBY 3 #define RTC_MAX_FREQ 8192 |