diff mbox series

[4/6] pinctrl: sunxi: Declare set_config on the GPIO chip

Message ID b83a81feebb87c8314581648f8d01fb5f04eb4d6.1552591798.git-series.maxime.ripard@bootlin.com (mailing list archive)
State New, archived
Headers show
Series pinctrl: sunxi: Allow to configure pull-up / pull-down from GPIO flags | expand

Commit Message

Maxime Ripard March 14, 2019, 7:32 p.m. UTC
Our pin controller can configure the pins no matter how they are muxed, so
it makes sense to allow this for GPIOs as well.

Add the generic set_config function so that we can rely on the existing
pinctrl code we have.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij April 4, 2019, 3:27 a.m. UTC | #1
On Fri, Mar 15, 2019 at 2:33 AM Maxime Ripard <maxime.ripard@bootlin.com> wrote:

> Our pin controller can configure the pins no matter how they are muxed, so
> it makes sense to allow this for GPIOs as well.
>
> Add the generic set_config function so that we can rely on the existing
> pinctrl code we have.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

Patch applied.

This looks really nice, proper GPIO with pin config backend!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 96490dee62be..be04223591d4 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -1452,6 +1452,7 @@  int sunxi_pinctrl_init_with_variant(struct platform_device *pdev,
 	pctl->chip->owner = THIS_MODULE;
 	pctl->chip->request = gpiochip_generic_request;
 	pctl->chip->free = gpiochip_generic_free;
+	pctl->chip->set_config = gpiochip_generic_config;
 	pctl->chip->direction_input = sunxi_pinctrl_gpio_direction_input;
 	pctl->chip->direction_output = sunxi_pinctrl_gpio_direction_output;
 	pctl->chip->get = sunxi_pinctrl_gpio_get;