* [PATCH 1/1] dt-bindings: leds: Convert leds-tlc591xx.txt to yaml format
@ 2025-01-06 21:06 Frank Li
2025-01-06 23:06 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Frank Li @ 2025-01-06 21:06 UTC (permalink / raw)
To: Pavel Machek, Lee Jones, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andrew Lunn, open list:LED SUBSYSTEM,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
Cc: imx
Convert binding doc leds-tlc591xx.txt to yaml format to fix below DTB_CHECK
warning.
arch/arm64/boot/dts/freescale/imx8mp-aristainetos3-proton2s.dtb:
/soc@0/bus@30800000/i2c@30a30000/tlc59108@40: failed to match any schema with compatible: ['ti,tlc59108']
Additional change:
- ref to common.yaml for child nodes.
- limit child's reg to 0 - 7 for ti,tlc59108.
- fix typo 'linux,default_trigger' in example.
- change child node name's prefix to led-.
- change nodename to led-controller.
- fix properties order in example.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
.../bindings/leds/leds-tlc591xx.txt | 40 --------
.../devicetree/bindings/leds/ti,tlc59116.yaml | 91 +++++++++++++++++++
2 files changed, 91 insertions(+), 40 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/leds/leds-tlc591xx.txt
create mode 100644 Documentation/devicetree/bindings/leds/ti,tlc59116.yaml
diff --git a/Documentation/devicetree/bindings/leds/leds-tlc591xx.txt b/Documentation/devicetree/bindings/leds/leds-tlc591xx.txt
deleted file mode 100644
index 3bbbf70244119..0000000000000
--- a/Documentation/devicetree/bindings/leds/leds-tlc591xx.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-LEDs connected to tlc59116 or tlc59108
-
-Required properties
-- compatible: should be "ti,tlc59116" or "ti,tlc59108"
-- #address-cells: must be 1
-- #size-cells: must be 0
-- reg: typically 0x68
-
-Each led is represented as a sub-node of the ti,tlc59116.
-See Documentation/devicetree/bindings/leds/common.txt
-
-LED sub-node properties:
-- reg: number of LED line, 0 to 15 or 0 to 7
-- label: (optional) name of LED
-- linux,default-trigger : (optional)
-
-Examples:
-
-tlc59116@68 {
- #address-cells = <1>;
- #size-cells = <0>;
- compatible = "ti,tlc59116";
- reg = <0x68>;
-
- wan@0 {
- label = "wrt1900ac:amber:wan";
- reg = <0x0>;
- };
-
- 2g@2 {
- label = "wrt1900ac:white:2g";
- reg = <0x2>;
- };
-
- alive@9 {
- label = "wrt1900ac:green:alive";
- reg = <0x9>;
- linux,default_trigger = "heartbeat";
- };
-};
diff --git a/Documentation/devicetree/bindings/leds/ti,tlc59116.yaml b/Documentation/devicetree/bindings/leds/ti,tlc59116.yaml
new file mode 100644
index 0000000000000..cbf1a79b9cf6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/ti,tlc59116.yaml
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/ti,tlc59116.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LEDs connected to tlc59116 or tlc59108
+
+maintainers:
+ - Andrew Lunn <andrew@lunn.ch>
+
+properties:
+ compatible:
+ enum:
+ - ti,tlc59108
+ - ti,tlc59116
+
+ reg:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+patternProperties:
+ "(^led-[0-9a-f]$|led)":
+ type: object
+ $ref: common.yaml#
+ properties:
+ reg:
+ items:
+ minimum: 0
+ maximum: 15
+
+ unevaluatedProperties: false
+
+required:
+ - compatible
+ - reg
+ - "#address-cells"
+ - "#size-cells"
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,tlc59108
+ then:
+ patternProperties:
+ "(^led-[0-9a-f]$|led)":
+ properties:
+ reg:
+ items:
+ minimum: 0
+ maximum: 7
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led-controller@68 {
+ compatible = "ti,tlc59116";
+ reg = <0x68>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led-wan@0 {
+ reg = <0x0>;
+ label = "wrt1900ac:amber:wan";
+ };
+
+ led-2g@2 {
+ reg = <0x2>;
+ label = "wrt1900ac:white:2g";
+ };
+
+ led-alive@9 {
+ reg = <0x9>;
+ label = "wrt1900ac:green:alive";
+ linux,default-trigger = "heartbeat";
+ };
+ };
+ };
+
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/1] dt-bindings: leds: Convert leds-tlc591xx.txt to yaml format
2025-01-06 21:06 [PATCH 1/1] dt-bindings: leds: Convert leds-tlc591xx.txt to yaml format Frank Li
@ 2025-01-06 23:06 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2025-01-06 23:06 UTC (permalink / raw)
To: Frank Li
Cc: Pavel Machek, Lee Jones, Krzysztof Kozlowski, Conor Dooley,
Andrew Lunn, open list:LED SUBSYSTEM,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list, imx
On Mon, Jan 06, 2025 at 04:06:20PM -0500, Frank Li wrote:
> Convert binding doc leds-tlc591xx.txt to yaml format to fix below DTB_CHECK
> warning.
>
> arch/arm64/boot/dts/freescale/imx8mp-aristainetos3-proton2s.dtb:
> /soc@0/bus@30800000/i2c@30a30000/tlc59108@40: failed to match any schema with compatible: ['ti,tlc59108']
>
> Additional change:
> - ref to common.yaml for child nodes.
> - limit child's reg to 0 - 7 for ti,tlc59108.
> - fix typo 'linux,default_trigger' in example.
> - change child node name's prefix to led-.
> - change nodename to led-controller.
> - fix properties order in example.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> .../bindings/leds/leds-tlc591xx.txt | 40 --------
> .../devicetree/bindings/leds/ti,tlc59116.yaml | 91 +++++++++++++++++++
> 2 files changed, 91 insertions(+), 40 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/leds/leds-tlc591xx.txt
> create mode 100644 Documentation/devicetree/bindings/leds/ti,tlc59116.yaml
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-tlc591xx.txt b/Documentation/devicetree/bindings/leds/leds-tlc591xx.txt
> deleted file mode 100644
> index 3bbbf70244119..0000000000000
> --- a/Documentation/devicetree/bindings/leds/leds-tlc591xx.txt
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -LEDs connected to tlc59116 or tlc59108
> -
> -Required properties
> -- compatible: should be "ti,tlc59116" or "ti,tlc59108"
> -- #address-cells: must be 1
> -- #size-cells: must be 0
> -- reg: typically 0x68
> -
> -Each led is represented as a sub-node of the ti,tlc59116.
> -See Documentation/devicetree/bindings/leds/common.txt
> -
> -LED sub-node properties:
> -- reg: number of LED line, 0 to 15 or 0 to 7
> -- label: (optional) name of LED
> -- linux,default-trigger : (optional)
> -
> -Examples:
> -
> -tlc59116@68 {
> - #address-cells = <1>;
> - #size-cells = <0>;
> - compatible = "ti,tlc59116";
> - reg = <0x68>;
> -
> - wan@0 {
> - label = "wrt1900ac:amber:wan";
> - reg = <0x0>;
> - };
> -
> - 2g@2 {
> - label = "wrt1900ac:white:2g";
> - reg = <0x2>;
> - };
> -
> - alive@9 {
> - label = "wrt1900ac:green:alive";
> - reg = <0x9>;
> - linux,default_trigger = "heartbeat";
> - };
> -};
> diff --git a/Documentation/devicetree/bindings/leds/ti,tlc59116.yaml b/Documentation/devicetree/bindings/leds/ti,tlc59116.yaml
> new file mode 100644
> index 0000000000000..cbf1a79b9cf6c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/ti,tlc59116.yaml
> @@ -0,0 +1,91 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/ti,tlc59116.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LEDs connected to tlc59116 or tlc59108
> +
> +maintainers:
> + - Andrew Lunn <andrew@lunn.ch>
> +
> +properties:
> + compatible:
> + enum:
> + - ti,tlc59108
> + - ti,tlc59116
> +
> + reg:
> + maxItems: 1
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
> +
> +patternProperties:
> + "(^led-[0-9a-f]$|led)":
You have reg, so this should always have a unit-address: "^led@[0-9a-f]$"
> + type: object
> + $ref: common.yaml#
> + properties:
> + reg:
> + items:
> + minimum: 0
> + maximum: 15
> +
> + unevaluatedProperties: false
> +
> +required:
> + - compatible
> + - reg
> + - "#address-cells"
> + - "#size-cells"
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: ti,tlc59108
> + then:
> + patternProperties:
> + "(^led-[0-9a-f]$|led)":
> + properties:
> + reg:
> + items:
> + minimum: 0
0 is already the min.
> + maximum: 7
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + led-controller@68 {
> + compatible = "ti,tlc59116";
> + reg = <0x68>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + led-wan@0 {
> + reg = <0x0>;
> + label = "wrt1900ac:amber:wan";
> + };
> +
> + led-2g@2 {
> + reg = <0x2>;
> + label = "wrt1900ac:white:2g";
> + };
> +
> + led-alive@9 {
> + reg = <0x9>;
> + label = "wrt1900ac:green:alive";
> + linux,default-trigger = "heartbeat";
> + };
> + };
> + };
> +
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-06 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-06 21:06 [PATCH 1/1] dt-bindings: leds: Convert leds-tlc591xx.txt to yaml format Frank Li
2025-01-06 23:06 ` 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).