aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar7/files
diff options
context:
space:
mode:
authorMatteo Croce <matteo@openwrt.org>2008-01-12 17:14:15 +0000
committerMatteo Croce <matteo@openwrt.org>2008-01-12 17:14:15 +0000
commit2603bf190b3d07b4040c203d044ec047655e7374 (patch)
tree1083ca85460f95b54f7224fcfa1b632c1b41625a /target/linux/ar7/files
parentf1b788d21c97eaaf0220fead447049b5328d4d08 (diff)
downloadupstream-2603bf190b3d07b4040c203d044ec047655e7374.tar.gz
upstream-2603bf190b3d07b4040c203d044ec047655e7374.tar.bz2
upstream-2603bf190b3d07b4040c203d044ec047655e7374.zip
[AR7] GPIO fix
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10180 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar7/files')
-rw-r--r--target/linux/ar7/files/include/asm-mips/ar7/gpio.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/target/linux/ar7/files/include/asm-mips/ar7/gpio.h b/target/linux/ar7/files/include/asm-mips/ar7/gpio.h
index 7d665ff62d..00418b5863 100644
--- a/target/linux/ar7/files/include/asm-mips/ar7/gpio.h
+++ b/target/linux/ar7/files/include/asm-mips/ar7/gpio.h
@@ -41,15 +41,14 @@ static inline int gpio_get_value(unsigned gpio)
static inline void gpio_set_value(unsigned gpio, int value)
{
- static unsigned addr;
+ static void __iomem *gpio_out;
unsigned tmp;
- void __iomem *gpio_out =
- (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
- if (!addr)
- addr = readl(gpio_out);
+ if (!gpio_out)
+ gpio_out = (void __iomem *)
+ KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
- tmp = addr & ~(1 << gpio);
+ tmp = readl(gpio_out) & ~(1 << gpio);
if (value)
tmp |= 1 << gpio;
writel(tmp, gpio_out);