diff options
author | Benoit Cousson <b-cousson@ti.com> | 2012-02-23 15:50:10 -0500 |
---|---|---|
committer | Benoit Cousson <b-cousson@ti.com> | 2012-03-05 17:02:53 -0500 |
commit | 25db711df3258d125dc1209800317e5c0ef3c870 (patch) | |
tree | 7445b68d6f50f65cb1f316dcf135494e3737910a /arch/arm | |
parent | 384ebe1c2849160d040df3e68634ec506f13d9ff (diff) |
gpio/omap: Fix IRQ handling for SPARSE_IRQ
The driver is still relying on internal OMAP IRQ defines that
are not relevant anymore if OMAP is built with SPARSE_IRQ.
Replace the defines with the proper IRQ base number.
Clean some comment style issue.
Remove some hidden and ugly cpu_class_is_omap1() inside the
gpio header.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Tested-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-omap/include/plat/gpio.h | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h index cb75b657b04b..b8a96c6a1a30 100644 --- a/arch/arm/plat-omap/include/plat/gpio.h +++ b/arch/arm/plat-omap/include/plat/gpio.h | |||
@@ -218,30 +218,14 @@ extern void omap_set_gpio_debounce(int gpio, int enable); | |||
218 | extern void omap_set_gpio_debounce_time(int gpio, int enable); | 218 | extern void omap_set_gpio_debounce_time(int gpio, int enable); |
219 | /*-------------------------------------------------------------------------*/ | 219 | /*-------------------------------------------------------------------------*/ |
220 | 220 | ||
221 | /* Wrappers for "new style" GPIO calls, using the new infrastructure | 221 | /* |
222 | * Wrappers for "new style" GPIO calls, using the new infrastructure | ||
222 | * which lets us plug in FPGA, I2C, and other implementations. | 223 | * which lets us plug in FPGA, I2C, and other implementations. |
223 | * * | 224 | * |
224 | * The original OMAP-specific calls should eventually be removed. | 225 | * The original OMAP-specific calls should eventually be removed. |
225 | */ | 226 | */ |
226 | 227 | ||
227 | #include <linux/errno.h> | 228 | #include <linux/errno.h> |
228 | #include <asm-generic/gpio.h> | 229 | #include <asm-generic/gpio.h> |
229 | 230 | ||
230 | static inline int irq_to_gpio(unsigned irq) | ||
231 | { | ||
232 | int tmp; | ||
233 | |||
234 | /* omap1 SOC mpuio */ | ||
235 | if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16))) | ||
236 | return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES; | ||
237 | |||
238 | /* SOC gpio */ | ||
239 | tmp = irq - IH_GPIO_BASE; | ||
240 | if (tmp < OMAP_MAX_GPIO_LINES) | ||
241 | return tmp; | ||
242 | |||
243 | /* we don't supply reverse mappings for non-SOC gpios */ | ||
244 | return -EIO; | ||
245 | } | ||
246 | |||
247 | #endif | 231 | #endif |