linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: pinctrl: pinctrl-single: Define a max count for "pinctrl-single,gpio-range"
@ 2024-06-18 16:51 Nishanth Menon
  2024-06-18 18:34 ` Rob Herring (Arm)
  0 siblings, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2024-06-18 16:51 UTC (permalink / raw)
  To: Tony Lindgren, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
	Linus Walleij
  Cc: linux-kernel, devicetree, linux-gpio, linux-arm-kernel,
	Nishanth Menon

"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@ti.com>
---
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(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml
index c11495524dd2..416a70db14af 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml
@@ -74,6 +74,7 @@ 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

base-commit: 76db4c64526c5e8ba0f56ad3d890dce8f9b00bbc
-- 
2.43.0


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

end of thread, other threads:[~2024-06-21 14:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-18 16:51 [PATCH] dt-bindings: pinctrl: pinctrl-single: Define a max count for "pinctrl-single,gpio-range" Nishanth Menon
2024-06-18 18:34 ` Rob Herring (Arm)
2024-06-18 18:57   ` Nishanth Menon
2024-06-19 16:19     ` Andrew Davis
2024-06-21 13:36       ` Nishanth Menon
2024-06-21 14:00         ` Andrew Davis

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).