From: Ye Li <ye.li@nxp.com>
To: u-boot@lists.denx.de
Subject: [PATCH 1/2] gpio: mxc_gpio: change gpio index for i.MX8
Date: Tue, 9 Jun 2020 20:28:02 -0700 [thread overview]
Message-ID: <1591759683-16091-1-git-send-email-ye.li@nxp.com> (raw)
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>
---
drivers/gpio/mxc_gpio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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;
--
2.7.4
next reply other threads:[~2020-06-10 3:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-10 3:28 Ye Li [this message]
2020-06-10 3:28 ` [PATCH 2/2] arm: dts: imx: fsl-imx8qm.dtsi: fix gpio aliases Ye Li
2020-06-23 7:51 ` sbabic at denx.de
2020-06-23 7:50 ` [PATCH 1/2] gpio: mxc_gpio: change gpio index for i.MX8 sbabic at denx.de
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1591759683-16091-1-git-send-email-ye.li@nxp.com \
--to=ye.li@nxp.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox