led.txt 1.9 KB
Newer Older
1
LEDs connected to GPIO lines
2 3

Required properties:
4 5 6 7 8 9 10
- compatible : should be "gpio-leds".

Each LED is represented as a sub-node of the gpio-leds device.  Each
node's name represents the name of the corresponding LED.

LED sub-node properties:
- gpios :  Should specify the LED's GPIO, see "Specifying GPIO information
P
Paul Bolle 已提交
11
  for devices" in Documentation/devicetree/booting-without-of.txt.  Active
12 13
  low LEDs should be indicated using flags in the GPIO specifier.
- label :  (optional) The label for this LED.  If omitted, the label is
14
  taken from the node name (excluding the unit address).
15 16 17 18
- linux,default-trigger :  (optional) This parameter, if present, is a
  string defining the trigger assigned to the LED.  Current triggers are:
    "backlight" - LED will act as a back-light, controlled by the framebuffer
		  system
19
    "default-on" - LED will turn on, but see "default-state" below
20 21 22
    "heartbeat" - LED "double" flashes at a load average based rate
    "ide-disk" - LED indicates disk activity
    "timer" - LED flashes at a fixed, configurable rate
23 24 25 26 27 28 29
- default-state:  (optional) The initial state of the LED.  Valid
  values are "on", "off", and "keep".  If the LED is already on or off
  and the default-state property is set the to same value, then no
  glitch should be produced where the LED momentarily turns off (or
  on).  The "keep" setting will keep the LED at whatever its current
  state is, without producing a glitch.  The default is off if this
  property is not present.
30

31
Examples:
32

33 34 35 36 37 38 39
leds {
	compatible = "gpio-leds";
	hdd {
		label = "IDE Activity";
		gpios = <&mcu_pio 0 1>; /* Active low */
		linux,default-trigger = "ide-disk";
	};
40 41 42 43 44 45

	fault {
		gpios = <&mcu_pio 1 0>;
		/* Keep LED on if BIOS detected hardware fault */
		default-state = "keep";
	};
46
};
47 48 49 50 51

run-control {
	compatible = "gpio-leds";
	red {
		gpios = <&mpc8572 6 0>;
52
		default-state = "off";
53 54 55
	};
	green {
		gpios = <&mpc8572 7 0>;
56
		default-state = "on";
57 58
	};
}