summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-htc-egpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-htc-egpio.c')
-rw-r--r--drivers/gpio/gpio-htc-egpio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-htc-egpio.c b/drivers/gpio/gpio-htc-egpio.c
index 8aa23d70b1e6..a40bd56673fe 100644
--- a/drivers/gpio/gpio-htc-egpio.c
+++ b/drivers/gpio/gpio-htc-egpio.c
@@ -220,7 +220,10 @@ static int egpio_get_direction(struct gpio_chip *chip, unsigned offset)
egpio = gpiochip_get_data(chip);
- return !test_bit(offset, &egpio->is_out);
+ if (test_bit(offset, &egpio->is_out))
+ return GPIO_LINE_DIRECTION_OUT;
+
+ return GPIO_LINE_DIRECTION_IN;
}
static void egpio_write_cache(struct egpio_info *ei)