Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Adding an interrupt locator to the GPIO, I2C and SPI buses



On Thu, Apr 18, 2013 at 05:31:41PM +0200, Pierre Pronchery wrote:
> Another option could be to:
> - add a call returning the corresponding interrupt for a given pin, eg
>   gpio_to_irq() (and return -1 when the requested type isn't supported)
> - use intr_establish() as for regular drivers.
> 
> That's what Linux does, as far as I could tell from the OMAP code that
> I've read there.

That would be a problem if the GPIO module has less interrupt lines than
interrupt sources (as in the AM335x: 32 GPIO per module but only
2 interrupt lines to the PIC): 
the interrupt would then be shared and drivers would have to deal
with that, eventually with callback functions to the gpio driver
to know which pin really generated the interrupt.
Or the gpio module would have to be able to build its own interrupt
cookie, so that it can call itself the right interrupt handler, but this
would need intrusive changes to all MD interrupt frameworks.

I think a gpio-specific callback framework is the way to go for the time
being.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index