Interrupt GPIOs with MPC5200b

Grant Likely grant.likely at secretlab.ca
Sat Mar 7 02:18:21 EST 2009


On Fri, Mar 6, 2009 at 6:27 AM, Dave Best <arieswar24b at yahoo.de> wrote:
>
> Hi, I am working on a MPC5200B-tiny with 2.6.23.1 Linux (pcm030).
>
> I want to use an interrupt GPIO to act as the source for my ISR, but i can't find the IRQ numbers for the GPIOs so i can't call request_irq() to set my ISR up.
>
> For other platforms there seems to be the function gpio_to_irq() where enumerated GPIOs get an IRQ number for their request_irq calls.

Which GPIO line are you using?  Is it on the gpio_simple block?
gpio_wkup?  or one of the GPT lines?

There is support in Ben Herrenschmidt's -next tree to use the GPT as
an interrupt controller.  A similar patch for the mpc52xx_gpio driver
would be fairly easy to do.  That would allow you to simply specify
the GPIO controller as the interrupt controller in the device tree and
get your IRQ number with a single call to of_irq_parse_and_map().  It
also allows each GPIO line to be assigned an independent IRQ number
and be enabled/acked independently from the others and for the
enable/ack code to live with the mpc52xx-gpio driver where it belongs.

See here for the GPT patch.  You can use it as an example to do the
same for the gpio driver.

http://patchwork.ozlabs.org/patch/21914/

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list