mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-26 01:18:58 +02:00
[AR7] GPIO fix
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10180 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
b9a0122f2f
commit
c46ac2ae6d
@ -41,15 +41,14 @@ static inline int gpio_get_value(unsigned gpio)
|
|||||||
|
|
||||||
static inline void gpio_set_value(unsigned gpio, int value)
|
static inline void gpio_set_value(unsigned gpio, int value)
|
||||||
{
|
{
|
||||||
static unsigned addr;
|
static void __iomem *gpio_out;
|
||||||
unsigned tmp;
|
unsigned tmp;
|
||||||
|
|
||||||
void __iomem *gpio_out =
|
if (!gpio_out)
|
||||||
(void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
|
gpio_out = (void __iomem *)
|
||||||
if (!addr)
|
KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
|
||||||
addr = readl(gpio_out);
|
|
||||||
|
|
||||||
tmp = addr & ~(1 << gpio);
|
tmp = readl(gpio_out) & ~(1 << gpio);
|
||||||
if (value)
|
if (value)
|
||||||
tmp |= 1 << gpio;
|
tmp |= 1 << gpio;
|
||||||
writel(tmp, gpio_out);
|
writel(tmp, gpio_out);
|
||||||
|
Loading…
Reference in New Issue
Block a user