aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2007-07-24 03:35:53 -0400
committerBryan Wu <bryan.wu@analog.com>2007-07-24 03:35:53 -0400
commit301af2952b35fa527c89b4c0c0c1003d50afc378 (patch)
treebd4f9fd33277cefa456aa57857c83674916b2fe4
parentbc8c84c947ad65cd2850c43f96bea825e426f9eb (diff)
Blackfin arch: Finalize the generic gpio support - add gpio_to_irq and irq_to_gpio
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
-rw-r--r--include/asm-blackfin/gpio.h13
-rw-r--r--include/asm-blackfin/mach-bf533/irq.h2
-rw-r--r--include/asm-blackfin/mach-bf537/irq.h2
-rw-r--r--include/asm-blackfin/mach-bf548/irq.h2
-rw-r--r--include/asm-blackfin/mach-bf561/irq.h2
5 files changed, 21 insertions, 0 deletions
diff --git a/include/asm-blackfin/gpio.h b/include/asm-blackfin/gpio.h
index 7480cfa7e2d6..e714363bc4ed 100644
--- a/include/asm-blackfin/gpio.h
+++ b/include/asm-blackfin/gpio.h
@@ -421,6 +421,19 @@ unsigned short gpio_get_value(unsigned short gpio);
421void gpio_direction_input(unsigned short gpio); 421void gpio_direction_input(unsigned short gpio);
422void gpio_direction_output(unsigned short gpio); 422void gpio_direction_output(unsigned short gpio);
423 423
424#include <asm-generic/gpio.h> /* cansleep wrappers */
425#include <asm/irq.h>
426
427static inline int gpio_to_irq(unsigned gpio)
428{
429 return (gpio + GPIO_IRQ_BASE);
430}
431
432static inline int irq_to_gpio(unsigned irq)
433{
434 return (irq - GPIO_IRQ_BASE);
435}
436
424#endif /* __ASSEMBLY__ */ 437#endif /* __ASSEMBLY__ */
425 438
426#endif /* __ARCH_BLACKFIN_GPIO_H__ */ 439#endif /* __ARCH_BLACKFIN_GPIO_H__ */
diff --git a/include/asm-blackfin/mach-bf533/irq.h b/include/asm-blackfin/mach-bf533/irq.h
index 9879e68e315c..452fb825d891 100644
--- a/include/asm-blackfin/mach-bf533/irq.h
+++ b/include/asm-blackfin/mach-bf533/irq.h
@@ -128,6 +128,8 @@ Core Emulation **
128#define IRQ_PF14 47 128#define IRQ_PF14 47
129#define IRQ_PF15 48 129#define IRQ_PF15 48
130 130
131#define GPIO_IRQ_BASE IRQ_PF0
132
131#ifdef CONFIG_IRQCHIP_DEMUX_GPIO 133#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
132#define NR_IRQS (IRQ_PF15+1) 134#define NR_IRQS (IRQ_PF15+1)
133#else 135#else
diff --git a/include/asm-blackfin/mach-bf537/irq.h b/include/asm-blackfin/mach-bf537/irq.h
index 8af2a832ef6b..36c44bc1a917 100644
--- a/include/asm-blackfin/mach-bf537/irq.h
+++ b/include/asm-blackfin/mach-bf537/irq.h
@@ -160,6 +160,8 @@ Core Emulation **
160#define IRQ_PH14 96 160#define IRQ_PH14 96
161#define IRQ_PH15 97 161#define IRQ_PH15 97
162 162
163#define GPIO_IRQ_BASE IRQ_PF0
164
163#ifdef CONFIG_IRQCHIP_DEMUX_GPIO 165#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
164#define NR_IRQS (IRQ_PH15+1) 166#define NR_IRQS (IRQ_PH15+1)
165#else 167#else
diff --git a/include/asm-blackfin/mach-bf548/irq.h b/include/asm-blackfin/mach-bf548/irq.h
index e548d3cd81e3..21f06f710be6 100644
--- a/include/asm-blackfin/mach-bf548/irq.h
+++ b/include/asm-blackfin/mach-bf548/irq.h
@@ -337,6 +337,8 @@ Events (highest priority) EMU 0
337#define IRQ_PJ14 BFIN_PJ_IRQ(14) /* N/A */ 337#define IRQ_PJ14 BFIN_PJ_IRQ(14) /* N/A */
338#define IRQ_PJ15 BFIN_PJ_IRQ(15) /* N/A */ 338#define IRQ_PJ15 BFIN_PJ_IRQ(15) /* N/A */
339 339
340#define GPIO_IRQ_BASE IRQ_PA0
341
340#ifdef CONFIG_IRQCHIP_DEMUX_GPIO 342#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
341#define NR_IRQS (IRQ_PJ15+1) 343#define NR_IRQS (IRQ_PJ15+1)
342#else 344#else
diff --git a/include/asm-blackfin/mach-bf561/irq.h b/include/asm-blackfin/mach-bf561/irq.h
index a753ce720d74..12789927db3d 100644
--- a/include/asm-blackfin/mach-bf561/irq.h
+++ b/include/asm-blackfin/mach-bf561/irq.h
@@ -289,6 +289,8 @@
289#define IRQ_PF46 119 289#define IRQ_PF46 119
290#define IRQ_PF47 120 290#define IRQ_PF47 120
291 291
292#define GPIO_IRQ_BASE IRQ_PF0
293
292#ifdef CONFIG_IRQCHIP_DEMUX_GPIO 294#ifdef CONFIG_IRQCHIP_DEMUX_GPIO
293#define NR_IRQS (IRQ_PF47 + 1) 295#define NR_IRQS (IRQ_PF47 + 1)
294#else 296#else