History

rtc: define RTC_VL_READ values

Currently, the meaning of the value returned by RTC_VL_READ is undocumented and left to the driver implementation. In order to get more meaningful values, define a set of values to use as to make clear to userspace what is the status of the various voltages feeding the RTC.

Alexandre Belloni committed 6 years ago

Commit 3431ca41 parent 3b520931 file · +6 −1Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/rtc.h+6−1
@@ -92,7 +92,12 @@ struct rtc_pll_info { · 91 unmodified lines
9292 #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */
9393 #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */
9494
95−#define RTC_VL_READ _IOR('p', 0x13, int) /* Voltage low detector */
95+#define RTC_VL_DATA_INVALID BIT(0) /* Voltage too low, RTC data is invalid */
96+#define RTC_VL_BACKUP_LOW BIT(1) /* Backup voltage is low */
97+#define RTC_VL_BACKUP_EMPTY BIT(2) /* Backup empty or not present */
98+#define RTC_VL_ACCURACY_LOW BIT(3) /* Voltage is low, RTC accuracy is reduced */
99+
100+#define RTC_VL_READ _IOR('p', 0x13, unsigned int) /* Voltage low detection */
96101 #define RTC_VL_CLR _IO('p', 0x14) /* Clear voltage low information */
97102
98103 /* interrupt flags */