GPIO interrupts on mpc8313e
Yoni Levin
yoni.l at slyde-tech.com
Fri Aug 3 01:38:52 EST 2007
myirq=74
-----Original Message-----
From: Scott Wood [mailto:scottwood at freescale.com]
Sent: Thursday, August 02, 2007 6:19 PM
To: Yoni Levin
Cc: linuxppc-embedded at ozlabs.org
Subject: Re: GPIO interrupts on mpc8313e
Yoni Levin wrote:
> Yes, I removed the flag (0) and nothing change in both cases the
request_irq
> return 0 which is good.
> Then I added enable_irq and I recived :
>
> Unbalanced enable for IRQ 74
Yeah, sorry, I misremembered what IRQF_DISABLED does. As Domen pointed
out, you need to pass myirq, not 74, to request_irq().
> void CreateGPIOHandler()
> {
>
> unsigned int myirq=irq_create_mapping(NULL,74);
> enable_irq(74);
> printk("myirq is : %d \n",myirq);
> int ret;
>
> ret=- request_irq(74, GPIOinterrupt_handler,0, "GPIO", NULL);
> printk("ret is : %d \n",ret);
>
>
> }
Even if IRQF_DISABLED did do what I thought it did (I was thinking of
IRQ_NOAUTOEN, which is apparently an ARM-only thing), you should never
call enable_irq() before request_irq(), or without previously disabling
it (either explicitly or via IRQ_NOAUTOEN).
-Scott
More information about the Linuxppc-embedded
mailing list