LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Interrupts on parallel port. (https://www.linuxquestions.org/questions/linux-software-2/interrupts-on-parallel-port-4175444482/)

smith283 01-07-2013 05:33 AM

Interrupts on parallel port.
 
Hey mate,
I need help regarding interrupts on the parallel port:-

1.) implementing interrupt handler...

2.) registering the interrupt handler...(removing the existing parallel port driver and replacing the existing parallel port handler with mine)

3.) invoking the interrupt...(through setting status nack bit..).

thnx
reply fast...

sundialsvcs 01-08-2013 02:13 PM

It's time to "re-align your thinking." :)

Your piece of software ... whatever it is ... is not the only bit of software (on this planet...) that "is interested in the fact that an interrupt has just occurred on this parallel I/O port ..."

... it is, rather, 'just 'an interested party.'" Just one of however-many...

Your driver, therefore, is obliged to register itself upon the appropriate interrupt-handling chain, in order to be duly called by the Linux kernel whenever such an interrupt arrives. It will be obliged to indicate to the kernel whether it has "handled" the interrupt, or not. But, in any case, it will not be "in control of" the situation.

It may well be that part of the process of "handling the interrupt" consists of a hardware action, such as "setting a status-bit." It may well be that, in your suitably-specialized hardware situation, "no other interrupt-handler need apply." Your second-level interrupt handler actually has that prerogative.

smith283 01-10-2013 04:11 AM

Thnx for the reply sir :)

I tried to register the interrupt handler with a call "request_irq()" at irq line-7. But when i insert the module i get an error "IRQ handler type mismatch for IRQ 7
" as the irq line-7 is already acquired by parport0.
And also i can see from the "/proc/interrupts" that parport0 is registered to IRQ 7. So, my problem is how can i register my handler to the IRQ 7.
Or is there any way that my handler can share the IRQ 7 with existing parpot0??

Thnx, waiting for reply :)

smith283 01-10-2013 04:31 AM

Actually, i hv written request_irq() call in the open() function of my driver and when i try to run the application(where open() and write() calls are called from application), i get this error"IRQ handler type mismatch for IRQ 7"..


All times are GMT -5. The time now is 06:14 AM.