diff options
Diffstat (limited to 'drivers/gpio/gpio-rcar.c')
-rw-r--r-- | drivers/gpio/gpio-rcar.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 350390c0b290..55cc61086d99 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio/driver.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
@@ -278,6 +278,13 @@ static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset) | |||
278 | pm_runtime_put(&p->pdev->dev); | 278 | pm_runtime_put(&p->pdev->dev); |
279 | } | 279 | } |
280 | 280 | ||
281 | static int gpio_rcar_get_direction(struct gpio_chip *chip, unsigned int offset) | ||
282 | { | ||
283 | struct gpio_rcar_priv *p = gpiochip_get_data(chip); | ||
284 | |||
285 | return !(gpio_rcar_read(p, INOUTSEL) & BIT(offset)); | ||
286 | } | ||
287 | |||
281 | static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset) | 288 | static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset) |
282 | { | 289 | { |
283 | gpio_rcar_config_general_input_output_mode(chip, offset, false); | 290 | gpio_rcar_config_general_input_output_mode(chip, offset, false); |
@@ -461,6 +468,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) | |||
461 | gpio_chip = &p->gpio_chip; | 468 | gpio_chip = &p->gpio_chip; |
462 | gpio_chip->request = gpio_rcar_request; | 469 | gpio_chip->request = gpio_rcar_request; |
463 | gpio_chip->free = gpio_rcar_free; | 470 | gpio_chip->free = gpio_rcar_free; |
471 | gpio_chip->get_direction = gpio_rcar_get_direction; | ||
464 | gpio_chip->direction_input = gpio_rcar_direction_input; | 472 | gpio_chip->direction_input = gpio_rcar_direction_input; |
465 | gpio_chip->get = gpio_rcar_get; | 473 | gpio_chip->get = gpio_rcar_get; |
466 | gpio_chip->direction_output = gpio_rcar_direction_output; | 474 | gpio_chip->direction_output = gpio_rcar_direction_output; |