Linux-LEDs Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] dt-binding: leds: Document leds-multi-gpio bindings
@ 2021-03-22  9:18 Hermes Zhang
  2021-03-22 17:38 ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Hermes Zhang @ 2021-03-22  9:18 UTC (permalink / raw)
  To: Pavel Machek, Dan Murphy, Rob Herring, Hermes Zhang
  Cc: kernel, linux-leds, devicetree, linux-kernel

From: Hermes Zhang <chenhuiz@axis.com>

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

Signed-off-by: Hermes Zhang <chenhuiz@axis.com>
---

Notes:
    Fix typo and missing item

 .../bindings/leds/leds-multi-gpio.yaml        | 49 +++++++++++++++++++
 1 file changed, 49 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..bc19d1758d92
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
@@ -0,0 +1,49 @@
+# 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 <chenhuiz@axis.com>
+
+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
+
+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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-binding: leds: Document leds-multi-gpio bindings
  2021-03-22  9:18 [PATCH v2] dt-binding: leds: Document leds-multi-gpio bindings Hermes Zhang
@ 2021-03-22 17:38 ` Rob Herring
  2021-03-23  4:27   ` Hermes Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2021-03-22 17:38 UTC (permalink / raw)
  To: Hermes Zhang
  Cc: Pavel Machek, Rob Herring, devicetree, kernel, linux-kernel,
	Dan Murphy, Hermes Zhang, linux-leds

On Mon, 22 Mar 2021 17:18:19 +0800, Hermes Zhang wrote:
> From: Hermes Zhang <chenhuiz@axis.com>
> 
> Document the device tree bindings of the multiple GPIOs LED driver
> Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml.
> 
> Signed-off-by: Hermes Zhang <chenhuiz@axis.com>
> ---
> 
> Notes:
>     Fix typo and missing item
> 
>  .../bindings/leds/leds-multi-gpio.yaml        | 49 +++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/leds-multi-gpio.example.dt.yaml: gpios-led: led-states: 'oneOf' conditional failed, one must be fixed:
	[[0, 1, 2, 3]] is too short
	[0, 1, 2, 3] is too long
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml

See https://patchwork.ozlabs.org/patch/1456433

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] dt-binding: leds: Document leds-multi-gpio bindings
  2021-03-22 17:38 ` Rob Herring
@ 2021-03-23  4:27   ` Hermes Zhang
  2021-03-23 14:00     ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Hermes Zhang @ 2021-03-23  4:27 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pavel Machek, Rob Herring, devicetree, kernel, linux-kernel,
	Dan Murphy, linux-leds

> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: 2021年3月23日 1:38
> My bot found errors running 'make dt_binding_check' on your patch:
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/leds/leds-multi-
> gpio.example.dt.yaml: gpios-led: led-states: 'oneOf' conditional failed, one
> must be fixed:
> 	[[0, 1, 2, 3]] is too short
> 	[0, 1, 2, 3] is too long
> 	From schema: /builds/robherring/linux-dt-
> review/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
> 

Hi Rob,

Thanks. Yes, now I can see the warning, but I could not understand what was wrong? Could you give some hint? 

Best Regards,
Hermes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-binding: leds: Document leds-multi-gpio bindings
  2021-03-23  4:27   ` Hermes Zhang
@ 2021-03-23 14:00     ` Rob Herring
  2021-03-24  2:52       ` Hermes Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2021-03-23 14:00 UTC (permalink / raw)
  To: Hermes Zhang
  Cc: Pavel Machek, devicetree, kernel, linux-kernel, Dan Murphy, linux-leds

On Mon, Mar 22, 2021 at 10:28 PM Hermes Zhang <Hermes.Zhang@axis.com> wrote:
>
> > -----Original Message-----
> > From: Rob Herring <robh@kernel.org>
> > Sent: 2021年3月23日 1:38
> > My bot found errors running 'make dt_binding_check' on your patch:
> >
> > yamllint warnings/errors:
> >
> > dtschema/dtc warnings/errors:
> > /builds/robherring/linux-dt-
> > review/Documentation/devicetree/bindings/leds/leds-multi-
> > gpio.example.dt.yaml: gpios-led: led-states: 'oneOf' conditional failed, one
> > must be fixed:
> >       [[0, 1, 2, 3]] is too short
> >       [0, 1, 2, 3] is too long
> >       From schema: /builds/robherring/linux-dt-
> > review/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml
> >
>
> Hi Rob,
>
> Thanks. Yes, now I can see the warning, but I could not understand what was wrong? Could you give some hint?

I think you need 'maxItems' in addition to minItems.

Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2] dt-binding: leds: Document leds-multi-gpio bindings
  2021-03-23 14:00     ` Rob Herring
@ 2021-03-24  2:52       ` Hermes Zhang
  0 siblings, 0 replies; 5+ messages in thread
From: Hermes Zhang @ 2021-03-24  2:52 UTC (permalink / raw)
  To: Rob Herring
  Cc: Pavel Machek, devicetree, kernel, linux-kernel, Dan Murphy, linux-leds

> >
> > Hi Rob,
> >
> > Thanks. Yes, now I can see the warning, but I could not understand what
> was wrong? Could you give some hint?
> 
> I think you need 'maxItems' in addition to minItems.

Exactly! Thanks for the suggestion.

Best Regards,
Hermes

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22  9:18 [PATCH v2] dt-binding: leds: Document leds-multi-gpio bindings Hermes Zhang
2021-03-22 17:38 ` Rob Herring
2021-03-23  4:27   ` Hermes Zhang
2021-03-23 14:00     ` Rob Herring
2021-03-24  2:52       ` Hermes Zhang

Linux-LEDs Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-leds/0 linux-leds/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-leds linux-leds/ https://lore.kernel.org/linux-leds \
		linux-leds@vger.kernel.org
	public-inbox-index linux-leds

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-leds


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git