- UID
- 1029342
- 性别
- 男
|
int keyirq_open(struct inode *inode, struct file *file)
{
clearIrq();
#if 1
enable_irq(IRQ_EINT0);
enable_irq(IRQ_EINT1);
enable_irq(IRQ_EINT6);
#endif
sema_init(&key_sem, 0);
return 0;
}
int keyirq_release(struct inode *inode, struct file *filp)
{
#if 1
disable_irq(IRQ_EINT0);
disable_irq(IRQ_EINT1);
disable_irq(IRQ_EINT6);
#endif
return 0;
}
static int keyirq_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
return 0;
}
struct file_operations keyirq_fops = {
.owner= THIS_MODULE,
.read = keyirq_read,
.open = keyirq_open,
.release = keyirq_release,
.ioctl = keyirq_ioctl,
};
int __init keyirq_init(void)
{
int rc;
printk("_SDK2410 gpio key driver irq=%d\n", IRQ_EINT0);
set_irq_type(IRQ_EINT0, IRQT_FALLING);
set_irq_type(IRQ_EINT1, IRQT_FALLING);
set_irq_type(IRQ_EINT6, IRQT_FALLING);
rc = request_irq(IRQ_EINT0, key1_irq_isr, SA_INTERRUPT, "key2345irq", NULL);
if (rc) {
printk ("<1>keyirq 1 irq not registered. Error:%d\n", rc);
}
rc = request_irq(IRQ_EINT1, key2_irq_isr, SA_INTERRUPT, "key2345irq", NULL);
if (rc) {
printk ("<1>keyirq 2 irq not registered. Error:%d\n", rc);
}
rc = request_irq(IRQ_EINT6, key3_irq_isr, SA_INTERRUPT, "key2345irq", NULL);
if (rc) {
printk ("<1>keyirq 4 irq not registered. Error:%d\n", rc);
} |
|