About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Documentation / devicetree / bindings / leds / leds-gpio.txt




Custom Search

Based on kernel version 3.15.4. Page generated on 2014-07-07 09:01 EST.

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	
27	Examples:
28	
29	leds {
30		compatible = "gpio-leds";
31		hdd {
32			label = "IDE Activity";
33			gpios = <&mcu_pio 0 1>; /* Active low */
34			linux,default-trigger = "ide-disk";
35		};
36	
37		fault {
38			gpios = <&mcu_pio 1 0>;
39			/* Keep LED on if BIOS detected hardware fault */
40			default-state = "keep";
41		};
42	};
43	
44	run-control {
45		compatible = "gpio-leds";
46		red {
47			gpios = <&mpc8572 6 0>;
48			default-state = "off";
49		};
50		green {
51			gpios = <&mpc8572 7 0>;
52			default-state = "on";
53		};
54	};
55	
56	leds {
57		compatible = "gpio-leds";
58	
59		charger-led {
60			gpios = <&gpio1 2 0>;
61			linux,default-trigger = "max8903-charger-charging";
62			retain-state-suspended;
63		};
64	};
Hide Line Numbers
About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Information is copyright its respective author. All material is available from the Linux Kernel Source distributed under a GPL License. This page is provided as a free service by mjmwired.net.