[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1377613817.14731.1.camel@phoenix>
Date: Tue, 27 Aug 2013 22:30:17 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Heiko Stübner <heiko@...ech.de>,
linux-kernel@...r.kernel.org
Subject: [PATCH] pinctrl: rockchip: Implement .request() and .free()
callbacks on the GPIO chips
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@...ics.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists