dt-bindings: leds: backlight: Convert TPS65217 to DT schema
Subsystems (3)
PATCH 1/1 dt-bindings: leds: backlight: Convert TPS65217 to DT schema
Convert the Texas Instruments TPS65217 PMIC bindings to DT schema.
During the conversion, the following updates were made:
- Make the 'backlight' node optional to resolve dtbs_check warnings. Some boards declare a bare TPS65217 node without implementing the backlight configuration.
- Document the 'isink-en' property in the backlight subnode to resolve dtbs_check warnings. This property is used (am335x-guardian.dts) to manage the backlight current sinks. It was missing from the old txt binding.
- 'additionalProperties: true' is at the top level because the TPS65217 node is documented across multiple independent schemas matching the same compatible string.
--- .../bindings/leds/backlight/ti,tps65217.yaml | 82 +++++++++++++++++++ .../leds/backlight/tps65217-backlight.txt | 27 ------ 2 files changed, 82 insertions(+), 27 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml delete mode 100644 Documentation/devicetree/bindings/leds/backlight/tps65217-backlight.txt
Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml new file +82 -0
@@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/backlight/ti,tps65217.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TPS65217 family of regulators + +maintainers: + - Eduard Bostina <[email protected]> + +description: | + The TPS65217 chip contains a boost converter and current sinks which can be + used to drive LEDs for use as backlights. + +properties: + compatible: + const: ti,tps65217 + + reg: + maxItems: 1 + description: I2C slave address + + backlight: + type: object + additionalProperties: false + description: + Node for specifying WLED1 and WLED2 lines in TPS65217. + + properties: + isel: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [1, 2] + description: | + Selection bit. Valid values: + 1 - ISEL1 (low-level) + 2 - ISEL2 (high-level) + + fdim: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [100, 200, 500, 1000] + description: + PWM dimming frequency in Hz. + + default-brightness: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 100 + + isink-en: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Enable backlight current sinks. + + required: + - isel + - fdim + - default-brightness + +required: + - compatible + - reg + +additionalProperties: true + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + tps@24 { + reg = <0x24>; + compatible = "ti,tps65217"; + + backlight { + isel = <1>; /* 1 - ISET1, 2 ISET2 */ + fdim = <100>; /* TPS65217_BL_FDIM_100HZ */ + default-brightness = <50>; + }; + }; + };
Documentation/devicetree/bindings/leds/backlight/tps65217-backlight.txt deleted +0 -27
@@ -1,27 +0,0 @@ -TPS65217 family of regulators - -The TPS65217 chip contains a boost converter and current sinks which can be -used to drive LEDs for use as backlights. - -Required properties: -- compatible: "ti,tps65217" -- reg: I2C slave address -- backlight: node for specifying WLED1 and WLED2 lines in TPS65217 -- isel: selection bit, valid values: 1 for ISEL1 (low-level) and 2 for ISEL2 (high-level) -- fdim: PWM dimming frequency, valid values: 100, 200, 500, 1000 -- default-brightness: valid values: 0-100 - -Each regulator is defined using the standard binding for regulators. - -Example: - - tps: tps@24 { - reg = <0x24>; - compatible = "ti,tps65217"; - backlight { - isel = <1>; /* 1 - ISET1, 2 ISET2 */ - fdim = <100>; /* TPS65217_BL_FDIM_100HZ */ - default-brightness = <50>; - }; - }; -
Signature · 1 line
2.43.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 14 lines
Convert the Texas Instruments TPS65217 PMIC bindings to DT schema.
During the conversion, the following updates were made:
- Make the 'backlight' node optional to resolvedtbs_checkwarnings. Some boards declare a bare TPS65217 node without implementing the backlight configuration.
- Document the 'isink-en' property in the backlight subnode to resolvedtbs_checkwarnings. This property is used (am335x-guardian.dts) to manage the backlight current sinks. It was missing from the old txt binding.
- 'additionalProperties: true' is at the top level because the TPS65217 node is documented across multiple independent schemas matching the same compatible string.
Quoted 1 line
Signed-off-by Eduard Bostina <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Rob Herring
maintainerQuoted 13 lines · Eduard Bostina
Convert the Texas Instruments TPS65217 PMIC bindings to DT schema.
During the conversion, the following updates were made:
- Make the 'backlight' node optional to resolvedtbs_checkwarnings. Some boards declare a bare TPS65217 node without implementing the backlight configuration.
- Document the 'isink-en' property in the backlight subnode to resolvedtbs_checkwarnings. This property is used (am335x-guardian.dts) to manage the backlight current sinks. It was missing from the old txt binding.
- 'additionalProperties: true' is at the top level because the TPS65217 node is documented across multiple independent schemas matching the same compatible string.
We can't have true here.
Looks to me like you just need to define all the child nodes like 'regulators' (and its children) and 'charger' (which already has a schema).
Quoted 17 lines
Signed-off-by Eduard Bostina <[email protected]>--- .../bindings/leds/backlight/ti,tps65217.yaml | 82 +++++++++++++++++++ .../leds/backlight/tps65217-backlight.txt | 27 ------ 2 files changed, 82 insertions(+), 27 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml delete mode 100644 Documentation/devicetree/bindings/leds/backlight/tps65217-backlight.txtDocumentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml new file +2
-0@@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2
Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml line 12
Quoted 10 lines
Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml new file +10
-0+--- +$id: http://devicetree.org/schemas/leds/backlight/ti,tps65217.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TPS65217 family of regulators + +maintainers: + - Eduard Bostina <[email protected]> + +description: |
Don't need '|' if no formatting.
Quoted 32 lines
Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml new file +31
-0+ The TPS65217 chip contains a boost converter and current sinks which can be + used to drive LEDs for use as backlights. + +properties: + compatible: + const: ti,tps65217 + + reg: + maxItems: 1 + description: I2C slave address + + backlight: + type: object + additionalProperties: false + description: + Node for specifying WLED1 and WLED2 lines in TPS65217. + + properties: + isel: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [1, 2] + description: | + Selection bit. Valid values: + 1 - ISEL1 (low-level) + 2 - ISEL2 (high-level) + + fdim: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [100, 200, 500, 1000] + description: + PWM dimming frequency in Hz.
Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml line 53
Quoted 10 lines
Documentation/devicetree/bindings/leds/backlight/ti,tps65217.yaml new file +10
-0+ + default-brightness: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 100 + + isink-en: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Enable backlight current sinks.
Constraints? 0 or 1?
Not used by any driver, so perhaps it should be removed from the .dts file.
Rob