The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Yuxi Wang <Yuxi.Wang@monolithicpower.com>
To: <Yuxi.Wang@monolithicpower.com>, <pavel@ucw.cz>, <lee@kernel.org>,
	<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
	<conor+dt@kernel.org>, <wyx137120466@gmail.com>
Cc: <linux-leds@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH V2 1/2] dt-bindings: leds: add mps mp3326 LED
Date: Tue, 11 Jun 2024 16:32:34 +0800	[thread overview]
Message-ID: <20240611083236.1609-2-Yuxi.Wang@monolithicpower.com> (raw)
In-Reply-To: <20240611083236.1609-1-Yuxi.Wang@monolithicpower.com>

Document mps mp3326 LED driver devicetree bindings.

Signed-off-by: Yuxi Wang <Yuxi.Wang@monolithicpower.com>

diff --git a/Documentation/devicetree/bindings/leds/mps,mp3326.yaml b/Documentation/devicetree/bindings/leds/mps,mp3326.yaml
new file mode 100644
index 000000000000..09833df692ba
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/mps,mp3326.yaml
@@ -0,0 +1,146 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/mps,mp3326.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MPS MP3326 RGB/White LED Driver
+
+maintainers:
+  - Yuxi Wang <Yuxi.Wang@monolithicpower.com>
+
+description: |
+  The MP3326 is a RGB/White LED driver with I2C interface.
+
+  For more product information please see the link below:
+  https://www.monolithicpower.com/en/products/mp3326.html
+
+properties:
+  compatible:
+    const: mps,mp3326
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  reg:
+    maxItems: 1
+
+patternProperties:
+  '^multi-led@[0-4]$':
+    type: object
+    $ref: leds-class-multicolor.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      "#address-cells":
+        const: 1
+
+      "#size-cells":
+        const: 0
+      reg:
+        minimum: 0
+        maximum: 4
+        description: Index of the RGB module.
+
+    patternProperties:
+      "^led@[0-9a-f]+$":
+        type: object
+        $ref: common.yaml#
+        unevaluatedProperties: false
+
+        properties:
+          reg:
+            description: Index of the LED.
+            minimum: 0
+            maximum: 15
+
+        required:
+          - reg
+          - color
+
+    required:
+      - "#address-cells"
+      - "#size-cells"
+      - reg
+
+  "^led@[0-9a-f]+$":
+    type: object
+    $ref: common.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        description: Index of the LED.
+        minimum: 0
+        maximum: 15
+
+    required:
+      - reg
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led-controller@30 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "mps,mp3326";
+            reg = <0x30>;
+            multi-led@0 {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                color = <LED_COLOR_ID_RGB>;
+                reg = <0>;
+                label = "multi-led1";
+                led@0 {
+                    reg  = <0>;
+                    color = <LED_COLOR_ID_RED>;
+                };
+
+                led@1 {
+                    reg = <1>;
+                    color = <LED_COLOR_ID_GREEN>;
+                };
+
+                led@2 {
+                    reg = <2>;
+                    color = <LED_COLOR_ID_BLUE>;
+                };
+            };
+        };
+    };
+
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        led-controller@30 {
+            compatible = "mps,mp3326";
+            reg = <0x30>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            led@0 {
+                label = "red0";
+                reg= <0>;
+                color = <LED_COLOR_ID_WHITE>;
+            };
+        };
+    };
-- 
2.39.2


  reply	other threads:[~2024-06-11  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11  8:32 [PATCH V2 0/2] leds: Add a driver for MP3326 Yuxi Wang
2024-06-11  8:32 ` Yuxi Wang [this message]
2024-06-11  8:32 ` [PATCH V2 2/2] leds: add mp3326 driver Yuxi Wang
2024-06-11  9:21   ` Krzysztof Kozlowski
2024-06-12  2:23     ` Yuxi (Yuxi) Wang
2024-06-12  6:12       ` Krzysztof Kozlowski
2024-06-11 23:28   ` kernel test robot
2024-06-11  9:14 ` [PATCH V2 0/2] leds: Add a driver for MP3326 Krzysztof Kozlowski
2024-06-12  2:26   ` Yuxi (Yuxi) Wang
2024-06-12  6:13     ` 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=20240611083236.1609-2-Yuxi.Wang@monolithicpower.com \
    --to=yuxi.wang@monolithicpower.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 \
    --cc=wyx137120466@gmail.com \
    /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