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
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
>
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
© 2016 - 2026 Red Hat, Inc.