Commit 64964e82 authored by Mark Brown's avatar Mark Brown

ASoC: Fix return value of wm5100_gpio_direction_out()

We can't just pass back the return value of snd_soc_update_bits() as it
will be 1 if a bit changed rather than zero.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 5a7c5f26
...@@ -2361,13 +2361,17 @@ static int wm5100_gpio_direction_out(struct gpio_chip *chip, ...@@ -2361,13 +2361,17 @@ static int wm5100_gpio_direction_out(struct gpio_chip *chip,
{ {
struct wm5100_priv *wm5100 = gpio_to_wm5100(chip); struct wm5100_priv *wm5100 = gpio_to_wm5100(chip);
struct snd_soc_codec *codec = wm5100->codec; struct snd_soc_codec *codec = wm5100->codec;
int val; int val, ret;
val = (1 << WM5100_GP1_FN_SHIFT) | (!!value << WM5100_GP1_LVL_SHIFT); val = (1 << WM5100_GP1_FN_SHIFT) | (!!value << WM5100_GP1_LVL_SHIFT);
return snd_soc_update_bits(codec, WM5100_GPIO_CTRL_1 + offset, ret = snd_soc_update_bits(codec, WM5100_GPIO_CTRL_1 + offset,
WM5100_GP1_FN_MASK | WM5100_GP1_DIR | WM5100_GP1_FN_MASK | WM5100_GP1_DIR |
WM5100_GP1_LVL, val); WM5100_GP1_LVL, val);
if (ret < 0)
return ret;
else
return 0;
} }
static int wm5100_gpio_get(struct gpio_chip *chip, unsigned offset) static int wm5100_gpio_get(struct gpio_chip *chip, unsigned offset)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment