pinctrl/lantiq: Fix GPIO Setup of GPIO Port3
authorJohn Crispin <blogic@openwrt.org>
Thu, 26 Nov 2015 10:00:09 +0000 (11:00 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 30 Nov 2015 12:16:34 +0000 (13:16 +0100)
Some special handling of GPIO Port 3 is needed because of
some hardware thingofabob.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Martin Schiller <mschiller@tdt.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-xway.c

index a064962ece8b0118a33d55822a941b35cbcc5072..b78baaa5ee4b3ea9e68e2c7477f2706b36c07d97 100644 (file)
@@ -1563,6 +1563,10 @@ static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val)
 {
        struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
 
+       if (PORT(pin) == PORT3)
+               gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin));
+       else
+               gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin));
        gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
        xway_gpio_set(chip, pin, val);