blob: 3871f66a7bd8e50b73f7d1e6113acbc10b268046 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_LINUX_RTC_H_
8#define _UAPI_LINUX_RTC_H_
Christopher Ferrisaf09c702020-06-01 20:29:29 -07009#include <linux/const.h>
10#include <linux/ioctl.h>
Christopher Ferrisa4792612022-01-10 13:51:15 -080011#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070012struct rtc_time {
Tao Baod7db5942015-01-28 10:07:51 -080013 int tm_sec;
Tao Baod7db5942015-01-28 10:07:51 -080014 int tm_min;
15 int tm_hour;
16 int tm_mday;
17 int tm_mon;
Tao Baod7db5942015-01-28 10:07:51 -080018 int tm_year;
19 int tm_wday;
20 int tm_yday;
21 int tm_isdst;
Ben Cheng655a7c02013-10-16 16:09:24 -070022};
23struct rtc_wkalrm {
Tao Baod7db5942015-01-28 10:07:51 -080024 unsigned char enabled;
25 unsigned char pending;
Tao Baod7db5942015-01-28 10:07:51 -080026 struct rtc_time time;
Ben Cheng655a7c02013-10-16 16:09:24 -070027};
28struct rtc_pll_info {
Tao Baod7db5942015-01-28 10:07:51 -080029 int pll_ctrl;
Tao Baod7db5942015-01-28 10:07:51 -080030 int pll_value;
31 int pll_max;
32 int pll_min;
33 int pll_posmult;
Tao Baod7db5942015-01-28 10:07:51 -080034 int pll_negmult;
35 long pll_clock;
Ben Cheng655a7c02013-10-16 16:09:24 -070036};
Christopher Ferrisa4792612022-01-10 13:51:15 -080037struct rtc_param {
38 __u64 param;
39 union {
40 __u64 uvalue;
41 __s64 svalue;
42 __u64 ptr;
43 };
44 __u32 index;
45 __u32 __pad;
46};
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define RTC_AIE_ON _IO('p', 0x01)
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define RTC_AIE_OFF _IO('p', 0x02)
49#define RTC_UIE_ON _IO('p', 0x03)
50#define RTC_UIE_OFF _IO('p', 0x04)
51#define RTC_PIE_ON _IO('p', 0x05)
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define RTC_PIE_OFF _IO('p', 0x06)
53#define RTC_WIE_ON _IO('p', 0x0f)
54#define RTC_WIE_OFF _IO('p', 0x10)
55#define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time)
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time)
57#define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time)
58#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time)
59#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long)
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long)
61#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long)
62#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long)
63#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)
65#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info)
66#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info)
Christopher Ferrisa4792612022-01-10 13:51:15 -080067#define RTC_PARAM_GET _IOW('p', 0x13, struct rtc_param)
68#define RTC_PARAM_SET _IOW('p', 0x14, struct rtc_param)
Christopher Ferrisaf09c702020-06-01 20:29:29 -070069#define RTC_VL_DATA_INVALID _BITUL(0)
70#define RTC_VL_BACKUP_LOW _BITUL(1)
71#define RTC_VL_BACKUP_EMPTY _BITUL(2)
72#define RTC_VL_ACCURACY_LOW _BITUL(3)
Christopher Ferris8177cdf2020-08-03 11:53:55 -070073#define RTC_VL_BACKUP_SWITCH _BITUL(4)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070074#define RTC_VL_READ _IOR('p', 0x13, unsigned int)
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define RTC_VL_CLR _IO('p', 0x14)
76#define RTC_IRQF 0x80
77#define RTC_PF 0x40
78#define RTC_AF 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define RTC_UF 0x10
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070080#define RTC_FEATURE_ALARM 0
81#define RTC_FEATURE_ALARM_RES_MINUTE 1
82#define RTC_FEATURE_NEED_WEEK_DAY 2
Christopher Ferrisa4792612022-01-10 13:51:15 -080083#define RTC_FEATURE_ALARM_RES_2S 3
84#define RTC_FEATURE_UPDATE_INTERRUPT 4
85#define RTC_FEATURE_CORRECTION 5
86#define RTC_FEATURE_BACKUP_SWITCH_MODE 6
Christopher Ferris10a76e62022-06-08 13:31:52 -070087#define RTC_FEATURE_ALARM_WAKEUP_ONLY 7
88#define RTC_FEATURE_CNT 8
Christopher Ferrisa4792612022-01-10 13:51:15 -080089#define RTC_PARAM_FEATURES 0
90#define RTC_PARAM_CORRECTION 1
91#define RTC_PARAM_BACKUP_SWITCH_MODE 2
92#define RTC_BSM_DISABLED 0
93#define RTC_BSM_DIRECT 1
94#define RTC_BSM_LEVEL 2
95#define RTC_BSM_STANDBY 3
Ben Cheng655a7c02013-10-16 16:09:24 -070096#define RTC_MAX_FREQ 8192
97#endif