lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 10 Mar 2024 01:51:58 -0300
From: Luiz Angelo Daros de Luca <luizluca@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>, 
 Alvin Šipraga <alsi@...g-olufsen.dk>, 
 Andrew Lunn <andrew@...n.ch>, Florian Fainelli <f.fainelli@...il.com>, 
 Vladimir Oltean <olteanv@...il.com>, 
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Luiz Angelo Daros de Luca <luizluca@...il.com>, devicetree@...r.kernel.org
Subject: [PATCH net-next 1/4] dt-bindings: net: dsa: realtek: describe LED
 usage

Each port can have up to 4 LEDs (3 for current rtl8365mb devices). The
LED reg property will indicate its LED group.

An example of LED usage was included in an existing switch example.

Cc: devicetree@...r.kernel.org
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@...il.com>
---
 .../devicetree/bindings/net/dsa/realtek.yaml       | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
index 70b6bda3cf98..45c1656b3fae 100644
--- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml
@@ -108,6 +108,32 @@ properties:
       compatible:
         const: realtek,smi-mdio
 
+patternProperties:
+  '^(ethernet-)?ports$':
+    type: object
+    additionalProperties: true
+
+    patternProperties:
+      '^(ethernet-)?port@[0-6]$':
+        type: object
+        additionalProperties: true
+
+        properties:
+          leds:
+            description:
+              "LEDs associated with this port"
+
+            patternProperties:
+              '^led@[a-f0-9]+$':
+                type: object
+                additionalProperties: true
+
+                properties:
+                  reg:
+                    description:
+                      "reg indicates the LED group for this LED"
+                    enum: [0, 1, 2, 3]
+
 if:
   required:
     - reg
@@ -144,6 +170,7 @@ unevaluatedProperties: false
 examples:
   - |
     #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/leds/common.h>
     #include <dt-bindings/interrupt-controller/irq.h>
 
     platform {
@@ -190,6 +217,25 @@ examples:
                                     reg = <4>;
                                     label = "wan";
                                     phy-handle = <&phy4>;
+
+                                    leds {
+                                            #address-cells = <1>;
+                                            #size-cells = <0>;
+
+                                            led@0 {
+                                                    reg = <0>;
+                                                    color = <LED_COLOR_ID_GREEN>;
+                                                    function = LED_FUNCTION_WAN;
+                                                    default-state = "keep";
+                                            };
+
+                                            led@3 {
+                                                    reg = <3>;
+                                                    color = <LED_COLOR_ID_AMBER>;
+                                                    function = LED_FUNCTION_WAN;
+                                                    default-state = "keep";
+                                            };
+                                    };
                             };
                             port@5 {
                                     reg = <5>;

-- 
2.44.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