blob: 7f38483f9b9dec1fdc21bf28190cf31a4b7e57d8 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 Ferrisaf09c702020-06-01 20:29:29 -070021#include <linux/const.h>
22#include <linux/ioctl.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023struct rtc_time {
Tao Baod7db5942015-01-28 10:07:51 -080024 int tm_sec;
Tao Baod7db5942015-01-28 10:07:51 -080025 int tm_min;
26 int tm_hour;
27 int tm_mday;
28 int tm_mon;
Tao Baod7db5942015-01-28 10:07:51 -080029 int tm_year;
30 int tm_wday;
31 int tm_yday;
32 int tm_isdst;
Ben Cheng655a7c02013-10-16 16:09:24 -070033};
34struct rtc_wkalrm {
Tao Baod7db5942015-01-28 10:07:51 -080035 unsigned char enabled;
36 unsigned char pending;
Tao Baod7db5942015-01-28 10:07:51 -080037 struct rtc_time time;
Ben Cheng655a7c02013-10-16 16:09:24 -070038};
39struct rtc_pll_info {
Tao Baod7db5942015-01-28 10:07:51 -080040 int pll_ctrl;
Tao Baod7db5942015-01-28 10:07:51 -080041 int pll_value;
42 int pll_max;
43 int pll_min;
44 int pll_posmult;
Tao Baod7db5942015-01-28 10:07:51 -080045 int pll_negmult;
46 long pll_clock;
Ben Cheng655a7c02013-10-16 16:09:24 -070047};
48#define RTC_AIE_ON _IO('p', 0x01)
Ben Cheng655a7c02013-10-16 16:09:24 -070049#define RTC_AIE_OFF _IO('p', 0x02)
50#define RTC_UIE_ON _IO('p', 0x03)
51#define RTC_UIE_OFF _IO('p', 0x04)
52#define RTC_PIE_ON _IO('p', 0x05)
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define RTC_PIE_OFF _IO('p', 0x06)
54#define RTC_WIE_ON _IO('p', 0x0f)
55#define RTC_WIE_OFF _IO('p', 0x10)
56#define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time)
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time)
58#define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time)
59#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time)
60#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long)
Ben Cheng655a7c02013-10-16 16:09:24 -070061#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long)
62#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long)
63#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long)
64#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)
66#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info)
67#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info)
Christopher Ferrisaf09c702020-06-01 20:29:29 -070068#define RTC_VL_DATA_INVALID _BITUL(0)
69#define RTC_VL_BACKUP_LOW _BITUL(1)
70#define RTC_VL_BACKUP_EMPTY _BITUL(2)
71#define RTC_VL_ACCURACY_LOW _BITUL(3)
Christopher Ferris8177cdf2020-08-03 11:53:55 -070072#define RTC_VL_BACKUP_SWITCH _BITUL(4)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070073#define RTC_VL_READ _IOR('p', 0x13, unsigned int)
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define RTC_VL_CLR _IO('p', 0x14)
75#define RTC_IRQF 0x80
76#define RTC_PF 0x40
77#define RTC_AF 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -070078#define RTC_UF 0x10
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070079#define RTC_FEATURE_ALARM 0
80#define RTC_FEATURE_ALARM_RES_MINUTE 1
81#define RTC_FEATURE_NEED_WEEK_DAY 2
82#define RTC_FEATURE_CNT 3
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define RTC_MAX_FREQ 8192
84#endif