linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: gpio: add common consumer GPIO lines
@ 2022-03-15  8:37 Krzysztof Kozlowski
  2022-03-21 18:20 ` Rob Herring
  2022-03-26  0:28 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-15  8:37 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, linux-gpio, devicetree, linux-kernel
  Cc: Laurent Pinchart, Krzysztof Kozlowski

Typical GPIO lines like enable, powerdown, reset or wakeup are not
documented as common, which leads to new variations of these (e.g.
pwdn-gpios).  Add a common schema which serves also as a documentation
for preferred naming.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 .../bindings/gpio/gpio-consumer-common.yaml   | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml

diff --git a/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
new file mode 100644
index 000000000000..098dc913f9e5
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/gpio-consumer-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common GPIO lines
+
+maintainers:
+  - Bartosz Golaszewski <brgl@bgdev.pl>
+  - Linus Walleij <linus.walleij@linaro.org>
+
+# do not select this schema for GPIO hogs
+select:
+  properties:
+    gpio-hog: false
+
+properties:
+  enable-gpios:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
+  reset-gpios:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
+  powerdown-gpios:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
+  pwdn-gpios:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: Use powerdown-gpios
+    deprecated: true
+
+  wakeup-gpios:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
+additionalProperties: true
-- 
2.32.0


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

* Re: [PATCH] dt-bindings: gpio: add common consumer GPIO lines
  2022-03-15  8:37 [PATCH] dt-bindings: gpio: add common consumer GPIO lines Krzysztof Kozlowski
@ 2022-03-21 18:20 ` Rob Herring
  2022-03-22 18:26   ` Krzysztof Kozlowski
  2022-03-26  0:28 ` Linus Walleij
  1 sibling, 1 reply; 5+ messages in thread
From: Rob Herring @ 2022-03-21 18:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Bartosz Golaszewski, Krzysztof Kozlowski,
	linux-gpio, devicetree, linux-kernel, Laurent Pinchart

On Tue, Mar 15, 2022 at 09:37:23AM +0100, Krzysztof Kozlowski wrote:
> Typical GPIO lines like enable, powerdown, reset or wakeup are not
> documented as common, which leads to new variations of these (e.g.
> pwdn-gpios).  Add a common schema which serves also as a documentation
> for preferred naming.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../bindings/gpio/gpio-consumer-common.yaml   | 36 +++++++++++++++++++
>  1 file changed, 36 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
> new file mode 100644
> index 000000000000..098dc913f9e5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
> @@ -0,0 +1,36 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/gpio-consumer-common.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common GPIO lines
> +
> +maintainers:
> +  - Bartosz Golaszewski <brgl@bgdev.pl>
> +  - Linus Walleij <linus.walleij@linaro.org>
> +
> +# do not select this schema for GPIO hogs
> +select:
> +  properties:
> +    gpio-hog: false

'select: true' should be sufficient here.

> +
> +properties:
> +  enable-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array

Perhaps some sort of description on these.

I think these are always a single line, so 'maxItems: 1'.

> +
> +  reset-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  powerdown-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  pwdn-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    description: Use powerdown-gpios
> +    deprecated: true
> +
> +  wakeup-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +additionalProperties: true
> -- 
> 2.32.0
> 
> 

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

