作者hsuya (隐身术??)
看板LinuxDev
标题[问题] linux中断旗标-IRQF_TRIGGER_NONE的触发动作与意义
时间Sun Aug 21 19:59:33 2011
各位先进你好:
小弟刚踏入linux 驱动程式开发
我想请问一下
IRQF_TRIGGER_NONE 的信号触发方式是怎样的一个触发方式??
在诸多范例中不乏有下面的用法
if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL))
{
printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq);
return -EBUSY;
}
但是在程式上下文中却没有用set_irq_type 来宣告该信号是上缘/下缘/level trigger
我很纳闷这样的用法的意义为何?
IRQF_TRIGGER_NONE是哪种触发方式啊?
#include <linux/input.h>
#include <linux/module.h>
#include <linux/init.h>
#include <asm/irq.h>
include <asm/io.h>
static struct input_dev *button_dev;
static irqreturn_t button_interrupt(int irq, void *dummy)
{
input_report_key(button_dev, BTN_0, inb(BUTTON_PORT) & 1);
input_sync(button_dev);
return IRQ_HANDLED;
}
static int __init button_init(void)
{
int error;
if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL))
{
printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq);
return -EBUSY;
}
button_dev = input_allocate_device();
....
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 1.169.181.227
1F:→ mecs:in interrupt.h : 08/22 01:04
2F:→ mecs:When requesting an interrupt without specifying a 08/22 01:05
3F:→ mecs:IRQF_TRIGGER, the setting should be assumed to be 08/22 01:05
4F:→ mecs:"as already configured", which may be as per machine or 08/22 01:05
5F:→ mecs:firmware initialisation. 08/22 01:06
6F:→ hsuya:可以举例说明吗 ?此类外部中断的触发类型应该决定於哪里呢? 08/22 08:25
7F:推 mecs:SOC 里的装置 08/22 13:34