summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Packham <[email protected]>2012-09-06 17:28:35 +0000
committerAndy Fleming <[email protected]>2012-10-22 03:03:16 -0500
commit168e5bc4095177764edaff306c9d4674a6f7f5e6 (patch)
tree0bf63b83fac63fbb3eaa063e9e0ea4f5b0150eeb
parent505f3e6f2e0e90b78dec065e64ad57c5d8741b04 (diff)
mpc85xx: make gpio_direction_output respect value
Users of familiar with the Linux gpiolib API expect that value parameter to gpio_direction_output reflects the initial state of the output pin. gpio_direction_output was always driving the output low, now it drives it high or low according to the value provided. Signed-off-by: Chris Packham <[email protected]> Cc: Kyle Moffett <[email protected]> Cc: Andy Fleming <[email protected]> Cc: Peter Tyser <[email protected]> Cc: Kumar Gala <[email protected]> Signed-off-by: Andy Fleming <[email protected]>
-rw-r--r--arch/powerpc/include/asm/mpc85xx_gpio.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/mpc85xx_gpio.h b/arch/powerpc/include/asm/mpc85xx_gpio.h
index 5a608a5d0f8..2aed5148ef5 100644
--- a/arch/powerpc/include/asm/mpc85xx_gpio.h
+++ b/arch/powerpc/include/asm/mpc85xx_gpio.h
@@ -98,7 +98,10 @@ static inline int gpio_direction_input(unsigned gpio)
static inline int gpio_direction_output(unsigned gpio, int value)
{
- mpc85xx_gpio_set_low(1U << gpio);
+ if (value)
+ mpc85xx_gpio_set_high(1U << gpio);
+ else
+ mpc85xx_gpio_set_low(1U << gpio);
return 0;
}