* [PATCH] gpio: davinci: add support for pinmux gpio ranges
@ 2018-01-21 23:09 David Lechner
2018-02-07 13:00 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: David Lechner @ 2018-01-21 23:09 UTC (permalink / raw)
To: linux-gpio
Cc: David Lechner, linux-arm-kernel, linux-kernel, Keerthy,
Linus Walleij
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 <j-keerthy@ti.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David Lechner <david@lechnology.com>
---
drivers/gpio/gpio-davinci.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index e4b3d7d..744d6c2 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: davinci: add support for pinmux gpio ranges
2018-01-21 23:09 [PATCH] gpio: davinci: add support for pinmux gpio ranges David Lechner
@ 2018-02-07 13:00 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2018-02-07 13:00 UTC (permalink / raw)
To: David Lechner
Cc: linux-gpio, linux-kernel@vger.kernel.org, Linux ARM, Keerthy
On Mon, Jan 22, 2018 at 12:09 AM, David Lechner <david@lechnology.com> wrote:
> 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 <j-keerthy@ti.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: David Lechner <david@lechnology.com>
Nice, patch applied!
> + 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-07 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-21 23:09 [PATCH] gpio: davinci: add support for pinmux gpio ranges David Lechner
2018-02-07 13:00 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).