diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-12-10 20:35:25 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-12-10 20:35:25 -0500 |
commit | a007b7096feea2d865ad3e7177eb8be34041bef9 (patch) | |
tree | be9a46ce0a25639481d1c6db1dd6d936f4c5b9e1 /arch/arm/plat-omap/include/mach/gpio.h | |
parent | 21c867f1dedc21fb6e5244b7b27cfcfd09b83188 (diff) |
ARM: OMAP: gpios implement new to_irq()
Make OMAP use the new __gpio_to_irq() hook, to make it easier to
support IRQs coming in from off-chip gpio controllers like the
TWL4030/TPS65930 chip used on OMAP3 boads like Beagleboard.org and
the Gumstix Overo.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/include/mach/gpio.h')
-rw-r--r-- | arch/arm/plat-omap/include/mach/gpio.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/mach/gpio.h index 98e9008b7e9d..5f996f350c84 100644 --- a/arch/arm/plat-omap/include/mach/gpio.h +++ b/arch/arm/plat-omap/include/mach/gpio.h | |||
@@ -109,16 +109,24 @@ static inline int gpio_cansleep(unsigned gpio) | |||
109 | 109 | ||
110 | static inline int gpio_to_irq(unsigned gpio) | 110 | static inline int gpio_to_irq(unsigned gpio) |
111 | { | 111 | { |
112 | if (gpio < (OMAP_MAX_GPIO_LINES + 16)) | 112 | return __gpio_to_irq(gpio); |
113 | return OMAP_GPIO_IRQ(gpio); | ||
114 | return -EINVAL; | ||
115 | } | 113 | } |
116 | 114 | ||
117 | static inline int irq_to_gpio(unsigned irq) | 115 | static inline int irq_to_gpio(unsigned irq) |
118 | { | 116 | { |
117 | int tmp; | ||
118 | |||
119 | /* omap1 SOC mpuio */ | ||
119 | if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16))) | 120 | if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16))) |
120 | return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES; | 121 | return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES; |
121 | return irq - IH_GPIO_BASE; | 122 | |
123 | /* SOC gpio */ | ||
124 | tmp = irq - IH_GPIO_BASE; | ||
125 | if (tmp < OMAP_MAX_GPIO_LINES) | ||
126 | return tmp; | ||
127 | |||
128 | /* we don't supply reverse mappings for non-SOC gpios */ | ||
129 | return -EIO; | ||
122 | } | 130 | } |
123 | 131 | ||
124 | #endif | 132 | #endif |