devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: gpio: davinci: list contents of GPIO hogs
@ 2022-03-28 19:11 Krzysztof Kozlowski
  2022-04-01  0:44 ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-28 19:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Krzysztof Kozlowski, Keerthy, Linus Walleij, Bartosz Golaszewski,
	Rob Herring, Krzysztof Kozlowski, linux-gpio, devicetree

The hogs children should list allowed properties, otherwise any property
would be accepted.  Simplify also GPIO hog node name pattern.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/gpio/gpio-davinci.yaml        | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml b/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
index f32e09ef937c..e5b91c65dcb0 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
@@ -76,12 +76,21 @@ properties:
     const: 2
 
 patternProperties:
-  "^(.+-hog(-[0-9]+)?)$":
+  "^.+-hog(-[0-9]+)?$":
     type: object
+    properties:
+      gpio-hog: true
+      gpios: true
+      input: true
+      output-high: true
+      output-low: true
+      line-name: true
 
     required:
       - gpio-hog
 
+    additionalProperties: false
+
 required:
   - compatible
   - reg
-- 
2.32.0


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

* Re: [PATCH] dt-bindings: gpio: davinci: list contents of GPIO hogs
  2022-03-28 19:11 [PATCH] dt-bindings: gpio: davinci: list contents of GPIO hogs Krzysztof Kozlowski
@ 2022-04-01  0:44 ` Rob Herring
  2022-04-01  6:23   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2022-04-01  0:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-kernel, Keerthy, Linus Walleij, Bartosz Golaszewski,
	Krzysztof Kozlowski, linux-gpio, devicetree

On Mon, Mar 28, 2022 at 09:11:53PM +0200, Krzysztof Kozlowski wrote:
> The hogs children should list allowed properties, otherwise any property
> would be accepted.  Simplify also GPIO hog node name pattern.

Only if 'gpio-hog' is missing, because the gpio-hog.yaml schema will 
check every node with that property.

Hogs are allowed on any GPIO controller, but I don't think we to 
duplicate what's here on every schema.

> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/gpio/gpio-davinci.yaml        | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml b/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
> index f32e09ef937c..e5b91c65dcb0 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
> +++ b/Documentation/devicetree/bindings/gpio/gpio-davinci.yaml
> @@ -76,12 +76,21 @@ properties:
>      const: 2
>  
>  patternProperties:
> -  "^(.+-hog(-[0-9]+)?)$":
> +  "^.+-hog(-[0-9]+)?$":
>      type: object
> +    properties:
> +      gpio-hog: true
> +      gpios: true
> +      input: true
> +      output-high: true
> +      output-low: true
> +      line-name: true
>  
>      required:
>        - gpio-hog
>  
> +    additionalProperties: false
> +
>  required:
>    - compatible
>    - reg
> -- 
> 2.32.0
> 
> 

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

* Re: [PATCH] dt-bindings: gpio: davinci: list contents of GPIO hogs
  2022-04-01  0:44 ` Rob Herring
@ 2022-04-01  6:23   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-01  6:23 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-kernel, Keerthy, Linus Walleij, Bartosz Golaszewski,
	Krzysztof Kozlowski, linux-gpio, devicetree

On 01/04/2022 02:44, Rob Herring wrote:
> On Mon, Mar 28, 2022 at 09:11:53PM +0200, Krzysztof Kozlowski wrote:
>> The hogs children should list allowed properties, otherwise any property
>> would be accepted.  Simplify also GPIO hog node name pattern.
> 
> Only if 'gpio-hog' is missing, because the gpio-hog.yaml schema will 
> check every node with that property.
> 
> Hogs are allowed on any GPIO controller, but I don't think we to 
> duplicate what's here on every schema.

I understand, so the patch could be dropped because it requires
gpio-hog, thus the schema will always match.


Best regards,
Krzysztof

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

end of thread, other threads:[~2022-04-01  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 19:11 [PATCH] dt-bindings: gpio: davinci: list contents of GPIO hogs Krzysztof Kozlowski
2022-04-01  0:44 ` Rob Herring
2022-04-01  6:23   ` Krzysztof Kozlowski

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