public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: pl061: Add pl061_gpio_free()
@ 2013-03-15 12:52 Axel Lin
  2013-03-27 21:52 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2013-03-15 12:52 UTC (permalink / raw)
  To: Grant Likely, Linus Walleij; +Cc: Haojian Zhuang, linux-kernel

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>
---
 drivers/gpio/gpio-pl061.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 06ed257..d7008df 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)
 	return pinctrl_request_gpio(gpio);
 }
 
+static void pl061_gpio_free(struct gpio_chip *chip, unsigned offset)
+{
+	int gpio = chip->base + offset;
+
+	pinctrl_free_gpio(gpio);
+}
+
 static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
 {
 	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)
 	spin_lock_init(&chip->lock);
 
 	chip->gc.request = pl061_gpio_request;
+	chip->gc.free = pl061_gpio_free;
 	chip->gc.direction_input = pl061_direction_input;
 	chip->gc.direction_output = pl061_direction_output;
 	chip->gc.get = pl061_get_value;
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: pl061: Add pl061_gpio_free()
  2013-03-15 12:52 [PATCH] gpio: pl061: Add pl061_gpio_free() Axel Lin
@ 2013-03-27 21:52 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2013-03-27 21:52 UTC (permalink / raw)
  To: Axel Lin; +Cc: Grant Likely, Haojian Zhuang, linux-kernel

On Fri, Mar 15, 2013 at 1:52 PM, Axel Lin <axel.lin@ingics.com> wrote:

> 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>

Excellent catch Axel (as usual).

Correct Haojian?

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-27 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-15 12:52 [PATCH] gpio: pl061: Add pl061_gpio_free() Axel Lin
2013-03-27 21:52 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox