Re: [PATCH] dt-bindings: pinctrl: pinctrl-single: Define a max count for "pinctrl-single,gpio-range"
From: Rob Herring (Arm)
Date: Tue Jun 18 2024 - 14:34:35 EST
On Tue, 18 Jun 2024 11:51:02 -0500, Nishanth Menon wrote:
> "pinctrl-single,gpio-range" allows us to define a dis-contiguous
> range of pinctrl registers that can have different mux settings for
> GPIO mode of operation. However, the maxItems seem to be set to 1 in
> processed schema for some reason. This is incorrect. For example:
> arch/arm64/boot/dts/hisilicon/hi6220.dtsi and others have more than
> one dis-contiguous range.
>
> Arbitrarily define a max 100 count to override the defaults.
>
> Signed-off-by: Nishanth Menon <nm@xxxxxx>
> ---
> I am not sure if I should call this RFC or not.. and if this is even the
> right solution.. I am on 2024.05 dt-schema for this check.
>
> I noticed this when adding gpio-ranges for am62p platform:
> https://gist.github.com/nmenon/7019cd2f24be47997640df5db60a7544
>
> It is possible that this is a bug in dt-schema, but I have'nt been able
> to track it down either.
>
> behavior seen is the following:
> pinctrl-single,gpio-range = <&mcu_pmx_range 0 21 7>;
> generates no warning
> However,
> pinctrl-single,gpio-range = <&mcu_pmx_range 0 21 7>, <&mcu_pmx_range 32 2 7>;
>
> generates "is too long" warning.
>
>
> Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml: properties:pinctrl-single,gpio-range: {'description': 'Optional list of pin base, nr pins & gpio function', '$ref': '/schemas/types.yaml#/definitions/phandle-array', 'maxItems': 100, 'items': [{'items': [{'description': 'phandle of a gpio-range node'}, {'description': 'pin base'}, {'description': 'number of pins'}, {'description': 'gpio function'}]}]} should not be valid under {'required': ['maxItems']}
hint: "maxItems" is not needed with an "items" list
from schema $id: http://devicetree.org/meta-schemas/items.yaml#
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240618165102.2380159-1-nm@xxxxxx
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.