3 * This software is licensed under the terms of the GNU General Public
4 * License version 2, as published by the Free Software Foundation, and
5 * may be copied, distributed, and modified under those terms.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
14 * Definitions for APDS9930 als/ps sensor chip.
16 #ifndef __APDS9930_H__
17 #define __APDS9930_H__
19 #include <linux/ioctl.h>
21 extern int APDS9930_CMM_PPCOUNT_VALUE
;
22 extern int APDS9930_CMM_CONTROL_VALUE
;
25 #define APDS9930_CMM_ENABLE 0X80
26 #define APDS9930_CMM_ATIME 0X81
27 #define APDS9930_CMM_PTIME 0X82
28 #define APDS9930_CMM_WTIME 0X83
29 /*for interrup work mode support -- by liaoxl.lenovo 12.08.2011*/
30 #define APDS9930_CMM_INT_LOW_THD_LOW 0X88
31 #define APDS9930_CMM_INT_LOW_THD_HIGH 0X89
32 #define APDS9930_CMM_INT_HIGH_THD_LOW 0X8A
33 #define APDS9930_CMM_INT_HIGH_THD_HIGH 0X8B
34 #define APDS9930_CMM_Persistence 0X8C
35 #define APDS9930_CMM_STATUS 0X93
36 #define TAOS_TRITON_CMD_REG 0X80
37 #define TAOS_TRITON_CMD_SPL_FN 0x60
39 #define APDS9930_CMM_CONFIG 0X8D
40 #define APDS9930_CMM_PPCOUNT 0X8E
41 #define APDS9930_CMM_CONTROL 0X8F
43 #define APDS9930_CMM_PDATA_L 0X98
44 #define APDS9930_CMM_PDATA_H 0X99
45 #define APDS9930_CMM_C0DATA_L 0X94
46 #define APDS9930_CMM_C0DATA_H 0X95
47 #define APDS9930_CMM_C1DATA_L 0X96
48 #define APDS9930_CMM_C1DATA_H 0X97
51 #define APDS9930_SUCCESS 0
52 #define APDS9930_ERR_I2C -1
53 #define APDS9930_ERR_STATUS -3
54 #define APDS9930_ERR_SETUP_FAILURE -4
55 #define APDS9930_ERR_GETGSENSORDATA -5
56 #define APDS9930_ERR_IDENTIFICATION -6