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 18/04/2013 15:51, Pierre Pronchery wrote:
> 
> On 18/04/2013 07:59, Marc Balmer wrote:
>>
>> The low-level gpio driver, let's call it n900gpio, should report to the
>> gpio(4) framework which of it's pins are interrupt capable (that needs a
>> new pin capability).  And when a a driver like n900cambtn(4) attaches at
>> a certain GPIO pin, it checks whether this pin is interrupt capable,
>> bails out if it is not, enables the interrupt otherwise.  This needs an
>> extension of the current GPIO framework, something that is needed
>> anyways (see the BUGS section of gpio(4)...).
> 
> Understood. In that case I guess I would no longer use intr_establish(),
> but rather something like gpio_pin_ctl() with an interrupt type and a
> callback - in any case, let me know how I can help on this.

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.

HTH,
-- 
khorben



Home | Main Index | Thread Index | Old Index