Commit 67b249aa authored by Tomer Maimon's avatar Tomer Maimon Committed by Linus Walleij

pinctrl: nuvoton: modify NPCM7xx pin configuration function

Modify GPIO direction setting in pin configuration function by using
generic GPIO functions to set the GPIO direction instead of direct
access to the GPIO direction register.
Signed-off-by: default avatarTomer Maimon <tmaimon77@gmail.com>
Tested-by: default avatarKun Yi <kunyi@google.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent f969b7aa
......@@ -1799,19 +1799,12 @@ static int npcm7xx_config_set_one(struct npcm7xx_pinctrl *npcm,
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_PU, gpio);
break;
case PIN_CONFIG_INPUT_ENABLE:
if (arg) {
iowrite32(gpio, bank->base + NPCM7XX_GP_N_OEC);
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_IEM,
gpio);
} else
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_IEM,
gpio);
iowrite32(gpio, bank->base + NPCM7XX_GP_N_OEC);
bank->direction_input(&bank->gc, pin % bank->gc.ngpio);
break;
case PIN_CONFIG_OUTPUT:
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_IEM, gpio);
iowrite32(gpio, arg ? bank->base + NPCM7XX_GP_N_DOS :
bank->base + NPCM7XX_GP_N_DOC);
iowrite32(gpio, bank->base + NPCM7XX_GP_N_OES);
bank->direction_output(&bank->gc, pin % bank->gc.ngpio, arg);
break;
case PIN_CONFIG_DRIVE_PUSH_PULL:
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_OTYP, gpio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment