123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- From 8fec046f568e2b946abd55a82d5417717a115b21 Mon Sep 17 00:00:00 2001
- From: Linus Walleij <linus.walleij@linaro.org>
- Date: Wed, 27 Jun 2018 10:39:31 +0200
- Subject: [PATCH 12/18] 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: Mika Westerberg <mika.westerberg@linux.intel.com>
- Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
- ---
- drivers/gpio/gpio-sch.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
- diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
- index 5f72b177fc80..6715828c3940 100644
- --- a/drivers/gpio/gpio-sch.c
- +++ b/drivers/gpio/gpio-sch.c
- @@ -138,6 +138,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 struct gpio_chip sch_gpio_chip = {
- .label = "sch_gpio",
- .owner = THIS_MODULE,
- @@ -145,6 +152,7 @@ static 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)
- --
- 2.16.4
|