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>
This commit is contained in:
Ye Li 2018-12-26 00:48:26 -08:00
parent 9e406ea46a
commit 81154aed77
1 changed files with 0 additions and 4 deletions

View File

@ -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[] = {