#include #include #include #include #include irqreturn_t myIRQ(int irq, void *devid){ //Clear pending interrupt return IRQ_HANDLED; } int my_open(void){ //Set polarity and type of interrupt //this is the api to register interrupt to //kernel driver. requet_irq(30, myIRQ, 0, "MYIRQ", 1); //This 30 is the line number in interrupt register //stored. It's like a id to the interrupt handler. //The last line is the decive number. If multiple //device uses same IRQ handler, then this last argument //is used to diffrentiate between various devices using //the same IRQ Handler. } void my_release(void){ //To release the interrupt handler //free_irq api is used. free_irq(30,1); }