Skip to content
Browse files

gpiolib: wm8994: Pay attention to the value set when enabling as output

commit 8cd578b upstream.

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 <>
Signed-off-by: Linus Walleij <>
Signed-off-by: Ben Hutchings <>
  • Loading branch information...
1 parent db46b26 commit 43fc6bce37ff39ab5010afadf1ea86e7cc9c2b37 @broonie broonie committed with bwhacks Jun 9, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 drivers/gpio/gpio-wm8994.c
5 drivers/gpio/gpio-wm8994.c
@@ -89,8 +89,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip,
struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
struct wm8994 *wm8994 = wm8994_gpio->wm8994;
+ if (value)
+ value = WM8994_GPN_LVL;
return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset,
- WM8994_GPN_DIR, 0);
+ WM8994_GPN_DIR | WM8994_GPN_LVL, value);
static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value)

0 comments on commit 43fc6bc

Please sign in to comment.
Something went wrong with that request. Please try again.