devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] leds: add mp3326 driver
@ 2023-11-08  3:29 Yuxi Wang
  2023-11-08  3:29 ` [PATCH 1/2] dt-bindings: leds: add mps mp3326 LED Yuxi Wang
  2023-11-08  3:29 ` [PATCH 2/2] leds: add mp3326 driver Yuxi Wang
  0 siblings, 2 replies; 13+ messages in thread
From: Yuxi Wang @ 2023-11-08  3:29 UTC (permalink / raw)
  To: pavel, lee, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	wyx137120466, Yuxi.Wang
  Cc: linux-leds, devicetree, linux-kernel

Add the binding description and the corresponding driver for
the mps mp3326.

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

Yuxi Wang (2):
  dt-bindings: leds: add mps mp3326 LED
  leds: add mp3326 driver

 .../devicetree/bindings/leds/leds-mp3326.yaml | 184 +++++
 drivers/leds/Kconfig                          |   7 +
 drivers/leds/Makefile                         |   1 +
 drivers/leds/leds-mp3326.c                    | 627 ++++++++++++++++++
 4 files changed, 819 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-mp3326.yaml
 create mode 100644 drivers/leds/leds-mp3326.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH 0/2] leds: Add a driver for MP3326
@ 2023-11-24  9:30 Yuxi Wang
  2023-11-24  9:30 ` [PATCH 1/2] dt-bindings: leds: add mps mp3326 LED Yuxi Wang
  0 siblings, 1 reply; 13+ messages in thread
From: Yuxi Wang @ 2023-11-24  9:30 UTC (permalink / raw)
  To: pavel, lee, robh+dt, krzysztof.kozlowski+dt, conor+dt, Yuxi.Wang
  Cc: linux-kernel, linux-leds, devicetree, wyx137120466

Add the binding description and the corresponding driver for
the MPS MP3326.

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


Yuxi Wang (2):
  dt-bindings: leds: add mps mp3326 LED
  leds: add mp3326 driver

 .../devicetree/bindings/leds/mps,mp3326.yaml  | 143 ++++
 drivers/leds/Kconfig                          |   7 +
 drivers/leds/Makefile                         |   1 +
 drivers/leds/leds-mp3326.c                    | 622 ++++++++++++++++++
 4 files changed, 773 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/mps,mp3326.yaml
 create mode 100644 drivers/leds/leds-mp3326.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH 1/2] dt-bindings: leds: add mps mp3326 LED
@ 2023-10-31  6:59 Yuxi (Yuxi) Wang
  2023-10-31  8:10 ` Krzysztof Kozlowski
  2023-10-31 12:57 ` Rob Herring
  0 siblings, 2 replies; 13+ messages in thread
From: Yuxi (Yuxi) Wang @ 2023-10-31  6:59 UTC (permalink / raw)
  To: pavel@ucw.cz, lee@kernel.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org
  Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, wyx137120466@gmail.com


Document mps mp3326 LED driver devicetree bindings.

Signed-off-by: Yuxi Wang <Yuxi.Wang@monolithicpower.com>
---
 .../devicetree/bindings/leds/leds-mp3326.yaml | 184 ++++++++++++++++++
 1 file changed, 184 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-mp3326.yaml

diff --git a/Documentation/devicetree/bindings/leds/leds-mp3326.yaml b/Documentation/devicetree/bindings/leds/leds-mp3326.yaml
new file mode 100644
index 000000000000..df03c21ae53a
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-mp3326.yaml
@@ -0,0 +1,184 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds-mp3326.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LED driver for MP3326 from Monolithic Power Systems
+
+maintainers:
+  - Yuxi Wang <Yuxi.Wang@monolithicpower.com>
+
+description: |
+  Monolithic Power Systems MP3326 LED Drivers
+
+  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
+
+  mps,led-protect:
+    description: |
+      LED short protection threshold.
+    enum: [0, 1, 2, 3]
+
+  multi-led:
+    type: object
+
+    properties:
+      "#address-cells":
+        const: 1
+      "#size-cells":
+        const: 0
+
+      color:
+        description: RGB module
+        const: LED_COLOR_ID_RGB
+
+      led_r:
+        type: object
+
+        properties:
+          "#address-cells":
+            const: 1
+          "#size-cells":
+            const: 0
+          reg:
+            description: Index of the LED.
+            minimum: 1
+            maximum: 16
+          color:
+            description: Red.
+            const: LED_COLOR_ID_RED
+          required:
+            - reg
+            - color
+
+      led_g:
+        type: object
+
+        properties:
+          "#address-cells":
+            const: 1
+          "#size-cells":
+            const: 0
+        reg:
+          description: Index of the LED.
+          minimum: 1
+          maximum: 16
+        color:
+          description: Green.
+          const: LED_COLOR_ID_GREEN
+        required:
+          - reg
+          - color
+
+      led_b:
+        type: object
+
+        properties:
+          "#address-cells":
+            const: 1
+          "#size-cells":
+            const: 0
+        reg:
+          description: Index of the LED.
+          minimum: 1
+          maximum: 16
+        color:
+          description: Blue.
+          const: LED_COLOR_ID_BLUE
+        required:
+          - reg
+          - color
+
+  patternProperties:
+    "^led@[0-3]$":
+      type: object
+
+      properties:
+        reg:
+          description: Index of the LED.
+          minimum: 1
+          maximum: 16
+
+        required:
+          - reg
+          - color
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mp3326@30 {
+            compatible = "mps,mp3326";
+            reg = <0x30>;
+            led-protect =<3>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            multi-led {
+              color = <LED_COLOR_ID_RGB>;
+              #address-cells = <1>;
+              #size-cells = <0>;
+
+              rgb_r@1 {
+                  #address-cells = <1>;
+                  #size-cells = <0>;
+                  reg  = <1>;
+                  color = <LED_COLOR_ID_RED>;
+              };
+              rgb_g@2 {
+                  #address-cells = <1>;
+                  #size-cells = <0>;
+                  reg = <2>;
+                  color = <LED_COLOR_ID_GREEN>;
+              };
+              rgb_b@3 {
+                  #address-cells = <1>;
+                  #size-cells = <0>;
+                  reg = <3>;
+                  color = <LED_COLOR_ID_BLUE>;
+              };
+            };
+        };
+    };
+
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mp3326@30 {
+            compatible = "mps,mp3326";
+            reg = <0x30>;
+            led-protect =<3>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+            led0@0 {
+                #address-cells = <1>;
+                #size-cells = <0>;
+                reg= <5>;
+                color = <LED_COLOR_ID_WHITE>;
+            };
+        };
+    };
+
+...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-11-25 10:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08  3:29 [PATCH 0/2] leds: add mp3326 driver Yuxi Wang
2023-11-08  3:29 ` [PATCH 1/2] dt-bindings: leds: add mps mp3326 LED Yuxi Wang
2023-11-08  4:15   ` Rob Herring
2023-11-08  8:20   ` Krzysztof Kozlowski
2023-11-08  9:30     ` Yuxi (Yuxi) Wang
2023-11-08 10:42       ` Krzysztof Kozlowski
2023-11-08  3:29 ` [PATCH 2/2] leds: add mp3326 driver Yuxi Wang
2023-11-12 11:21   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-11-24  9:30 [PATCH 0/2] leds: Add a driver for MP3326 Yuxi Wang
2023-11-24  9:30 ` [PATCH 1/2] dt-bindings: leds: add mps mp3326 LED Yuxi Wang
2023-11-25 10:44   ` Krzysztof Kozlowski
2023-10-31  6:59 Yuxi (Yuxi) Wang
2023-10-31  8:10 ` Krzysztof Kozlowski
2023-10-31 12:57 ` Rob Herring

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).