Dear sir/madam,
I wrote one driver code for interrupt in the
DM355 IPNC camera it having ARM9 Architecture and tms320Dm355 processor.I
wore one driver for gpio and it is working and i wrote one driver for
interrupt it is not working interrupt is registering but it is not going to
the isr.I made one pin as input and level triggering when input comes to
the pin the control want to jump into the isr but it is not going to the
isr.If any one helped me in this problem it will be very useful for me.
I attached my code with this mail
to selvan
/* 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>
#define IRQF_SHARED 0x00000080
MODULE_AUTHOR("Venkatesh");
MODULE_DESCRIPTION("GPIO kernel module for avench");
MODULE_LICENSE("GPL");
#define DAVINCI_SYSTEM_MODULE_BASE (0x01C40000)
//#define INT_NUMBER
55
#define INT_NUMBER 45
unsigned long int x=10;
irqreturn_t my_isr(int,void*,struct pt_regs*);
//////////////////////system tried/////////////////////////
static int my_init(void)
{
unsigned int a,b;
printk("In init module\n");
gpio_direction_input(1);
gpio_direction_output(2,0);
printk("GPIO vlaue fo 1=%d",gpio_get_value(1));
a=gpio_get_value(1);
if(a==1)
{
printk("Entered into polling\n");
b=gpio_get_value(2);
gpio_set_value(2,0);
msleep(3000);
printk("gpiovalue=%d",b);
gpio_set_value(2,1);
b=gpio_get_value(2);
msleep(3000);
printk("gpiovalue=%d",b);
}
/* Configure GPIO1 to generate an interrupt on rising edge only
*/
set_irq_type(INT_NUMBER, IRQT_HIGH);
//SA_INTERRUPT
// if(request_irq(INT_NUMBER,my_isr,IRQF_SHARED,"myinterrupt",&x))
if(request_irq(INT_NUMBER,my_isr,SA_INTERRUPT,"myinterrupt",&x))
{
printk("error");
return -EBUSY;
}
return 0;
}
irqreturn_t my_isr(int irq,void *dev_id,struct pt_regs *regs)
{
//printk("In isr-key %d\n",++count);
//printk("Dev id %d\n",*(unsigned long*)dev_id);
printk("Entered into isr\n");
return 0;
}
static void my_clean(void)
{
printk("In cleanup module");
free_irq(INT_NUMBER,&x);
}
module_init(my_init);
module_exit(my_clean);
--
Regards,
Venkatasubramanian.p
mob:-+919035188170
Show your power by suffering.