diff options
author | viresh kumar <viresh.kumar@st.com> | 2010-04-21 04:42:05 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-04-22 07:30:14 -0400 |
commit | 64b997c5142a13373857de09599afd2f079c2f7a (patch) | |
tree | d6abc0a71b1e2fa283d73050a0ea45e229c930eb /drivers/gpio | |
parent | 9a99d55514d3c6bfc03e41536659d781af6998f5 (diff) |
ARM: 6060/1: PL061 GPIO: Setting gpio val after changing direction to OUT.
pl061_direction_output doesn't set value of gpio to value passed to it.
This patch sets value of GPIO pin to requested value after changing direction
to OUT.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/pl061.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c index cc3b5e0b595a..2196f318114c 100644 --- a/drivers/gpio/pl061.c +++ b/drivers/gpio/pl061.c | |||
@@ -91,6 +91,12 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset, | |||
91 | gpiodir = readb(chip->base + GPIODIR); | 91 | gpiodir = readb(chip->base + GPIODIR); |
92 | gpiodir |= 1 << offset; | 92 | gpiodir |= 1 << offset; |
93 | writeb(gpiodir, chip->base + GPIODIR); | 93 | writeb(gpiodir, chip->base + GPIODIR); |
94 | |||
95 | /* | ||
96 | * gpio value is set again, because pl061 doesn't allow to set value of | ||
97 | * a gpio pin before configuring it in OUT mode. | ||
98 | */ | ||
99 | writeb(!!value << offset, chip->base + (1 << (offset + 2))); | ||
94 | spin_unlock_irqrestore(&chip->lock, flags); | 100 | spin_unlock_irqrestore(&chip->lock, flags); |
95 | 101 | ||
96 | return 0; | 102 | return 0; |