This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interrupt driver not going to the interrupt handler for dm355 processor

Hi,

       I wrote one driver code for Externel interrupt for IPNC processor dm355.When i am inserting the driver It is register in the /proc/interrupt but it is not going to the handler and also showing one

enable_irq(51) unbalanced from c006c574

If i removed the enable_irq the  error unbalanced its not coming but it is not going to the interrupt handler.I set the pin as input and arm no is also i correctly given i used the gpio no -7 and corresponding interrupt no is 51.

The diver code is here

/* add copyright notice here*/
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/bitops.h>
#include <linux/proc_fs.h>

#include <asm/irq.h>
#include <asm/io.h>
#include <asm/hardware/clock.h>

#include <asm/arch/irqs.h>
#include <asm/arch/hardware.h>
#include <asm/arch/gpio.h>
#include <asm/arch/cpu.h>

#include <asm/mach/irq.h>
#include <linux/delay.h>

#include<linux/interrupt.h>
#include<linux/delay.h>
#include<linux/sched.h>

MODULE_AUTHOR("Venkatesh");
MODULE_DESCRIPTION("GPIO kernel module for avench");
MODULE_LICENSE("GPL");

#define DAVINCI_SYSTEM_MODULE_BASE        (0x01C40000)
#define INT_NUMBER                              51
int x=3;

irqreturn_t gpio_handler(int irq,void *dev_id,struct pt_regs *regs);

int init_module (void) {
    unsigned int result;
    unsigned int a;
        void __iomem *pinmux3 = (void __iomem *) IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE + 0x0c);  //pinmux pins are used as gpio
    
    printk("Entered into the init module\n");
    /* Configure the pin multiplexing to enable pin 7 & 17 */
    __raw_writel(0xEFFDFFFF, pinmux3);
    printk("pin mux initialiszed\n");

    gpio_direction_input(7);                                             //pin 7 set as input
    printk("Gpiovalue7=%d",gpio_get_value(7));
        a=gpio_get_value(7);
    gpio_direction_output(17,0);                                       //pin 17 set as output
    printk("Gpiovalue17=%d",gpio_get_value(17));

 
        
            /* Configure GPIO1 to generate an interrupt on high only */
          set_irq_type(INT_NUMBER, IRQT_HIGH);

 
    result=request_irq(INT_NUMBER,gpio_handler,SA_INTERRUPT,"gpio_intr_handler",NULL);
    
    

    
        if (result < 0) {
        printk(KERN_INFO "short: can't get assigned irq %i\n",INT_NUMBER);
    }else { // actually enable it -- assume this *is* a parallel port */
        //printk("Entered into the isr");
    }
    


        enable_irq(INT_NUMBER);
//return 0;

}


irqreturn_t gpio_handler(int irq,void *dev_id,struct pt_regs *regs){
    printk("Entered into the Interrupt routine\n");
    return 0;
}



void cleanup_module(void) {

    printk("Cleaning up interrupt driver \n");
    free_irq(INT_NUMBER,NULL);
}

Please any one help in this problem it will be very use full for me.

Thanks