Skip to contentSkip to conversation

dt-bindings: leds: max77650: convert the binding document to yaml

PATCH In review Lucca fachinetti 2 participants 2 messages Jun 28, 2024 – Jul 1, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: leds: max77650: convert the binding document to yaml

From: Lucca Fachinetti <[email protected]>

Convert the binding document for max77650 LED module to yaml.

---
 .../bindings/leds/leds-is31fl32xx.txt         | 52 --------------
 .../bindings/leds/leds-is31fl32xx.yaml        | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 52 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl32xx.txt
 create mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml
Documentation/devicetree/bindings/leds/leds-is31fl32xx.txt deleted +0 -52
deleted file mode 100644
index 926c2117942c..000000000000
@@ -1,52 +0,0 @@
-Binding for ISSI IS31FL32xx and Si-En SN32xx LED Drivers
-
-The IS31FL32xx/SN32xx family of LED drivers are I2C devices with multiple
-constant-current channels, each with independent 256-level PWM control.
-Each LED is represented as a sub-node of the device.
-
-Required properties:
-- compatible: one of
-	issi,is31fl3236
-	issi,is31fl3235
-	issi,is31fl3218
-	issi,is31fl3216
-	si-en,sn3218
-	si-en,sn3216
-- reg: I2C slave address
-- address-cells : must be 1
-- size-cells : must be 0
-
-LED sub-node properties:
-- reg : LED channel number (1..N)
-- label :  (optional)
-  see Documentation/devicetree/bindings/leds/common.txt
-- linux,default-trigger :  (optional)
-  see Documentation/devicetree/bindings/leds/common.txt
-
-
-Example:
-
-is31fl3236: led-controller@3c {
-	compatible = "issi,is31fl3236";
-	reg = <0x3c>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	led@1 {
-		reg = <1>;
-		label = "EB:blue:usr0";
-	};
-	led@2 {
-		reg = <2>;
-		label = "EB:blue:usr1";
-	};
-	...
-	led@36 {
-		reg = <36>;
-		label = "EB:blue:usr35";
-	};
-};
-
-For more product information please see the links below:
-http://www.issi.com/US/product-analog-fxled-driver.shtml
-http://www.si-en.com/product.asp?parentid=890
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw

Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml

Quoted 75 lines · Lucca fachinetti

From: Lucca Fachinetti <[email protected]>

Convert the binding document for max77650 LED module to yaml.

---
 .../bindings/leds/leds-is31fl32xx.txt         | 52 --------------
 .../bindings/leds/leds-is31fl32xx.yaml        | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 52 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl32xx.txt
 create mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml
Documentation/devicetree/bindings/leds/leds-is31fl32xx.txt deleted +0 -52
deleted file mode 100644
index 926c2117942c..000000000000
@@ -1,52 +0,0 @@
-Binding for ISSI IS31FL32xx and Si-En SN32xx LED Drivers
-
-The IS31FL32xx/SN32xx family of LED drivers are I2C devices with multiple
-constant-current channels, each with independent 256-level PWM control.
-Each LED is represented as a sub-node of the device.
-
-Required properties:
-- compatible: one of
-	issi,is31fl3236
-	issi,is31fl3235
-	issi,is31fl3218
-	issi,is31fl3216
-	si-en,sn3218
-	si-en,sn3216
-- reg: I2C slave address
-- address-cells : must be 1
-- size-cells : must be 0
-
-LED sub-node properties:
-- reg : LED channel number (1..N)
-- label :  (optional)
-  see Documentation/devicetree/bindings/leds/common.txt
-- linux,default-trigger :  (optional)
-  see Documentation/devicetree/bindings/leds/common.txt
-
-
-Example:
-
-is31fl3236: led-controller@3c {
-	compatible = "issi,is31fl3236";
-	reg = <0x3c>;
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	led@1 {
-		reg = <1>;
-		label = "EB:blue:usr0";
-	};
-	led@2 {
-		reg = <2>;
-		label = "EB:blue:usr1";
-	};
-	...
-	led@36 {
-		reg = <36>;
-		label = "EB:blue:usr35";
-	};
-};
-
-For more product information please see the links below:
-http://www.issi.com/US/product-analog-fxled-driver.shtml
-http://www.si-en.com/product.asp?parentid=890
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +0 -0
new file mode 100644
index 000000000000..0f4c7c3440c6

Can you call the binding after one of the compatible strings please?

Quoted 4 lines
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +3 -0
@@ -0,0 +1,67 @@
+ # SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---

Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml line 13

Quoted 10 lines
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +10 -0
+$id: http://devicetree.org/schemas/leds/leds-is31fl32xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LED driver for is31fl32xx and Si-En SN32xx.
+
+maintainers:
+  - Pavel Machek <[email protected]>
+  - Lee Jones <[email protected]>
+
+description: |

The | here likely isn't needed, the formatting isn't really worth preserving....

Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml line 14

Quoted 1 line
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +1 -0
+  Binding for ISSI is31fl32xx and Si-En SN32xx LED Drivers

Especially as this line is just duplicating the title.

Quoted 19 lines
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +19 -0
+
+  The is31fl32xx/SN32xx family of LED drivers are I2C devices with multiple
+  constant-current channels, each with independent 256-level PWM control.
+  Each LED is represented as a sub-node of the device.
+
+properties:
+  compatible:
+    enum:
+      - issi,is31fl3236
+      - issi,is31fl3235
+      - issi,is31fl3218
+      - issi,is31fl3216
+      - si-en,sn3218
+      - si-en,sn3216
+
+  reg:
+    maxItems: 1
+    description:
+      I2C slave address

Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml line 43

Quoted 10 lines
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +10 -0
+
+  '#address-cells':
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^led@[1-9][0-9]*$":
+    type: object

You're missing a ref to leds/common.yaml here, where the label and trigger properties are described.

Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml line 44

Quoted 1 line
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +1 -0
+    description: |

And this | isn't needed either.

Quoted 13 lines
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +13 -0
+      Properties for a single subnode LED.
+    additionalProperties: false
+
+    properties:
+      reg:
+        minItems: 1
+        description:
+          LED channel number (1..N)
+
+      label: true
+
+      linux,default-trigger: true
+

Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml line 67

Quoted 10 lines
Documentation/devicetree/bindings/leds/leds-is31fl32xx.yaml new file +10 -0
+    required:
+      - reg
+
+required:
+  - compatible
+  - reg
+  - "#size-cells"
+  - "#address-cells"
+
+additionalProperties: false

You should add the example from the text binding to the yaml one too, so that dt_binding_check can be used to validate the binding versus the example.

Thanks,
Conor.