pinctrl: as3722: fix handling of GPIO invert bit
authorAndrew Bresticker <abrestic@chromium.org>
Wed, 16 Apr 2014 20:40:17 +0000 (13:40 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 22 Apr 2014 15:04:11 +0000 (17:04 +0200)
commita73d2e30b46787d478275db36c19222020e29dc5
tree3d6a0115518e9ca8b569791a51df127ae2fcfc07
parent4c5fba3d4ae3a7aae2c4a56d4a234aa556b7caca
pinctrl: as3722: fix handling of GPIO invert bit

The AS3722_GPIO_INV bit will always be blindly overwritten by
as3722_pinctrl_gpio_set_direction() and will be ignored when
setting the value of the GPIO in as3722_gpio_set() since the
enable_gpio_invert flag is never set.  This will cause an
initially inverted GPIO to toggle when requested as an output,
which could be problematic if, for example, the GPIO controls
a critical regulator.

Instead of setting up the enable_gpio_invert flag, just leave
the invert bit alone and check it before setting the GPIO value.

Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-as3722.c