* [PATCH v3 0/7] gpio: introduce a gpio driver for SCMI
@ 2026-03-11 19:37 Dan Carpenter
2026-03-11 19:39 ` [PATCH v3 6/7] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2026-03-11 19:37 UTC (permalink / raw)
To: Linus Walleij, AKASHI Takahiro
Cc: arm-scmi, Bartosz Golaszewski, Conor Dooley, Cristian Marussi,
Dan Carpenter, devicetree, Krzysztof Kozlowski, linux-arm-kernel,
linux-gpio, linux-kernel, Rob Herring, Sudeep Holla,
Andy Shevchenko, Linus Walleij, Bartosz Golaszewski, Michal Simek
This basically abandons my earlier attempts and goes back to Takahiro
Akashi's driver. Here is the link to Takahiro's patchset:
https://lore.kernel.org/all/20231005025843.508689-1-takahiro.akashi@linaro.org/
In the review comments, to that patchset we had discussed putting the
gpio section inside the pinctrl section. The ordering problems are a
bit tricky because you want the pinctrl driver to finish probing before
you start probing the gpio driver. To me it seems nicer to put the
pinctrl things such as pinmuxing in the pinctrl block and the gpio things
in the gpio block.
I updated Takahiro's patch to work on current kernels. I've had added a
few other patches to make things work on current kernels. The most
noteworthy change is that instead of calculating the ngpios, I changed
it so you have to specify the ngpios in the device tree.
I updated the device tree spec file to address review comments. I
changed the compatible to scmi-pinctrl-gpio. I also updated the
examples to show how pinmuxing works. I didn't know how to include all
the potential GPIO configuration options so I set
"additionalProperties: true". Hopefully, that's okay.
AKASHI Takahiro (3):
pinctrl: introduce pinctrl_gpio_get_config()
dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver
gpio: add pinctrl based generic gpio driver
Dan Carpenter (4):
pinctrl: scmi: Add SCMI_PIN_INPUT_VALUE
pinctrl: Delete PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS support
pinctrl-scmi: ignore PIN_CONFIG_PERSIST_STATE
arm_scmi: pinctrl: allow PINCTRL_REQUEST to return EOPNOTSUPP
.../bindings/gpio/pin-control-gpio.yaml | 70 ++++++++++
drivers/firmware/arm_scmi/pinctrl.c | 2 +
drivers/gpio/Kconfig | 7 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-by-pinctrl.c | 124 ++++++++++++++++++
drivers/pinctrl/core.c | 30 +++++
drivers/pinctrl/pinctrl-scmi.c | 46 +++++--
include/linux/pinctrl/consumer.h | 9 ++
8 files changed, 276 insertions(+), 13 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml
create mode 100644 drivers/gpio/gpio-by-pinctrl.c
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 6/7] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver
2026-03-11 19:37 [PATCH v3 0/7] gpio: introduce a gpio driver for SCMI Dan Carpenter
@ 2026-03-11 19:39 ` Dan Carpenter
2026-03-11 21:53 ` Linus Walleij
2026-03-14 0:12 ` Rob Herring
0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2026-03-11 19:39 UTC (permalink / raw)
To: Linus Walleij, AKASHI Takahiro
Cc: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Dan Carpenter, linux-gpio, devicetree, linux-kernel,
Andy Shevchenko, Linus Walleij, Bartosz Golaszewski, arm-scmi
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
Add a dt binding for the gpio-by-pinctrl driver. The driver is used
for doing GPIO over the SCMI pinctrl protocol. There are a few
mandatory properties such as gpio-ranges and ngpios, but it's not
mandatory to specify the pin-mux.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
.../bindings/gpio/pin-control-gpio.yaml | 70 +++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml
diff --git a/Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml b/Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml
new file mode 100644
index 000000000000..81c68579df6e
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/pin-control-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Pin control based generic GPIO controller
+
+description:
+ The pin control-based GPIO will facilitate a pin controller's ability
+ to drive electric lines high/low and other generic properties of a
+ pin controller to perform general-purpose one-bit binary I/O.
+
+maintainers:
+ - Dan Carpenter <dan.carpenter@linaro.og>
+
+properties:
+ compatible:
+ const: scmi-pinctrl-gpio
+
+ gpio-controller: true
+
+ "#gpio-cells":
+ const: 2
+
+ gpio-ranges: true
+
+ ngpios: true
+
+patternProperties:
+ "^.+-hog(-[0-9]+)?$":
+ type: object
+
+ required:
+ - gpio-hog
+
+required:
+ - compatible
+ - gpio-controller
+ - "#gpio-cells"
+ - gpio-ranges
+ - ngpios
+
+additionalProperties: true
+
+examples:
+ - |
+ gpio1 {
+ compatible = "scmi-pinctrl-gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ ngpios = <10>;
+ gpio-ranges = <&scmi_pinctrl 0 8 4>,
+ <&scmi_pinctrl 4 12 1>,
+ <&scmi_pinctrl 5 15 1>,
+ <&scmi_pinctrl 6 17 4>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c2_pins>;
+ };
+
+ gpio2 {
+ compatible = "scmi-pinctrl-gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ ngpios = <3>;
+ gpio-line-names = "gpio_5_17", "gpio_5_20", "gpio_5_22", "gpio_2_1";
+ gpio-ranges = <&scmi_pinctrl 0 30 4>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&keys_pins>;
+ };
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 6/7] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver
2026-03-11 19:39 ` [PATCH v3 6/7] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver Dan Carpenter
@ 2026-03-11 21:53 ` Linus Walleij
2026-03-14 0:12 ` Rob Herring
1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2026-03-11 21:53 UTC (permalink / raw)
To: Dan Carpenter
Cc: AKASHI Takahiro, Bartosz Golaszewski, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dan Carpenter, linux-gpio,
devicetree, linux-kernel, Andy Shevchenko, Bartosz Golaszewski,
arm-scmi
On Wed, Mar 11, 2026 at 8:39 PM Dan Carpenter <dan.carpenter@linaro.org> wrote:
> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
>
> Add a dt binding for the gpio-by-pinctrl driver. The driver is used
> for doing GPIO over the SCMI pinctrl protocol. There are a few
> mandatory properties such as gpio-ranges and ngpios, but it's not
> mandatory to specify the pin-mux.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
I think Takashi's original idea is sound now that we clarified
the level read/set semantics!
Reviewed-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 6/7] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver
2026-03-11 19:39 ` [PATCH v3 6/7] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver Dan Carpenter
2026-03-11 21:53 ` Linus Walleij
@ 2026-03-14 0:12 ` Rob Herring
1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2026-03-14 0:12 UTC (permalink / raw)
To: Dan Carpenter
Cc: Linus Walleij, AKASHI Takahiro, Bartosz Golaszewski,
Krzysztof Kozlowski, Conor Dooley, Dan Carpenter, linux-gpio,
devicetree, linux-kernel, Andy Shevchenko, Bartosz Golaszewski,
arm-scmi
On Wed, Mar 11, 2026 at 10:39:17PM +0300, Dan Carpenter wrote:
> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
>
> Add a dt binding for the gpio-by-pinctrl driver. The driver is used
> for doing GPIO over the SCMI pinctrl protocol. There are a few
> mandatory properties such as gpio-ranges and ngpios, but it's not
> mandatory to specify the pin-mux.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> .../bindings/gpio/pin-control-gpio.yaml | 70 +++++++++++++++++++
> 1 file changed, 70 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml
>
> diff --git a/Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml b/Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml
> new file mode 100644
> index 000000000000..81c68579df6e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/pin-control-gpio.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/pin-control-gpio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Pin control based generic GPIO controller
> +
> +description:
> + The pin control-based GPIO will facilitate a pin controller's ability
> + to drive electric lines high/low and other generic properties of a
> + pin controller to perform general-purpose one-bit binary I/O.
> +
> +maintainers:
> + - Dan Carpenter <dan.carpenter@linaro.og>
> +
> +properties:
> + compatible:
> + const: scmi-pinctrl-gpio
> +
> + gpio-controller: true
> +
> + "#gpio-cells":
> + const: 2
> +
> + gpio-ranges: true
> +
> + ngpios: true
> +
> +patternProperties:
> + "^.+-hog(-[0-9]+)?$":
> + type: object
> +
> + required:
> + - gpio-hog
> +
> +required:
> + - compatible
> + - gpio-controller
> + - "#gpio-cells"
> + - gpio-ranges
> + - ngpios
> +
> +additionalProperties: true
That's only valid for common (incomplete) schemas. It must be false.
> +
> +examples:
> + - |
> + gpio1 {
> + compatible = "scmi-pinctrl-gpio";
> + gpio-controller;
> + #gpio-cells = <2>;
> + ngpios = <10>;
> + gpio-ranges = <&scmi_pinctrl 0 8 4>,
> + <&scmi_pinctrl 4 12 1>,
> + <&scmi_pinctrl 5 15 1>,
> + <&scmi_pinctrl 6 17 4>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&i2c2_pins>;
> + };
> +
> + gpio2 {
> + compatible = "scmi-pinctrl-gpio";
> + gpio-controller;
> + #gpio-cells = <2>;
> + ngpios = <3>;
> + gpio-line-names = "gpio_5_17", "gpio_5_20", "gpio_5_22", "gpio_2_1";
> + gpio-ranges = <&scmi_pinctrl 0 30 4>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&keys_pins>;
> + };
I think 1 example is enough.
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-14 0:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 19:37 [PATCH v3 0/7] gpio: introduce a gpio driver for SCMI Dan Carpenter
2026-03-11 19:39 ` [PATCH v3 6/7] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver Dan Carpenter
2026-03-11 21:53 ` Linus Walleij
2026-03-14 0:12 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox