From: Axel Lin Date: Tue, 27 Aug 2013 14:30:17 +0000 (+0800) Subject: pinctrl: rockchip: Implement .request() and .free() callbacks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0351c287952483dafa904f84496631198465fbf4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git pinctrl: rockchip: Implement .request() and .free() callbacks Implement .request() and .free() callbacks on the GPIO chips to inform pinctrl when a GPIO is requested or freed. Signed-off-by: Axel Lin Tested-by: Heiko Stuebner Acked-by: Heiko Stuebner Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index abff5895e81f..e0718b7c4abc 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -884,6 +884,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); @@ -957,6 +967,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,