leds-gpio.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. Valid
  15. values are "on", "off", and "keep". If the LED is already on or off
  16. and the default-state property is set the to same value, then no
  17. glitch should be produced where the LED momentarily turns off (or
  18. on). The "keep" setting will keep the LED at whatever its current
  19. state is, without producing a glitch. The default is off if this
  20. property is not present.
  21. Examples:
  22. leds {
  23. compatible = "gpio-leds";
  24. hdd {
  25. label = "IDE Activity";
  26. gpios = <&mcu_pio 0 1>; /* Active low */
  27. linux,default-trigger = "ide-disk";
  28. };
  29. fault {
  30. gpios = <&mcu_pio 1 0>;
  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 0>;
  39. default-state = "off";
  40. };
  41. green {
  42. gpios = <&mpc8572 7 0>;
  43. default-state = "on";
  44. };
  45. };