diff mbox series

[1/2] gpio: mxc_gpio: change gpio index for i.MX8

Message ID 1591759683-16091-1-git-send-email-ye.li@nxp.com
State Accepted
Commit e168eacde1cfbdcf75e92bfda6d51fa59d488dfd
Headers show
Series [1/2] gpio: mxc_gpio: change gpio index for i.MX8 | expand

Commit Message

Ye Li June 10, 2020, 3:28 a.m. UTC
Since the i.MX8 GPIO banks are indexed from 0 not 1 on other i.MX
platforms, so we have to adjust the index accordingly.

Signed-off-by: Adrian Alonso <adrian.alonso at nxp.com>
Signed-off-by: Ye Li <ye.li at nxp.com>
---
 drivers/gpio/mxc_gpio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Stefano Babic June 23, 2020, 7:50 a.m. UTC | #1
> Since the i.MX8 GPIO banks are indexed from 0 not 1 on other i.MX
> platforms, so we have to adjust the index accordingly.
> Signed-off-by: Adrian Alonso <adrian.alonso at nxp.com>
> Signed-off-by: Ye Li <ye.li at nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index a851893..90d36fb 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -281,7 +281,10 @@  static int mxc_gpio_probe(struct udevice *dev)
 	char name[18], *str;
 
 	banknum = plat->bank_index;
-	sprintf(name, "GPIO%d_", banknum + 1);
+	if (IS_ENABLED(CONFIG_ARCH_IMX8))
+		sprintf(name, "GPIO%d_", banknum);
+	else
+		sprintf(name, "GPIO%d_", banknum + 1);
 	str = strdup(name);
 	if (!str)
 		return -ENOMEM;