pinctrl: rockchip: Implement .request() and .free() callbacks on the GPIO chips
Subsystems (2)
PATCH 1/1 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.
--- drivers/pinctrl/pinctrl-rockchip.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/pinctrl/pinctrl-rockchip.c +12 -0
@@ -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,
Signature · 1 line
1.8.1.2
Quoted 5 lines · Axel Lin
Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl when a GPIO is requested or freed.
Signed-off-by Axel Lin <[email protected]>---
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
2013/8/28 Linus Walleij <[email protected]>:
Quoted 5 lines · Axel Lin
Quoted 4 lines
Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl when a GPIO is requested or freed.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Axel Lin <[email protected]>---
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
Am Mittwoch, 28. August 2013, 13:25:57 schrieb Linus Walleij:
Quoted 9 lines · Axel Lin
Quoted 5 lines
Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl when a GPIO is requested or freed.
Signed-off-by Axel Lin <[email protected]>---
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
Heiko
Quoted 4 lines · Axel Lin
Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl when a GPIO is requested or freed.
Signed-off-by Axel Lin <[email protected]>
Patch applied with Heiko's tags.
Yours,
Linus Walleij