From f3b2b995cc3f3b65df49981bad1dee206f998dc3 Mon Sep 17 00:00:00 2001 From: Michael Hennerich Date: Tue, 24 Jul 2007 15:35:53 +0800 Subject: [PATCH] --- yaml --- r: 65980 b: refs/heads/master c: 301af2952b35fa527c89b4c0c0c1003d50afc378 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/asm-blackfin/gpio.h | 13 +++++++++++++ trunk/include/asm-blackfin/mach-bf533/irq.h | 2 ++ trunk/include/asm-blackfin/mach-bf537/irq.h | 2 ++ trunk/include/asm-blackfin/mach-bf548/irq.h | 2 ++ trunk/include/asm-blackfin/mach-bf561/irq.h | 2 ++ 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c812dc1756ff..207b7fd54897 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bc8c84c947ad65cd2850c43f96bea825e426f9eb +refs/heads/master: 301af2952b35fa527c89b4c0c0c1003d50afc378 diff --git a/trunk/include/asm-blackfin/gpio.h b/trunk/include/asm-blackfin/gpio.h index 7480cfa7e2d6..e714363bc4ed 100644 --- a/trunk/include/asm-blackfin/gpio.h +++ b/trunk/include/asm-blackfin/gpio.h @@ -421,6 +421,19 @@ unsigned short gpio_get_value(unsigned short gpio); void gpio_direction_input(unsigned short gpio); void gpio_direction_output(unsigned short gpio); +#include /* cansleep wrappers */ +#include + +static inline int gpio_to_irq(unsigned gpio) +{ + return (gpio + GPIO_IRQ_BASE); +} + +static inline int irq_to_gpio(unsigned irq) +{ + return (irq - GPIO_IRQ_BASE); +} + #endif /* __ASSEMBLY__ */ #endif /* __ARCH_BLACKFIN_GPIO_H__ */ diff --git a/trunk/include/asm-blackfin/mach-bf533/irq.h b/trunk/include/asm-blackfin/mach-bf533/irq.h index 9879e68e315c..452fb825d891 100644 --- a/trunk/include/asm-blackfin/mach-bf533/irq.h +++ b/trunk/include/asm-blackfin/mach-bf533/irq.h @@ -128,6 +128,8 @@ Core Emulation ** #define IRQ_PF14 47 #define IRQ_PF15 48 +#define GPIO_IRQ_BASE IRQ_PF0 + #ifdef CONFIG_IRQCHIP_DEMUX_GPIO #define NR_IRQS (IRQ_PF15+1) #else diff --git a/trunk/include/asm-blackfin/mach-bf537/irq.h b/trunk/include/asm-blackfin/mach-bf537/irq.h index 8af2a832ef6b..36c44bc1a917 100644 --- a/trunk/include/asm-blackfin/mach-bf537/irq.h +++ b/trunk/include/asm-blackfin/mach-bf537/irq.h @@ -160,6 +160,8 @@ Core Emulation ** #define IRQ_PH14 96 #define IRQ_PH15 97 +#define GPIO_IRQ_BASE IRQ_PF0 + #ifdef CONFIG_IRQCHIP_DEMUX_GPIO #define NR_IRQS (IRQ_PH15+1) #else diff --git a/trunk/include/asm-blackfin/mach-bf548/irq.h b/trunk/include/asm-blackfin/mach-bf548/irq.h index e548d3cd81e3..21f06f710be6 100644 --- a/trunk/include/asm-blackfin/mach-bf548/irq.h +++ b/trunk/include/asm-blackfin/mach-bf548/irq.h @@ -337,6 +337,8 @@ Events (highest priority) EMU 0 #define IRQ_PJ14 BFIN_PJ_IRQ(14) /* N/A */ #define IRQ_PJ15 BFIN_PJ_IRQ(15) /* N/A */ +#define GPIO_IRQ_BASE IRQ_PA0 + #ifdef CONFIG_IRQCHIP_DEMUX_GPIO #define NR_IRQS (IRQ_PJ15+1) #else diff --git a/trunk/include/asm-blackfin/mach-bf561/irq.h b/trunk/include/asm-blackfin/mach-bf561/irq.h index a753ce720d74..12789927db3d 100644 --- a/trunk/include/asm-blackfin/mach-bf561/irq.h +++ b/trunk/include/asm-blackfin/mach-bf561/irq.h @@ -289,6 +289,8 @@ #define IRQ_PF46 119 #define IRQ_PF47 120 +#define GPIO_IRQ_BASE IRQ_PF0 + #ifdef CONFIG_IRQCHIP_DEMUX_GPIO #define NR_IRQS (IRQ_PF47 + 1) #else