diff options
author | Matteo Croce <rootkit85@yahoo.it> | 2008-01-13 20:13:08 +0000 |
---|---|---|
committer | Matteo Croce <rootkit85@yahoo.it> | 2008-01-13 20:13:08 +0000 |
commit | af9cf4a7a8fe91d1d7253c1b32e2caab8fbd0331 (patch) | |
tree | ff84827d23d3748604ef99b887091e955a5ef888 /target/linux/ar7/files | |
parent | 5d249c898d05ad60ae6e9212c54b426a19d9acc0 (diff) | |
download | mtk-20170518-af9cf4a7a8fe91d1d7253c1b32e2caab8fbd0331.zip mtk-20170518-af9cf4a7a8fe91d1d7253c1b32e2caab8fbd0331.tar.gz mtk-20170518-af9cf4a7a8fe91d1d7253c1b32e2caab8fbd0331.tar.bz2 |
gpio: revert it back, wrong and useless
SVN-Revision: 10181
Diffstat (limited to 'target/linux/ar7/files')
-rw-r--r-- | target/linux/ar7/files/include/asm-mips/ar7/gpio.h | 18 |
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 00418b5..2e19fca 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; |