Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284077
b: refs/heads/master
c: 385bd93
h: refs/heads/master
i:
  284075: cd74556
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Jan 2, 2012
1 parent ce1fa27 commit a98c4bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c3f51f6a37ff9c3f8ffef2ab600d1482a9f30c8
refs/heads/master: 385bd9379babaf0982c76e4c073d928e830df6ad
18 changes: 14 additions & 4 deletions trunk/sound/soc/codecs/wm8903.c
Original file line number Diff line number Diff line change
Expand Up @@ -1777,13 +1777,18 @@ static int wm8903_gpio_direction_in(struct gpio_chip *chip, unsigned offset)
struct wm8903_priv *wm8903 = gpio_to_wm8903(chip);
struct snd_soc_codec *codec = wm8903->codec;
unsigned int mask, val;
int ret;

mask = WM8903_GP1_FN_MASK | WM8903_GP1_DIR_MASK;
val = (WM8903_GPn_FN_GPIO_INPUT << WM8903_GP1_FN_SHIFT) |
WM8903_GP1_DIR;

return snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset,
mask, val);
ret = snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset,
mask, val);
if (ret < 0)
return ret;

return 0;
}

static int wm8903_gpio_get(struct gpio_chip *chip, unsigned offset)
Expand All @@ -1803,13 +1808,18 @@ static int wm8903_gpio_direction_out(struct gpio_chip *chip,
struct wm8903_priv *wm8903 = gpio_to_wm8903(chip);
struct snd_soc_codec *codec = wm8903->codec;
unsigned int mask, val;
int ret;

mask = WM8903_GP1_FN_MASK | WM8903_GP1_DIR_MASK | WM8903_GP1_LVL_MASK;
val = (WM8903_GPn_FN_GPIO_OUTPUT << WM8903_GP1_FN_SHIFT) |
(value << WM8903_GP2_LVL_SHIFT);

return snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset,
mask, val);
ret = snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset,
mask, val);
if (ret < 0)
return ret;

return 0;
}

static void wm8903_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
Expand Down

0 comments on commit a98c4bb

Please sign in to comment.