Merge tag 'ceph-for-4.9-rc1' of git://github.com/ceph/ceph-client
[cascardo/linux.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.
18   see Documentation/devicetree/bindings/leds/common.txt
19 - retain-state-suspended: (optional) The suspend state can be retained.Such
20   as charge-led gpio.
21 - panic-indicator : (optional)
22   see Documentation/devicetree/bindings/leds/common.txt
23
24 Examples:
25
26 #include <dt-bindings/gpio/gpio.h>
27
28 leds {
29         compatible = "gpio-leds";
30         hdd {
31                 label = "Disk Activity";
32                 gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
33                 linux,default-trigger = "disk-activity";
34         };
35
36         fault {
37                 gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>;
38                 /* Keep LED on if BIOS detected hardware fault */
39                 default-state = "keep";
40         };
41 };
42
43 run-control {
44         compatible = "gpio-leds";
45         red {
46                 gpios = <&mpc8572 6 GPIO_ACTIVE_HIGH>;
47                 default-state = "off";
48         };
49         green {
50                 gpios = <&mpc8572 7 GPIO_ACTIVE_HIGH>;
51                 default-state = "on";
52         };
53 };
54
55 leds {
56         compatible = "gpio-leds";
57
58         charger-led {
59                 gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
60                 linux,default-trigger = "max8903-charger-charging";
61                 retain-state-suspended;
62         };
63 };