diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-03-15 08:52:07 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-03-27 17:51:18 -0400 |
commit | 22ce4464fad1c0a90ed5c9a745a1fceabf69283d (patch) | |
tree | 05625a4bfb41ca8aa8cd08c593c7fd7f541ab855 /drivers | |
parent | 8b0ef2580f7ffdd0018332ab9c085729afa59f75 (diff) |
gpio: pl061: Add pl061_gpio_free()
commit 39b70ee051 "gpio: pl061: bind pinctrl by gpio request"
adds pl061_gpio_request() to request pinctrl.
Thus we need to add corresponding pl061_gpio_free() to free the pin.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-pl061.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 06ed257c5d31..d7008dfdd6f0 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c | |||
@@ -72,6 +72,13 @@ static int pl061_gpio_request(struct gpio_chip *chip, unsigned offset) | |||
72 | return pinctrl_request_gpio(gpio); | 72 | return pinctrl_request_gpio(gpio); |
73 | } | 73 | } |
74 | 74 | ||
75 | static void pl061_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
76 | { | ||
77 | int gpio = chip->base + offset; | ||
78 | |||
79 | pinctrl_free_gpio(gpio); | ||
80 | } | ||
81 | |||
75 | static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) | 82 | static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) |
76 | { | 83 | { |
77 | struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc); | 84 | struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc); |
@@ -287,6 +294,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) | |||
287 | spin_lock_init(&chip->lock); | 294 | spin_lock_init(&chip->lock); |
288 | 295 | ||
289 | chip->gc.request = pl061_gpio_request; | 296 | chip->gc.request = pl061_gpio_request; |
297 | chip->gc.free = pl061_gpio_free; | ||
290 | chip->gc.direction_input = pl061_direction_input; | 298 | chip->gc.direction_input = pl061_direction_input; |
291 | chip->gc.direction_output = pl061_direction_output; | 299 | chip->gc.direction_output = pl061_direction_output; |
292 | chip->gc.get = pl061_get_value; | 300 | chip->gc.get = pl061_get_value; |