[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Timer Interrupt.

On Sat, 2 Mar 2002, Eric Tang wrote:
> 	I am going to use the timer1 interrupt of etrax in my device driver,
> 	I can't find any good example of using interrupts in the source tree.
> 	Can i follow the  linux device driver prototype functions(like
> 	int request_irq(unsigned int irq,
> 	   void (*handler)(int, void *, struct pt_regs *),
>    	   unsigned long flags, 
>            const char *dev_name,
>            void *dev_id);
> 	   void free_irq(unsigned int irq, void *dev_id);
>         )
> 	The IRQ of timer1 is 3? as i found that the timer0 is 2
> 	in /linux/arch/cris/kernel/time.c

Yes you can use request irq. Just keep in mind that while the kernel
handles the irq low-level handling for you, it cannot know how to
acknowledge an interrupt, so you need to do this explicitely in your
handler. For the timers this involves writing something to the timer
control register.