summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2018-12-26 00:48:26 -0800
committerYe Li <ye.li@nxp.com>2018-12-26 01:25:41 -0800
commit81154aed77d78140a2a18555f6e3acebb8a86377 (patch)
tree16780119813db07e839ecb0ebabea5cd7eb0b7d1
parent9e406ea46a93013b4b5370d0d45fe892e9f52583 (diff)
MLK-20655-1 mxc_gpio: Fix non-DM driver issue for iMX8 platforms
The port index is not calculated correctly. It should not be descreased, because the gpio number is from 0 on imx8 platform. Otherwise we will access wrong registers. Signed-off-by: Ye Li <ye.li@nxp.com>
-rw-r--r--drivers/gpio/mxc_gpio.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index 3b163cb47a3..2353b50b2a0 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -40,11 +40,7 @@ struct mxc_bank_info {
};
#ifndef CONFIG_DM_GPIO
-#if defined(CONFIG_IMX8)
-#define GPIO_TO_PORT(n) ((n / 32) - 1)
-#else
#define GPIO_TO_PORT(n) (n / 32)
-#endif
/* GPIO port description */
static unsigned long gpio_ports[] = {