Skip to content

Commit 8cd578b

Browse files
broonielinusw
authored andcommitted
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 <[email protected]> Cc: [email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent afcc0f8 commit 8cd578b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpio/gpio-wm8994.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,11 @@ static int wm8994_gpio_direction_out(struct gpio_chip *chip,
8989
struct wm8994_gpio *wm8994_gpio = to_wm8994_gpio(chip);
9090
struct wm8994 *wm8994 = wm8994_gpio->wm8994;
9191

92+
if (value)
93+
value = WM8994_GPN_LVL;
94+
9295
return wm8994_set_bits(wm8994, WM8994_GPIO_1 + offset,
93-
WM8994_GPN_DIR, 0);
96+
WM8994_GPN_DIR | WM8994_GPN_LVL, value);
9497
}
9598

9699
static void wm8994_gpio_set(struct gpio_chip *chip, unsigned offset, int value)

0 commit comments

Comments
 (0)