leds-lp55xx.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * LP55XX Platform Data Header
  3. *
  4. * Copyright (C) 2012 Texas Instruments
  5. *
  6. * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * Derived from leds-lp5521.h, leds-lp5523.h
  13. */
  14. #ifndef _LEDS_LP55XX_H
  15. #define _LEDS_LP55XX_H
  16. /* Clock configuration */
  17. #define LP55XX_CLOCK_AUTO 0
  18. #define LP55XX_CLOCK_INT 1
  19. #define LP55XX_CLOCK_EXT 2
  20. struct lp55xx_led_config {
  21. const char *name;
  22. u8 chan_nr;
  23. u8 led_current; /* mA x10, 0 if led is not connected */
  24. u8 max_current;
  25. };
  26. struct lp55xx_predef_pattern {
  27. const u8 *r;
  28. const u8 *g;
  29. const u8 *b;
  30. u8 size_r;
  31. u8 size_g;
  32. u8 size_b;
  33. };
  34. /*
  35. * struct lp55xx_platform_data
  36. * @led_config : Configurable led class device
  37. * @num_channels : Number of LED channels
  38. * @label : Used for naming LEDs
  39. * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT
  40. * @setup_resources : Platform specific function before enabling the chip
  41. * @release_resources : Platform specific function after disabling the chip
  42. * @enable : EN pin control by platform side
  43. * @patterns : Predefined pattern data for RGB channels
  44. * @num_patterns : Number of patterns
  45. * @update_config : Value of CONFIG register
  46. */
  47. struct lp55xx_platform_data {
  48. /* LED channel configuration */
  49. struct lp55xx_led_config *led_config;
  50. u8 num_channels;
  51. const char *label;
  52. /* Clock configuration */
  53. u8 clock_mode;
  54. /* Platform specific functions */
  55. int (*setup_resources)(void);
  56. void (*release_resources)(void);
  57. void (*enable)(bool state);
  58. /* Predefined pattern data */
  59. struct lp55xx_predef_pattern *patterns;
  60. unsigned int num_patterns;
  61. };
  62. #endif /* _LEDS_LP55XX_H */