diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2018-06-27 04:39:31 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-07-02 10:00:49 -0400 |
commit | d8e764c2cc451452f07e4f35a3e83df9decf7f99 (patch) | |
tree | 8eb2f5e399d1d0e91dfded1c802cfa6f11855f45 | |
parent | 4c1abc84f482706f033113665faa062852bd97da (diff) |
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>
-rw-r--r-- | drivers/gpio/gpio-sch.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c index 26e9b1cd2c78..e9878f6ede67 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, | |||
137 | return 0; | 137 | return 0; |
138 | } | 138 | } |
139 | 139 | ||
140 | static int sch_gpio_get_direction(struct gpio_chip *gc, unsigned gpio_num) | ||
141 | { | ||
142 | struct sch_gpio *sch = gpiochip_get_data(gc); | ||
143 | |||
144 | return sch_gpio_reg_get(sch, gpio_num, GIO); | ||
145 | } | ||
146 | |||
140 | static const struct gpio_chip sch_gpio_chip = { | 147 | static const struct gpio_chip sch_gpio_chip = { |
141 | .label = "sch_gpio", | 148 | .label = "sch_gpio", |
142 | .owner = THIS_MODULE, | 149 | .owner = THIS_MODULE, |
@@ -144,6 +151,7 @@ static const struct gpio_chip sch_gpio_chip = { | |||
144 | .get = sch_gpio_get, | 151 | .get = sch_gpio_get, |
145 | .direction_output = sch_gpio_direction_out, | 152 | .direction_output = sch_gpio_direction_out, |
146 | .set = sch_gpio_set, | 153 | .set = sch_gpio_set, |
154 | .get_direction = sch_gpio_get_direction, | ||
147 | }; | 155 | }; |
148 | 156 | ||
149 | static int sch_gpio_probe(struct platform_device *pdev) | 157 | static int sch_gpio_probe(struct platform_device *pdev) |