提交 64b997c5 编写于 作者: V viresh kumar 提交者: Russell King

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: NViresh Kumar <viresh.kumar@st.com>
Acked-by: NBaruch Siach <baruch@tkos.co.il>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 9a99d555
...@@ -91,6 +91,12 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset, ...@@ -91,6 +91,12 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset,
gpiodir = readb(chip->base + GPIODIR); gpiodir = readb(chip->base + GPIODIR);
gpiodir |= 1 << offset; gpiodir |= 1 << offset;
writeb(gpiodir, chip->base + GPIODIR); writeb(gpiodir, chip->base + GPIODIR);
/*
* gpio value is set again, because pl061 doesn't allow to set value of
* a gpio pin before configuring it in OUT mode.
*/
writeb(!!value << offset, chip->base + (1 << (offset + 2)));
spin_unlock_irqrestore(&chip->lock, flags); spin_unlock_irqrestore(&chip->lock, flags);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册