gpio: davinci: add support for pinmux gpio ranges
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Cc Linus Walleij <[email protected]>
Signed-off-by David Lechner <[email protected]>
--- drivers/gpio/gpio-davinci.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpio/gpio-davinci.c +6 -0
@@ -20,6 +20,7 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> +#include <linux/pinctrl/consumer.h> #include <linux/platform_device.h> #include <linux/platform_data/gpio-davinci.h> #include <linux/irqchip/chained_irq.h>
@@ -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;
Signature · 1 line
2.7.4
Quoted 7 lines · David Lechner
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 <[email protected]>Cc Linus Walleij <[email protected]>Signed-off-by David Lechner <[email protected]>
Nice, patch applied!
drivers/gpio/gpio-davinci.c static int davinci_gpio_probe(struct platform_device *pdev) · line 233
Quoted 4 lines
drivers/gpio/gpio-davinci.c +4
-0+if (of_property_read_bool (dev->of_node,"gpio-ranges" )) { + chips->chip.request = gpiochip_generic_request; + chips->chip.free = gpiochip_generic_free; + }
If the backing pin controller can do things like debounce or open drain pin control, consider using also the gpiochip_generic_config() callback in the future.
Yours,
Linus Walleij