summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-twl6040.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-09-03 10:04:01 +0200
committerLinus Walleij <linus.walleij@linaro.org>2018-09-10 08:49:22 +0200
commitba74bd5d5b5b063d50891af16d5c14c29bcc52a6 (patch)
treeb72f88ea7a33c8e514c8a0ac3ace147a05041046 /drivers/gpio/gpio-twl6040.c
parent4bef8bf20b69c3a98dbb9c8e406c22adb8fd3903 (diff)
gpio: twl6040: Implement .get_direction()
The gpiolib cannot deduce the fact that every line is output by itself, implement a .get_direction() callback so we can inspect this. Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-twl6040.c')
-rw-r--r--drivers/gpio/gpio-twl6040.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c
index 77d50542bf61..c845b2ff1f43 100644
--- a/drivers/gpio/gpio-twl6040.c
+++ b/drivers/gpio/gpio-twl6040.c
@@ -32,6 +32,12 @@ static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset)
return !!(ret & BIT(offset));
}
+static int twl6040gpo_get_direction(struct gpio_chip *chip, unsigned offset)
+{
+ /* This means "out" */
+ return 0;
+}
+
static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset,
int value)
{
@@ -62,6 +68,7 @@ static struct gpio_chip twl6040gpo_chip = {
.owner = THIS_MODULE,
.get = twl6040gpo_get,
.direction_output = twl6040gpo_direction_out,
+ .get_direction = twl6040gpo_get_direction,
.set = twl6040gpo_set,
.can_sleep = true,
};