2021-03-24 22:00:03

by Hermes Zhang

[permalink] [raw]
Subject: [PATCH v3] dt-binding: leds: Document leds-multi-gpio bindings

From: Hermes Zhang <[email protected]>

Document the device tree bindings of the multiple GPIOs LED driver
Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml.

Signed-off-by: Hermes Zhang <[email protected]>
---

Notes:
Add maxItems

.../bindings/leds/leds-multi-gpio.yaml | 50 +++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml

diff --git a/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml b/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
new file mode 100644
index 000000000000..6f2b47487b90
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/leds-multi-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Multiple GPIOs LED driver
+
+maintainers:
+ - Hermes Zhang <[email protected]>
+
+description:
+ This will support some LED made of multiple GPIOs and the brightness of the
+ LED could map to different states of the GPIOs.
+
+properties:
+ compatible:
+ const: multi-gpio-led
+
+ led-gpios:
+ description: Array of one or more GPIOs pins used to control the LED.
+ minItems: 1
+ maxItems: 8 # Should be enough
+
+ led-states:
+ description: |
+ The array list the supported states here which will map to brightness
+ from 0 to maximum. Each item in the array will present all the GPIOs
+ value by bit.
+ $ref: /schemas/types.yaml#/definitions/uint8-array
+ minItems: 1
+ maxItems: 16 # Should be enough
+
+required:
+ - compatible
+ - led-gpios
+ - led-states
+
+additionalProperties: false
+
+examples:
+ - |
+ gpios-led {
+ compatible = "multi-gpio-led";
+
+ led-gpios = <&gpio0 23 0x1>,
+ <&gpio0 24 0x1>;
+ led-states = /bits/ 8 <0x00 0x01 0x02 0x03>;
+ };
+...
--
2.20.1


2021-03-25 01:11:15

by Alexander Dahl

[permalink] [raw]
Subject: Re: [PATCH v3] dt-binding: leds: Document leds-multi-gpio bindings

Hello Hermes,

> Hermes Zhang <[email protected]> hat am 24.03.2021 03:48 geschrieben:
>
>
> From: Hermes Zhang <[email protected]>
>
> Document the device tree bindings of the multiple GPIOs LED driver
> Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml.
>
> Signed-off-by: Hermes Zhang <[email protected]>
> ---
>
> Notes:
> Add maxItems

What about the other part of the series? I think you should send both patches together with an introduction message on both. If you only change one patch for a new version spin of the series, just send the other one unchanged.

(It makes no sense to merge the binding as long as the driver is not merged, otherwise you would end up with a binding without driver. So keeping them together should help reviewers and maintainers.)

Greets
Alex

>
> .../bindings/leds/leds-multi-gpio.yaml | 50 +++++++++++++++++++
> 1 file changed, 50 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml b/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
> new file mode 100644
> index 000000000000..6f2b47487b90
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-multi-gpio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Multiple GPIOs LED driver
> +
> +maintainers:
> + - Hermes Zhang <[email protected]>
> +
> +description:
> + This will support some LED made of multiple GPIOs and the brightness of the
> + LED could map to different states of the GPIOs.
> +
> +properties:
> + compatible:
> + const: multi-gpio-led
> +
> + led-gpios:
> + description: Array of one or more GPIOs pins used to control the LED.
> + minItems: 1
> + maxItems: 8 # Should be enough
> +
> + led-states:
> + description: |
> + The array list the supported states here which will map to brightness
> + from 0 to maximum. Each item in the array will present all the GPIOs
> + value by bit.
> + $ref: /schemas/types.yaml#/definitions/uint8-array
> + minItems: 1
> + maxItems: 16 # Should be enough
> +
> +required:
> + - compatible
> + - led-gpios
> + - led-states
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + gpios-led {
> + compatible = "multi-gpio-led";
> +
> + led-gpios = <&gpio0 23 0x1>,
> + <&gpio0 24 0x1>;
> + led-states = /bits/ 8 <0x00 0x01 0x02 0x03>;
> + };
> +...
> --
> 2.20.1

2021-03-25 01:50:51

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH v3] dt-binding: leds: Document leds-multi-gpio bindings

On Wed 2021-03-24 06:58:21, Alexander Dahl wrote:
> Hello Hermes,
>
> > Hermes Zhang <[email protected]> hat am 24.03.2021 03:48 geschrieben:
> >
> >
> > From: Hermes Zhang <[email protected]>
> >
> > Document the device tree bindings of the multiple GPIOs LED driver
> > Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml.
> >
> > Signed-off-by: Hermes Zhang <[email protected]>
> > ---
> >
> > Notes:
> > Add maxItems
>
> What about the other part of the series? I think you should send both patches together with an introduction message on both. If you only change one patch for a new version spin of the series, just send the other one unchanged.
>

Please wrap emails after 72 columns or so.

> (It makes no sense to merge the binding as long as the driver is not merged, otherwise you would end up with a binding without driver. So keeping them together should help reviewers and maintainers.)
>

This is actually okay to do if you expect discussion and not a patch
merge. Series works, too.

Best regads,
Pavel
--
http://www.livejournal.com/~pavelmachek


Attachments:
(No filename) (1.10 kB)
signature.asc (188.00 B)
Digital signature
Download all attachments