]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: pxa: fix legacy non pinctrl aware builds
authorRobert Jarzmik <robert.jarzmik@free.fr>
Tue, 29 Mar 2016 08:04:00 +0000 (10:04 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 8 Apr 2016 08:10:08 +0000 (10:10 +0200)
commit57bd17b5ac95c843a2ce8ada0a793ffb740e0aa3
tree227b0446b6ea79ac43b244ad841c2a844ba026b7
parent0468ad219541e778fece8d65a784688f644e9bce
gpio: pxa: fix legacy non pinctrl aware builds

In legacy pxa builds, ie. non device-tree and platform-data only builds,
pinctrl is not yet available. As a consequence, the pinctrl gpio
direction change function is a stub, returning always success.

In the current state, the gpio driver direction function believes the
pinctrl direction change was successful, and exits without actually
changing the gpio direction.

This patch changes the logic :
 - if the pinctrl direction function fails, gpio direction will report
   that failure
 - if the pinctrl direction function succeeds, gpio direction is changed
   by the gpio driver anyway.
   This is sub optimal in the pinctrl aware case, as the gpio direction
   will be changed twice: once by pinctrl function and another time by
   the gpio direction function.

Yet it should be acceptable in this form, as this is functional for all
pxa platforms (device-tree and platform-data), and moreover changing a
gpio direction is very very seldom, usually in machine initialization,
seldom in drivers probe, and an exception for ac97 reset bug.

Fixes: 8390e69c7567 ("gpio: pxa: add pin control gpio direction and request")
Reported-by: Guenter Roeck <guenter@roeck-us.net>
Tested-by: Guenter Roeck <guenter@roeck-us.net>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pxa.c