diff options
author | Matteo Croce <rootkit85@yahoo.it> | 2008-01-12 17:14:15 +0000 |
---|---|---|
committer | Matteo Croce <rootkit85@yahoo.it> | 2008-01-12 17:14:15 +0000 |
commit | 5d249c898d05ad60ae6e9212c54b426a19d9acc0 (patch) | |
tree | c76a6e40def4e0a39de9ff29b7e4054b6b26458d /target | |
parent | fae9e82aad968f65cf2d8b3a8f5db11f3f1e88d6 (diff) | |
download | mtk-20170518-5d249c898d05ad60ae6e9212c54b426a19d9acc0.zip mtk-20170518-5d249c898d05ad60ae6e9212c54b426a19d9acc0.tar.gz mtk-20170518-5d249c898d05ad60ae6e9212c54b426a19d9acc0.tar.bz2 |
GPIO fix
SVN-Revision: 10180
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/ar7/files/include/asm-mips/ar7/gpio.h | 11 |
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 7d665ff..00418b5 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); |