* Re: [PATCH] dt-bindings: gpio: add common consumer GPIO lines
  2022-03-21 18:20 ` Rob Herring
@ 2022-03-22 18:26   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-22 18:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Linus Walleij, Bartosz Golaszewski, Krzysztof Kozlowski,
	linux-gpio, devicetree, linux-kernel, Laurent Pinchart

On 21/03/2022 19:20, Rob Herring wrote:
> On Tue, Mar 15, 2022 at 09:37:23AM +0100, Krzysztof Kozlowski wrote:
>> Typical GPIO lines like enable, powerdown, reset or wakeup are not
>> documented as common, which leads to new variations of these (e.g.
>> pwdn-gpios).  Add a common schema which serves also as a documentation
>> for preferred naming.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>> ---
>>  .../bindings/gpio/gpio-consumer-common.yaml   | 36 +++++++++++++++++++
>>  1 file changed, 36 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
>> new file mode 100644
>> index 000000000000..098dc913f9e5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
>> @@ -0,0 +1,36 @@
>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/gpio/gpio-consumer-common.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Common GPIO lines
>> +
>> +maintainers:
>> +  - Bartosz Golaszewski <brgl@bgdev.pl>
>> +  - Linus Walleij <linus.walleij@linaro.org>
>> +
>> +# do not select this schema for GPIO hogs
>> +select:
>> +  properties:
>> +    gpio-hog: false
> 
> 'select: true' should be sufficient here.
> 
>> +
>> +properties:
>> +  enable-gpios:
>> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> 
> Perhaps some sort of description on these.
> 
> I think these are always a single line, so 'maxItems: 1'.

I assume you meant all other as well (so reset-gpios, powerdown-gpios) -
also with maxItems:1.

I'll fix it.


Best regards,
Krzysztof

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

* Re: [PATCH] dt-bindings: gpio: add common consumer GPIO lines
  2022-03-15  8:37 [PATCH] dt-bindings: gpio: add common consumer GPIO lines Krzysztof Kozlowski
  2022-03-21 18:20 ` Rob Herring
@ 2022-03-26  0:28 ` Linus Walleij
  2022-03-26  8:05   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2022-03-26  0:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
	linux-gpio, devicetree, linux-kernel, Laurent Pinchart

On Tue, Mar 15, 2022 at 9:37 AM Krzysztof Kozlowski
<krzysztof.kozlowski@canonical.com> wrote:

> Typical GPIO lines like enable, powerdown, reset or wakeup are not
> documented as common, which leads to new variations of these (e.g.
> pwdn-gpios).  Add a common schema which serves also as a documentation
> for preferred naming.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

I like the idea!

> +  enable-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  reset-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  powerdown-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +
> +  pwdn-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    description: Use powerdown-gpios
> +    deprecated: true
> +
> +  wakeup-gpios:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array

I would underscore either on each one or in a global description:
that lines on components that indicate they are active low
such as RESETN, RESET* etc MUST have the flag in the
second cell set to GPIO_ACTIVE_LOW.

Yours,
Linus Walleij

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

* Re: [PATCH] dt-bindings: gpio: add common consumer GPIO lines
  2022-03-26  0:28 ` Linus Walleij
@ 2022-03-26  8:05   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-26  8:05 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Krzysztof Kozlowski, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, linux-gpio, devicetree, linux-kernel,
	Laurent Pinchart

On Sat, 26 Mar 2022 at 01:28, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Tue, Mar 15, 2022 at 9:37 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>
> > Typical GPIO lines like enable, powerdown, reset or wakeup are not
> > documented as common, which leads to new variations of these (e.g.
> > pwdn-gpios).  Add a common schema which serves also as a documentation
> > for preferred naming.
> >
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>
> I like the idea!
>
> > +  enable-gpios:
> > +    $ref: /schemas/types.yaml#/definitions/phandle-array
> > +
> > +  reset-gpios:
> > +    $ref: /schemas/types.yaml#/definitions/phandle-array
> > +
> > +  powerdown-gpios:
> > +    $ref: /schemas/types.yaml#/definitions/phandle-array
> > +
> > +  pwdn-gpios:
> > +    $ref: /schemas/types.yaml#/definitions/phandle-array
> > +    description: Use powerdown-gpios
> > +    deprecated: true
> > +
> > +  wakeup-gpios:
> > +    $ref: /schemas/types.yaml#/definitions/phandle-array
>
> I would underscore either on each one or in a global description:
> that lines on components that indicate they are active low
> such as RESETN, RESET* etc MUST have the flag in the
> second cell set to GPIO_ACTIVE_LOW.

Sure, I'll add it.

Best regards,
Krzysztof

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

end of thread, other threads:[~2022-03-26  8:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15  8:37 [PATCH] dt-bindings: gpio: add common consumer GPIO lines Krzysztof Kozlowski
2022-03-21 18:20 ` Rob Herring
2022-03-22 18:26   ` Krzysztof Kozlowski
2022-03-26  0:28 ` Linus Walleij
2022-03-26  8:05   ` 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).