Commit d8e764c2 authored by Linus Walleij's avatar Linus Walleij

gpio: sch: Implement .get_direction()

It's pretty simple to implement the .get_direction() for this
chip, so let's just do it.

Cc: Denis Turischev <denis.turischev@compulab.co.il>
Cc: Daniel Krueger <daniel.krueger@systec-electronic.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4c1abc84
...@@ -137,6 +137,13 @@ static int sch_gpio_direction_out(struct gpio_chip *gc, unsigned gpio_num, ...@@ -137,6 +137,13 @@ static int sch_gpio_direction_out(struct gpio_chip *gc, unsigned gpio_num,
return 0; return 0;
} }
static int sch_gpio_get_direction(struct gpio_chip *gc, unsigned gpio_num)
{
struct sch_gpio *sch = gpiochip_get_data(gc);
return sch_gpio_reg_get(sch, gpio_num, GIO);
}
static const struct gpio_chip sch_gpio_chip = { static const struct gpio_chip sch_gpio_chip = {
.label = "sch_gpio", .label = "sch_gpio",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -144,6 +151,7 @@ static const struct gpio_chip sch_gpio_chip = { ...@@ -144,6 +151,7 @@ static const struct gpio_chip sch_gpio_chip = {
.get = sch_gpio_get, .get = sch_gpio_get,
.direction_output = sch_gpio_direction_out, .direction_output = sch_gpio_direction_out,
.set = sch_gpio_set, .set = sch_gpio_set,
.get_direction = sch_gpio_get_direction,
}; };
static int sch_gpio_probe(struct platform_device *pdev) static int sch_gpio_probe(struct platform_device *pdev)
......
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