Commit 3484f1be authored by Linus Walleij's avatar Linus Walleij

gpio: pl061: implement .get_direction()

Implement this callback so that the driver reports correctly
the direction setting of each line.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 682366d5
...@@ -61,6 +61,13 @@ struct pl061_gpio { ...@@ -61,6 +61,13 @@ struct pl061_gpio {
#endif #endif
}; };
static int pl061_get_direction(struct gpio_chip *gc, unsigned offset)
{
struct pl061_gpio *chip = gpiochip_get_data(gc);
return !(readb(chip->base + GPIODIR) & BIT(offset));
}
static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
{ {
struct pl061_gpio *chip = gpiochip_get_data(gc); struct pl061_gpio *chip = gpiochip_get_data(gc);
...@@ -315,6 +322,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -315,6 +322,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
chip->gc.free = gpiochip_generic_free; chip->gc.free = gpiochip_generic_free;
} }
chip->gc.get_direction = pl061_get_direction;
chip->gc.direction_input = pl061_direction_input; chip->gc.direction_input = pl061_direction_input;
chip->gc.direction_output = pl061_direction_output; chip->gc.direction_output = pl061_direction_output;
chip->gc.get = pl061_get_value; chip->gc.get = pl061_get_value;
......
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