aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/au1000/common/gpio.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-12 15:44:33 +0200
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-12 15:44:33 +0200
commit0d62950125241a6e6db8e8f14271f098ec7a2da4 (patch)
tree8cdd9e17f6a6ff4cb6166ad12a4d3ed1d45b2dc9 /arch/mips/au1000/common/gpio.c
parentb3bc2c5562f06ca34b30f61c5714e96490946c81 (diff)
parent5e7184ae0dd49456387e8b1cdebc6b2c92fc6d51 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/atmel-mci-2.6.28
Diffstat (limited to 'arch/mips/au1000/common/gpio.c')
-rw-r--r--arch/mips/au1000/common/gpio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/au1000/common/gpio.c b/arch/mips/au1000/common/gpio.c
index b485d94ce8a..e660ddd611c 100644
--- a/arch/mips/au1000/common/gpio.c
+++ b/arch/mips/au1000/common/gpio.c
@@ -48,7 +48,7 @@ static void au1xxx_gpio2_write(unsigned gpio, int value)
{
gpio -= AU1XXX_GPIO_BASE;
- gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | (value << gpio);
+ gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
}
static int au1xxx_gpio2_direction_input(unsigned gpio)
@@ -61,7 +61,8 @@ static int au1xxx_gpio2_direction_input(unsigned gpio)
static int au1xxx_gpio2_direction_output(unsigned gpio, int value)
{
gpio -= AU1XXX_GPIO_BASE;
- gpio2->dir = (0x01 << gpio) | (value << gpio);
+ gpio2->dir |= 0x01 << gpio;
+ gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
return 0;
}
@@ -90,6 +91,7 @@ static int au1xxx_gpio1_direction_input(unsigned gpio)
static int au1xxx_gpio1_direction_output(unsigned gpio, int value)
{
gpio1->trioutclr = (0x01 & gpio);
+ au1xxx_gpio1_write(gpio, value);
return 0;
}