Skip to content

Commit

Permalink
mxc/gpio: make _set_value work with values != 0/1
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
  • Loading branch information
jacmet authored and saschahauer committed Oct 11, 2010
1 parent 9524705 commit 886ab3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/plat-mxc/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static void mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
unsigned long flags;

spin_lock_irqsave(&port->lock, flags);
l = (__raw_readl(reg) & (~(1 << offset))) | (value << offset);
l = (__raw_readl(reg) & (~(1 << offset))) | (!!value << offset);
__raw_writel(l, reg);
spin_unlock_irqrestore(&port->lock, flags);
}
Expand Down

0 comments on commit 886ab3d

Please sign in to comment.