diff mbox series

[1/2] dt-bindings: leds: bcmbca: Add bindings for BRCMBCA LEDs

Message ID 20240920-bcmbca-leds-v1-1-5f70e692c6ff@linaro.org (mailing list archive)
State New, archived
Headers show
Series leds: Add basic BCMBCA LEDs support | expand

Commit Message

Linus Walleij Sept. 20, 2024, 11:15 a.m. UTC
The Broadcom BCA (Broadband Access) SoCs contain a unique
LED block. Add bindings for it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../devicetree/bindings/leds/brcm,bcmbca-leds.yaml | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)

Comments

Rafał Miłecki Sept. 20, 2024, 11:28 a.m. UTC | #1
On 2024-09-20 13:15, Linus Walleij wrote:
> The Broadcom BCA (Broadband Access) SoCs contain a unique
> LED block. Add bindings for it.

I don't remember anymore what SoCs are part of the BCMBCA family but I
believe we already have bindings for those devices (depending on the hw
design variant). Please check:

Documentation/devicetree/bindings/leds/leds-bcm6328.yaml
Documentation/devicetree/bindings/leds/leds-bcm63138.yaml

It may be also worth to check my commit description:

commit 13344f8ce8a0d98aa7f5d69ce3b47393c73a343b
Author: Rafał Miłecki <rafal@milecki.pl>
Date:   Mon Dec 27 15:59:04 2021 +0100

     dt-bindings: leds: add Broadcom's BCM63138 controller

     Broadcom used 2 LEDs hardware blocks for their BCM63xx SoCs:
     1. Older one (BCM6318, BCM6328, BCM6362, BCM63268, BCM6838)
     2. Newer one (BCM6848, BCM6858, BCM63138, BCM63148, BCM63381, 
BCM68360)

     The newer one was also later also used on BCM4908 SoC.

     Old block is already documented in the leds-bcm6328.yaml. This 
binding
     documents the new one which uses different registers & programming. 
It's
     first used in BCM63138 thus the binding name.

     Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
     Reviewed-by: Rob Herring <robh@kernel.org>
     Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
     Signed-off-by: Pavel Machek <pavel@ucw.cz>
Rob Herring (Arm) Sept. 24, 2024, 9:51 p.m. UTC | #2
On Fri, Sep 20, 2024 at 01:15:12PM +0200, Linus Walleij wrote:
> The Broadcom BCA (Broadband Access) SoCs contain a unique
> LED block. Add bindings for it.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../devicetree/bindings/leds/brcm,bcmbca-leds.yaml | 88 ++++++++++++++++++++++
>  1 file changed, 88 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/leds/brcm,bcmbca-leds.yaml b/Documentation/devicetree/bindings/leds/brcm,bcmbca-leds.yaml
> new file mode 100644
> index 000000000000..7fe2222c0c58
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/brcm,bcmbca-leds.yaml
> @@ -0,0 +1,88 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/brcm,bcmbca-leds.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom BCMBCA LEDs
> +
> +maintainers:
> +  - Linus Walleij <linus.walleij@linaro.org>
> +
> +description: |

Don't need '|' if no formatting.

Otherwise,

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>

> +  The Broadcom BCA (Broadband Access) SoCs have a LED control
> +  block that can support either parallel (directly connected)
> +  LEDs or serial (connected to 1-4 shift registers) LEDs.
> +  The LEDs can optionally be hardware-triggered by ethernet port
> +  traffic.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/brcm,bcmbca-leds.yaml b/Documentation/devicetree/bindings/leds/brcm,bcmbca-leds.yaml
new file mode 100644
index 000000000000..7fe2222c0c58
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/brcm,bcmbca-leds.yaml
@@ -0,0 +1,88 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/brcm,bcmbca-leds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom BCMBCA LEDs
+
+maintainers:
+  - Linus Walleij <linus.walleij@linaro.org>
+
+description: |
+  The Broadcom BCA (Broadband Access) SoCs have a LED control
+  block that can support either parallel (directly connected)
+  LEDs or serial (connected to 1-4 shift registers) LEDs.
+  The LEDs can optionally be hardware-triggered by ethernet port
+  traffic.
+
+properties:
+  compatible:
+    const: brcm,bcmbca-leds
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  brcm,serial-shifters:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      This describes the number of 8-bit serial shifters
+      connected to the LED controller block. If this property
+      is definied, it is implicit that the driver is using
+      serial LED control, if it is missing, parallel LED
+      control is assumed.
+
+patternProperties:
+  "^led@[0-9a-f]+$":
+    type: object
+    $ref: common.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        minimum: 0
+
+    required:
+      - reg
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    soc {
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        led-controller@800 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "brcm,bcmbca-leds";
+            reg = <0x800 0xc8>;
+
+            led@0 {
+                reg = <0>;
+                active-low;
+                function = "ext";
+                color = <LED_COLOR_ID_GREEN>;
+            };
+
+            led@1 {
+                reg = <1>;
+                active-low;
+                function = "ext";
+                color = <LED_COLOR_ID_AMBER>;
+            };
+        };
+    };