leds-gpio.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. LEDs connected to GPIO lines
  2. Required properties:
  3. - compatible : should be "gpio-leds".
  4. Each LED is represented as a sub-node of the gpio-leds device. Each
  5. node's name represents the name of the corresponding LED.
  6. LED sub-node properties:
  7. - gpios : Should specify the LED's GPIO, see "gpios property" in
  8. Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be
  9. indicated using flags in the GPIO specifier.
  10. - label : (optional)
  11. see Documentation/devicetree/bindings/leds/common.txt
  12. - linux,default-trigger : (optional)
  13. see Documentation/devicetree/bindings/leds/common.txt
  14. - default-state: (optional) The initial state of the LED.
  15. see Documentation/devicetree/bindings/leds/common.txt
  16. - retain-state-suspended: (optional) The suspend state can be retained.Such
  17. as charge-led gpio.
  18. - panic-indicator : (optional)
  19. see Documentation/devicetree/bindings/leds/common.txt
  20. Examples:
  21. #include <dt-bindings/gpio/gpio.h>
  22. leds {
  23. compatible = "gpio-leds";
  24. hdd {
  25. label = "Disk Activity";
  26. gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
  27. linux,default-trigger = "disk-activity";
  28. };
  29. fault {
  30. gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>;
  31. /* Keep LED on if BIOS detected hardware fault */
  32. default-state = "keep";
  33. };
  34. };
  35. run-control {
  36. compatible = "gpio-leds";
  37. red {
  38. gpios = <&mpc8572 6 GPIO_ACTIVE_HIGH>;
  39. default-state = "off";
  40. };
  41. green {
  42. gpios = <&mpc8572 7 GPIO_ACTIVE_HIGH>;
  43. default-state = "on";
  44. };
  45. };
  46. leds {
  47. compatible = "gpio-leds";
  48. charger-led {
  49. gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
  50. linux,default-trigger = "max8903-charger-charging";
  51. retain-state-suspended;
  52. };
  53. };