led.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/gpio.txt. Active low LEDs should be
  9. indicated using flags in the GPIO specifier.
  10. - label : (optional) The label for this LED. If omitted, the label is
  11. taken from the node name (excluding the unit address).
  12. - linux,default-trigger : (optional) This parameter, if present, is a
  13. string defining the trigger assigned to the LED. Current triggers are:
  14. "backlight" - LED will act as a back-light, controlled by the framebuffer
  15. system
  16. "default-on" - LED will turn on, but see "default-state" below
  17. "heartbeat" - LED "double" flashes at a load average based rate
  18. "ide-disk" - LED indicates disk activity
  19. "timer" - LED flashes at a fixed, configurable rate
  20. - default-state: (optional) The initial state of the LED. Valid
  21. values are "on", "off", and "keep". If the LED is already on or off
  22. and the default-state property is set the to same value, then no
  23. glitch should be produced where the LED momentarily turns off (or
  24. on). The "keep" setting will keep the LED at whatever its current
  25. state is, without producing a glitch. The default is off if this
  26. property is not present.
  27. Examples:
  28. leds {
  29. compatible = "gpio-leds";
  30. hdd {
  31. label = "IDE Activity";
  32. gpios = <&mcu_pio 0 1>; /* Active low */
  33. linux,default-trigger = "ide-disk";
  34. };
  35. fault {
  36. gpios = <&mcu_pio 1 0>;
  37. /* Keep LED on if BIOS detected hardware fault */
  38. default-state = "keep";
  39. };
  40. };
  41. run-control {
  42. compatible = "gpio-leds";
  43. red {
  44. gpios = <&mpc8572 6 0>;
  45. default-state = "off";
  46. };
  47. green {
  48. gpios = <&mpc8572 7 0>;
  49. default-state = "on";
  50. };
  51. };