RE: Interrupts on GPIO
From: Yann Pelletier <hidden>
Date: 2009-03-31 20:59:37
Message: 7 Date: Mon, 30 Mar 2009 10:32:17 -0600 From: Grant Likely <redacted> Subject: > To: Yann Pelletier [off-list ref] Cc: "linuxppc-dev@ozlabs.org" <redacted> Message-ID: [off-list ref] Content-Type: text/plain; charset=3DISO-8859-1 =20 On Mon, Mar 30, 2009 at 9:57 AM, Yann Pelletier [off-list ref] wrote:quoted
Hi, I'd like to add supports for interrupts handling from GPIO controller.?Some of these interrupts are from I2C devices and some others are from SPI devices.quoted
What is the best approach to enable interrupts handling for thosedevices through GPIO. =20 Modify the GPIO driver to also be a cascaded IRQ driver (see http://patchwork.ozlabs.org/patch/21914/ for an example). =20
I've looked at the patch but I wonder if this would be applicable to the MP= C8313. If my understanding is good, in the MPC52xx you have 8 gpio only in= terrupts and 8 gpio/gpt. With the MPC8313, each GPIO can act as an interru= pt but they are all muxed to only 1 interrupt in the IPIC. So I'm concern = about making the GPIO controller act as an interrupt controller.
quoted
Also, # cat /proc/interrupts ? ? ? ? ? CPU0 ?16: ? ? ? ? 60 ? IPIC ? Level ? ? serial ?17: ? ? ? ? ?0 ? IPIC ? Level ? ? fpga ?18: ? ? ? ? ?4 ? IPIC ? Level ? ? mpc83xx_spi ?21: ? ? ? ? ?0 ? IPIC ? Level ? ? i2c-mpc ?22: ? ? ? ? ?7 ? IPIC ? Level ? ? i2c-mpc According to my platform device tree, serial irq should be on int9, SPIon int16 and i2c on int14,15. ?This causes me some problems as I need int18 to map to external IRQ2. =20 These numbers are *Linux internal* virtual irq numbers. They have no relation to the physical IRQ number for each interrupt controller. Just make sure your Device Tree maps the IRQs correctly and you'll be okay. =20
This is good now, thanks
g. =20 -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. =20 =20