cust_leds.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef _CUST_LEDS_H
  2. #define _CUST_LEDS_H
  3. #include <platform/mt_typedefs.h>
  4. enum mt65xx_led_type
  5. {
  6. MT65XX_LED_TYPE_RED = 0,
  7. MT65XX_LED_TYPE_GREEN,
  8. MT65XX_LED_TYPE_BLUE,
  9. MT65XX_LED_TYPE_JOGBALL,
  10. MT65XX_LED_TYPE_KEYBOARD,
  11. MT65XX_LED_TYPE_BUTTON,
  12. MT65XX_LED_TYPE_LCD,
  13. MT65XX_LED_TYPE_TOTAL,
  14. };
  15. enum mt65xx_led_mode
  16. {
  17. MT65XX_LED_MODE_NONE,
  18. MT65XX_LED_MODE_PWM,
  19. MT65XX_LED_MODE_GPIO,
  20. MT65XX_LED_MODE_PMIC,
  21. MT65XX_LED_MODE_CUST,
  22. MT65XX_LED_MODE_CUST_LCM,
  23. MT65XX_LED_MODE_CUST_BLS_PWM
  24. };
  25. enum mt65xx_led_pmic
  26. {
  27. MT65XX_LED_PMIC_BUTTON=0,
  28. MT65XX_LED_PMIC_LCD,
  29. MT65XX_LED_PMIC_LCD_ISINK,
  30. MT65XX_LED_PMIC_LCD_BOOST,
  31. MT65XX_LED_PMIC_NLED_ISINK4,
  32. MT65XX_LED_PMIC_NLED_ISINK5,
  33. MT65XX_LED_PMIC_NLED_ISINK0,
  34. MT65XX_LED_PMIC_NLED_ISINK1,
  35. MT65XX_LED_PMIC_NLED_ISINK2,
  36. MT65XX_LED_PMIC_NLED_ISINK3,
  37. MT65XX_LED_PMIC_NLED_ISINK01
  38. };
  39. typedef int (*cust_brightness_set)(int level);
  40. struct PWM_config
  41. {
  42. int clock_source;
  43. int div;
  44. int low_duration;
  45. int High_duration;
  46. BOOL pmic_pad;
  47. };
  48. /*
  49. * name : must the same as lights HAL
  50. * mode : control mode
  51. * data :
  52. * PWM: pwm number
  53. * GPIO: gpio id
  54. * PMIC: enum mt65xx_led_pmic
  55. * CUST: custom set brightness function pointer
  56. */
  57. struct cust_mt65xx_led {
  58. char *name;
  59. enum mt65xx_led_mode mode;
  60. int data;
  61. struct PWM_config config_data;
  62. };
  63. extern struct cust_mt65xx_led *get_cust_led_list(void);
  64. extern enum led_brightness get_cust_led_default_level(void);
  65. #endif