On 16 Oct 2009, at 11:53 AM, Matze wrote:
Hi all,
I'm implementing a device driver on a custom board with AVR32
(AP7000) and I observed that the isr executes on rising edge and on
high state of interrupt pin.
So I tried to request irq like this:
status = request_irq(spiaccel->irq, accel_interrupt,
IRQF_TRIGGER_RISING|IRQF_DISABLED, "accel-driver", spiaccel);
but it does not seem to have any effect on the behaviour on calling
isr.
Is there another place, where the trigger is set globaly?
Is there any possibility to determine inside the isr in which
trigger event it has been executed?
Regards,
Matthias
I'm not familiar with that exact platform, but have done Linux kernel
work on other atmel chips. There is generally a status register
(containing some bits corresponding to interrupt flags) you need to
read, and an interrupt mask register (which has mask bits
corresponding to the interrupts which are actually enabled). You then
do a bitwise AND on the two to determine which bit/s caused the
interrupt. In some cases reading the status register is enough to
clear that particular interrupt on the processor (e.g. bits which are
of the form "indicates event x happened since last time status was
read"), in other case you need to resolve some sort of scenario to
clear the interrupt status (e.g. setup a new peripheral dma controller
register to point to a dma buffer). If you do not clear the interrupt
condition inside the handler, the handler will be called again
immediately (possibly causing a softlockup), so if there is some
scenario in which you cannot clear the condition you need to disable
that interrupt. Hope some of this rambling helps, even though it
doesn't directly answer your question. AFAIK, you cannot change the
way the interrupt is triggered in the request_irq(), you need to do
that in a processor-specific way using control registers (I might be
wrong about this).
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