Skip to content

Commit

Permalink
gpio-lpc32xx: Fix value handling of gpio_direction_output()
Browse files Browse the repository at this point in the history
For GPIOs of gpio-lpc32xx, gpio_direction_output() ignores the value argument
(initial value of output). This patch fixes this by setting the level
accordingly.

Cc: [email protected]
Signed-off-by: Roland Stigge <[email protected]>
Acked-by: Alexandre Pereira da Silva <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
stigge authored and linusw committed Sep 24, 2012
1 parent 979570e commit b1268d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpio/gpio-lpc32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ static int lpc32xx_gpio_dir_output_p012(struct gpio_chip *chip, unsigned pin,
{
struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip);

__set_gpio_level_p012(group, pin, value);
__set_gpio_dir_p012(group, pin, 0);

return 0;
Expand All @@ -318,6 +319,7 @@ static int lpc32xx_gpio_dir_output_p3(struct gpio_chip *chip, unsigned pin,
{
struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip);

__set_gpio_level_p3(group, pin, value);
__set_gpio_dir_p3(group, pin, 0);

return 0;
Expand All @@ -326,6 +328,9 @@ static int lpc32xx_gpio_dir_output_p3(struct gpio_chip *chip, unsigned pin,
static int lpc32xx_gpio_dir_out_always(struct gpio_chip *chip, unsigned pin,
int value)
{
struct lpc32xx_gpio_chip *group = to_lpc32xx_gpio(chip);

__set_gpo_level_p3(group, pin, value);
return 0;
}

Expand Down

0 comments on commit b1268d3

Please sign in to comment.