Commit ba74bd5d authored by Linus Walleij's avatar Linus Walleij

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: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4bef8bf2
...@@ -32,6 +32,12 @@ static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset) ...@@ -32,6 +32,12 @@ static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset)
return !!(ret & BIT(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, static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset,
int value) int value)
{ {
...@@ -62,6 +68,7 @@ static struct gpio_chip twl6040gpo_chip = { ...@@ -62,6 +68,7 @@ static struct gpio_chip twl6040gpo_chip = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.get = twl6040gpo_get, .get = twl6040gpo_get,
.direction_output = twl6040gpo_direction_out, .direction_output = twl6040gpo_direction_out,
.get_direction = twl6040gpo_get_direction,
.set = twl6040gpo_set, .set = twl6040gpo_set,
.can_sleep = true, .can_sleep = true,
}; };
......
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