[net-next PATCH v6 10/16] dt-bindings: leds: Document support for generic ethernet LEDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add documentation for support of generic ethernet LEDs.
These LEDs are ethernet port LED and are controllable by the ethernet
controller or the ethernet PHY.

A port may expose multiple LEDs and reg is used to provide an index to
differentiate them.
Ethernet port LEDs follow generic LED implementation.

Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
---
 .../bindings/leds/leds-ethernet.yaml          | 76 +++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-ethernet.yaml

diff --git a/Documentation/devicetree/bindings/leds/leds-ethernet.yaml b/Documentation/devicetree/bindings/leds/leds-ethernet.yaml
new file mode 100644
index 000000000000..0a03d65beea0
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-ethernet.yaml
@@ -0,0 +1,76 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/leds-ethernet.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common properties for the ethernet port LED.
+
+maintainers:
+  - Christian Marangi <ansuelsmth@xxxxxxxxx>
+
+description:
+  Bindings for the LEDs present in ethernet port and controllable by
+  the ethernet controller or the ethernet PHY regs.
+
+  These LEDs provide the same feature of a normal LED and follow
+  the same LED definitions.
+
+  An ethernet port may expose multiple LEDs, reg binding is used to
+  differentiate them.
+
+properties:
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  '^led@[a-f0-9]+$':
+    $ref: /schemas/leds/common.yaml#
+
+    properties:
+      reg:
+        maxItems: 1
+        description:
+          This define the LED index in the PHY or the MAC. It's really
+          driver dependent and required for ports that define multiple
+          LED for the same port.
+
+    required:
+      - reg
+
+    unevaluatedProperties: false
+
+required:
+  - '#address-cells'
+  - '#size-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    leds {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led@0 {
+            reg = <0>;
+            color = <LED_COLOR_ID_WHITE>;
+            function = LED_FUNCTION_LAN;
+            function-enumerator = <1>;
+            default-state = "keep";
+        };
+
+        led@1 {
+            reg = <1>;
+            color = <LED_COLOR_ID_AMBER>;
+            function = LED_FUNCTION_LAN;
+            function-enumerator = <1>;
+            default-state = "keep";
+        };
+    };
+...
-- 
2.39.2




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux