Trent Piepho | a7d878a | 2009-01-10 17:26:01 +0000 | [diff] [blame] | 1 | LEDs connected to GPIO lines |
Anton Vorontsov | 89ae5b2 | 2008-07-04 20:53:28 +0400 | [diff] [blame] | 2 | |
| 3 | Required properties: |
Trent Piepho | a7d878a | 2009-01-10 17:26:01 +0000 | [diff] [blame] | 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: |
Tobias Klauser | 14cd3c1 | 2012-02-06 18:29:15 +0100 | [diff] [blame] | 10 | - gpios : Should specify the LED's GPIO, see "gpios property" in |
Sachin Kamat | 4485a12 | 2012-09-11 08:51:23 +0530 | [diff] [blame] | 11 | Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be |
Tobias Klauser | 14cd3c1 | 2012-02-06 18:29:15 +0100 | [diff] [blame] | 12 | indicated using flags in the GPIO specifier. |
Marek Belisko | 07c1211 | 2012-11-15 22:51:56 +0100 | [diff] [blame] | 13 | - label : (optional) |
| 14 | see Documentation/devicetree/bindings/leds/common.txt |
| 15 | - linux,default-trigger : (optional) |
| 16 | see Documentation/devicetree/bindings/leds/common.txt |
Trent Piepho | ed88bae | 2009-05-12 15:33:12 -0700 | [diff] [blame] | 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. |
Anton Vorontsov | 89ae5b2 | 2008-07-04 20:53:28 +0400 | [diff] [blame] | 24 | |
Trent Piepho | a7d878a | 2009-01-10 17:26:01 +0000 | [diff] [blame] | 25 | Examples: |
Anton Vorontsov | 89ae5b2 | 2008-07-04 20:53:28 +0400 | [diff] [blame] | 26 | |
Trent Piepho | a7d878a | 2009-01-10 17:26:01 +0000 | [diff] [blame] | 27 | leds { |
| 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 Piepho | ed88bae | 2009-05-12 15:33:12 -0700 | [diff] [blame] | 34 | |
| 35 | fault { |
| 36 | gpios = <&mcu_pio 1 0>; |
| 37 | /* Keep LED on if BIOS detected hardware fault */ |
| 38 | default-state = "keep"; |
| 39 | }; |
Anton Vorontsov | 89ae5b2 | 2008-07-04 20:53:28 +0400 | [diff] [blame] | 40 | }; |
Trent Piepho | a7d878a | 2009-01-10 17:26:01 +0000 | [diff] [blame] | 41 | |
| 42 | run-control { |
| 43 | compatible = "gpio-leds"; |
| 44 | red { |
| 45 | gpios = <&mpc8572 6 0>; |
Trent Piepho | ed88bae | 2009-05-12 15:33:12 -0700 | [diff] [blame] | 46 | default-state = "off"; |
Trent Piepho | a7d878a | 2009-01-10 17:26:01 +0000 | [diff] [blame] | 47 | }; |
| 48 | green { |
| 49 | gpios = <&mpc8572 7 0>; |
Trent Piepho | ed88bae | 2009-05-12 15:33:12 -0700 | [diff] [blame] | 50 | default-state = "on"; |
Trent Piepho | a7d878a | 2009-01-10 17:26:01 +0000 | [diff] [blame] | 51 | }; |
Marek Vasut | 177259c | 2012-06-23 20:41:17 +0200 | [diff] [blame] | 52 | }; |