gpio: tqmx86: Set proper output level for direction_output
authorAxel Lin <axel.lin@ingics.com>
Mon, 18 Feb 2019 03:23:16 +0000 (11:23 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 21 Feb 2019 12:19:52 +0000 (13:19 +0100)
For output-only gpios, direction_output should set proper output level.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-tqmx86.c

index 33dbe483f92fe2d50e6367ef2b085f60388262e3..d5880db7f9d47bae4db8267bf6dd7af1fb655f30 100644 (file)
@@ -93,8 +93,9 @@ static int tqmx86_gpio_direction_output(struct gpio_chip *chip,
        /* Direction cannot be changed, validate is an output */
        if (BIT(offset) & TQMX86_DIR_INPUT_MASK)
                return -EINVAL;
-       else
-               return 0;
+
+       tqmx86_gpio_set(chip, offset, value);
+       return 0;
 }
 
 static int tqmx86_gpio_get_direction(struct gpio_chip *chip,