Skip to contentSkip to conversation

dt-binding: leds: Document leds-multi-gpio bindings

PATCH Superseded Hermes Zhang 3 participants 5 messages Mar 22, 2021 – Mar 24, 2021

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---

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
Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml new file +49 -0
new file mode 100644
index 000000000000..bc19d1758d92
@@ -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 <[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
+
+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>;
+    };
+...
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 6 lines · Hermes Zhang

From: Hermes Zhang <[email protected]>

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

Quoted 9 lines

---

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.

#2 lore raw
Quoted 12 lines

-----Original Message-----
From: Rob Herring <[email protected]>
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:

Quoted 5 lines
	[[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

maintainer
#3 lore raw
Quoted 19 lines · Hermes Zhang
Quoted 13 lines

-----Original Message-----
From: Rob Herring <[email protected]>
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:

Quoted 5 lines
      [[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

Quoted 3 lines

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

#4 lore raw
Quoted 7 lines
Quoted 4 lines

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