看板 LinuxDev 關於我們 聯絡資訊
各位先進你好: 小弟剛踏入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
mecs:in interrupt.h : 08/22 01:04
mecs:When requesting an interrupt without specifying a 08/22 01:05
mecs:IRQF_TRIGGER, the setting should be assumed to be 08/22 01:05
mecs:"as already configured", which may be as per machine or 08/22 01:05
mecs:firmware initialisation. 08/22 01:06
hsuya:可以舉例說明嗎 ?此類外部中斷的觸發類型應該決定於哪裡呢? 08/22 08:25
mecs:SOC 裡的裝置 08/22 13:34