linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3]  Add IMX8 SCU GPIO support
@ 2022-08-04 18:49 Shenwei Wang
  2022-08-04 18:49 ` [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings Shenwei Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Shenwei Wang @ 2022-08-04 18:49 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, linus.walleij, brgl, shawnguo,
	s.hauer, kernel, festevam, linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel, Shenwei Wang

The system controller (SCU) is the central unit to manage the resources
on i.MX8 platforms. The SCU firmware provides a set of APIs to access
the GPIO PINs on the SCU domain.

This patch series implements the standard GPIO driver over the SCU
firmware APIs, so that the GPIOs on the SCU domain could be accessed
like a local GPIO PINs.

Shenwei Wang (3):
  dt-bindings: gpio: Add imx-scu gpio driver bindings
  dt-bindings: firmware: imx: Add imx-scu gpio node
  firmware: imx: add imx-scu GPIO driver

 .../devicetree/bindings/firmware/fsl,scu.yaml |   5 +
 .../bindings/gpio/fsl,imx8-scu-gpio.yaml      |  39 +++++
 drivers/firmware/imx/Kconfig                  |   6 +
 drivers/firmware/imx/Makefile                 |   1 +
 drivers/firmware/imx/imx-scu-gpio.c           | 139 ++++++++++++++++++
 5 files changed, 190 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/fsl,imx8-scu-gpio.yaml
 create mode 100644 drivers/firmware/imx/imx-scu-gpio.c

--
2.25.1


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

* [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings
  2022-08-04 18:49 [PATCH v1 0/3] Add IMX8 SCU GPIO support Shenwei Wang
@ 2022-08-04 18:49 ` Shenwei Wang
  2022-08-04 19:50   ` Rob Herring
  2022-08-05  6:55   ` Krzysztof Kozlowski
  2022-08-04 18:49 ` [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node Shenwei Wang
  2022-08-04 18:49 ` [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver Shenwei Wang
  2 siblings, 2 replies; 11+ messages in thread
From: Shenwei Wang @ 2022-08-04 18:49 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, linus.walleij, brgl, shawnguo,
	s.hauer, kernel, festevam, linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel, Shenwei Wang

Add binding document for the imx-scu gpio driver.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
 .../bindings/gpio/fsl,imx8-scu-gpio.yaml      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/fsl,imx8-scu-gpio.yaml

diff --git a/Documentation/devicetree/bindings/gpio/fsl,imx8-scu-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl,imx8-scu-gpio.yaml
new file mode 100644
index 000000000000..d06e91402666
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/fsl,imx8-scu-gpio.yaml
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/fsl,imx8-scu-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GPIO driver over IMX SCU firmware API
+
+maintainers:
+  - Shenwei Wang <shenwei.wang@nxp.com>
+
+description: |
+  This module provides the standard interface to control the
+  resource pins in SCU domain on i.MX8 platforms.
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx8-scu-gpio
+
+  "#gpio-cells":
+    const: 2
+
+  gpio-controller: true
+
+required:
+  - compatible
+  - "#gpio-cells"
+  - gpio-controller
+
+additionalProperties: false
+
+examples:
+  - |
+    gpio@scu {
+        compatible = "fsl,imx8-scu-gpio";
+        gpio-controller;
+        #gpio-cells = <2>;
+    };
-- 
2.25.1


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

* [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node
  2022-08-04 18:49 [PATCH v1 0/3] Add IMX8 SCU GPIO support Shenwei Wang
  2022-08-04 18:49 ` [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings Shenwei Wang
@ 2022-08-04 18:49 ` Shenwei Wang
  2022-08-05  6:56   ` Krzysztof Kozlowski
  2022-08-04 18:49 ` [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver Shenwei Wang
  2 siblings, 1 reply; 11+ messages in thread
From: Shenwei Wang @ 2022-08-04 18:49 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, linus.walleij, brgl, shawnguo,
	s.hauer, kernel, festevam, linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel, Shenwei Wang

Add the description for imx-scu gpio subnode.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
 Documentation/devicetree/bindings/firmware/fsl,scu.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
index b40b0ef56978..080955b6edd8 100644
--- a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
+++ b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
@@ -30,6 +30,11 @@ properties:
       Clock controller node that provides the clocks controlled by the SCU
     $ref: /schemas/clock/fsl,scu-clk.yaml
 
+  gpio:
+    description:
+      GPIO control over the SCU firmware APIs
+    $ref: /schemas/gpio/fsl,imx8-scu-gpio.yaml
+
   ocotp:
     description:
       OCOTP controller node provided by the SCU
-- 
2.25.1


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

* [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver
  2022-08-04 18:49 [PATCH v1 0/3] Add IMX8 SCU GPIO support Shenwei Wang
  2022-08-04 18:49 ` [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings Shenwei Wang
  2022-08-04 18:49 ` [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node Shenwei Wang
@ 2022-08-04 18:49 ` Shenwei Wang
  2022-08-05  6:57   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 11+ messages in thread
From: Shenwei Wang @ 2022-08-04 18:49 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, linus.walleij, brgl, shawnguo,
	s.hauer, kernel, festevam, linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel, Shenwei Wang

The SCU firmware on i.MX8 platforms provides a set of APIs to
control the GPIO PINs on the SCU domain. This patch implements the
standard GPIO driver interface to access those PINs on the
SCU domain over the SCU APIs.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
 drivers/firmware/imx/Kconfig        |   6 ++
 drivers/firmware/imx/Makefile       |   1 +
 drivers/firmware/imx/imx-scu-gpio.c | 139 ++++++++++++++++++++++++++++
 3 files changed, 146 insertions(+)
 create mode 100644 drivers/firmware/imx/imx-scu-gpio.c

diff --git a/drivers/firmware/imx/Kconfig b/drivers/firmware/imx/Kconfig
index c027d99f2a59..484c13f3149a 100644
--- a/drivers/firmware/imx/Kconfig
+++ b/drivers/firmware/imx/Kconfig
@@ -28,3 +28,9 @@ config IMX_SCU_PD
 	depends on IMX_SCU
 	help
 	  The System Controller Firmware (SCFW) based power domain driver.
+
+config IMX_SCU_GPIO
+       def_bool y
+       depends on IMX_SCU
+       help
+         Say Y here to enable the imx8 gpio over SCFW MISC API
diff --git a/drivers/firmware/imx/Makefile b/drivers/firmware/imx/Makefile
index b76acbade2a0..436476502bd8 100644
--- a/drivers/firmware/imx/Makefile
+++ b/drivers/firmware/imx/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_IMX_DSP)		+= imx-dsp.o
 obj-$(CONFIG_IMX_SCU)		+= imx-scu.o misc.o imx-scu-irq.o rm.o imx-scu-soc.o
+obj-$(CONFIG_IMX_SCU_GPIO)	+= imx-scu-gpio.o
 obj-$(CONFIG_IMX_SCU_PD)	+= scu-pd.o
diff --git a/drivers/firmware/imx/imx-scu-gpio.c b/drivers/firmware/imx/imx-scu-gpio.c
new file mode 100644
index 000000000000..2f4a991a9ad6
--- /dev/null
+++ b/drivers/firmware/imx/imx-scu-gpio.c
@@ -0,0 +1,139 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2021~2022 NXP
+ *
+ * The driver exports a standard gpiochip interface
+ * to control the PIN resources on SCU domain.
+ */
+
+#include <linux/module.h>
+#include <linux/gpio/driver.h>
+#include <linux/platform_device.h>
+#include <linux/firmware/imx/svc/rm.h>
+#include <dt-bindings/firmware/imx/rsrc.h>
+
+struct scu_gpio_priv {
+	struct gpio_chip	chip;
+	struct mutex		lock;
+	struct device		*dev;
+	struct imx_sc_ipc	*handle;
+};
+
+static unsigned int scu_rsrc_arr[] = {
+	IMX_SC_R_BOARD_R0,
+	IMX_SC_R_BOARD_R1,
+	IMX_SC_R_BOARD_R2,
+	IMX_SC_R_BOARD_R3,
+	IMX_SC_R_BOARD_R4,
+	IMX_SC_R_BOARD_R5,
+	IMX_SC_R_BOARD_R6,
+	IMX_SC_R_BOARD_R7,
+};
+
+static int imx_scu_gpio_get(struct gpio_chip *chip, unsigned int offset)
+{
+	struct scu_gpio_priv *priv = gpiochip_get_data(chip);
+	int level;
+	int err;
+
+	if (offset >= chip->ngpio)
+		return -EINVAL;
+
+	mutex_lock(&priv->lock);
+
+	/* to read PIN state via scu api */
+	err = imx_sc_misc_get_control(priv->handle,
+			scu_rsrc_arr[offset], 0, &level);
+	mutex_unlock(&priv->lock);
+
+	if (err) {
+		dev_err(priv->dev, "SCU get failed: %d\n", err);
+		return err;
+	}
+
+	return level;
+}
+
+static void imx_scu_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
+{
+	struct scu_gpio_priv *priv = gpiochip_get_data(chip);
+	int err;
+
+	if (offset >= chip->ngpio)
+		return;
+
+	mutex_lock(&priv->lock);
+
+	/* to set PIN output level via scu api */
+	err = imx_sc_misc_set_control(priv->handle,
+			scu_rsrc_arr[offset], 0, value);
+	mutex_unlock(&priv->lock);
+
+	if (err)
+		dev_err(priv->dev, "SCU set (%d) failed: %d\n",
+				scu_rsrc_arr[offset], err);
+}
+
+static int imx_scu_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
+{
+	if (offset >= chip->ngpio)
+		return -EINVAL;
+
+	return GPIO_LINE_DIRECTION_OUT;
+}
+
+static int imx_scu_gpio_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct scu_gpio_priv *priv;
+	struct gpio_chip *gc;
+	int ret;
+
+	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	ret = imx_scu_get_handle(&priv->handle);
+	if (ret)
+		return ret;
+
+	priv->dev = dev;
+	mutex_init(&priv->lock);
+
+	gc = &priv->chip;
+	gc->base = -1;
+	gc->parent = dev;
+	gc->ngpio = sizeof(scu_rsrc_arr)/sizeof(unsigned int);
+	gc->label = dev_name(dev);
+	gc->get = imx_scu_gpio_get;
+	gc->set = imx_scu_gpio_set;
+	gc->get_direction = imx_scu_gpio_get_direction;
+
+	platform_set_drvdata(pdev, priv);
+
+	return devm_gpiochip_add_data(dev, gc, priv);
+}
+
+static const struct of_device_id imx_scu_gpio_dt_ids[] = {
+	{ .compatible = "fsl,imx8-scu-gpio" },
+	{ /* sentinel */ }
+};
+
+static struct platform_driver imx_scu_gpio_driver = {
+	.driver	= {
+		.name = "gpio-imx-scu",
+		.of_match_table = imx_scu_gpio_dt_ids,
+	},
+	.probe = imx_scu_gpio_probe,
+};
+
+static int __init _imx_scu_gpio_init(void)
+{
+	return platform_driver_register(&imx_scu_gpio_driver);
+}
+
+subsys_initcall_sync(_imx_scu_gpio_init);
+
+MODULE_AUTHOR("Shenwei Wang <shenwei.wang@nxp.com>");
+MODULE_DESCRIPTION("NXP GPIO over IMX SCU API");
+MODULE_LICENSE("GPL");
-- 
2.25.1


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

* Re: [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings
  2022-08-04 18:49 ` [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings Shenwei Wang
@ 2022-08-04 19:50   ` Rob Herring
  2022-08-05  6:55   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 11+ messages in thread
From: Rob Herring @ 2022-08-04 19:50 UTC (permalink / raw)
  To: Shenwei Wang
  Cc: shawnguo, linux-arm-kernel, festevam, linux-gpio, robh+dt,
	krzysztof.kozlowski+dt, kernel, devicetree, brgl, s.hauer,
	linus.walleij, linux-kernel, linux-imx

On Thu, 04 Aug 2022 13:49:06 -0500, Shenwei Wang wrote:
> Add binding document for the imx-scu gpio driver.
> 
> Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> ---
>  .../bindings/gpio/fsl,imx8-scu-gpio.yaml      | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/fsl,imx8-scu-gpio.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/gpio/fsl,imx8-scu-gpio.example.dts:18.18-22.11: Warning (unit_address_vs_reg): /example-0/gpio@scu: node has a unit name, but no reg or ranges property

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


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

* Re: [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings
  2022-08-04 18:49 ` [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings Shenwei Wang
  2022-08-04 19:50   ` Rob Herring
@ 2022-08-05  6:55   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-05  6:55 UTC (permalink / raw)
  To: Shenwei Wang, robh+dt, krzysztof.kozlowski+dt, linus.walleij,
	brgl, shawnguo, s.hauer, kernel, festevam, linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel

On 04/08/2022 20:49, Shenwei Wang wrote:
> +
> +properties:
> +  compatible:
> +    enum:
> +      - fsl,imx8-scu-gpio
> +
> +  "#gpio-cells":
> +    const: 2
> +
> +  gpio-controller: true
> +
> +required:
> +  - compatible
> +  - "#gpio-cells"
> +  - gpio-controller
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    gpio@scu {

Does not look like you tested the bindings. Please run `make
dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).


Best regards,
Krzysztof

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

* Re: [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node
  2022-08-04 18:49 ` [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node Shenwei Wang
@ 2022-08-05  6:56   ` Krzysztof Kozlowski
  2022-08-05 12:49     ` [EXT] " Shenwei Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-05  6:56 UTC (permalink / raw)
  To: Shenwei Wang, robh+dt, krzysztof.kozlowski+dt, linus.walleij,
	brgl, shawnguo, s.hauer, kernel, festevam, linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel

On 04/08/2022 20:49, Shenwei Wang wrote:
> Add the description for imx-scu gpio subnode.
> 
> Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> ---
>  Documentation/devicetree/bindings/firmware/fsl,scu.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> index b40b0ef56978..080955b6edd8 100644
> --- a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> +++ b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> @@ -30,6 +30,11 @@ properties:
>        Clock controller node that provides the clocks controlled by the SCU
>      $ref: /schemas/clock/fsl,scu-clk.yaml
>  
> +  gpio:
> +    description:
> +      GPIO control over the SCU firmware APIs

I don't understand this description. How GPIO can control some API?

Best regards,
Krzysztof

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

* Re: [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver
  2022-08-04 18:49 ` [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver Shenwei Wang
@ 2022-08-05  6:57   ` Krzysztof Kozlowski
  2022-08-05 12:31     ` [EXT] " Shenwei Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-05  6:57 UTC (permalink / raw)
  To: Shenwei Wang, robh+dt, krzysztof.kozlowski+dt, linus.walleij,
	brgl, shawnguo, s.hauer, kernel, festevam, linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel

On 04/08/2022 20:49, Shenwei Wang wrote:
> The SCU firmware on i.MX8 platforms provides a set of APIs to
> control the GPIO PINs on the SCU domain. This patch implements the
> standard GPIO driver interface to access those PINs on the
> SCU domain over the SCU APIs.
> 
> Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> ---
>  drivers/firmware/imx/Kconfig        |   6 ++
>  drivers/firmware/imx/Makefile       |   1 +
>  drivers/firmware/imx/imx-scu-gpio.c | 139 ++++++++++++++++++++++++++++
>  3 files changed, 146 insertions(+)
>  create mode 100644 drivers/firmware/imx/imx-scu-gpio.c
> 
> diff --git a/drivers/firmware/imx/Kconfig b/drivers/firmware/imx/Kconfig
> index c027d99f2a59..484c13f3149a 100644
> --- a/drivers/firmware/imx/Kconfig
> +++ b/drivers/firmware/imx/Kconfig
> @@ -28,3 +28,9 @@ config IMX_SCU_PD
>  	depends on IMX_SCU
>  	help
>  	  The System Controller Firmware (SCFW) based power domain driver.
> +
> +config IMX_SCU_GPIO
> +       def_bool y
> +       depends on IMX_SCU
> +       help
> +         Say Y here to enable the imx8 gpio over SCFW MISC API

gpio driver go to drivers/gpio/

Best regards,
Krzysztof

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

* RE: [EXT] Re: [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver
  2022-08-05  6:57   ` Krzysztof Kozlowski
@ 2022-08-05 12:31     ` Shenwei Wang
  0 siblings, 0 replies; 11+ messages in thread
From: Shenwei Wang @ 2022-08-05 12:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski, robh+dt, krzysztof.kozlowski+dt,
	linus.walleij, brgl, shawnguo, s.hauer, kernel, festevam,
	dl-linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel



> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Friday, August 5, 2022 1:57 AM
> To: Shenwei Wang <shenwei.wang@nxp.com>; robh+dt@kernel.org;
> krzysztof.kozlowski+dt@linaro.org; linus.walleij@linaro.org; brgl@bgdev.pl;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; dl-linux-imx <linux-imx@nxp.com>
> Cc: devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> gpio@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: [EXT] Re: [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver
> 
> Caution: EXT Email
> 
> On 04/08/2022 20:49, Shenwei Wang wrote:
> > The SCU firmware on i.MX8 platforms provides a set of APIs to control
> > the GPIO PINs on the SCU domain. This patch implements the standard
> > GPIO driver interface to access those PINs on the SCU domain over the
> > SCU APIs.
> >
> > Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> > ---
> >  drivers/firmware/imx/Kconfig        |   6 ++
> >  drivers/firmware/imx/Makefile       |   1 +
> >  drivers/firmware/imx/imx-scu-gpio.c | 139
> > ++++++++++++++++++++++++++++
> >  3 files changed, 146 insertions(+)
> >  create mode 100644 drivers/firmware/imx/imx-scu-gpio.c
> >
> > diff --git a/drivers/firmware/imx/Kconfig
> > b/drivers/firmware/imx/Kconfig index c027d99f2a59..484c13f3149a 100644
> > --- a/drivers/firmware/imx/Kconfig
> > +++ b/drivers/firmware/imx/Kconfig
> > @@ -28,3 +28,9 @@ config IMX_SCU_PD
> >       depends on IMX_SCU
> >       help
> >         The System Controller Firmware (SCFW) based power domain driver.
> > +
> > +config IMX_SCU_GPIO
> > +       def_bool y
> > +       depends on IMX_SCU
> > +       help
> > +         Say Y here to enable the imx8 gpio over SCFW MISC API
> 
> gpio driver go to drivers/gpio/

I was thinking to put the driver under drivers/gpio at the beginning too. Are there any requirements to put a driver under firmware directory?

Thanks,
Shenwei

> 
> Best regards,
> Krzysztof

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

* RE: [EXT] Re: [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node
  2022-08-05  6:56   ` Krzysztof Kozlowski
@ 2022-08-05 12:49     ` Shenwei Wang
  2022-08-08  7:52       ` Marco Felsch
  0 siblings, 1 reply; 11+ messages in thread
From: Shenwei Wang @ 2022-08-05 12:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski, robh+dt, krzysztof.kozlowski+dt,
	linus.walleij, brgl, shawnguo, s.hauer, kernel, festevam,
	dl-linux-imx
  Cc: devicetree, linux-kernel, linux-gpio, linux-arm-kernel



> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Friday, August 5, 2022 1:56 AM
> To: Shenwei Wang <shenwei.wang@nxp.com>; robh+dt@kernel.org;
> krzysztof.kozlowski+dt@linaro.org; linus.walleij@linaro.org; brgl@bgdev.pl;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; dl-linux-imx <linux-imx@nxp.com>
> Cc: devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> gpio@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: [EXT] Re: [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio
> node
> 
> Caution: EXT Email
> 
> On 04/08/2022 20:49, Shenwei Wang wrote:
> > Add the description for imx-scu gpio subnode.
> >
> > Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/firmware/fsl,scu.yaml | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> > index b40b0ef56978..080955b6edd8 100644
> > --- a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> > +++ b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> > @@ -30,6 +30,11 @@ properties:
> >        Clock controller node that provides the clocks controlled by the SCU
> >      $ref: /schemas/clock/fsl,scu-clk.yaml
> >
> > +  gpio:
> > +    description:
> > +      GPIO control over the SCU firmware APIs
> 
> I don't understand this description. How GPIO can control some API?

How about change to "Control the GPIO PINs on SCU domain over the firmware APIs"?

Thanks,
Shenwei

> 
> Best regards,
> Krzysztof

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

* Re: [EXT] Re: [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node
  2022-08-05 12:49     ` [EXT] " Shenwei Wang
@ 2022-08-08  7:52       ` Marco Felsch
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Felsch @ 2022-08-08  7:52 UTC (permalink / raw)
  To: Shenwei Wang
  Cc: Krzysztof Kozlowski, robh+dt, krzysztof.kozlowski+dt,
	linus.walleij, brgl, shawnguo, s.hauer, kernel, festevam,
	dl-linux-imx, devicetree, linux-kernel, linux-arm-kernel,
	linux-gpio

On 22-08-05, Shenwei Wang wrote:
> 
> 
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Sent: Friday, August 5, 2022 1:56 AM
> > To: Shenwei Wang <shenwei.wang@nxp.com>; robh+dt@kernel.org;
> > krzysztof.kozlowski+dt@linaro.org; linus.walleij@linaro.org; brgl@bgdev.pl;
> > shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> > festevam@gmail.com; dl-linux-imx <linux-imx@nxp.com>
> > Cc: devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> > gpio@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> > Subject: [EXT] Re: [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio
> > node
> > 
> > Caution: EXT Email
> > 
> > On 04/08/2022 20:49, Shenwei Wang wrote:
> > > Add the description for imx-scu gpio subnode.
> > >
> > > Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> > > ---
> > >  Documentation/devicetree/bindings/firmware/fsl,scu.yaml | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> > b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> > > index b40b0ef56978..080955b6edd8 100644
> > > --- a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> > > +++ b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
> > > @@ -30,6 +30,11 @@ properties:
> > >        Clock controller node that provides the clocks controlled by the SCU
> > >      $ref: /schemas/clock/fsl,scu-clk.yaml
> > >
> > > +  gpio:
> > > +    description:
> > > +      GPIO control over the SCU firmware APIs
> > 
> > I don't understand this description. How GPIO can control some API?
> 
> How about change to "Control the GPIO PINs on SCU domain over the firmware APIs"?

For linux it doesn't matter how the GPIOs are controlled. They can be
controlled by a co-processor like this SCU or by an I2C expander or they
are native, the list goes on. All those details are hidden.

Regards,
  Marco

> 
> Thanks,
> Shenwei
> 
> > 
> > Best regards,
> > Krzysztof

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

end of thread, other threads:[~2022-08-08  7:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 18:49 [PATCH v1 0/3] Add IMX8 SCU GPIO support Shenwei Wang
2022-08-04 18:49 ` [PATCH v1 1/3] dt-bindings: gpio: Add imx-scu gpio driver bindings Shenwei Wang
2022-08-04 19:50   ` Rob Herring
2022-08-05  6:55   ` Krzysztof Kozlowski
2022-08-04 18:49 ` [PATCH v1 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node Shenwei Wang
2022-08-05  6:56   ` Krzysztof Kozlowski
2022-08-05 12:49     ` [EXT] " Shenwei Wang
2022-08-08  7:52       ` Marco Felsch
2022-08-04 18:49 ` [PATCH v1 3/3] firmware: imx: add imx-scu GPIO driver Shenwei Wang
2022-08-05  6:57   ` Krzysztof Kozlowski
2022-08-05 12:31     ` [EXT] " Shenwei Wang

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