aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-10-11 09:02:06 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-10-11 09:31:40 -0400
commit886ab3dae2ba26bde5bab096c931365db9f49830 (patch)
treea08f4613875c99ca6ac31683c16eb2c875b98d92 /arch/arm/plat-mxc
parent9524705c867dc8d5b558f4793b7464eab967a530 (diff)
mxc/gpio: make _set_value work with values != 0/1
Documentation/gpio.txt specifies that the value argument to gpio_set_value() should be handled as a boolean (E.G. != 0 is high), so use the same logic as in _set_direction(). Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r--arch/arm/plat-mxc/gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index 57ec4a896a5d..9d38da077edb 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -235,7 +235,7 @@ static void mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
235 unsigned long flags; 235 unsigned long flags;
236 236
237 spin_lock_irqsave(&port->lock, flags); 237 spin_lock_irqsave(&port->lock, flags);
238 l = (__raw_readl(reg) & (~(1 << offset))) | (value << offset); 238 l = (__raw_readl(reg) & (~(1 << offset))) | (!!value << offset);
239 __raw_writel(l, reg); 239 __raw_writel(l, reg);
240 spin_unlock_irqrestore(&port->lock, flags); 240 spin_unlock_irqrestore(&port->lock, flags);
241} 241}