2023-05-08 12:41:10

by Linus Walleij

[permalink] [raw]
Subject: [PATCH v4 0/2] STMPE device tree bindings

This adds the missing GPIO bindings for the STMPE port expander
and converts the existing MFD binding to YAML.

Signed-off-by: Linus Walleij <[email protected]>
---
Changes in v4:
- Make the GPIO bindings a conversion: there were some old
text bindings for the STMPE GPIO, we now delete them as
part of the patch.
- I expect Lee or the DT binding tree to pick both patches.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Update to review feedback
- Collected some ack/review tags
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Split off a separate GPIO binding
- Updated the MFD binding according to feedback

---
Linus Walleij (2):
dt-bindings: gpio: Convert STMPE GPIO to YAML schema
dt-bindings: MFD: Convert STMPE to YAML schema

.../devicetree/bindings/gpio/gpio-stmpe.txt | 17 --
.../devicetree/bindings/gpio/st,stmpe-gpio.yaml | 53 ++++
.../devicetree/bindings/input/stmpe-keypad.txt | 41 ---
.../bindings/input/touchscreen/stmpe.txt | 108 --------
.../devicetree/bindings/mfd/st,stmpe.yaml | 297 +++++++++++++++++++++
Documentation/devicetree/bindings/mfd/stmpe.txt | 42 ---
6 files changed, 350 insertions(+), 208 deletions(-)
---
base-commit: b777e950b1e0b9112418e7669c8b6d96915df778
change-id: 20230426-stmpe-dt-bindings-c3479dd71a28

Best regards,
--
Linus Walleij <[email protected]>


2023-05-08 12:51:31

by Linus Walleij

[permalink] [raw]
Subject: [PATCH v4 1/2] dt-bindings: gpio: Convert STMPE GPIO to YAML schema

This rewrites the STMPE GPIO bindings to a YAML schema.

We add the properties that are used in the widely used
STMPE GPIO device nodes found in the wild, most notably
interrupt support, so interrupt-cells and
interrupt-controller is now part of the bindings.

Signed-off-by: Linus Walleij <[email protected]>
---
ChangeLog v3->v4:
- Realize that there were actually some old bindings so we
need to get rid of them as part of this patch.
- Fix blank lines after description: keyword.
ChangeLog v2->v3:
- Use a compact hog node schema backed by the standard hog
schema.
ChangeLog v1->v2:
- New patch split off from the MFD patch.
---
.../devicetree/bindings/gpio/gpio-stmpe.txt | 17 -------
.../devicetree/bindings/gpio/st,stmpe-gpio.yaml | 53 ++++++++++++++++++++++
2 files changed, 53 insertions(+), 17 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt b/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt
deleted file mode 100644
index b33f8f02c0d7..000000000000
--- a/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-STMPE gpio
-----------
-
-Required properties:
- - compatible: "st,stmpe-gpio"
-
-Optional properties:
- - st,norequest-mask: bitmask specifying which GPIOs should _not_ be requestable
- due to different usage (e.g. touch, keypad)
-
-Node should be child node of stmpe node to which it belongs.
-
-Example:
- stmpe_gpio {
- compatible = "st,stmpe-gpio";
- st,norequest-mask = <0x20>; //gpio 5 can't be used
- };
diff --git a/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml b/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
new file mode 100644
index 000000000000..22c0cae73425
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/st,stmpe-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectonics Port Expander (STMPE) GPIO Block
+
+description:
+ STMicroelectronics Port Expander (STMPE) is a series of slow
+ bus controllers for various expanded peripherals such as GPIO, keypad,
+ touchscreen, ADC, PWM or rotator. It can contain one or several different
+ peripherals connected to SPI or I2C. These bindings pertain to the
+ GPIO portions of these expanders.
+
+maintainers:
+ - Linus Walleij <[email protected]>
+
+properties:
+ compatible:
+ const: st,stmpe-gpio
+
+ "#gpio-cells":
+ const: 2
+
+ "#interrupt-cells":
+ const: 2
+
+ gpio-controller: true
+
+ interrupt-controller: true
+
+ st,norequest-mask:
+ description:
+ A bitmask of GPIO lines that cannot be requested because for
+ for example not being connected to anything on the system
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+patternProperties:
+ "^.+-hog(-[0-9]+)?$":
+ type: object
+
+ required:
+ - gpio-hog
+
+additionalProperties: false
+
+required:
+ - compatible
+ - "#gpio-cells"
+ - "#interrupt-cells"
+ - gpio-controller
+ - interrupt-controller

--
2.34.1

2023-05-09 17:36:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] dt-bindings: gpio: Convert STMPE GPIO to YAML schema

On 08/05/2023 14:35, Linus Walleij wrote:
> This rewrites the STMPE GPIO bindings to a YAML schema.
>
> We add the properties that are used in the widely used
> STMPE GPIO device nodes found in the wild, most notably
> interrupt support, so interrupt-cells and
> interrupt-controller is now part of the bindings.
>
> Signed-off-by: Linus Walleij <[email protected]>


Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2023-05-11 15:30:40

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] dt-bindings: gpio: Convert STMPE GPIO to YAML schema

