aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-08 23:07:56 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-07-05 08:49:10 -0400
commit8cd578b6e28693f357867a77598a88ef3deb6b39 (patch)
tree7e88d5bdfe421e281f5ff9997e80396381c72fcb /drivers/gpio
parentafcc0f8c174ff34305146878c40e7dcc72fcbbdf (diff)
gpiolib: wm8994: Pay attention to the value set when enabling as output
Not paying attention to the value being set is a bad thing because it means that we'll not set the hardware up to reflect what was requested. Not setting the hardware up to reflect what was requested means that the caller won't get the results they wanted. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-wm8994.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index 92ea5350dfe..aa61ad2fcaa 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -89,8 +89,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip,
89 struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip); 89 struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
90 struct wm8994 *wm8994 = wm8994_gpio->wm8994; 90 struct wm8994 *wm8994 = wm8994_gpio->wm8994;
91 91
92 if (value)
93 value = WM8994_GPN_LVL;
94
92 return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset, 95 return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset,
93 WM8994_GPN_DIR, 0); 96 WM8994_GPN_DIR | WM8994_GPN_LVL, value);
94} 97}
95 98
96static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 99static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value)