Commit 220a04f0 authored by Linus Walleij's avatar Linus Walleij

gpio: tc3589x: fix up .get_direction()

The bit in the TC3589x direction register is 0 for input
and 1 for output, but the gpiolib expects the reverse.
Fix up the logic.

Cc: stable@vger.kernel.org
Fixes: 14063d71 ("gpio: tc3589x: add .get_direction() and small cleanup")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 60f8339e
...@@ -97,7 +97,7 @@ static int tc3589x_gpio_get_direction(struct gpio_chip *chip, ...@@ -97,7 +97,7 @@ static int tc3589x_gpio_get_direction(struct gpio_chip *chip,
if (ret < 0) if (ret < 0)
return ret; return ret;
return !!(ret & BIT(pos)); return !(ret & BIT(pos));
} }
static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip, static int tc3589x_gpio_set_single_ended(struct gpio_chip *chip,
......
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