OSDN Git Service

gpio: pxa: add pin control gpio direction and request
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sat, 12 Dec 2015 22:55:21 +0000 (23:55 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 15 Dec 2015 13:16:47 +0000 (14:16 +0100)
commita770d946371ec7710cbbcf523fccf8e05ef3927e
treebd67b13a9102b2cd2d4df0122a77cc7fea31e971
parent2f46205b4e4c1c2a4b72082f805753eb51fbfab5
gpio: pxa: add pin control gpio direction and request

If a pin control driver is available, use it to change the gpio
direction. If not fallback to directly manipulating the gpio direction
register.

The reason to use the pin control driver first is that pin control in
pxa2xx architecture implies changing the gpio direction, even for non
gpio functions. In order to do it atomically, only one driver should
control the gpio direction, and if a pin controller is available, it has
to be him.

There is a small catch : if CONFIG_PINCTRL is selected, then a pinctrl
driver has to be probed. If not, gpio_request() will return
-EPROBE_DEFER as pinctrl_request_gpio() returns it in that case.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pxa.c