From: Linus Walleij Date: Wed, 27 Jun 2018 08:39:31 +0000 (+0200) Subject: gpio: sch: Implement .get_direction() X-Git-Tag: v4.19~401^2~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8e764c2cc451452f07e4f35a3e83df9decf7f99;p=platform%2Fkernel%2Flinux-rpi.git 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 Cc: Daniel Krueger Acked-by: Mika Westerberg Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c index 26e9b1c..e9878f6 100644 --- a/drivers/gpio/gpio-sch.c +++ b/drivers/gpio/gpio-sch.c @@ -137,6 +137,13 @@ static int sch_gpio_direction_out(struct gpio_chip *gc, unsigned gpio_num, 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 = { .label = "sch_gpio", .owner = THIS_MODULE, @@ -144,6 +151,7 @@ static const struct gpio_chip sch_gpio_chip = { .get = sch_gpio_get, .direction_output = sch_gpio_direction_out, .set = sch_gpio_set, + .get_direction = sch_gpio_get_direction, }; static int sch_gpio_probe(struct platform_device *pdev)