Commit | Line | Data |
---|---|---|
6fa3eb70 S |
1 | /* |
2 | * | |
3 | * (C) Copyright 2008 | |
4 | * MediaTek <www.mediatek.com> | |
5 | * | |
6 | * Sensors IO command file for MT6516 | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | */ | |
22 | #ifndef SENSORS_IO_H | |
23 | #define SENSORS_IO_H | |
24 | ||
25 | #include <linux/ioctl.h> | |
26 | ||
27 | typedef struct { | |
28 | unsigned short x; /**< X axis */ | |
29 | unsigned short y; /**< Y axis */ | |
30 | unsigned short z; /**< Z axis */ | |
31 | } GSENSOR_VECTOR3D; | |
32 | ||
33 | typedef struct { | |
34 | int x; | |
35 | int y; | |
36 | int z; | |
37 | } SENSOR_DATA; | |
38 | ||
39 | ||
40 | #define GSENSOR 0x85 | |
41 | #define GSENSOR_IOCTL_INIT _IO(GSENSOR, 0x01) | |
42 | #define GSENSOR_IOCTL_READ_CHIPINFO _IOR(GSENSOR, 0x02, int) | |
43 | #define GSENSOR_IOCTL_READ_SENSORDATA _IOR(GSENSOR, 0x03, int) | |
44 | #define GSENSOR_IOCTL_READ_OFFSET _IOR(GSENSOR, 0x04, GSENSOR_VECTOR3D) | |
45 | #define GSENSOR_IOCTL_READ_GAIN _IOR(GSENSOR, 0x05, GSENSOR_VECTOR3D) | |
46 | #define GSENSOR_IOCTL_READ_RAW_DATA _IOR(GSENSOR, 0x06, int) | |
47 | #define GSENSOR_IOCTL_SET_CALI _IOW(GSENSOR, 0x06, SENSOR_DATA) | |
48 | #define GSENSOR_IOCTL_GET_CALI _IOW(GSENSOR, 0x07, SENSOR_DATA) | |
49 | #define GSENSOR_IOCTL_CLR_CALI _IO(GSENSOR, 0x08) | |
50 | ||
51 | ||
52 | /* mCube add start */ | |
53 | /* G-sensor */ | |
54 | ||
55 | #define GSENSOR_MCUBE_IOCTL_READ_RBM_DATA _IOR(GSENSOR, 0x09, SENSOR_DATA) | |
56 | #define GSENSOR_MCUBE_IOCTL_SET_RBM_MODE _IO(GSENSOR, 0x0a) | |
57 | #define GSENSOR_MCUBE_IOCTL_CLEAR_RBM_MODE _IO(GSENSOR, 0x0b) | |
58 | #define GSENSOR_MCUBE_IOCTL_SET_CALI _IOW(GSENSOR, 0x0c, SENSOR_DATA) | |
59 | #define GSENSOR_MCUBE_IOCTL_REGISTER_MAP _IO(GSENSOR, 0x0d) | |
60 | #define GSENSOR_IOCTL_SET_CALI_MODE _IOW(GSENSOR, 0x0e, int) | |
61 | #define GSENSOR_MCUBE_IOCTL_READ_PRODUCT_ID _IOR(GSENSOR, 0x0f, int) | |
62 | #define GSENSOR_MCUBE_IOCTL_READ_FILEPATH _IOR(GSENSOR, 0x10, char[256]) | |
63 | #define GSENSOR_MCUBE_IOCTL_VIRTUAL_Z _IOR(GSENSOR, 0x11, int) | |
64 | #define GSENSOR_MCUBE_IOCTL_READ_PCODE _IOR(GSENSOR, 0x12, char) | |
65 | #define GSENSOR_MCUBE_IOCTL_GET_OFLAG _IOR(GSENSOR, 0x13, short) | |
66 | ||
67 | ||
68 | /* IOCTLs for Msensor misc. device library */ | |
69 | #define MSENSOR 0x83 | |
70 | #define MSENSOR_IOCTL_INIT _IO(MSENSOR, 0x01) | |
71 | #define MSENSOR_IOCTL_READ_CHIPINFO _IOR(MSENSOR, 0x02, int) | |
72 | #define MSENSOR_IOCTL_READ_SENSORDATA _IOR(MSENSOR, 0x03, int) | |
73 | #define MSENSOR_IOCTL_READ_POSTUREDATA _IOR(MSENSOR, 0x04, int) | |
74 | #define MSENSOR_IOCTL_READ_CALIDATA _IOR(MSENSOR, 0x05, int) | |
75 | #define MSENSOR_IOCTL_READ_CONTROL _IOR(MSENSOR, 0x06, int) | |
76 | #define MSENSOR_IOCTL_SET_CONTROL _IOW(MSENSOR, 0x07, int) | |
77 | #define MSENSOR_IOCTL_SET_MODE _IOW(MSENSOR, 0x08, int) | |
78 | #define MSENSOR_IOCTL_SET_POSTURE _IOW(MSENSOR, 0x09, int) | |
79 | #define MSENSOR_IOCTL_SET_CALIDATA _IOW(MSENSOR, 0x0a, int) | |
80 | #define MSENSOR_IOCTL_SENSOR_ENABLE _IOW(MSENSOR, 0x51, int) | |
81 | #define MSENSOR_IOCTL_READ_FACTORY_SENSORDATA _IOW(MSENSOR, 0x52, int) | |
82 | ||
83 | ||
84 | /* IOCTLs for AKM library */ | |
85 | #define ECS_IOCTL_WRITE _IOW(MSENSOR, 0x0b, char*) | |
86 | #define ECS_IOCTL_READ _IOWR(MSENSOR, 0x0c, char*) | |
87 | #define ECS_IOCTL_RESET _IO(MSENSOR, 0x0d) /* NOT used in AK8975 */ | |
88 | #define ECS_IOCTL_SET_MODE _IOW(MSENSOR, 0x0e, short) | |
89 | #define ECS_IOCTL_GETDATA _IOR(MSENSOR, 0x0f, char[SENSOR_DATA_SIZE]) | |
90 | #define ECS_IOCTL_SET_YPR _IOW(MSENSOR, 0x10, short[12]) | |
91 | #define ECS_IOCTL_GET_OPEN_STATUS _IOR(MSENSOR, 0x11, int) | |
92 | #define ECS_IOCTL_GET_CLOSE_STATUS _IOR(MSENSOR, 0x12, int) | |
93 | #define ECS_IOCTL_GET_OSENSOR_STATUS _IOR(MSENSOR, 0x13, int) | |
94 | #define ECS_IOCTL_GET_DELAY _IOR(MSENSOR, 0x14, short) | |
95 | #define ECS_IOCTL_GET_PROJECT_NAME _IOR(MSENSOR, 0x15, char[64]) | |
96 | #define ECS_IOCTL_GET_MATRIX _IOR(MSENSOR, 0x16, short [4][3][3]) | |
97 | #define ECS_IOCTL_GET_LAYOUT _IOR(MSENSOR, 0x17, int[3]) | |
98 | ||
99 | #define ECS_IOCTL_GET_OUTBIT _IOR(MSENSOR, 0x23, char) | |
100 | #define ECS_IOCTL_GET_ACCEL _IOR(MSENSOR, 0x24, short[3]) | |
101 | #define MMC31XX_IOC_RM _IO(MSENSOR, 0x25) | |
102 | #define MMC31XX_IOC_RRM _IO(MSENSOR, 0x26) | |
103 | /* IOCTLs for akm09911 device */ | |
104 | #define ECS_IOCTL_GET_INFO _IOR(MSENSOR, 0x27, unsigned char[AKM_SENSOR_INFO_SIZE]) | |
105 | #define ECS_IOCTL_GET_CONF _IOR(MSENSOR, 0x28, unsigned char[AKM_SENSOR_CONF_SIZE]) | |
106 | #define ECS_IOCTL_SET_YPR_09911 _IOW(MSENSOR, 0x29, int[26]) | |
107 | #define ECS_IOCTL_GET_DELAY_09911 _IOR(MSENSOR, 0x30, int64_t[3]) | |
108 | #define ECS_IOCTL_GET_LAYOUT_09911 _IOR(MSENSOR, 0x31, char) | |
109 | ||
110 | /* IOCTLs for MMC31XX device */ | |
111 | #define MMC31XX_IOC_TM _IO(MSENSOR, 0x18) | |
112 | #define MMC31XX_IOC_SET _IO(MSENSOR, 0x19) | |
113 | #define MMC31XX_IOC_RESET _IO(MSENSOR, 0x1a) | |
114 | #define MMC31XX_IOC_READ _IOR(MSENSOR, 0x1b, int[3]) | |
115 | #define MMC31XX_IOC_READXYZ _IOR(MSENSOR, 0x1c, int[3]) | |
116 | ||
117 | #define ECOMPASS_IOC_GET_DELAY _IOR(MSENSOR, 0x1d, int) | |
118 | #define ECOMPASS_IOC_GET_MFLAG _IOR(MSENSOR, 0x1e, short) | |
119 | #define ECOMPASS_IOC_GET_OFLAG _IOR(MSENSOR, 0x1f, short) | |
120 | #define ECOMPASS_IOC_GET_OPEN_STATUS _IOR(MSENSOR, 0x20, int) | |
121 | #define ECOMPASS_IOC_SET_YPR _IOW(MSENSOR, 0x21, int[12]) | |
122 | #define ECOMPASS_IOC_GET_LAYOUT _IOR(MSENSOR, 0X22, int) | |
123 | ||
124 | ||
125 | ||
126 | ||
127 | #define ALSPS 0X84 | |
128 | #define ALSPS_SET_PS_MODE _IOW(ALSPS, 0x01, int) | |
129 | #define ALSPS_GET_PS_MODE _IOR(ALSPS, 0x02, int) | |
130 | #define ALSPS_GET_PS_DATA _IOR(ALSPS, 0x03, int) | |
131 | #define ALSPS_GET_PS_RAW_DATA _IOR(ALSPS, 0x04, int) | |
132 | #define ALSPS_SET_ALS_MODE _IOW(ALSPS, 0x05, int) | |
133 | #define ALSPS_GET_ALS_MODE _IOR(ALSPS, 0x06, int) | |
134 | #define ALSPS_GET_ALS_DATA _IOR(ALSPS, 0x07, int) | |
135 | #define ALSPS_GET_ALS_RAW_DATA _IOR(ALSPS, 0x08, int) | |
136 | /*-------------------yucong add-------------------------------------------*/ | |
137 | #define ALSPS_GET_PS_TEST_RESULT _IOR(ALSPS, 0x09, int) | |
138 | #define ALSPS_GET_ALS_TEST_RESULT _IOR(ALSPS, 0x0A, int) | |
139 | #define ALSPS_GET_PS_THRESHOLD_HIGH _IOR(ALSPS, 0x0B, int) | |
140 | #define ALSPS_GET_PS_THRESHOLD_LOW _IOR(ALSPS, 0x0C, int) | |
141 | #define ALSPS_GET_ALS_THRESHOLD_HIGH _IOR(ALSPS, 0x0D, int) | |
142 | #define ALSPS_GET_ALS_THRESHOLD_LOW _IOR(ALSPS, 0x0E, int) | |
143 | #define ALSPS_IOCTL_CLR_CALI _IOW(ALSPS, 0x0F, int) | |
144 | #define ALSPS_IOCTL_GET_CALI _IOR(ALSPS, 0x10, int) | |
145 | #define ALSPS_IOCTL_SET_CALI _IOW(ALSPS, 0x11, int) | |
146 | #define ALSPS_SET_PS_THRESHOLD _IOW(ALSPS, 0x12, int) | |
147 | #define ALSPS_SET_ALS_THRESHOLD _IOW(ALSPS, 0x13, int) | |
148 | #define AAL_SET_ALS_MODE _IOW(ALSPS, 0x14,int) | |
149 | #define AAL_GET_ALS_MODE _IOR(ALSPS, 0x15,int) | |
150 | #define AAL_GET_ALS_DATA _IOR(ALSPS, 0x16,int) | |
151 | ||
152 | ||
153 | #define GYROSCOPE 0X86 | |
154 | #define GYROSCOPE_IOCTL_INIT _IO(GYROSCOPE, 0x01) | |
155 | #define GYROSCOPE_IOCTL_SMT_DATA _IOR(GYROSCOPE, 0x02, int) | |
156 | #define GYROSCOPE_IOCTL_READ_SENSORDATA _IOR(GYROSCOPE, 0x03, int) | |
157 | #define GYROSCOPE_IOCTL_SET_CALI _IOW(GYROSCOPE, 0x04, SENSOR_DATA) | |
158 | #define GYROSCOPE_IOCTL_GET_CALI _IOW(GYROSCOPE, 0x05, SENSOR_DATA) | |
159 | #define GYROSCOPE_IOCTL_CLR_CALI _IO(GYROSCOPE, 0x06) | |
160 | #define GYROSCOPE_IOCTL_READ_SENSORDATA_RAW _IOR(GYROSCOPE, 0x07, int) | |
161 | #define GYROSCOPE_IOCTL_READ_TEMPERATURE _IOR(GYROSCOPE, 0x08, int) | |
162 | #define GYROSCOPE_IOCTL_GET_POWER_STATUS _IOR(GYROSCOPE, 0x09, int) | |
163 | ||
164 | #define BROMETER 0X87 | |
165 | #define BAROMETER_IOCTL_INIT _IO(BROMETER, 0x01) | |
166 | #define BAROMETER_GET_PRESS_DATA _IOR(BROMETER, 0x02, int) | |
167 | #define BAROMETER_GET_TEMP_DATA _IOR(BROMETER, 0x03, int) | |
168 | #define BAROMETER_IOCTL_READ_CHIPINFO _IOR(BROMETER, 0x04, int) | |
169 | ||
170 | ||
171 | ||
172 | ||
173 | #endif |