From: David Lechner Date: Sun, 21 Jan 2018 23:09:40 +0000 (-0600) Subject: gpio: davinci: add support for pinmux gpio ranges X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3c87d7c874b2119c1cff4eee5586b9a6bc0b7fe9;p=linux.git gpio: davinci: add support for pinmux gpio ranges This adds support for the pinmux gpio ranges feature to the DaVinci gpio driver. Only device tree is supported since the non-DT boards don't use a generic pinmux controller. Cc: Keerthy Cc: Linus Walleij Signed-off-by: David Lechner Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 0b951ca78ec40..987126c4c6f61 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -225,6 +226,11 @@ static int davinci_gpio_probe(struct platform_device *pdev) chips->chip.of_gpio_n_cells = 2; chips->chip.parent = dev; chips->chip.of_node = dev->of_node; + + if (of_property_read_bool(dev->of_node, "gpio-ranges")) { + chips->chip.request = gpiochip_generic_request; + chips->chip.free = gpiochip_generic_free; + } #endif spin_lock_init(&chips->lock); bank_base += ngpio;