leds-regulator.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * leds-regulator.h - platform data structure for regulator driven LEDs.
  3. *
  4. * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. */
  11. #ifndef __LINUX_LEDS_REGULATOR_H
  12. #define __LINUX_LEDS_REGULATOR_H
  13. /*
  14. * Use "vled" as supply id when declaring the regulator consumer:
  15. *
  16. * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = {
  17. * { .dev_name = "leds-regulator.0", .supply = "vled" },
  18. * };
  19. *
  20. * If you have several regulator driven LEDs, you can append a numerical id to
  21. * .dev_name as done above, and use the same id when declaring the platform
  22. * device:
  23. *
  24. * static struct led_regulator_platform_data a780_vibrator_data = {
  25. * .name = "a780::vibrator",
  26. * };
  27. *
  28. * static struct platform_device a780_vibrator = {
  29. * .name = "leds-regulator",
  30. * .id = 0,
  31. * .dev = {
  32. * .platform_data = &a780_vibrator_data,
  33. * },
  34. * };
  35. */
  36. #include <linux/leds.h>
  37. struct led_regulator_platform_data {
  38. char *name; /* LED name as expected by LED class */
  39. enum led_brightness brightness; /* initial brightness value */
  40. };
  41. #endif /* __LINUX_LEDS_REGULATOR_H */