lm3639_bl.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_LM3639_H
  11. #define __LINUX_LM3639_H
  12. #define LM3639_NAME "lm3639_bl"
  13. enum lm3639_pwm {
  14. LM3639_PWM_DISABLE = 0x00,
  15. LM3639_PWM_EN_ACTLOW = 0x48,
  16. LM3639_PWM_EN_ACTHIGH = 0x40,
  17. };
  18. enum lm3639_strobe {
  19. LM3639_STROBE_DISABLE = 0x00,
  20. LM3639_STROBE_EN_ACTLOW = 0x10,
  21. LM3639_STROBE_EN_ACTHIGH = 0x30,
  22. };
  23. enum lm3639_txpin {
  24. LM3639_TXPIN_DISABLE = 0x00,
  25. LM3639_TXPIN_EN_ACTLOW = 0x04,
  26. LM3639_TXPIN_EN_ACTHIGH = 0x0C,
  27. };
  28. enum lm3639_fleds {
  29. LM3639_FLED_DIASBLE_ALL = 0x00,
  30. LM3639_FLED_EN_1 = 0x40,
  31. LM3639_FLED_EN_2 = 0x20,
  32. LM3639_FLED_EN_ALL = 0x60,
  33. };
  34. enum lm3639_bleds {
  35. LM3639_BLED_DIASBLE_ALL = 0x00,
  36. LM3639_BLED_EN_1 = 0x10,
  37. LM3639_BLED_EN_2 = 0x08,
  38. LM3639_BLED_EN_ALL = 0x18,
  39. };
  40. enum lm3639_bled_mode {
  41. LM3639_BLED_MODE_EXPONETIAL = 0x00,
  42. LM3639_BLED_MODE_LINEAR = 0x10,
  43. };
  44. struct lm3639_platform_data {
  45. unsigned int max_brt_led;
  46. unsigned int init_brt_led;
  47. /* input pins */
  48. enum lm3639_pwm pin_pwm;
  49. enum lm3639_strobe pin_strobe;
  50. enum lm3639_txpin pin_tx;
  51. /* output pins */
  52. enum lm3639_fleds fled_pins;
  53. enum lm3639_bleds bled_pins;
  54. enum lm3639_bled_mode bled_mode;
  55. void (*pwm_set_intensity) (int brightness, int max_brightness);
  56. int (*pwm_get_intensity) (void);
  57. };
  58. #endif /* __LINUX_LM3639_H */