diff mbox series

[2/3] dt-bindings: leds: Add binding for Broadchip BCT3024 LED driver

Message ID 20230727160525.23312-3-matuszpd@gmail.com
State New
Headers show
Series leds: Add Broadchip BCT3024 LED driver | expand

Commit Message

Matus Gajdos July 27, 2023, 4:05 p.m. UTC
The BCT3024 chip is an I2C LED driver with independent 24 output
channels. Each channel supports 256 levels.

Signed-off-by: Matus Gajdos <matuszpd@gmail.com>
---
 .../bindings/leds/broadchip,bct3024.yaml      | 89 +++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/broadchip,bct3024.yaml
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/broadchip,bct3024.yaml b/Documentation/devicetree/bindings/leds/broadchip,bct3024.yaml
new file mode 100644
index 000000000000..0d622894e79c
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/broadchip,bct3024.yaml
@@ -0,0 +1,89 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/broadchip,bct3024.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadchip BCT3024 LED Driver
+
+maintainers:
+  - Matus Gajdos <matuszpd@gmail.com>
+
+description: |
+  The BCT3024 is an I2C LED driver with independent 24 output channels. Each
+  channel supports 256 levels and its output current can be scaled by a factor
+  of 1, 1/2, 1/3 and 1/4.
+
+properties:
+  compatible:
+    const: broadchip,bct3024
+
+  reg:
+    description: I2C slave address of the driver.
+    maxItems: 1
+
+  vdd-supply:
+    description: Regulator providing power to the VDD pin.
+
+  shutdown-gpios:
+    maxItems: 1
+    description: GPIO attached to the SDB pin.
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^led@[0-9a-f]+$":
+    type: object
+    $ref: common.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        description: Index of the LED channel.
+        minimum: 0
+        maximum: 23
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/leds/common.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led-controller@3c {
+            compatible = "broadchip,bct3024";
+            reg = <0x3c>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            vdd-supply = <&reg_3v3d>;
+
+            led@0 {
+                reg = <0x00>;
+                function = LED_FUNCTION_INDICATOR;
+                color = <LED_COLOR_ID_RED>;
+            };
+
+            led@1 {
+                reg = <0x01>;
+                function = LED_FUNCTION_INDICATOR;
+                color = <LED_COLOR_ID_GREEN>;
+            };
+        };
+    };
+
+...