linux/drivers/pinctrl
Stephen Warren 3712a3c488 pinctrl: add explicit gpio_disable_free pinmux_op
Some pinctrl drivers (Tegra at least) program a pin to be a GPIO in a
completely different manner than they select which function to mux out of
that pin. In order to support a single "free" pinmux_op, the driver would
need to maintain a per-pin state of requested-for-gpio vs. requested-for-
function. However, that's a lot of work when the core already has explicit
separate paths for gpio request/free and function request/free.

So, add a gpio_disable_free op to struct pinmux_ops, and make pin_free()
call it when appropriate.

When doing this, I noticed that when calling pin_request():

    !!gpio == (gpio_range != NULL)

... and so I collapsed those two parameters in both pin_request(), and
when adding writing the new code in pin_free().

Also, for pin_free():

    !!free_func == (gpio_range != NULL)

However, I didn't want pin_free() to know about the GPIO function naming
special case, so instead, I reworked pin_free() to always return the pin's
previously requested function, and now pinmux_free_gpio() calls
kfree(function). This is much more balanced with the allocation having
been performed in pinmux_request_gpio().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-01-03 09:09:59 +01:00
..
Kconfig pinctrl: hide subsystem from the populace 2011-11-10 09:02:12 +01:00
Makefile pinctrl: make the "Debug PINCTRL calls" entry actually do something 2011-12-08 16:17:47 +01:00
core.c pinctrl: move group lookup to core 2012-01-03 09:09:58 +01:00
core.h pinctrl: move group lookup to core 2012-01-03 09:09:58 +01:00
pinmux-sirf.c pinctrl/sirf: fix pin number typo for SPI1 2011-12-02 11:19:15 +01:00
pinmux-u300.c pinctrl: iterate over u300_pmx_mask's in u300_pmx_endisable 2012-01-03 09:09:58 +01:00
pinmux.c pinctrl: add explicit gpio_disable_free pinmux_op 2012-01-03 09:09:59 +01:00
pinmux.h