All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Eckert <fe@dev.tdt.de>
To: pavel@ucw.cz, robh+dt@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: [PATCH v2 2/2] dt: bindings: KTD20xx: Introduce the ktd20xx family of RGB drivers
Date: Tue, 23 Nov 2021 11:18:26 +0100	[thread overview]
Message-ID: <20211123101826.9069-3-fe@dev.tdt.de> (raw)
In-Reply-To: <20211123101826.9069-1-fe@dev.tdt.de>

Introduce the bindings for the Kinetic KTD2061/58/59/60RGB LED device
driver. The KTD20xx can control RGB LEDs individually or as part of a
control bank group.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
---
 .../bindings/leds/leds-ktd20xx.yaml           | 123 ++++++++++++++++++
 MAINTAINERS                                   |   1 +
 2 files changed, 124 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-ktd20xx.yaml

diff --git a/Documentation/devicetree/bindings/leds/leds-ktd20xx.yaml b/Documentation/devicetree/bindings/leds/leds-ktd20xx.yaml
new file mode 100644
index 000000000000..b10b5fd507db
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-ktd20xx.yaml
@@ -0,0 +1,123 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/leds-ktd20xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LED driver for KTD20xx RGB LED from Kinetic.
+
+maintainers:
+  - Florian Eckert <fe@dev.tdt.de>
+
+description: |
+  The KTD20XX is multi-channel, I2C RGB LED Drivers that can group RGB LEDs into
+  a LED group or control them individually.
+
+  The difference in these RGB LED drivers is I2C address number the device is
+  listen on.
+
+properties:
+  compatible:
+    enum:
+      - kinetic,ktd20xx
+
+  reg:
+    maxItems: 1
+    description:
+      I2C slave address
+      ktd2061/58/59/60 0x68 0x69 0x6A 0x6B
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  'kinetic,color-current0':
+    description:
+      Specifies the current selection for the RGB color0.
+      Value 1 must be the current value for the color red.
+      Value 2 must be the current value for the color green.
+      Value 3 must be the current value for the color blue.
+      The current setting range is from 0mA to 24mA with 125uA steps.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    items:
+      - minItems: 3
+      - maxItems: 3
+
+  'kinetic,color-current1':
+    description:
+      Specifies the current selection for the RGB color0.
+      Value 1 must be the current value for the color red.
+      Value 2 must be the current value for the color green.
+      Value 3 must be the current value for the color blue.
+      The current setting range is from 0mA to 24mA with 125uA steps.
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    items:
+      - minItems: 3
+      - maxItems: 3
+
+patternProperties:
+  '^multi-led@[0-9a-f]$':
+    type: object
+    allOf:
+      - $ref: leds-class-multicolor.yaml#
+    properties:
+      reg:
+        minItems: 1
+        maxItems: 12
+        description:
+          This property denotes the LED module number(s) that is used on the
+          for the child node.
+      'kinetic,color-selection':
+        description:
+          Specifies the color selection for this LED.
+          Value 1 selects the color register for color red.
+          Value 2 selects the color register for color green.
+          Value 3 selects the color register for color blue.
+          The value can be either 0 or 1. If 0, the current for the color
+          from color register 0 is used. If 1, the current for the color
+          from color register 1 is used.
+     $ref: /schemas/types.yaml#/definitions/uint8-array
+     items:
+       - minItems: 3
+       - maxItems: 3
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+   #include <dt-bindings/leds/common.h>
+
+   i2c {
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       led-controller@14 {
+           compatible = "ti,lp5009";
+           reg = <0x14>;
+           #address-cells = <1>;
+           #size-cells = <0>;
+           color-current0 = [ 00 00 00 ] // Current for RGB is 0mA
+           color-current1 = [ 28 28 28 ] // Current for RGB is 5mA
+
+           multi-led@0 {
+               reg = <0x0>;
+               color = <LED_COLOR_ID_RGB>;
+               function = LED_FUNCTION_CHARGING;
+                kinetic,color-selection = [ 00 01 00 ]; // Red=0mA Green=5mA Blue=0mA
+          };
+
+          multi-led@2 {
+            reg = <0x2>;
+            color = <LED_COLOR_ID_RGB>;
+            function = LED_FUNCTION_STANDBY;
+         };
+       };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 736d564f7e93..125bae48c2d1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10607,6 +10607,7 @@ KTD20XX LED CONTROLLER DRIVER
 M:	Florian Eckert <fe@dev.tdt.de>
 L:	linux-leds@vger.kernel.org
 S:	Maintained
+F:	Documentation/devicetree/bindings/leds/leds-ktd20xx.yaml
 F:	drivers/leds/leds-ktd20xx.c
 
 KTEST
-- 
2.20.1


  parent reply	other threads:[~2021-11-23 10:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 10:18 [PATCH v2 0/2] leds: Add KTD20xx RGB LEDs driver from Kinetic Florian Eckert
2021-11-23 10:18 ` [PATCH v2 1/2] leds: ktd20xx: Add the KTD20xx family of the " Florian Eckert
2021-12-15 20:46   ` Pavel Machek
2021-12-20  8:01     ` Florian Eckert
2021-11-23 10:18 ` Florian Eckert [this message]
2021-11-30 21:53   ` [PATCH v2 2/2] dt: bindings: KTD20xx: Introduce the ktd20xx family of RGB drivers Rob Herring
2021-12-21 13:40 [PATCH v2 0/2] leds: add ktd20xx LED driver support Florian Eckert
2021-12-21 13:40 ` [PATCH v2 2/2] dt: bindings: KTD20xx: Introduce the ktd20xx family of RGB drivers Florian Eckert
2021-12-22 18:44   ` Rob Herring

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=20211123101826.9069-3-fe@dev.tdt.de \
    --to=fe@dev.tdt.de \
    --cc=devicetree@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.