* [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema
@ 2023-04-12 14:05 Wadim Egorov
2023-04-12 14:05 ` Wadim Egorov
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Wadim Egorov @ 2023-04-12 14:05 UTC (permalink / raw)
To: upstream, linux-kernel, devicetree, linux-leds
Cc: riku.voipio, krzysztof.kozlowski+dt, robh+dt, lee, pavel
Convert the PCA9532 LED Dimmer to dtschema.
While at it, update the example to match recommended node names and
the link to the product datasheet. Also add GPIO properties since
the driver allows to use unused pins as GPIOs.
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
v3:
- Add gpio-controller & gpio-cells property, fixes
arch/arm/boot/dts/lpc3250-ea3250.dtb: pca9532@60: '#gpio-cells', 'gpio-controller'
do not match any of the regexes: '^led-[0-9a-z]+$', 'pinctrl-[0-9]+'
v2:
- Rename yaml file to match compatibles, nxp,pca953x.yaml
- Remove Jacek Anaszewski from maintainers list
- Remove color labels in example
- Restore labels/default-states from original example
- Drop reg description
- Add unevaluatedProperties to patternProperties scope
- Update description of type property & set default to 0
- Fix indentation in example
---
.../devicetree/bindings/leds/leds-pca9532.txt | 49 ----------
.../devicetree/bindings/leds/nxp,pca953x.yaml | 90 +++++++++++++++++++
2 files changed, 90 insertions(+), 49 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/leds/leds-pca9532.txt
create mode 100644 Documentation/devicetree/bindings/leds/nxp,pca953x.yaml
diff --git a/Documentation/devicetree/bindings/leds/leds-pca9532.txt b/Documentation/devicetree/bindings/leds/leds-pca9532.txt
deleted file mode 100644
index f769c52e3643..000000000000
--- a/Documentation/devicetree/bindings/leds/leds-pca9532.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-*NXP - pca9532 PWM LED Driver
-
-The PCA9532 family is SMBus I/O expander optimized for dimming LEDs.
-The PWM support 256 steps.
-
-Required properties:
- - compatible:
- "nxp,pca9530"
- "nxp,pca9531"
- "nxp,pca9532"
- "nxp,pca9533"
- - reg - I2C slave address
-
-Each led is represented as a sub-node of the nxp,pca9530.
-
-Optional sub-node properties:
- - label: see Documentation/devicetree/bindings/leds/common.txt
- - type: Output configuration, see dt-bindings/leds/leds-pca9532.h (default NONE)
- - linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt
- - default-state: see Documentation/devicetree/bindings/leds/common.txt
- This property is only valid for sub-nodes of type <PCA9532_TYPE_LED>.
-
-Example:
- #include <dt-bindings/leds/leds-pca9532.h>
-
- leds: pca9530@60 {
- compatible = "nxp,pca9530";
- reg = <0x60>;
-
- red-power {
- label = "pca:red:power";
- type = <PCA9532_TYPE_LED>;
- };
- green-power {
- label = "pca:green:power";
- type = <PCA9532_TYPE_LED>;
- };
- kernel-booting {
- type = <PCA9532_TYPE_LED>;
- default-state = "on";
- };
- sys-stat {
- type = <PCA9532_TYPE_LED>;
- default-state = "keep"; // don't touch, was set by U-Boot
- };
- };
-
-For more product information please see the link below:
-http://nxp.com/documents/data_sheet/PCA9532.pdf
diff --git a/Documentation/devicetree/bindings/leds/nxp,pca953x.yaml b/Documentation/devicetree/bindings/leds/nxp,pca953x.yaml
new file mode 100644
index 000000000000..edf6f55df685
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/nxp,pca953x.yaml
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/nxp,pca953x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PCA9532 LED Dimmer
+
+maintainers:
+ - Riku Voipio <riku.voipio@iki.fi>
+
+description: |
+ The PCA9532 family is SMBus I/O expander optimized for dimming LEDs.
+ The PWM support 256 steps.
+
+ For more product information please see the link below:
+ https://www.nxp.com/docs/en/data-sheet/PCA9532.pdf
+
+properties:
+ compatible:
+ enum:
+ - nxp,pca9530
+ - nxp,pca9531
+ - nxp,pca9532
+ - nxp,pca9533
+
+ reg:
+ maxItems: 1
+
+ gpio-controller: true
+
+ '#gpio-cells':
+ const: 2
+
+patternProperties:
+ "^led-[0-9a-z]+$":
+ type: object
+ $ref: common.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ type:
+ description: |
+ Output configuration, see include/dt-bindings/leds/leds-pca9532.h
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 0
+ minimum: 0
+ maximum: 4
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/leds/leds-pca9532.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led-controller@62 {
+ compatible = "nxp,pca9533";
+ reg = <0x62>;
+
+ led-1 {
+ label = "pca:red:power";
+ type = <PCA9532_TYPE_LED>;
+ };
+
+ led-2 {
+ label = "pca:green:power";
+ type = <PCA9532_TYPE_LED>;
+ };
+
+ led-3 {
+ type = <PCA9532_TYPE_LED>;
+ default-state = "on";
+ };
+
+ led-4 {
+ type = <PCA9532_TYPE_LED>;
+ default-state = "keep";
+ };
+ };
+ };
+
+...
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema
2023-04-12 14:05 [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema Wadim Egorov
@ 2023-04-12 14:05 ` Wadim Egorov
2023-04-13 16:46 ` Krzysztof Kozlowski
2023-04-14 12:20 ` Pavel Machek
2023-04-20 11:28 ` Lee Jones
2 siblings, 1 reply; 5+ messages in thread
From: Wadim Egorov @ 2023-04-12 14:05 UTC (permalink / raw)
To: upstream, linux-kernel, devicetree, linux-leds
Cc: riku.voipio, krzysztof.kozlowski+dt, robh+dt, lee, pavel
Convert the PCA9532 LED Dimmer to dtschema.
While at it, update the example to match recommended node names and
the link to the product datasheet. Also add GPIO properties since
the driver allows to use unused pins as GPIOs.
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
v3:
- Add gpio-controller & gpio-cells property, fixes
arch/arm/boot/dts/lpc3250-ea3250.dtb: pca9532@60: '#gpio-cells', 'gpio-controller'
do not match any of the regexes: '^led-[0-9a-z]+$', 'pinctrl-[0-9]+'
v2:
- Rename yaml file to match compatibles, nxp,pca953x.yaml
- Remove Jacek Anaszewski from maintainers list
- Remove color labels in example
- Restore labels/default-states from original example
- Drop reg description
- Add unevaluatedProperties to patternProperties scope
- Update description of type property & set default to 0
- Fix indentation in example
---
.../devicetree/bindings/leds/leds-pca9532.txt | 49 ----------
.../devicetree/bindings/leds/nxp,pca953x.yaml | 90 +++++++++++++++++++
2 files changed, 90 insertions(+), 49 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/leds/leds-pca9532.txt
create mode 100644 Documentation/devicetree/bindings/leds/nxp,pca953x.yaml
diff --git a/Documentation/devicetree/bindings/leds/leds-pca9532.txt b/Documentation/devicetree/bindings/leds/leds-pca9532.txt
deleted file mode 100644
index f769c52e3643..000000000000
--- a/Documentation/devicetree/bindings/leds/leds-pca9532.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-*NXP - pca9532 PWM LED Driver
-
-The PCA9532 family is SMBus I/O expander optimized for dimming LEDs.
-The PWM support 256 steps.
-
-Required properties:
- - compatible:
- "nxp,pca9530"
- "nxp,pca9531"
- "nxp,pca9532"
- "nxp,pca9533"
- - reg - I2C slave address
-
-Each led is represented as a sub-node of the nxp,pca9530.
-
-Optional sub-node properties:
- - label: see Documentation/devicetree/bindings/leds/common.txt
- - type: Output configuration, see dt-bindings/leds/leds-pca9532.h (default NONE)
- - linux,default-trigger: see Documentation/devicetree/bindings/leds/common.txt
- - default-state: see Documentation/devicetree/bindings/leds/common.txt
- This property is only valid for sub-nodes of type <PCA9532_TYPE_LED>.
-
-Example:
- #include <dt-bindings/leds/leds-pca9532.h>
-
- leds: pca9530@60 {
- compatible = "nxp,pca9530";
- reg = <0x60>;
-
- red-power {
- label = "pca:red:power";
- type = <PCA9532_TYPE_LED>;
- };
- green-power {
- label = "pca:green:power";
- type = <PCA9532_TYPE_LED>;
- };
- kernel-booting {
- type = <PCA9532_TYPE_LED>;
- default-state = "on";
- };
- sys-stat {
- type = <PCA9532_TYPE_LED>;
- default-state = "keep"; // don't touch, was set by U-Boot
- };
- };
-
-For more product information please see the link below:
-http://nxp.com/documents/data_sheet/PCA9532.pdf
diff --git a/Documentation/devicetree/bindings/leds/nxp,pca953x.yaml b/Documentation/devicetree/bindings/leds/nxp,pca953x.yaml
new file mode 100644
index 000000000000..edf6f55df685
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/nxp,pca953x.yaml
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/nxp,pca953x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PCA9532 LED Dimmer
+
+maintainers:
+ - Riku Voipio <riku.voipio@iki.fi>
+
+description: |
+ The PCA9532 family is SMBus I/O expander optimized for dimming LEDs.
+ The PWM support 256 steps.
+
+ For more product information please see the link below:
+ https://www.nxp.com/docs/en/data-sheet/PCA9532.pdf
+
+properties:
+ compatible:
+ enum:
+ - nxp,pca9530
+ - nxp,pca9531
+ - nxp,pca9532
+ - nxp,pca9533
+
+ reg:
+ maxItems: 1
+
+ gpio-controller: true
+
+ '#gpio-cells':
+ const: 2
+
+patternProperties:
+ "^led-[0-9a-z]+$":
+ type: object
+ $ref: common.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ type:
+ description: |
+ Output configuration, see include/dt-bindings/leds/leds-pca9532.h
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 0
+ minimum: 0
+ maximum: 4
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/leds/leds-pca9532.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led-controller@62 {
+ compatible = "nxp,pca9533";
+ reg = <0x62>;
+
+ led-1 {
+ label = "pca:red:power";
+ type = <PCA9532_TYPE_LED>;
+ };
+
+ led-2 {
+ label = "pca:green:power";
+ type = <PCA9532_TYPE_LED>;
+ };
+
+ led-3 {
+ type = <PCA9532_TYPE_LED>;
+ default-state = "on";
+ };
+
+ led-4 {
+ type = <PCA9532_TYPE_LED>;
+ default-state = "keep";
+ };
+ };
+ };
+
+...
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema
2023-04-12 14:05 ` Wadim Egorov
@ 2023-04-13 16:46 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-13 16:46 UTC (permalink / raw)
To: Wadim Egorov, upstream, linux-kernel, devicetree, linux-leds
Cc: riku.voipio, krzysztof.kozlowski+dt, robh+dt, lee, pavel
On 12/04/2023 16:05, Wadim Egorov wrote:
> Convert the PCA9532 LED Dimmer to dtschema.
> While at it, update the example to match recommended node names and
> the link to the product datasheet. Also add GPIO properties since
> the driver allows to use unused pins as GPIOs.
>
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> ---
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema
2023-04-12 14:05 [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema Wadim Egorov
2023-04-12 14:05 ` Wadim Egorov
@ 2023-04-14 12:20 ` Pavel Machek
2023-04-20 11:28 ` Lee Jones
2 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2023-04-14 12:20 UTC (permalink / raw)
To: Wadim Egorov
Cc: upstream, linux-kernel, devicetree, linux-leds, riku.voipio,
krzysztof.kozlowski+dt, robh+dt, lee
[-- Attachment #1: Type: text/plain, Size: 489 bytes --]
On Wed 2023-04-12 16:05:51, Wadim Egorov wrote:
> Convert the PCA9532 LED Dimmer to dtschema.
> While at it, update the example to match recommended node names and
> the link to the product datasheet. Also add GPIO properties since
> the driver allows to use unused pins as GPIOs.
>
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
BR,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema
2023-04-12 14:05 [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema Wadim Egorov
2023-04-12 14:05 ` Wadim Egorov
2023-04-14 12:20 ` Pavel Machek
@ 2023-04-20 11:28 ` Lee Jones
2 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2023-04-20 11:28 UTC (permalink / raw)
To: Wadim Egorov
Cc: upstream, linux-kernel, devicetree, linux-leds, riku.voipio,
krzysztof.kozlowski+dt, robh+dt, pavel
On Wed, 12 Apr 2023, Wadim Egorov wrote:
> Convert the PCA9532 LED Dimmer to dtschema.
> While at it, update the example to match recommended node names and
> the link to the product datasheet. Also add GPIO properties since
> the driver allows to use unused pins as GPIOs.
>
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> ---
> v3:
> - Add gpio-controller & gpio-cells property, fixes
> arch/arm/boot/dts/lpc3250-ea3250.dtb: pca9532@60: '#gpio-cells', 'gpio-controller'
> do not match any of the regexes: '^led-[0-9a-z]+$', 'pinctrl-[0-9]+'
>
> v2:
> - Rename yaml file to match compatibles, nxp,pca953x.yaml
> - Remove Jacek Anaszewski from maintainers list
> - Remove color labels in example
> - Restore labels/default-states from original example
> - Drop reg description
> - Add unevaluatedProperties to patternProperties scope
> - Update description of type property & set default to 0
> - Fix indentation in example
> ---
> .../devicetree/bindings/leds/leds-pca9532.txt | 49 ----------
> .../devicetree/bindings/leds/nxp,pca953x.yaml | 90 +++++++++++++++++++
> 2 files changed, 90 insertions(+), 49 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/leds/leds-pca9532.txt
> create mode 100644 Documentation/devicetree/bindings/leds/nxp,pca953x.yaml
Applied, thanks
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-04-20 11:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12 14:05 [PATCH v3] dt-bindings: leds: Convert PCA9532 to dtschema Wadim Egorov
2023-04-12 14:05 ` Wadim Egorov
2023-04-13 16:46 ` Krzysztof Kozlowski
2023-04-14 12:20 ` Pavel Machek
2023-04-20 11:28 ` Lee Jones
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).