Message ID | 20190218032316.15561-1-axel.lin@ingics.com |
---|---|
State | New |
Headers | show |
Series | gpio: tqmx86: Set proper output level for direction_output | expand |
On Mon, Feb 18, 2019 at 11:23:16AM +0800, Axel Lin wrote: > 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") Thanks Axel Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
On Mon, Feb 18, 2019 at 4:23 AM Axel Lin <axel.lin@ingics.com> wrote: > 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") Patch applied with Andrew's review tag. Excellent attention to detail! Thanks a lot. Yours, Linus Walleij
diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c index 33dbe483f92f..d5880db7f9d4 100644 --- a/drivers/gpio/gpio-tqmx86.c +++ b/drivers/gpio/gpio-tqmx86.c @@ -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,
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") --- drivers/gpio/gpio-tqmx86.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)