Thread (10 messages) 10 messages, 4 authors, 2021-10-26
STALE1701d

[PATCH 2/3] dt-bindings: leds: Add `excludes` property

From: Marek Behún <kabel@kernel.org>
Date: 2021-10-13 20:44:33
Also in: linux-devicetree, linux-leds, lkml
Subsystem: led subsystem, open firmware and flattened device tree bindings, the rest · Maintainers: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Torvalds

Some RJ-45 connectors have LEDs wired in the following way:

         LED1
      +--|>|--+
      |       |
  A---+--|<|--+---B
         LED2

With + on A and - on B, LED1 is ON and LED2 is OFF. Inverting the
polarity turns LED1 OFF and LED2 ON.

So these LEDs exclude each other.

Add new `excludes` property to the LED binding. The property is a
phandle-array to all the other LEDs that are excluded by this LED.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
 Documentation/devicetree/bindings/leds/common.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
index a19acc781e89..03759d2e125a 100644
--- a/Documentation/devicetree/bindings/leds/common.yaml
+++ b/Documentation/devicetree/bindings/leds/common.yaml
@@ -59,6 +59,14 @@ properties:
       deprecated - use 'function' and 'color' properties instead.
       function-enumerator has no effect when this property is present.
 
+  excludes:
+    description:
+      List of LEDs that are excluded by this LED: if this LED is ON, the others
+      must be OFF. This is mostly the case when there are two LEDs connected in
+      parallel, but inversely: inverting the polarity of the source turns one
+      LED ON while the other OFF. There are RJ-45 connectors with such wiring.
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
   default-state:
     description:
       The initial state of the LED. If the LED is already on or off and the
-- 
2.32.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help