diff options
author | Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> | 2016-09-08 03:48:16 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-09-12 14:28:59 +0200 |
commit | 4c806c9891100e80cbd6be654de7c8ca6f6be3ef (patch) | |
tree | 1d3382c859b48963d136519b00cbed5b86d0f1b4 /drivers/gpio/gpio-mxc.c | |
parent | gpio: mxc: shift gpio_mxc_init() to subsys_initcall level (diff) | |
download | linux-4c806c9891100e80cbd6be654de7c8ca6f6be3ef.tar.xz linux-4c806c9891100e80cbd6be654de7c8ca6f6be3ef.zip |
gpio: mxc: add generic gpio request/free callbacks to pinctrl
If a GPIO controller description in board DTB contains information
about mappings between GPIOs and pads under IOMUX control use it to
request and free GPIOs with respect to pinctrl/pinmux subsystems.
One of immediate positive functional changes is inability to
request non-existing GPIOs, i.e. if there is no pad such. Also
pinctrl/pinmux may now properly account pads occupied by requested
GPIOs.
The change has no effect, if "gpio-ranges" property is not found
including the case if a board has no DTB firmware.
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-mxc.c')
-rw-r--r-- | drivers/gpio/gpio-mxc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 1fdd5d804b5b..e38989a4fa0c 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -458,6 +458,11 @@ static int mxc_gpio_probe(struct platform_device *pdev) if (err) goto out_bgio; + if (of_property_read_bool(np, "gpio-ranges")) { + port->gc.request = gpiochip_generic_request; + port->gc.free = gpiochip_generic_free; + } + port->gc.to_irq = mxc_gpio_to_irq; port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 : pdev->id * 32; |