public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips
@ 2013-08-27 14:30 Axel Lin
  2013-08-28 11:25 ` Linus Walleij
  2013-08-29  7:11 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2013-08-27 14:30 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Heiko Stübner, linux-kernel

Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl
when a GPIO is requested or freed.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pinctrl/pinctrl-rockchip.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 64ad0c0..b1337eb 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -872,6 +872,16 @@ static int rockchip_pinctrl_register(struct platform_device *pdev,
  * GPIO handling
  */
 
+static int rockchip_gpio_request(struct gpio_chip *chip, unsigned offset)
+{
+	return pinctrl_request_gpio(chip->base + offset);
+}
+
+static void rockchip_gpio_free(struct gpio_chip *chip, unsigned offset)
+{
+	pinctrl_free_gpio(chip->base + offset);
+}
+
 static void rockchip_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
 {
 	struct rockchip_pin_bank *bank = gc_to_pin_bank(gc);
@@ -945,6 +955,8 @@ static int rockchip_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
 }
 
 static const struct gpio_chip rockchip_gpiolib_chip = {
+	.request = rockchip_gpio_request,
+	.free = rockchip_gpio_free,
 	.set = rockchip_gpio_set,
 	.get = rockchip_gpio_get,
 	.direction_input = rockchip_gpio_direction_input,
-- 
1.8.1.2




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

* Re: [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips
  2013-08-27 14:30 [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips Axel Lin
@ 2013-08-28 11:25 ` Linus Walleij
  2013-08-28 13:06   ` Axel Lin
  2013-08-28 23:03   ` Heiko Stübner
  2013-08-29  7:11 ` Linus Walleij
  1 sibling, 2 replies; 5+ messages in thread
From: Linus Walleij @ 2013-08-28 11:25 UTC (permalink / raw)
  To: Axel Lin; +Cc: Heiko Stübner, linux-kernel@vger.kernel.org

On Tue, Aug 27, 2013 at 4:30 PM, Axel Lin <axel.lin@ingics.com> wrote:

> Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl
> when a GPIO is requested or freed.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---

Ohhh that will have semantic effects so really need to wait
for Heiko's opinion on this one.

BTW: Axel are you working with this system?

Yours,
Linus Walleij

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

* Re: [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips
  2013-08-28 11:25 ` Linus Walleij
@ 2013-08-28 13:06   ` Axel Lin
  2013-08-28 23:03   ` Heiko Stübner
  1 sibling, 0 replies; 5+ messages in thread
From: Axel Lin @ 2013-08-28 13:06 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Heiko Stübner, linux-kernel@vger.kernel.org

2013/8/28 Linus Walleij <linus.walleij@linaro.org>:
> On Tue, Aug 27, 2013 at 4:30 PM, Axel Lin <axel.lin@ingics.com> wrote:
>
>> Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl
>> when a GPIO is requested or freed.
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>> ---
>
> Ohhh that will have semantic effects so really need to wait
> for Heiko's opinion on this one.
>
> BTW: Axel are you working with this system?

No, I don't have a rockchip platform.

But I'm writting a pinctrl driver for an ARM SoC.
So I read a couple pinctrl driver source code for reference.

Regards,
Axel

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

* Re: [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips
  2013-08-28 11:25 ` Linus Walleij
  2013-08-28 13:06   ` Axel Lin
@ 2013-08-28 23:03   ` Heiko Stübner
  1 sibling, 0 replies; 5+ messages in thread
From: Heiko Stübner @ 2013-08-28 23:03 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Axel Lin, linux-kernel@vger.kernel.org

Am Mittwoch, 28. August 2013, 13:25:57 schrieb Linus Walleij:
> On Tue, Aug 27, 2013 at 4:30 PM, Axel Lin <axel.lin@ingics.com> wrote:
> > Implement .request() and .free() callbacks on the GPIO chips to inform
> > pinctrl when a GPIO is requested or freed.
> > 
> > Signed-off-by: Axel Lin <axel.lin@ingics.com>
> > ---
> 
> Ohhh that will have semantic effects so really need to wait
> for Heiko's opinion on this one.

I don't see any showstoppers here. Tested it on my machine with gpio-keys 
without any issues popping up. So

Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Heiko Stuebner <heiko@sntech.de>


Heiko

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

* Re: [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips
  2013-08-27 14:30 [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips Axel Lin
  2013-08-28 11:25 ` Linus Walleij
@ 2013-08-29  7:11 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2013-08-29  7:11 UTC (permalink / raw)
  To: Axel Lin; +Cc: Heiko Stübner, linux-kernel@vger.kernel.org

On Tue, Aug 27, 2013 at 4:30 PM, Axel Lin <axel.lin@ingics.com> wrote:

> Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl
> when a GPIO is requested or freed.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Patch applied with Heiko's tags.

Yours,
Linus Walleij

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

end of thread, other threads:[~2013-08-29  7:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 14:30 [PATCH] pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips Axel Lin
2013-08-28 11:25 ` Linus Walleij
2013-08-28 13:06   ` Axel Lin
2013-08-28 23:03   ` Heiko Stübner
2013-08-29  7:11 ` Linus Walleij

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