Skip to contentSkip to conversation

Interrupt GPIOs with MPC5200b

DISCUSSION Dave Best 2 participants 2 messages Mar 6, 2009

lore
Share & tools
lore

Dave Best

author
#0 lore raw

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 m= y ISR up. =20

For other platforms there seems to be the function gpio_to_irq() where enum= erated GPIOs get an IRQ number for their request_irq calls.

Any help or hints appreciated.

Dave=0A=0A=0A

#1 lore raw
Quoted 6 lines · Dave Best

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.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.