Merge tag 'v3.10.55' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / tcl8127_c_mlc / alsps / inc / cust_alsps.h
1 #ifndef __CUST_ALSPS_H__
2 #define __CUST_ALSPS_H__
3
4 #include <linux/types.h>
5
6 #define C_CUST_ALS_LEVEL 16
7 #define C_CUST_I2C_ADDR_NUM 4
8
9 #define MAX_THRESHOLD_HIGH 0xffff
10 #define MIN_THRESHOLD_LOW 0x0
11
12 struct alsps_hw {
13 int i2c_num; /*!< the i2c bus used by ALS/PS */
14 int power_id; /*!< the VDD power id of the als chip */
15 int power_vol; /*!< the VDD power voltage of the als chip */
16 int polling_mode; /*!< 1: polling mode ; 0:interrupt mode*/
17 int polling_mode_ps; /*!< 1: polling mode ; 0:interrupt mode*/
18 int polling_mode_als; /*!< 1: polling mode ; 0:interrupt mode*/
19 unsigned char i2c_addr[C_CUST_I2C_ADDR_NUM]; /*!< i2c address list, some chip will have multiple address */
20 unsigned int als_level[C_CUST_ALS_LEVEL-1]; /*!< (C_CUST_ALS_LEVEL-1) levels divides all range into C_CUST_ALS_LEVEL levels*/
21 unsigned int als_value[C_CUST_ALS_LEVEL]; /*!< the value reported in each level */
22 unsigned int ps_threshold; /*!< the threshold of proximity sensor */
23 unsigned int als_window_loss; /*!< the window loss */
24 unsigned int ps_threshold_high;
25 unsigned int ps_threshold_low;
26 unsigned int als_threshold_high;
27 unsigned int als_threshold_low;
28 int als_power_vio_id; /*!< the VIO power id of the als chip */
29 int als_power_vio_vol; /*!< the VIO power voltage of the als chip */
30 int ps_power_vdd_id; /*!< the VDD power id of the ps chip */
31 int ps_power_vdd_vol; /*!< the VDD power voltage of the ps chip */
32 int ps_power_vio_id; /*!< the VIO power id of the ps chip */
33 int ps_power_vio_vol; /*!< the VIO power voltage of the ps chip */
34 int power_lp_mode_ctrl; /*!< 1: disable ldo low power mode when p sensor enabled ; 0: no action*/
35 bool is_batch_supported_ps;
36 bool is_batch_supported_als;
37 };
38
39 extern struct alsps_hw* get_cust_alsps_hw(void);
40
41 __weak int pmic_ldo_suspend_enable(int enable);
42 #endif