blob: df1b3080f6b88f22f5844d02c7c2f717dac50175 [file] [log] [blame]
Trent Piephoa7d878a2009-01-10 17:26:01 +00001LEDs connected to GPIO lines
Anton Vorontsov89ae5b22008-07-04 20:53:28 +04002
3Required properties:
Trent Piephoa7d878a2009-01-10 17:26:01 +00004- compatible : should be "gpio-leds".
5
6Each LED is represented as a sub-node of the gpio-leds device. Each
7node's name represents the name of the corresponding LED.
8
9LED sub-node properties:
Tobias Klauser14cd3c12012-02-06 18:29:15 +010010- gpios : Should specify the LED's GPIO, see "gpios property" in
Sachin Kamat4485a122012-09-11 08:51:23 +053011 Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be
Tobias Klauser14cd3c12012-02-06 18:29:15 +010012 indicated using flags in the GPIO specifier.
Marek Belisko07c12112012-11-15 22:51:56 +010013- label : (optional)
14 see Documentation/devicetree/bindings/leds/common.txt
15- linux,default-trigger : (optional)
16 see Documentation/devicetree/bindings/leds/common.txt
Trent Piephoed88bae2009-05-12 15:33:12 -070017- default-state: (optional) The initial state of the LED. Valid
18 values are "on", "off", and "keep". If the LED is already on or off
19 and the default-state property is set the to same value, then no
20 glitch should be produced where the LED momentarily turns off (or
21 on). The "keep" setting will keep the LED at whatever its current
22 state is, without producing a glitch. The default is off if this
23 property is not present.
Anton Vorontsov89ae5b22008-07-04 20:53:28 +040024
Trent Piephoa7d878a2009-01-10 17:26:01 +000025Examples:
Anton Vorontsov89ae5b22008-07-04 20:53:28 +040026
Trent Piephoa7d878a2009-01-10 17:26:01 +000027leds {
28 compatible = "gpio-leds";
29 hdd {
30 label = "IDE Activity";
31 gpios = <&mcu_pio 0 1>; /* Active low */
32 linux,default-trigger = "ide-disk";
33 };
Trent Piephoed88bae2009-05-12 15:33:12 -070034
35 fault {
36 gpios = <&mcu_pio 1 0>;
37 /* Keep LED on if BIOS detected hardware fault */
38 default-state = "keep";
39 };
Anton Vorontsov89ae5b22008-07-04 20:53:28 +040040};
Trent Piephoa7d878a2009-01-10 17:26:01 +000041
42run-control {
43 compatible = "gpio-leds";
44 red {
45 gpios = <&mpc8572 6 0>;
Trent Piephoed88bae2009-05-12 15:33:12 -070046 default-state = "off";
Trent Piephoa7d878a2009-01-10 17:26:01 +000047 };
48 green {
49 gpios = <&mpc8572 7 0>;
Trent Piephoed88bae2009-05-12 15:33:12 -070050 default-state = "on";
Trent Piephoa7d878a2009-01-10 17:26:01 +000051 };
Marek Vasut177259c2012-06-23 20:41:17 +020052};