Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / leds / leds-gpio.txt
1 LEDs connected to GPIO lines
2
3 Required properties:
4 - compatible : should be "gpio-leds".
5
6 Each LED is represented as a sub-node of the gpio-leds device.  Each
7 node's name represents the name of the corresponding LED.
8
9 LED sub-node properties:
10 - gpios :  Should specify the LED's GPIO, see "gpios property" in
11   Documentation/devicetree/bindings/gpio/gpio.txt.  Active low LEDs should be
12   indicated using flags in the GPIO specifier.
13 - label :  (optional)
14   see Documentation/devicetree/bindings/leds/common.txt
15 - linux,default-trigger :  (optional)
16   see Documentation/devicetree/bindings/leds/common.txt
17 - 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.
24 - retain-state-suspended: (optional) The suspend state can be retained.Such
25   as charge-led gpio.
26 - panic-indicator : (optional)
27   see Documentation/devicetree/bindings/leds/common.txt
28
29 Examples:
30
31 #include <dt-bindings/gpio/gpio.h>
32
33 leds {
34         compatible = "gpio-leds";
35         hdd {
36                 label = "IDE Activity";
37                 gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
38                 linux,default-trigger = "ide-disk";
39         };
40
41         fault {
42                 gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>;
43                 /* Keep LED on if BIOS detected hardware fault */
44                 default-state = "keep";
45         };
46 };
47
48 run-control {
49         compatible = "gpio-leds";
50         red {
51                 gpios = <&mpc8572 6 GPIO_ACTIVE_HIGH>;
52                 default-state = "off";
53         };
54         green {
55                 gpios = <&mpc8572 7 GPIO_ACTIVE_HIGH>;
56                 default-state = "on";
57         };
58 };
59
60 leds {
61         compatible = "gpio-leds";
62
63         charger-led {
64                 gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
65                 linux,default-trigger = "max8903-charger-charging";
66                 retain-state-suspended;
67         };
68 };