Skip to content

Commit f9be4d5

Browse files
linuswlag-linaro
authored andcommitted
dt-bindings: leds: Mention GPIO triggers
We reuse the trigger-sources phandle to just point to GPIOs we may want to use as LED triggers. Example: gpio: gpio@0 { compatible "my-gpio"; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; #trigger-source-cells = <2>; }; leds { compatible = "gpio-leds"; led-my-gpio { label = "device:blue:myled"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; default-state = "off"; linux,default-trigger = "gpio"; trigger-sources = <&gpio 1 GPIO_ACTIVE_HIGH>; }; }; Signed-off-by: Linus Walleij <[email protected]> Acked-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 8d3fd7e commit f9be4d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Documentation/devicetree/bindings/leds/common.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ properties:
191191
each of them having its own LED assigned (assuming they are not
192192
hardwired). In such cases this property should contain phandle(s) of
193193
related source device(s).
194+
Another example is a GPIO line that will be monitored and mirror the
195+
state of the line (with or without inversion flags) to the LED.
194196
In many cases LED can be related to more than one device (e.g. one USB LED
195197
vs. multiple USB ports). Each source should be represented by a node in
196198
the device tree and be referenced by a phandle and a set of phandle

0 commit comments

Comments
 (0)