imx.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] Add IMX8 SCU GPIO support
@ 2022-08-11 12:41 Shenwei Wang
  2022-08-11 12:41 ` [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings Shenwei Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Shenwei Wang @ 2022-08-11 12:41 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, imx,
	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.

Changes in V4:
 - remove the generic compatible of "fsl,imx-sc-gpio"
 - update the gpio $ref in "fsl,scu.yaml" as the file name is changed
 - update the commit comment for 0003 because the driver is moved to the
   directory of "drivers/gpio"

Changes in V3:
 - follow the other imx8 SCU binding rule and rename the compatible string
   from fsl,imx8-scu-gpio to fsl,imx8qxp-sc-gpio
 - rename the doc file from fsl,imx8-scu-gpio.yaml to fsl,imx-sc-gpio.yaml

Changes in V2:
 - move the driver into the gpio directory per Krzysztof's feedback
 - change the subnode description in file fsl,scu.yaml
 - fix the dt_binding_check error

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

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

--
2.25.1


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

* [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings
  2022-08-11 12:41 [PATCH v4 0/3] Add IMX8 SCU GPIO support Shenwei Wang
@ 2022-08-11 12:41 ` Shenwei Wang
  2022-08-11 14:35   ` Krzysztof Kozlowski
  2022-08-11 12:41 ` [PATCH v4 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node Shenwei Wang
  2022-08-11 12:41 ` [PATCH v4 3/3] gpio: imx-scu: add imx-scu GPIO driver Shenwei Wang
  2 siblings, 1 reply; 9+ messages in thread
From: Shenwei Wang @ 2022-08-11 12:41 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, imx,
	Shenwei Wang

Add binding document for the imx scu gpio driver.

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

diff --git a/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
new file mode 100644
index 000000000000..a1b024cddc97
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-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,imx-sc-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,imx8qxp-sc-gpio
+
+  "#gpio-cells":
+    const: 2
+
+  gpio-controller: true
+
+required:
+  - compatible
+  - "#gpio-cells"
+  - gpio-controller
+
+additionalProperties: false
+
+examples:
+  - |
+    gpio0: gpio {
+        compatible = "fsl,imx8qxp-sc-gpio";
+        gpio-controller;
+        #gpio-cells = <2>;
+    };
-- 
2.25.1


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

* [PATCH v4 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node
  2022-08-11 12:41 [PATCH v4 0/3] Add IMX8 SCU GPIO support Shenwei Wang
  2022-08-11 12:41 ` [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings Shenwei Wang
@ 2022-08-11 12:41 ` Shenwei Wang
  2022-08-11 12:41 ` [PATCH v4 3/3] gpio: imx-scu: add imx-scu GPIO driver Shenwei Wang
  2 siblings, 0 replies; 9+ messages in thread
From: Shenwei Wang @ 2022-08-11 12:41 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, imx,
	Shenwei Wang, Krzysztof Kozlowski

Add the description for imx-scu gpio subnode.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 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..1fe61c2599e4 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:
+      Control the GPIO PINs on SCU domain over the firmware APIs
+    $ref: /schemas/gpio/fsl,imx-sc-gpio.yaml
+
   ocotp:
     description:
       OCOTP controller node provided by the SCU
-- 
2.25.1


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

* [PATCH v4 3/3] gpio: imx-scu: add imx-scu GPIO driver
  2022-08-11 12:41 [PATCH v4 0/3] Add IMX8 SCU GPIO support Shenwei Wang
  2022-08-11 12:41 ` [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings Shenwei Wang
  2022-08-11 12:41 ` [PATCH v4 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node Shenwei Wang
@ 2022-08-11 12:41 ` Shenwei Wang
  2 siblings, 0 replies; 9+ messages in thread
From: Shenwei Wang @ 2022-08-11 12:41 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, imx,
	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/gpio/Kconfig        |   4 ++
 drivers/gpio/Makefile       |   1 +
 drivers/gpio/gpio-imx-scu.c | 139 ++++++++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+)
 create mode 100644 drivers/gpio/gpio-imx-scu.c

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 0499c2facbb0..b01310f6ebcc 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -341,6 +341,10 @@ config GPIO_ICH
 
 	  If unsure, say N.
 
+config GPIO_IMX_SCU
+       def_bool y
+       depends on IMX_SCU
+
 config GPIO_IOP
 	tristate "Intel IOP GPIO"
 	depends on ARCH_IOP32X || COMPILE_TEST
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 3fa4f3f93d85..b39ab87793ec 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -70,6 +70,7 @@ obj-$(CONFIG_HTC_EGPIO)			+= gpio-htc-egpio.o
 obj-$(CONFIG_GPIO_I8255)		+= gpio-i8255.o
 obj-$(CONFIG_GPIO_ICH)			+= gpio-ich.o
 obj-$(CONFIG_GPIO_IDT3243X)		+= gpio-idt3243x.o
+obj-$(CONFIG_GPIO_IMX_SCU)		+= gpio-imx-scu.o
 obj-$(CONFIG_GPIO_IOP)			+= gpio-iop.o
 obj-$(CONFIG_GPIO_IT87)			+= gpio-it87.o
 obj-$(CONFIG_GPIO_IXP4XX)		+= gpio-ixp4xx.o
diff --git a/drivers/gpio/gpio-imx-scu.c b/drivers/gpio/gpio-imx-scu.c
new file mode 100644
index 000000000000..17be21b8f3b7
--- /dev/null
+++ b/drivers/gpio/gpio-imx-scu.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,imx8qxp-sc-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] 9+ messages in thread

* Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings
  2022-08-11 12:41 ` [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings Shenwei Wang
@ 2022-08-11 14:35   ` Krzysztof Kozlowski
  2022-08-11 14:52     ` [EXT] " Shenwei Wang
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-11 14:35 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, imx

On 11/08/2022 15:41, Shenwei Wang wrote:
> Add binding document for the imx scu gpio driver.
> 
> Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> ---
>  .../bindings/gpio/fsl,imx-sc-gpio.yaml        | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> 
> diff --git a/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> new file mode 100644
> index 000000000000..a1b024cddc97
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-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,imx-sc-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,imx8qxp-sc-gpio

Now the filename does not match compatible. Use the same compatible as
filename.

Best regards,
Krzysztof

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

* RE: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings
  2022-08-11 14:35   ` Krzysztof Kozlowski
@ 2022-08-11 14:52     ` Shenwei Wang
  2022-08-11 15:10       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Shenwei Wang @ 2022-08-11 14:52 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, imx



> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Thursday, August 11, 2022 9:36 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; imx@lists.linux.dev
> Subject: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver
> bindings
> > diff --git
> > a/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> > b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> > new file mode 100644
> > index 000000000000..a1b024cddc97
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> > +description: |
> > +  This module provides the standard interface to control the
> > +  resource pins in SCU domain on i.MX8 platforms.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - fsl,imx8qxp-sc-gpio
> 
> Now the filename does not match compatible. Use the same compatible as
> filename.

The subnodes under fsl,scu.yaml have their own naming rule. For example, the watchdog
compatible is "fsl,imx-sc-wdt", but the file name is "fsl,scu-wdt.yaml". Is the filename required 
to match its compatible?

Regards,
Shenwei

> 
> Best regards,
> Krzysztof

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

* Re: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings
  2022-08-11 14:52     ` [EXT] " Shenwei Wang
@ 2022-08-11 15:10       ` Krzysztof Kozlowski
  2022-08-11 15:30         ` Shenwei Wang
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-11 15:10 UTC (permalink / raw)
  To: Shenwei Wang, 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, imx

On 11/08/2022 17:52, Shenwei Wang wrote:
> 
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Thursday, August 11, 2022 9:36 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; imx@lists.linux.dev
>> Subject: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver
>> bindings
>>> diff --git
>>> a/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
>>> b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
>>> new file mode 100644
>>> index 000000000000..a1b024cddc97
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
>>> +description: |
>>> +  This module provides the standard interface to control the
>>> +  resource pins in SCU domain on i.MX8 platforms.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    enum:
>>> +      - fsl,imx8qxp-sc-gpio
>>
>> Now the filename does not match compatible. Use the same compatible as
>> filename.
> 
> The subnodes under fsl,scu.yaml have their own naming rule. For example, the watchdog
> compatible is "fsl,imx-sc-wdt", but the file name is "fsl,scu-wdt.yaml". 

The other files have for example fsl,imx-sc-wdt, so they match compatible.

> Is the filename required 
> to match its compatible?

Yes, that's the convention. Otherwise people tend to name the files in
whatever way they like...

Best regards,
Krzysztof

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

* RE: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings
  2022-08-11 15:10       ` Krzysztof Kozlowski
@ 2022-08-11 15:30         ` Shenwei Wang
  2022-08-12  8:30           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Shenwei Wang @ 2022-08-11 15:30 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, imx



> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Thursday, August 11, 2022 10:11 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; imx@lists.linux.dev
> Subject: Re: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver
> bindings
> 
> Caution: EXT Email
> 
> On 11/08/2022 17:52, Shenwei Wang wrote:
> >
> >
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> Sent: Thursday, August 11, 2022 9:36 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;
> >> imx@lists.linux.dev
> >> Subject: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio
> >> driver bindings
> >>> diff --git
> >>> a/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> >>> b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> >>> new file mode 100644
> >>> index 000000000000..a1b024cddc97
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
> >>> +description: |
> >>> +  This module provides the standard interface to control the
> >>> +  resource pins in SCU domain on i.MX8 platforms.
> >>> +
> >>> +properties:
> >>> +  compatible:
> >>> +    enum:
> >>> +      - fsl,imx8qxp-sc-gpio
> >>
> >> Now the filename does not match compatible. Use the same compatible
> >> as filename.
> >
> > The subnodes under fsl,scu.yaml have their own naming rule. For
> > example, the watchdog compatible is "fsl,imx-sc-wdt", but the file name is
> "fsl,scu-wdt.yaml".
> 
> The other files have for example fsl,imx-sc-wdt, so they match compatible.

I don't see the file fsl,imx-sc-wdt you mentioned under the watchdog directory.

$ ls fsl*
fsl-imx7ulp-wdt.yaml  fsl-imx-wdt.yaml  fsl,scu-wdt.yaml

Regards,
Shenwei

> 
> > Is the filename required
> > to match its compatible?
> 
> Yes, that's the convention. Otherwise people tend to name the files in whatever
> way they like...
> 
> Best regards,
> Krzysztof

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

* Re: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings
  2022-08-11 15:30         ` Shenwei Wang
@ 2022-08-12  8:30           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2022-08-12  8:30 UTC (permalink / raw)
  To: Shenwei Wang, 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, imx

On 11/08/2022 18:30, Shenwei Wang wrote:
> 
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Thursday, August 11, 2022 10:11 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; imx@lists.linux.dev
>> Subject: Re: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver
>> bindings
>>
>> Caution: EXT Email
>>
>> On 11/08/2022 17:52, Shenwei Wang wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> Sent: Thursday, August 11, 2022 9:36 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;
>>>> imx@lists.linux.dev
>>>> Subject: [EXT] Re: [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio
>>>> driver bindings
>>>>> diff --git
>>>>> a/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
>>>>> b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
>>>>> new file mode 100644
>>>>> index 000000000000..a1b024cddc97
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/gpio/fsl,imx-sc-gpio.yaml
>>>>> +description: |
>>>>> +  This module provides the standard interface to control the
>>>>> +  resource pins in SCU domain on i.MX8 platforms.
>>>>> +
>>>>> +properties:
>>>>> +  compatible:
>>>>> +    enum:
>>>>> +      - fsl,imx8qxp-sc-gpio
>>>>
>>>> Now the filename does not match compatible. Use the same compatible
>>>> as filename.
>>>
>>> The subnodes under fsl,scu.yaml have their own naming rule. For
>>> example, the watchdog compatible is "fsl,imx-sc-wdt", but the file name is
>> "fsl,scu-wdt.yaml".
>>
>> The other files have for example fsl,imx-sc-wdt, so they match compatible.
> 
> I don't see the file fsl,imx-sc-wdt you mentioned under the watchdog directory.
> 
> $ ls fsl*
> fsl-imx7ulp-wdt.yaml  fsl-imx-wdt.yaml  fsl,scu-wdt.yaml

Eh, they looked similar enough that I did not spot it during review.
fsl,scu-wdt.yaml should be named fsl,imx-sc-wdt.yaml, of course.


Best regards,
Krzysztof

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

end of thread, other threads:[~2022-08-12  8:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 12:41 [PATCH v4 0/3] Add IMX8 SCU GPIO support Shenwei Wang
2022-08-11 12:41 ` [PATCH v4 1/3] dt-bindings: gpio: Add imx scu gpio driver bindings Shenwei Wang
2022-08-11 14:35   ` Krzysztof Kozlowski
2022-08-11 14:52     ` [EXT] " Shenwei Wang
2022-08-11 15:10       ` Krzysztof Kozlowski
2022-08-11 15:30         ` Shenwei Wang
2022-08-12  8:30           ` Krzysztof Kozlowski
2022-08-11 12:41 ` [PATCH v4 2/3] dt-bindings: firmware: imx: Add imx-scu gpio node Shenwei Wang
2022-08-11 12:41 ` [PATCH v4 3/3] gpio: imx-scu: add imx-scu GPIO driver 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).