cust_alsps.h 2.2 KB

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