2 * This software is licensed under the terms of the GNU General Public
3 * License version 2, as published by the Free Software Foundation, and
4 * may be copied, distributed, and modified under those terms.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
13 * Definitions for CM36283 als/ps sensor chip.
18 #include <linux/ioctl.h>
20 /*cm36283 als/ps sensor register related macro*/
21 #define CM36283_REG_ALS_CONF 0X00
22 #define CM36283_REG_ALS_THDH 0X01
23 #define CM36283_REG_ALS_THDL 0X02
24 #define CM36283_REG_PS_CONF1_2 0X03
25 #define CM36283_REG_PS_CONF3_MS 0X04
26 #define CM36283_REG_PS_CANC 0X05
27 #define CM36283_REG_PS_THD 0X06
28 #define CM36283_REG_PS_DATA 0X08
29 #define CM36283_REG_ALS_DATA 0X09
30 #define CM36283_REG_INT_FLAG 0X0B
31 #define CM36283_REG_ID_MODE 0X0C
33 /*CM36283 related driver tag macro*/
34 #define CM36283_SUCCESS 0
35 #define CM36283_ERR_I2C -1
36 #define CM36283_ERR_STATUS -3
37 #define CM36283_ERR_SETUP_FAILURE -4
38 #define CM36283_ERR_GETGSENSORDATA -5
39 #define CM36283_ERR_IDENTIFICATION -6
41 /*----------------------------------------------------------------------------*/
43 CM36283_NOTIFY_PROXIMITY_CHANGE
= 1,
45 /*----------------------------------------------------------------------------*/
47 CM36283_CUST_ACTION_SET_CUST
= 1,
48 CM36283_CUST_ACTION_CLR_CALI
,
49 CM36283_CUST_ACTION_SET_CALI
,
50 CM36283_CUST_ACTION_SET_PS_THRESHODL
52 /*----------------------------------------------------------------------------*/
57 /*----------------------------------------------------------------------------*/
64 /*----------------------------------------------------------------------------*/
65 typedef CM36283_CUST CM36283_CLR_CALI
;
66 /*----------------------------------------------------------------------------*/
72 /*----------------------------------------------------------------------------*/
77 }CM36283_SET_PS_THRESHOLD
;
78 /*----------------------------------------------------------------------------*/
83 CM36283_SET_CUST setCust
;
84 CM36283_CLR_CALI clearCali
;
85 CM36283_SET_CALI setCali
;
86 CM36283_SET_PS_THRESHOLD setPSThreshold
;
88 /*----------------------------------------------------------------------------*/