devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matus Gajdos <matuszpd@gmail.com>
To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Matus Gajdos <matuszpd@gmail.com>
Subject: [PATCH 2/3] dt-bindings: leds: Add binding for Broadchip BCT3024 LED driver
Date: Thu, 27 Jul 2023 18:05:24 +0200	[thread overview]
Message-ID: <20230727160525.23312-3-matuszpd@gmail.com> (raw)
In-Reply-To: <20230727160525.23312-1-matuszpd@gmail.com>

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 --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>;
+            };
+        };
+    };
+
+...
-- 
2.25.1


  parent reply	other threads:[~2023-07-27 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 16:05 [PATCH 0/3] leds: Add Broadchip BCT3024 LED driver Matus Gajdos
2023-07-27 16:05 ` [PATCH 1/3] dt-bindings: Add vendor prefix for Broadchip Technology Group Co., Ltd Matus Gajdos
2023-07-28  7:29   ` Krzysztof Kozlowski
2023-07-27 16:05 ` Matus Gajdos [this message]
2023-07-28  7:31   ` [PATCH 2/3] dt-bindings: leds: Add binding for Broadchip BCT3024 LED driver Krzysztof Kozlowski
2023-07-27 16:05 ` [PATCH 3/3] leds: Add " Matus Gajdos
2023-07-28  4:20   ` kernel test robot
2023-07-28  7:41   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230727160525.23312-3-matuszpd@gmail.com \
    --to=matuszpd@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).