diff options
Diffstat (limited to 'arch/mips/au1000/common')
| -rw-r--r-- | arch/mips/au1000/common/gpio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/au1000/common/gpio.c b/arch/mips/au1000/common/gpio.c index b485d94ce8a5..e660ddd611c4 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) | |||
| 48 | { | 48 | { |
| 49 | gpio -= AU1XXX_GPIO_BASE; | 49 | gpio -= AU1XXX_GPIO_BASE; |
| 50 | 50 | ||
| 51 | gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | (value << gpio); | 51 | gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | static int au1xxx_gpio2_direction_input(unsigned gpio) | 54 | static int au1xxx_gpio2_direction_input(unsigned gpio) |
| @@ -61,7 +61,8 @@ static int au1xxx_gpio2_direction_input(unsigned gpio) | |||
| 61 | static int au1xxx_gpio2_direction_output(unsigned gpio, int value) | 61 | static int au1xxx_gpio2_direction_output(unsigned gpio, int value) |
| 62 | { | 62 | { |
| 63 | gpio -= AU1XXX_GPIO_BASE; | 63 | gpio -= AU1XXX_GPIO_BASE; |
| 64 | gpio2->dir = (0x01 << gpio) | (value << gpio); | 64 | gpio2->dir |= 0x01 << gpio; |
| 65 | gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio); | ||
| 65 | return 0; | 66 | return 0; |
| 66 | } | 67 | } |
| 67 | 68 | ||
| @@ -90,6 +91,7 @@ static int au1xxx_gpio1_direction_input(unsigned gpio) | |||
| 90 | static int au1xxx_gpio1_direction_output(unsigned gpio, int value) | 91 | static int au1xxx_gpio1_direction_output(unsigned gpio, int value) |
| 91 | { | 92 | { |
| 92 | gpio1->trioutclr = (0x01 & gpio); | 93 | gpio1->trioutclr = (0x01 & gpio); |
| 94 | au1xxx_gpio1_write(gpio, value); | ||
| 93 | return 0; | 95 | return 0; |
| 94 | } | 96 | } |
| 95 | 97 | ||
