aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatteo Croce <matteo@openwrt.org>2008-01-13 20:13:08 +0000
committerMatteo Croce <matteo@openwrt.org>2008-01-13 20:13:08 +0000
commit959fe0f9d9dbe9338fc1f160bc329a4b9ebbbbc0 (patch)
tree9bfc3d050b9e3f22509ea8075446edbaccc2a784
parent2603bf190b3d07b4040c203d044ec047655e7374 (diff)
downloadupstream-959fe0f9d9dbe9338fc1f160bc329a4b9ebbbbc0.tar.gz
upstream-959fe0f9d9dbe9338fc1f160bc329a4b9ebbbbc0.tar.bz2
upstream-959fe0f9d9dbe9338fc1f160bc329a4b9ebbbbc0.zip
gpio: revert it back, wrong and useless
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10181 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/ar7/files/include/asm-mips/ar7/gpio.h18
1 files changed, 5 insertions, 13 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 00418b5863..2e19fcae9d 100644
--- a/target/linux/ar7/files/include/asm-mips/ar7/gpio.h
+++ b/target/linux/ar7/files/include/asm-mips/ar7/gpio.h
@@ -28,26 +28,18 @@ extern void gpio_free(unsigned gpio);
/* Common GPIO layer */
static inline int gpio_get_value(unsigned gpio)
{
- static unsigned addr;
+ void __iomem *gpio_in =
+ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
- if (!addr) {
- void __iomem *gpio_in = (void __iomem *)
- KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
- addr = readl(gpio_in);
- }
-
- return addr & (1 << gpio);
+ return readl(gpio_in) & (1 << gpio);
}
static inline void gpio_set_value(unsigned gpio, int value)
{
- static void __iomem *gpio_out;
+ void __iomem *gpio_out =
+ (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
unsigned tmp;
- if (!gpio_out)
- gpio_out = (void __iomem *)
- KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
-
tmp = readl(gpio_out) & ~(1 << gpio);
if (value)
tmp |= 1 << gpio;