diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-01-11 18:00:50 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-01-11 18:00:50 +0000 |
commit | 1b3efb335284abe970e32a2a9f8347de847585cd (patch) | |
tree | 2ac9adba8fd6abd3ac550250d5a724a08150a5ff | |
parent | efab389042723b9943ed9280183776e17b0c36ab (diff) |
ar71xx: move irq_to_gpio and gpio_to_irq into gpio.c
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29713 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ar71xx/gpio.c | 12 | ||||
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/gpio.h | 14 |
2 files changed, 14 insertions, 12 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/gpio.c b/target/linux/ar71xx/files/arch/mips/ar71xx/gpio.c index eca3b5b76..91c838345 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/gpio.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/gpio.c @@ -288,3 +288,15 @@ void __init ar71xx_gpio_init(void) if (err) panic("cannot add AR71xx GPIO chip, error=%d", err); } + +int gpio_to_irq(unsigned gpio) +{ + return AR71XX_GPIO_IRQ(gpio); +} +EXPORT_SYMBOL(gpio_to_irq); + +int irq_to_gpio(unsigned irq) +{ + return irq - AR71XX_GPIO_IRQ_BASE; +} +EXPORT_SYMBOL(irq_to_gpio); diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/gpio.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/gpio.h index 6354d68cf..56fe902e2 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/gpio.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/gpio.h @@ -16,21 +16,11 @@ #define ARCH_NR_GPIOS 64 #include <asm-generic/gpio.h> -#include <asm/mach-ar71xx/ar71xx.h> - extern unsigned long ar71xx_gpio_count; extern void __ar71xx_gpio_set_value(unsigned gpio, int value); extern int __ar71xx_gpio_get_value(unsigned gpio); - -static inline int gpio_to_irq(unsigned gpio) -{ - return AR71XX_GPIO_IRQ(gpio); -} - -static inline int irq_to_gpio(unsigned irq) -{ - return irq - AR71XX_GPIO_IRQ_BASE; -} +int gpio_to_irq(unsigned gpio); +int irq_to_gpio(unsigned gpio); static inline int gpio_get_value(unsigned gpio) { |