devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes.
@ 2022-08-20 20:41 Conor Dooley
  2022-08-25 12:10 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Conor Dooley @ 2022-08-20 20:41 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-gpio, devicetree, linux-kernel

From: Conor Dooley <conor.dooley@microchip.com>

The SD card and eMMC on PolarFire SoC based dev boards are sometimes
statically muxed using a GPIO. To facilitate this, enable gpio-hog
child node properties.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 .../bindings/gpio/microchip,mpfs-gpio.yaml     | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
index 110651eafa70..6704a7a52cd0 100644
--- a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
@@ -44,6 +44,24 @@ properties:
 
   gpio-controller: true
 
+patternProperties:
+  "^.+-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
+      - gpios
+
+    additionalProperties: false
+
 required:
   - compatible
   - reg
-- 
2.37.1


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

* Re: [PATCH] dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes.
  2022-08-20 20:41 [PATCH] dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes Conor Dooley
@ 2022-08-25 12:10 ` Krzysztof Kozlowski
  2022-08-25 12:30   ` Conor.Dooley
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-25 12:10 UTC (permalink / raw)
  To: Conor Dooley, Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-gpio, devicetree, linux-kernel

On 20/08/2022 23:41, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> The SD card and eMMC on PolarFire SoC based dev boards are sometimes
> statically muxed using a GPIO. To facilitate this, enable gpio-hog
> child node properties.
> 
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>  .../bindings/gpio/microchip,mpfs-gpio.yaml     | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
> index 110651eafa70..6704a7a52cd0 100644
> --- a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
> +++ b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
> @@ -44,6 +44,24 @@ properties:
>  
>    gpio-controller: true
>  
> +patternProperties:
> +  "^.+-hog(?:-[0-9]+)?$":

What is this pattern about: "(?:" ?

> +    type: object
> +
> +    properties:
> +      gpio-hog: true
> +      gpios: true
> +      input: true
> +      output-high: true
> +      output-low: true
> +      line-name: true
> +
> +    required:
> +      - gpio-hog
> +      - gpios
> +
> +    additionalProperties: false

Put it after type:object. Easier to read/find.

Best regards,
Krzysztof

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

* Re: [PATCH] dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes.
  2022-08-25 12:10 ` Krzysztof Kozlowski
@ 2022-08-25 12:30   ` Conor.Dooley
  2022-08-25 12:35     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 5+ messages in thread
From: Conor.Dooley @ 2022-08-25 12:30 UTC (permalink / raw)
  To: krzysztof.kozlowski, mail, linus.walleij, brgl, robh+dt,
	krzysztof.kozlowski+dt
  Cc: linux-gpio, devicetree, linux-kernel

On 25/08/2022 13:10, Krzysztof Kozlowski wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 20/08/2022 23:41, Conor Dooley wrote:
>> From: Conor Dooley <conor.dooley@microchip.com>
>>
>> The SD card and eMMC on PolarFire SoC based dev boards are sometimes
>> statically muxed using a GPIO. To facilitate this, enable gpio-hog
>> child node properties.
>>
>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>> ---
>>   .../bindings/gpio/microchip,mpfs-gpio.yaml     | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>> index 110651eafa70..6704a7a52cd0 100644
>> --- a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>> +++ b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>> @@ -44,6 +44,24 @@ properties:
>>
>>     gpio-controller: true
>>
>> +patternProperties:
>> +  "^.+-hog(?:-[0-9]+)?$":
> 
> What is this pattern about: "(?:" ?

Me being a pedant I suppose. "()" is a capture while "(?:)" is a match.
However, it does seem like json-schema suggests using "()":
https://json-schema.org/understanding-json-schema/reference/regular_expressions.html

I don't mind & neither does the schema checker.

> 
>> +    type: object
>> +
>> +    properties:
>> +      gpio-hog: true
>> +      gpios: true
>> +      input: true
>> +      output-high: true
>> +      output-low: true
>> +      line-name: true
>> +
>> +    required:
>> +      - gpio-hog
>> +      - gpios
>> +
>> +    additionalProperties: false
> 
> Put it after type:object. Easier to read/find.

Sure.
Thanks,
Conor.

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

