summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-merrifield.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-11-08 14:10:38 +0100
committerLinus Walleij <linus.walleij@linaro.org>2019-11-08 14:10:38 +0100
commit6b240aeb121ec14a528a58413baa9a74f8749604 (patch)
tree4148d2f8aa56b75488fbd568048ac81fa786ae9a /drivers/gpio/gpio-merrifield.c
parent1173c3c28abfc3d7b7665db502280ba9322320e6 (diff)
parent70d97e099bb426ecb3ad4bf31e88dbf2ef4b2e4c (diff)
Merge branch 'devel' into for-next
Diffstat (limited to 'drivers/gpio/gpio-merrifield.c')
-rw-r--r--drivers/gpio/gpio-merrifield.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
index 3302125e5265..0ee29c2049be 100644
--- a/drivers/gpio/gpio-merrifield.c
+++ b/drivers/gpio/gpio-merrifield.c
@@ -162,7 +162,10 @@ static int mrfld_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
{
void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
- return !(readl(gpdr) & BIT(offset % 32));
+ if (readl(gpdr) & BIT(offset % 32))
+ return GPIO_LINE_DIRECTION_OUT;
+
+ return GPIO_LINE_DIRECTION_IN;
}
static int mrfld_gpio_set_debounce(struct gpio_chip *chip, unsigned int offset,