lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251002-ti-leds-to-dt-v1-2-1604ae333479@thegoodpenguin.co.uk>
Date: Thu, 02 Oct 2025 10:20:16 +0100
From: Harrison Carter <hcarter@...goodpenguin.co.uk>
To: Lee Jones <lee@...nel.org>, Pavel Machek <pavel@...nel.org>, 
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>, Dan Murphy <dmurphy@...com>
Cc: linux-leds@...r.kernel.org, devicetree@...r.kernel.org, 
 linux-kernel@...r.kernel.org, 
 Harrison Carter <hcarter@...goodpenguin.co.uk>
Subject: [PATCH 2/2] dt-bindings: leds: ti,lm3601x: Convert to DT Schema

Converts the ti,lm36010 and ti,lm36011 txt to dt schema

Signed-off-by: Harrison Carter <hcarter@...goodpenguin.co.uk>
---
 .../devicetree/bindings/leds/leds-lm3601x.txt      |  51 -----------
 .../devicetree/bindings/leds/ti,lm3601x.yaml       | 100 +++++++++++++++++++++
 2 files changed, 100 insertions(+), 51 deletions(-)

diff --git a/Documentation/devicetree/bindings/leds/leds-lm3601x.txt b/Documentation/devicetree/bindings/leds/leds-lm3601x.txt
deleted file mode 100644
index 17e940025dc26213314f5cfd54aa8e5bb09f86b7..0000000000000000000000000000000000000000
--- a/Documentation/devicetree/bindings/leds/leds-lm3601x.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-* Texas Instruments - lm3601x Single-LED Flash Driver
-
-The LM3601X are ultra-small LED flash drivers that
-provide a high level of adjustability.
-
-Required properties:
-	- compatible : Can be one of the following
-		"ti,lm36010"
-		"ti,lm36011"
-	- reg : I2C slave address
-	- #address-cells : 1
-	- #size-cells : 0
-
-Required child properties:
-	- reg : 0 - Indicates a IR mode
-		1 - Indicates a Torch (white LED) mode
-
-Required properties for flash LED child nodes:
-	See Documentation/devicetree/bindings/leds/common.txt
-	- flash-max-microamp : Range from 11mA - 1.5A
-	- flash-max-timeout-us : Range from 40ms - 1600ms
-	- led-max-microamp : Range from 2.4mA - 376mA
-
-Optional child properties:
-	- function : see Documentation/devicetree/bindings/leds/common.txt
-	- color : see Documentation/devicetree/bindings/leds/common.txt
-	- label : see Documentation/devicetree/bindings/leds/common.txt (deprecated)
-
-Example:
-
-#include <dt-bindings/leds/common.h>
-
-led-controller@64 {
-	compatible = "ti,lm36010";
-	#address-cells = <1>;
-	#size-cells = <0>;
-	reg = <0x64>;
-
-	led@0 {
-		reg = <1>;
-		function = LED_FUNCTION_TORCH;
-		color = <LED_COLOR_ID_WHITE>;
-		led-max-microamp = <376000>;
-		flash-max-microamp = <1500000>;
-		flash-max-timeout-us = <1600000>;
-	};
-}
-
-For more product information please see the links below:
-https://www.ti.com/product/LM36010
-https://www.ti.com/product/LM36011
diff --git a/Documentation/devicetree/bindings/leds/ti,lm3601x.yaml b/Documentation/devicetree/bindings/leds/ti,lm3601x.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..d7d8ee44d6fe37d13ee84888c5811df3e15a5d02
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/ti,lm3601x.yaml
@@ -0,0 +1,100 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/ti,lm3601x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments - lm3601x Single-LED Flash Driver
+
+description: |
+  The LM3601X are ultra-small LED flash drivers
+  that provide a high level of adjustability.
+
+  For more product information please see the links below:
+  https://www.ti.com/product/LM36010
+  https://www.ti.com/product/LM36011
+
+maintainers:
+  - Dan Murphy <dmurphy@...com>
+
+properties:
+  compatible:
+    enum:
+      - "ti,lm36010"
+      - "ti,lm36011"
+
+  reg:
+    maxItems: 1
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  "^led@[0,1]?([0-9]|[a-z])$":
+    type: object
+    $ref: common.yaml#
+    properties:
+      reg:
+        description: |
+          0 - Indicates IR mode
+          1 - Indicates Torch (white LED) mode
+        minimum: 0
+        maximum: 1
+
+      flash-max-microamp:
+        minimum: 11
+        maximum: 1500000
+
+      flash-max-timeout-us:
+        minimum: 40
+        maximum: 1600000
+
+      led-max-microamp:
+        minimum: 24
+        maximum: 376000
+
+    required:
+      - reg
+      - flash-max-microamp
+      - flash-max-timeout-us
+      - led-max-microamp
+
+    unevaluatedProperties: true
+
+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@64 {
+            compatible = "ti,lm36010";
+            #address-cells = <1>;
+            #size-cells = <0>;
+            reg = <0x64>;
+
+            led@1 {
+                reg = <1>;
+                function = LED_FUNCTION_TORCH;
+                color = <LED_COLOR_ID_WHITE>;
+                led-max-microamp = <376000>;
+                flash-max-microamp = <1500000>;
+                flash-max-timeout-us = <1600000>;
+            };
+        };
+    };
+...
+

-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