diff options
author | Thomas Kunze <thommycheck@gmx.de> | 2009-02-09 17:14:44 -0500 |
---|---|---|
committer | Thomas Kunze <tkunze@tkunze-desktop.(none)> | 2009-11-27 15:07:20 -0500 |
commit | cc647172795713e013f8de4bcdf91860e9e87bff (patch) | |
tree | a3a9538fcc03253bfc81063c08e5a35653b960d9 /arch/arm/mach-sa1100/include | |
parent | 167c55ef80d26679b8b4b4ffba9da208a7c1875d (diff) |
SA1100: make gpio_to_irq and reverse a macro
The function can't be used for static initialisations so
convert them to macros.
Diffstat (limited to 'arch/arm/mach-sa1100/include')
-rw-r--r-- | arch/arm/mach-sa1100/include/mach/gpio.h | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h index 582a0c92da53..7befc104e9a9 100644 --- a/arch/arm/mach-sa1100/include/mach/gpio.h +++ b/arch/arm/mach-sa1100/include/mach/gpio.h | |||
@@ -49,20 +49,9 @@ static inline void gpio_set_value(unsigned gpio, int value) | |||
49 | 49 | ||
50 | #define gpio_cansleep __gpio_cansleep | 50 | #define gpio_cansleep __gpio_cansleep |
51 | 51 | ||
52 | static inline unsigned gpio_to_irq(unsigned gpio) | 52 | #define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \ |
53 | { | 53 | (IRQ_GPIO11 - 11 + gpio)) |
54 | if (gpio < 11) | 54 | #define irq_to_gpio(irq) ((irq < IRQ_GPIO11_27) ? (irq - IRQ_GPIO0) : \ |
55 | return IRQ_GPIO0 + gpio; | 55 | (irq - IRQ_GPIO11 + 11)) |
56 | else | ||
57 | return IRQ_GPIO11 - 11 + gpio; | ||
58 | } | ||
59 | |||
60 | static inline unsigned irq_to_gpio(unsigned irq) | ||
61 | { | ||
62 | if (irq < IRQ_GPIO11_27) | ||
63 | return irq - IRQ_GPIO0; | ||
64 | else | ||
65 | return irq - IRQ_GPIO11 + 11; | ||
66 | } | ||
67 | 56 | ||
68 | #endif | 57 | #endif |