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>
This commit is contained in:
parent
05d3534a32
commit
0351c28795
|
@ -884,6 +884,16 @@ static int rockchip_pinctrl_register(struct platform_device *pdev,
|
||||||
* GPIO handling
|
* 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)
|
static void rockchip_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
|
||||||
{
|
{
|
||||||
struct rockchip_pin_bank *bank = gc_to_pin_bank(gc);
|
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 = {
|
static const struct gpio_chip rockchip_gpiolib_chip = {
|
||||||
|
.request = rockchip_gpio_request,
|
||||||
|
.free = rockchip_gpio_free,
|
||||||
.set = rockchip_gpio_set,
|
.set = rockchip_gpio_set,
|
||||||
.get = rockchip_gpio_get,
|
.get = rockchip_gpio_get,
|
||||||
.direction_input = rockchip_gpio_direction_input,
|
.direction_input = rockchip_gpio_direction_input,
|
||||||
|
|
Loading…
Reference in New Issue