1* Common leds properties.
2
3LED and flash LED devices provide the same basic functionality as current
4regulators, but extended with LED and flash LED specific features like
5blinking patterns, flash timeout, flash faults and external flash strobe mode.
6
7Many LED devices expose more than one current output that can be connected
8to one or more discrete LED component. Since the arrangement of connections
9can influence the way of the LED device initialization, the LED components
10have to be tightly coupled with the LED device binding. They are represented
11by child nodes of the parent LED device binding.
12
13Optional properties for child nodes:
14- led-sources : List of device current outputs the LED is connected to. The
15		outputs are identified by the numbers that must be defined
16		in the LED device binding documentation.
17- label : The label for this LED. If omitted, the label is taken from the node
18	  name (excluding the unit address). It has to uniquely identify
19	  a device, i.e. no other LED class device can be assigned the same
20	  label.
21
22- default-state : The initial state of the LED. Valid values are "on", "off",
23  and "keep". If the LED is already on or off and the default-state property is
24  set the to same value, then no glitch should be produced where the LED
25  momentarily turns off (or on). The "keep" setting will keep the LED at
26  whatever its current state is, without producing a glitch.  The default is
27  off if this property is not present.
28
29- linux,default-trigger :  This parameter, if present, is a
30    string defining the trigger assigned to the LED.  Current triggers are:
31     "backlight" - LED will act as a back-light, controlled by the framebuffer
32		   system
33     "default-on" - LED will turn on (but for leds-gpio see "default-state"
34		    property in Documentation/devicetree/bindings/leds/leds-gpio.txt)
35     "heartbeat" - LED "double" flashes at a load average based rate
36     "disk-activity" - LED indicates disk activity
37     "ide-disk" - LED indicates IDE disk activity (deprecated),
38                  in new implementations use "disk-activity"
39     "timer" - LED flashes at a fixed, configurable rate
40     "pattern" - LED alters the brightness for the specified duration with one
41                 software timer (requires "led-pattern" property)
42
43- led-pattern : Array of integers with default pattern for certain triggers.
44                Each trigger may parse this property differently:
45                - one-shot : two numbers specifying delay on and delay off (in ms),
46                - timer : two numbers specifying delay on and delay off (in ms),
47                - pattern : the pattern is given by a series of tuples, of
48                  brightness and duration (in ms).  The exact format is
49                  described in:
50                  Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt
51
52
53- led-max-microamp : Maximum LED supply current in microamperes. This property
54                     can be made mandatory for the board configurations
55                     introducing a risk of hardware damage in case an excessive
56                     current is set.
57                     For flash LED controllers with configurable current this
58                     property is mandatory for the LEDs in the non-flash modes
59                     (e.g. torch or indicator).
60
61- panic-indicator : This property specifies that the LED should be used,
62		    if at all possible, as a panic indicator.
63
64- trigger-sources : List of devices which should be used as a source triggering
65		    this LED activity. Some LEDs can be related to a specific
66		    device and should somehow indicate its state. E.g. USB 2.0
67		    LED may react to device(s) in a USB 2.0 port(s).
68		    Another common example is switch or router with multiple
69		    Ethernet ports each of them having its own LED assigned
70		    (assuming they are not hardwired). In such cases this
71		    property should contain phandle(s) of related source
72		    device(s).
73		    In many cases LED can be related to more than one device
74		    (e.g. one USB LED vs. multiple USB ports). Each source
75		    should be represented by a node in the device tree and be
76		    referenced by a phandle and a set of phandle arguments. A
77		    length of arguments should be specified by the
78		    #trigger-source-cells property in the source node.
79
80Required properties for flash LED child nodes:
81- flash-max-microamp : Maximum flash LED supply current in microamperes.
82- flash-max-timeout-us : Maximum timeout in microseconds after which the flash
83                         LED is turned off.
84
85For controllers that have no configurable current the flash-max-microamp
86property can be omitted.
87For controllers that have no configurable timeout the flash-max-timeout-us
88property can be omitted.
89
90* Trigger source providers
91
92Each trigger source should be represented by a device tree node. It may be e.g.
93a USB port or an Ethernet device.
94
95Required properties for trigger source:
96- #trigger-source-cells : Number of cells in a source trigger. Typically 0 for
97			  nodes of simple trigger sources (e.g. a specific USB
98			  port).
99
100* Examples
101
102gpio-leds {
103	compatible = "gpio-leds";
104
105	system-status {
106		label = "Status";
107		linux,default-trigger = "heartbeat";
108		gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
109	};
110
111	usb {
112		gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
113		trigger-sources = <&ohci_port1>, <&ehci_port1>;
114	};
115};
116
117max77693-led {
118	compatible = "maxim,max77693-led";
119
120	camera-flash {
121		label = "Flash";
122		led-sources = <0>, <1>;
123		led-max-microamp = <50000>;
124		flash-max-microamp = <320000>;
125		flash-max-timeout-us = <500000>;
126	};
127};
128