1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-26 22:46:27 +02:00

gpio: revert it back, wrong and useless

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10181 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
matteo 2008-01-13 20:13:08 +00:00
parent c46ac2ae6d
commit 2172c8c58f

View File

@ -28,26 +28,18 @@ extern void gpio_free(unsigned gpio);
/* Common GPIO layer */ /* Common GPIO layer */
static inline int gpio_get_value(unsigned gpio) 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) { return readl(gpio_in) & (1 << gpio);
void __iomem *gpio_in = (void __iomem *)
KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
addr = readl(gpio_in);
}
return addr & (1 << gpio);
} }
static inline void gpio_set_value(unsigned gpio, int value) 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; unsigned tmp;
if (!gpio_out)
gpio_out = (void __iomem *)
KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
tmp = readl(gpio_out) & ~(1 << gpio); tmp = readl(gpio_out) & ~(1 << gpio);
if (value) if (value)
tmp |= 1 << gpio; tmp |= 1 << gpio;