lm3630_bl.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Simple driver for Texas Instruments LM3630 LED Flash driver chip
  3. * Copyright (C) 2012 Texas Instruments
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. */
  10. #ifndef __LINUX_LM3630_H
  11. #define __LINUX_LM3630_H
  12. #define LM3630_NAME "lm3630_bl"
  13. enum lm3630_pwm_ctrl {
  14. PWM_CTRL_DISABLE = 0,
  15. PWM_CTRL_BANK_A,
  16. PWM_CTRL_BANK_B,
  17. PWM_CTRL_BANK_ALL,
  18. };
  19. enum lm3630_pwm_active {
  20. PWM_ACTIVE_HIGH = 0,
  21. PWM_ACTIVE_LOW,
  22. };
  23. enum lm3630_bank_a_ctrl {
  24. BANK_A_CTRL_DISABLE = 0x0,
  25. BANK_A_CTRL_LED1 = 0x4,
  26. BANK_A_CTRL_LED2 = 0x1,
  27. BANK_A_CTRL_ALL = 0x5,
  28. };
  29. enum lm3630_bank_b_ctrl {
  30. BANK_B_CTRL_DISABLE = 0,
  31. BANK_B_CTRL_LED2,
  32. };
  33. struct lm3630_platform_data {
  34. /* maximum brightness */
  35. int max_brt_led1;
  36. int max_brt_led2;
  37. /* initial on brightness */
  38. int init_brt_led1;
  39. int init_brt_led2;
  40. enum lm3630_pwm_ctrl pwm_ctrl;
  41. enum lm3630_pwm_active pwm_active;
  42. enum lm3630_bank_a_ctrl bank_a_ctrl;
  43. enum lm3630_bank_b_ctrl bank_b_ctrl;
  44. unsigned int pwm_period;
  45. void (*pwm_set_intensity) (int brightness, int max_brightness);
  46. };
  47. #endif /* __LINUX_LM3630_H */