* Re: [PATCH] dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes.
  2022-08-25 12:30   ` Conor.Dooley
@ 2022-08-25 12:35     ` Krzysztof Kozlowski
  2022-08-25 12:40       ` Conor.Dooley
  0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-25 12:35 UTC (permalink / raw)
  To: Conor.Dooley, mail, linus.walleij, brgl, robh+dt,
	krzysztof.kozlowski+dt
  Cc: linux-gpio, devicetree, linux-kernel

On 25/08/2022 15:30, Conor.Dooley@microchip.com wrote:
> On 25/08/2022 13:10, Krzysztof Kozlowski wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> On 20/08/2022 23:41, Conor Dooley wrote:
>>> From: Conor Dooley <conor.dooley@microchip.com>
>>>
>>> The SD card and eMMC on PolarFire SoC based dev boards are sometimes
>>> statically muxed using a GPIO. To facilitate this, enable gpio-hog
>>> child node properties.
>>>
>>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>>> ---
>>>   .../bindings/gpio/microchip,mpfs-gpio.yaml     | 18 ++++++++++++++++++
>>>   1 file changed, 18 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>>> index 110651eafa70..6704a7a52cd0 100644
>>> --- a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>>> +++ b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>>> @@ -44,6 +44,24 @@ properties:
>>>
>>>     gpio-controller: true
>>>
>>> +patternProperties:
>>> +  "^.+-hog(?:-[0-9]+)?$":
>>
>> What is this pattern about: "(?:" ?
> 
> Me being a pedant I suppose. "()" is a capture while "(?:)" is a match.
> However, it does seem like json-schema suggests using "()":
> https://json-schema.org/understanding-json-schema/reference/regular_expressions.html
> 
> I don't mind & neither does the schema checker.

Use what existing sources are doing, so "^.+-hog(-[0-9]+)?$"

Best regards,
Krzysztof

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

* Re: [PATCH] dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes.
  2022-08-25 12:35     ` Krzysztof Kozlowski
@ 2022-08-25 12:40       ` Conor.Dooley
  0 siblings, 0 replies; 5+ messages in thread
From: Conor.Dooley @ 2022-08-25 12:40 UTC (permalink / raw)
  To: krzysztof.kozlowski, mail, linus.walleij, brgl, robh+dt,
	krzysztof.kozlowski+dt
  Cc: linux-gpio, devicetree, linux-kernel

On 25/08/2022 13:35, Krzysztof Kozlowski wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 25/08/2022 15:30, Conor.Dooley@microchip.com wrote:
>> On 25/08/2022 13:10, Krzysztof Kozlowski wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>
>>> On 20/08/2022 23:41, Conor Dooley wrote:
>>>> From: Conor Dooley <conor.dooley@microchip.com>
>>>>
>>>> The SD card and eMMC on PolarFire SoC based dev boards are sometimes
>>>> statically muxed using a GPIO. To facilitate this, enable gpio-hog
>>>> child node properties.
>>>>
>>>> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>>>> ---
>>>>    .../bindings/gpio/microchip,mpfs-gpio.yaml     | 18 ++++++++++++++++++
>>>>    1 file changed, 18 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>>>> index 110651eafa70..6704a7a52cd0 100644
>>>> --- a/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>>>> +++ b/Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
>>>> @@ -44,6 +44,24 @@ properties:
>>>>
>>>>      gpio-controller: true
>>>>
>>>> +patternProperties:
>>>> +  "^.+-hog(?:-[0-9]+)?$":
>>>
>>> What is this pattern about: "(?:" ?
>>
>> Me being a pedant I suppose. "()" is a capture while "(?:)" is a match.
>> However, it does seem like json-schema suggests using "()":
>> https://json-schema.org/understanding-json-schema/reference/regular_expressions.html
>>
>> I don't mind & neither does the schema checker.
> 
> Use what existing sources are doing, so "^.+-hog(-[0-9]+)?$"


Willdo :)


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

end of thread, other threads:[~2022-08-25 12:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-20 20:41 [PATCH] dt-bindings: gpio: mpfs-gpio: allow parsing of hog child nodes Conor Dooley
2022-08-25 12:10 ` Krzysztof Kozlowski
2022-08-25 12:30   ` Conor.Dooley
2022-08-25 12:35     ` Krzysztof Kozlowski
2022-08-25 12:40       ` Conor.Dooley

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