mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: dongsheng liu <2509730023@qq.com>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Daniel Mack <daniel@zonque.org>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] dt-bindings: leds: Convert leds-lt3593.txt to yaml format
Date: Tue, 22 Sep 2026 13:00:12 +0800	[thread overview]
Message-ID: <tencent_67B8796B733C275D1EF565D0D2CDB9B48306@qq.com> (raw)

Convert binding doc leds-lt3593.txt to yaml format, so that nodes using
the "lltc,lt3593" compatible are no longer reported by dtbs_check as:

  failed to match any schema with compatible: ['lltc,lt3593']

Additional change:
- reference common.yaml for the LED sub-node properties.
- require the sub-node, matching the driver's check for exactly one child.

The schema was written with the help of an LLM coding assistant, based on
the previous binding text and drivers/leds/leds-lt3593.c. It is validated
with make dt_binding_check, and against the "lltc,lt3593" node in
arch/arm/boot/dts/intel/pxa/pxa300-raumfeld-controller.dts.

Assisted-by: LLM dtschema yamllint
Signed-off-by: dongsheng liu <2509730023@qq.com>
---
 .../devicetree/bindings/leds/leds-lt3593.txt  | 37 -----------
 .../devicetree/bindings/leds/lltc,lt3593.yaml | 62 +++++++++++++++++++
 2 files changed, 62 insertions(+), 37 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-lt3593.txt
 create mode 100644 Documentation/devicetree/bindings/leds/lltc,lt3593.yaml

diff --git a/Documentation/devicetree/bindings/leds/leds-lt3593.txt b/Documentation/devicetree/bindings/leds/leds-lt3593.txt
deleted file mode 100644
index 24eccda..0000000
--- a/Documentation/devicetree/bindings/leds/leds-lt3593.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-Bindings for Linear Technologies LT3593 LED controller
-
-Required properties:
-- compatible:		Should be "lltc,lt3593".
-- lltc,ctrl-gpios:	A handle to the GPIO that is connected to the 'CTRL'
-			pin of the chip.
-
-The hardware supports only one LED. The properties of this LED are
-configured in a sub-node in the device node.
-
-Optional sub-node properties:
-- function:		See Documentation/devicetree/bindings/leds/common.txt
-- color:		See Documentation/devicetree/bindings/leds/common.txt
-- label:		A label for the LED. If none is given, the LED will be
-			named "lt3595::" (deprecated)
-- linux,default-trigger: The default trigger for the LED.
-			See Documentation/devicetree/bindings/leds/common.txt
-- default-state:	The initial state of the LED.
-			See Documentation/devicetree/bindings/leds/common.txt
-
-If multiple chips of this type are found in a design, each one needs to
-be handled by its own device node.
-
-Example:
-
-#include <dt-bindings/leds/common.h>
-
-led-controller {
-	compatible = "lltc,lt3593";
-	lltc,ctrl-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
-
-	led {
-		function = LED_FUNCTION_BACKLIGHT;
-		color = <LED_COLOR_ID_WHITE>;
-		default-state = "on";
-	};
-};
diff --git a/Documentation/devicetree/bindings/leds/lltc,lt3593.yaml b/Documentation/devicetree/bindings/leds/lltc,lt3593.yaml
new file mode 100644
index 0000000..5c1801e
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/lltc,lt3593.yaml
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/lltc,lt3593.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Linear Technology LT3593 LED controller
+
+maintainers:
+  - Daniel Mack <daniel@zonque.org>
+
+description: |
+  The LT3593 is a step-up DC/DC converter designed to drive a single LED
+  string. Its output current is programmed by the number of pulses applied to
+  the CTRL pin, which also acts as the enable input.
+
+  The hardware supports only one LED. The properties of this LED are
+  configured in a sub-node in the device node. If multiple chips of this type
+  are found in a design, each one needs to be handled by its own device node.
+
+properties:
+  compatible:
+    const: lltc,lt3593
+
+  lltc,ctrl-gpios:
+    maxItems: 1
+    description:
+      A handle to the GPIO that is connected to the 'CTRL' pin of the chip.
+
+  led:
+    type: object
+    $ref: common.yaml#
+    unevaluatedProperties: false
+    description:
+      Properties of the LED driven by the controller.
+
+required:
+  - compatible
+  - lltc,ctrl-gpios
+  - led
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/leds/common.h>
+
+    led-controller {
+        compatible = "lltc,lt3593";
+        pinctrl-names = "default";
+        pinctrl-0 = <&lt3593_pins>;
+        lltc,ctrl-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+
+        led {
+            function = LED_FUNCTION_BACKLIGHT;
+            color = <LED_COLOR_ID_WHITE>;
+            default-state = "on";
+        };
+    };
+
+...
-- 
2.43.0


             reply	other threads:[~2026-09-22  5:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  5:00 dongsheng liu [this message]
2026-09-28  6:18 ` 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=tencent_67B8796B733C275D1EF565D0D2CDB9B48306@qq.com \
    --to=2509730023@qq.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@zonque.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    --cc=robh@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

all inboxes | Powered by JetHome®