linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property
@ 2023-09-28 13:43 Fabio Estevam
  2023-10-10 11:42 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2023-09-28 13:43 UTC (permalink / raw)
  To: linus.walleij; +Cc: aisheng.dong, ping.bai, linux-gpio, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

The 'fsl,mxs-gpio' property is not documented in gpio-mxs.yaml, but
the imx23 and imx28 dtsi describe the gpios as:

compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";

This gives schema warnings like:

imx28-cfa10037.dtb: pinctrl@80018000: gpio@0:compatible: ['fsl,imx28-gpio', 'fsl,mxs-gpio'] is too long
	from schema $id: http://devicetree.org/schemas/gpio/gpio-mxs.yaml#

"fsl,mxs-gpio" is only used inside pinctrl-mxs, but can be removed if
the compatible check is done against fsl,imx23-gpio and fsl,imx28-gpio.

Introduce is_mxs_gpio() and remove the need for "fsl,mxs-gpio".

Tested on a imx28-evk.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 drivers/pinctrl/freescale/pinctrl-mxs.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c
index cf3f4d2e0c16..e77311f26262 100644
--- a/drivers/pinctrl/freescale/pinctrl-mxs.c
+++ b/drivers/pinctrl/freescale/pinctrl-mxs.c
@@ -395,6 +395,12 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev,
 	return 0;
 }
 
+static bool is_mxs_gpio(struct device_node *child)
+{
+	return of_device_is_compatible(child, "fsl,imx23-gpio") ||
+	       of_device_is_compatible(child, "fsl,imx28-gpio");
+}
+
 static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
 				struct mxs_pinctrl_data *d)
 {
@@ -402,7 +408,6 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
 	struct device_node *np = pdev->dev.of_node;
 	struct device_node *child;
 	struct mxs_function *f;
-	const char *gpio_compat = "fsl,mxs-gpio";
 	const char *fn, *fnull = "";
 	int i = 0, idxf = 0, idxg = 0;
 	int ret;
@@ -417,7 +422,7 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
 	/* Count total functions and groups */
 	fn = fnull;
 	for_each_child_of_node(np, child) {
-		if (of_device_is_compatible(child, gpio_compat))
+		if (is_mxs_gpio(child))
 			continue;
 		soc->ngroups++;
 		/* Skip pure pinconf node */
@@ -446,7 +451,7 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
 	fn = fnull;
 	f = &soc->functions[idxf];
 	for_each_child_of_node(np, child) {
-		if (of_device_is_compatible(child, gpio_compat))
+		if (is_mxs_gpio(child))
 			continue;
 		if (of_property_read_u32(child, "reg", &val))
 			continue;
@@ -486,7 +491,7 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
 	idxf = 0;
 	fn = fnull;
 	for_each_child_of_node(np, child) {
-		if (of_device_is_compatible(child, gpio_compat))
+		if (is_mxs_gpio(child))
 			continue;
 		if (of_property_read_u32(child, "reg", &val)) {
 			ret = mxs_pinctrl_parse_group(pdev, child,
-- 
2.34.1


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

* Re: [PATCH] pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property
  2023-09-28 13:43 [PATCH] pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property Fabio Estevam
@ 2023-10-10 11:42 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2023-10-10 11:42 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: aisheng.dong, ping.bai, linux-gpio, Fabio Estevam

On Thu, Sep 28, 2023 at 3:43 PM Fabio Estevam <festevam@gmail.com> wrote:


> From: Fabio Estevam <festevam@denx.de>
>
> The 'fsl,mxs-gpio' property is not documented in gpio-mxs.yaml, but
> the imx23 and imx28 dtsi describe the gpios as:
>
> compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";
>
> This gives schema warnings like:
>
> imx28-cfa10037.dtb: pinctrl@80018000: gpio@0:compatible: ['fsl,imx28-gpio', 'fsl,mxs-gpio'] is too long
>         from schema $id: http://devicetree.org/schemas/gpio/gpio-mxs.yaml#
>
> "fsl,mxs-gpio" is only used inside pinctrl-mxs, but can be removed if
> the compatible check is done against fsl,imx23-gpio and fsl,imx28-gpio.
>
> Introduce is_mxs_gpio() and remove the need for "fsl,mxs-gpio".
>
> Tested on a imx28-evk.
>
> Signed-off-by: Fabio Estevam <festevam@denx.de>

Patch applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2023-10-10 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-28 13:43 [PATCH] pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property Fabio Estevam
2023-10-10 11:42 ` Linus Walleij

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