| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
 | 2 |  **************************************************************************** | 
 | 3 |  *** | 
 | 4 |  ***   This header was automatically generated from a Linux kernel header | 
 | 5 |  ***   of the same name, to make information necessary for userspace to | 
 | 6 |  ***   call into the kernel available to libc.  It contains only constants, | 
 | 7 |  ***   structures, and macros generated from the original header, and thus, | 
 | 8 |  ***   contains no copyrightable information. | 
 | 9 |  *** | 
 | 10 |  ***   To edit the content of this header, modify the corresponding | 
 | 11 |  ***   source file (e.g. under external/kernel-headers/original/) then | 
 | 12 |  ***   run bionic/libc/kernel/tools/update_all.py | 
 | 13 |  *** | 
 | 14 |  ***   Any manual change here will be lost the next time this script will | 
 | 15 |  ***   be run. You've been warned! | 
 | 16 |  *** | 
 | 17 |  **************************************************************************** | 
 | 18 |  ****************************************************************************/ | 
 | 19 | #ifndef _UAPI_LINUX_RTC_H_ | 
 | 20 | #define _UAPI_LINUX_RTC_H_ | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 21 | #include <linux/const.h> | 
 | 22 | #include <linux/ioctl.h> | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 23 | #include <linux/types.h> | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | struct rtc_time { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 25 |   int tm_sec; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 26 |   int tm_min; | 
 | 27 |   int tm_hour; | 
 | 28 |   int tm_mday; | 
 | 29 |   int tm_mon; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 30 |   int tm_year; | 
 | 31 |   int tm_wday; | 
 | 32 |   int tm_yday; | 
 | 33 |   int tm_isdst; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | }; | 
 | 35 | struct rtc_wkalrm { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 |   unsigned char enabled; | 
 | 37 |   unsigned char pending; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 |   struct rtc_time time; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | }; | 
 | 40 | struct rtc_pll_info { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 |   int pll_ctrl; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 42 |   int pll_value; | 
 | 43 |   int pll_max; | 
 | 44 |   int pll_min; | 
 | 45 |   int pll_posmult; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 |   int pll_negmult; | 
 | 47 |   long pll_clock; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | }; | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 49 | struct rtc_param { | 
 | 50 |   __u64 param; | 
 | 51 |   union { | 
 | 52 |     __u64 uvalue; | 
 | 53 |     __s64 svalue; | 
 | 54 |     __u64 ptr; | 
 | 55 |   }; | 
 | 56 |   __u32 index; | 
 | 57 |   __u32 __pad; | 
 | 58 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define RTC_AIE_ON _IO('p', 0x01) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | #define RTC_AIE_OFF _IO('p', 0x02) | 
 | 61 | #define RTC_UIE_ON _IO('p', 0x03) | 
 | 62 | #define RTC_UIE_OFF _IO('p', 0x04) | 
 | 63 | #define RTC_PIE_ON _IO('p', 0x05) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | #define RTC_PIE_OFF _IO('p', 0x06) | 
 | 65 | #define RTC_WIE_ON _IO('p', 0x0f) | 
 | 66 | #define RTC_WIE_OFF _IO('p', 0x10) | 
 | 67 | #define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | #define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time) | 
 | 69 | #define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time) | 
 | 70 | #define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time) | 
 | 71 | #define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | #define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) | 
 | 73 | #define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) | 
 | 74 | #define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) | 
 | 75 | #define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 76 | #define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm) | 
 | 77 | #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) | 
 | 78 | #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 79 | #define RTC_PARAM_GET _IOW('p', 0x13, struct rtc_param) | 
 | 80 | #define RTC_PARAM_SET _IOW('p', 0x14, struct rtc_param) | 
| Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 81 | #define RTC_VL_DATA_INVALID _BITUL(0) | 
 | 82 | #define RTC_VL_BACKUP_LOW _BITUL(1) | 
 | 83 | #define RTC_VL_BACKUP_EMPTY _BITUL(2) | 
 | 84 | #define RTC_VL_ACCURACY_LOW _BITUL(3) | 
| Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 85 | #define RTC_VL_BACKUP_SWITCH _BITUL(4) | 
| Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 86 | #define RTC_VL_READ _IOR('p', 0x13, unsigned int) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | #define RTC_VL_CLR _IO('p', 0x14) | 
 | 88 | #define RTC_IRQF 0x80 | 
 | 89 | #define RTC_PF 0x40 | 
 | 90 | #define RTC_AF 0x20 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 91 | #define RTC_UF 0x10 | 
| Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 92 | #define RTC_FEATURE_ALARM 0 | 
 | 93 | #define RTC_FEATURE_ALARM_RES_MINUTE 1 | 
 | 94 | #define RTC_FEATURE_NEED_WEEK_DAY 2 | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 95 | #define RTC_FEATURE_ALARM_RES_2S 3 | 
 | 96 | #define RTC_FEATURE_UPDATE_INTERRUPT 4 | 
 | 97 | #define RTC_FEATURE_CORRECTION 5 | 
 | 98 | #define RTC_FEATURE_BACKUP_SWITCH_MODE 6 | 
| Christopher Ferris | 5d36796 | 2022-05-25 13:36:15 -0700 | [diff] [blame^] | 99 | #define RTC_FEATURE_ALARM_WAKEUP_ONLY 7 | 
 | 100 | #define RTC_FEATURE_CNT 8 | 
| Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 101 | #define RTC_PARAM_FEATURES 0 | 
 | 102 | #define RTC_PARAM_CORRECTION 1 | 
 | 103 | #define RTC_PARAM_BACKUP_SWITCH_MODE 2 | 
 | 104 | #define RTC_BSM_DISABLED 0 | 
 | 105 | #define RTC_BSM_DIRECT 1 | 
 | 106 | #define RTC_BSM_LEVEL 2 | 
 | 107 | #define RTC_BSM_STANDBY 3 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 108 | #define RTC_MAX_FREQ 8192 | 
 | 109 | #endif |