Skip to content

Commit

Permalink
MIPS: BCM47xx: Fix gpio_direction_output
Browse files Browse the repository at this point in the history
gpio_direction_output should also set an output value according to the API.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr> 
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Matthieu Castet authored and Ralf Baechle committed Jun 17, 2009
1 parent cc906f8 commit f203b7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/mips/include/asm/mach-bcm47xx/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ static inline int gpio_direction_input(unsigned gpio)

static inline int gpio_direction_output(unsigned gpio, int value)
{
/* first set the gpio out value */
ssb_gpio_out(&ssb_bcm47xx, 1 << gpio, value ? 1 << gpio : 0);
/* then set the gpio mode */
ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 1 << gpio);
return 0;
}
Expand Down

0 comments on commit f203b7c

Please sign in to comment.