Thanks for your reply.
I did try using the following 3 ways (see below) to request irq, but, my ISR
was not called and the SET_RIS_TRIG value was not set for gpio6.
status = request_irq(irq_num, &gpio_irq_handler, IRQF_TRIGGER_RISING,
"gpio_test", NULL );
status = request_irq(irq_num, &gpio_irq_handler, IRQF_TRIGGER_RISING |
IRQF_DISABLED, "gpio_test", NULL );
status = request_irq(irq_num, &gpio_irq_handler, IORESOURCE_IRQ
|IORESOURCE_IRQ_HIGHEDGE | IRQF_DISABLED, "gpio_test", NULL );
The last one is same as dm9000 driver. It did not work for me. What I am
missing?
BTW, my ISR is like this:
static irqreturn_t gpio_irq_handler(int irq, void *dev_id)
{
printk("<1> gpio_irq_handler : IRQ=%d \n",irq);
return IRQ_HANDLED;
}
Thanks for your help!
Yan
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Tuesday, June 16, 2009 9:53 AM
To: Liu, Yan
Cc: [email protected]
Subject: Re: GPIO Interrupt type
"Liu, Yan" <[email protected]> writes:
> I am using linux kernel 2.6.30. I am trying to set interrupt type
> like Falling edge or Rising edge to my GPIO. I am using the
> following calls:
>
> set_irq_type(irq_num, IRQ_TYPE_EDGE_RISING) // here irq_num is 50
> for gpio 6 in DM355
>
> But, the value in GPIO register SET_RIS_TRIG is not set. So, my interrupt
> service route was never called even though my gpio interrupt is registered
> successfully.
>
> But, if I directly set the value in this SET_RIS_TRIG register for my gpio 6,
> the interrupt is raised and my ISR is been called.
>
>
>
> My questions are:
>
> 1) If set_irq_type is the right API I should call to set irq type for
> gpio?
>
> 2) If yes, what I am missing?
>
> 3) If no, what is the right API I should use to set irq type for gpio?
Instead of set_irq_type(), you should use the flags field of
request_irq() to set the trigering when you request the interrupt.
The IRQF_TRIGGER_* flags from <linux/interrupts.h> are for this
purpose, and in you'll want IRQF_TRIGGER_FALLING.
Kevin
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source