diff options
author | Ye Li <ye.li@nxp.com> | 2020-06-10 06:28:02 +0300 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2020-06-23 01:08:53 +0300 |
commit | e168eacde1cfbdcf75e92bfda6d51fa59d488dfd (patch) | |
tree | 8ca4e032a8b0a9761b9e11a7b3eb4ce0134d25b4 /drivers/gpio | |
parent | 9959d0f679671c6edf91ef2213a08c90531a5980 (diff) | |
download | u-boot-e168eacde1cfbdcf75e92bfda6d51fa59d488dfd.tar.xz |
gpio: mxc_gpio: change gpio index for i.MX8
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@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/mxc_gpio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index c924e52f07..316dcc757b 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; |