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>
This commit is contained in:
committed by
Tony Lindgren
parent
21c867f1de
commit
a007b7096f
@ -109,16 +109,24 @@ static inline int gpio_cansleep(unsigned gpio)
|
||||
|
||||
static inline int gpio_to_irq(unsigned gpio)
|
||||
{
|
||||
if (gpio < (OMAP_MAX_GPIO_LINES + 16))
|
||||
return OMAP_GPIO_IRQ(gpio);
|
||||
return -EINVAL;
|
||||
return __gpio_to_irq(gpio);
|
||||
}
|
||||
|
||||
static inline int irq_to_gpio(unsigned irq)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
/* omap1 SOC mpuio */
|
||||
if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16)))
|
||||
return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES;
|
||||
return irq - IH_GPIO_BASE;
|
||||
|
||||
/* SOC gpio */
|
||||
tmp = irq - IH_GPIO_BASE;
|
||||
if (tmp < OMAP_MAX_GPIO_LINES)
|
||||
return tmp;
|
||||
|
||||
/* we don't supply reverse mappings for non-SOC gpios */
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user