diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-08-27 10:30:17 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-08-29 03:11:00 -0400 |
commit | 0351c287952483dafa904f84496631198465fbf4 (patch) | |
tree | 45f0a59952be9a64a28a726db37b4eaff5841d9e /drivers/pinctrl/pinctrl-rockchip.c | |
parent | 05d3534a321d7fe4524b3b83bb20318282f3ec2c (diff) |
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 <axel.lin@ingics.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-rockchip.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-rockchip.c | 12 |
1 files changed, 12 insertions, 0 deletions
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, | |||
884 | * GPIO handling | 884 | * GPIO handling |
885 | */ | 885 | */ |
886 | 886 | ||
887 | static int rockchip_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
888 | { | ||
889 | return pinctrl_request_gpio(chip->base + offset); | ||
890 | } | ||
891 | |||
892 | static void rockchip_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
893 | { | ||
894 | pinctrl_free_gpio(chip->base + offset); | ||
895 | } | ||
896 | |||
887 | static void rockchip_gpio_set(struct gpio_chip *gc, unsigned offset, int value) | 897 | static void rockchip_gpio_set(struct gpio_chip *gc, unsigned offset, int value) |
888 | { | 898 | { |
889 | struct rockchip_pin_bank *bank = gc_to_pin_bank(gc); | 899 | 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) | |||
957 | } | 967 | } |
958 | 968 | ||
959 | static const struct gpio_chip rockchip_gpiolib_chip = { | 969 | static const struct gpio_chip rockchip_gpiolib_chip = { |
970 | .request = rockchip_gpio_request, | ||
971 | .free = rockchip_gpio_free, | ||
960 | .set = rockchip_gpio_set, | 972 | .set = rockchip_gpio_set, |
961 | .get = rockchip_gpio_get, | 973 | .get = rockchip_gpio_get, |
962 | .direction_input = rockchip_gpio_direction_input, | 974 | .direction_input = rockchip_gpio_direction_input, |