lm3630a_bl.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Simple driver for Texas Instruments LM3630A 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_LM3630A_H
  11. #define __LINUX_LM3630A_H
  12. #define LM3630A_NAME "lm3630a_bl"
  13. enum lm3630a_pwm_ctrl {
  14. LM3630A_PWM_DISABLE = 0x00,
  15. LM3630A_PWM_BANK_A,
  16. LM3630A_PWM_BANK_B,
  17. LM3630A_PWM_BANK_ALL,
  18. LM3630A_PWM_BANK_A_ACT_LOW = 0x05,
  19. LM3630A_PWM_BANK_B_ACT_LOW,
  20. LM3630A_PWM_BANK_ALL_ACT_LOW,
  21. };
  22. enum lm3630a_leda_ctrl {
  23. LM3630A_LEDA_DISABLE = 0x00,
  24. LM3630A_LEDA_ENABLE = 0x04,
  25. LM3630A_LEDA_ENABLE_LINEAR = 0x14,
  26. };
  27. enum lm3630a_ledb_ctrl {
  28. LM3630A_LEDB_DISABLE = 0x00,
  29. LM3630A_LEDB_ON_A = 0x01,
  30. LM3630A_LEDB_ENABLE = 0x02,
  31. LM3630A_LEDB_ENABLE_LINEAR = 0x0A,
  32. };
  33. #define LM3630A_MAX_BRIGHTNESS 255
  34. /*
  35. *@leda_init_brt : led a init brightness. 4~255
  36. *@leda_max_brt : led a max brightness. 4~255
  37. *@leda_ctrl : led a disable, enable linear, enable exponential
  38. *@ledb_init_brt : led b init brightness. 4~255
  39. *@ledb_max_brt : led b max brightness. 4~255
  40. *@ledb_ctrl : led b disable, enable linear, enable exponential
  41. *@pwm_period : pwm period
  42. *@pwm_ctrl : pwm disable, bank a or b, active high or low
  43. */
  44. struct lm3630a_platform_data {
  45. /* led a config. */
  46. int leda_init_brt;
  47. int leda_max_brt;
  48. enum lm3630a_leda_ctrl leda_ctrl;
  49. /* led b config. */
  50. int ledb_init_brt;
  51. int ledb_max_brt;
  52. enum lm3630a_ledb_ctrl ledb_ctrl;
  53. /* pwm config. */
  54. unsigned int pwm_period;
  55. enum lm3630a_pwm_ctrl pwm_ctrl;
  56. };
  57. #endif /* __LINUX_LM3630A_H */