On Mon, May 8, 2023 at 2:35 PM Linus Walleij <[email protected]> wrote:
>
> This rewrites the STMPE GPIO bindings to a YAML schema.
>
> We add the properties that are used in the widely used
> STMPE GPIO device nodes found in the wild, most notably
> interrupt support, so interrupt-cells and
> interrupt-controller is now part of the bindings.
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> ChangeLog v3->v4:
> - Realize that there were actually some old bindings so we
> need to get rid of them as part of this patch.
> - Fix blank lines after description: keyword.
> ChangeLog v2->v3:
> - Use a compact hog node schema backed by the standard hog
> schema.
> ChangeLog v1->v2:
> - New patch split off from the MFD patch.
> ---
> .../devicetree/bindings/gpio/gpio-stmpe.txt | 17 -------
> .../devicetree/bindings/gpio/st,stmpe-gpio.yaml | 53 ++++++++++++++++++++++
> 2 files changed, 53 insertions(+), 17 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt b/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt
> deleted file mode 100644
> index b33f8f02c0d7..000000000000
> --- a/Documentation/devicetree/bindings/gpio/gpio-stmpe.txt
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -STMPE gpio
> -----------
> -
> -Required properties:
> - - compatible: "st,stmpe-gpio"
> -
> -Optional properties:
> - - st,norequest-mask: bitmask specifying which GPIOs should _not_ be requestable
> - due to different usage (e.g. touch, keypad)
> -
> -Node should be child node of stmpe node to which it belongs.
> -
> -Example:
> - stmpe_gpio {
> - compatible = "st,stmpe-gpio";
> - st,norequest-mask = <0x20>; //gpio 5 can't be used
> - };
> diff --git a/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml b/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
> new file mode 100644
> index 000000000000..22c0cae73425
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/st,stmpe-gpio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: STMicroelectonics Port Expander (STMPE) GPIO Block
> +
> +description:
> + STMicroelectronics Port Expander (STMPE) is a series of slow
> + bus controllers for various expanded peripherals such as GPIO, keypad,
> + touchscreen, ADC, PWM or rotator. It can contain one or several different
> + peripherals connected to SPI or I2C. These bindings pertain to the
> + GPIO portions of these expanders.
> +
> +maintainers:
> + - Linus Walleij <[email protected]>
> +
> +properties:
> + compatible:
> + const: st,stmpe-gpio
> +
> + "#gpio-cells":
> + const: 2
> +
> + "#interrupt-cells":
> + const: 2
> +
> + gpio-controller: true
> +
> + interrupt-controller: true
> +
> + st,norequest-mask:
> + description:
> + A bitmask of GPIO lines that cannot be requested because for
> + for example not being connected to anything on the system
> + $ref: /schemas/types.yaml#/definitions/uint32
> +
> +patternProperties:
> + "^.+-hog(-[0-9]+)?$":
> + type: object
> +
> + required:
> + - gpio-hog
> +
> +additionalProperties: false
> +
> +required:
> + - compatible
> + - "#gpio-cells"
> + - "#interrupt-cells"
> + - gpio-controller
> + - interrupt-controller
>
> --
> 2.34.1
>

Applied, thanks!

Bart

2023-05-11 21:06:19

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] dt-bindings: gpio: Convert STMPE GPIO to YAML schema

On Thu, May 11, 2023 at 4:58 PM Bartosz Golaszewski <[email protected]> wrote:

> Applied, thanks!

That works ... but patch 2/2 depends on this one. (uses $ref).
You'd have to give Lee an immutable branch that he can pull
before applying patch 2/2 so he has the dependency, or let him
apply both.

Yours,
Linus Walleij

2023-05-16 15:39:03

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] dt-bindings: gpio: Convert STMPE GPIO to YAML schema

On Thu, May 11, 2023 at 10:39 PM Linus Walleij <[email protected]> wrote:
>
> On Thu, May 11, 2023 at 4:58 PM Bartosz Golaszewski <[email protected]> wrote:
>
> > Applied, thanks!
>
> That works ... but patch 2/2 depends on this one. (uses $ref).
> You'd have to give Lee an immutable branch that he can pull
> before applying patch 2/2 so he has the dependency, or let him
> apply both.
>
> Yours,
> Linus Walleij

Sure:

The following changes since commit ac9a78681b921877518763ba0e89202254349d1b:

Linux 6.4-rc1 (2023-05-07 13:34:35 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
tags/v6.4-stmpe-gpio

for you to fetch changes up to 6c19974d1e83fba2cca1cbea2fbf250f093eb5ed:

dt-bindings: gpio: Convert STMPE GPIO to YAML schema (2023-05-11
16:58:04 +0200)

Bart

2023-05-16 18:33:48

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v4 1/2] dt-bindings: gpio: Convert STMPE GPIO to YAML schema

On Tue, May 16, 2023 at 5:34 PM Bartosz Golaszewski <[email protected]> wrote:
> On Thu, May 11, 2023 at 10:39 PM Linus Walleij <[email protected]> wrote:
> >
> > On Thu, May 11, 2023 at 4:58 PM Bartosz Golaszewski <[email protected]> wrote:
> >
> > > Applied, thanks!
> >
> > That works ... but patch 2/2 depends on this one. (uses $ref).
> > You'd have to give Lee an immutable branch that he can pull
> > before applying patch 2/2 so he has the dependency, or let him
> > apply both.
> >
> > Yours,
> > Linus Walleij
>
> Sure:
>
> The following changes since commit ac9a78681b921877518763ba0e89202254349d1b:
>
> Linux 6.4-rc1 (2023-05-07 13:34:35 -0700)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
> tags/v6.4-stmpe-gpio
>
> for you to fetch changes up to 6c19974d1e83fba2cca1cbea2fbf250f093eb5ed:
>
> dt-bindings: gpio: Convert STMPE GPIO to YAML schema (2023-05-11
> 16:58:04 +0200)

Hey cool :D

Lee if you pull this in you can apply 2/2 on top if it checks out.

Yours,
Linus Walleij