leds-lp55xx.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. const char *default_trigger;
  23. u8 chan_nr;
  24. u8 led_current; /* mA x10, 0 if led is not connected */
  25. u8 max_current;
  26. };
  27. struct lp55xx_predef_pattern {
  28. const u8 *r;
  29. const u8 *g;
  30. const u8 *b;
  31. u8 size_r;
  32. u8 size_g;
  33. u8 size_b;
  34. };
  35. enum lp8501_pwr_sel {
  36. LP8501_ALL_VDD, /* D1~9 are connected to VDD */
  37. LP8501_6VDD_3VOUT, /* D1~6 with VDD, D7~9 with VOUT */
  38. LP8501_3VDD_6VOUT, /* D1~6 with VOUT, D7~9 with VDD */
  39. LP8501_ALL_VOUT, /* D1~9 are connected to VOUT */
  40. };
  41. /*
  42. * struct lp55xx_platform_data
  43. * @led_config : Configurable led class device
  44. * @num_channels : Number of LED channels
  45. * @label : Used for naming LEDs
  46. * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT
  47. * @setup_resources : Platform specific function before enabling the chip
  48. * @release_resources : Platform specific function after disabling the chip
  49. * @enable : EN pin control by platform side
  50. * @patterns : Predefined pattern data for RGB channels
  51. * @num_patterns : Number of patterns
  52. * @update_config : Value of CONFIG register
  53. */
  54. struct lp55xx_platform_data {
  55. /* LED channel configuration */
  56. struct lp55xx_led_config *led_config;
  57. u8 num_channels;
  58. const char *label;
  59. /* Clock configuration */
  60. u8 clock_mode;
  61. /* optional enable GPIO */
  62. int enable_gpio;
  63. /* Predefined pattern data */
  64. struct lp55xx_predef_pattern *patterns;
  65. unsigned int num_patterns;
  66. /* LP8501 specific */
  67. enum lp8501_pwr_sel pwr_sel;
  68. };
  69. #endif /* _LEDS_LP55XX_H */