(b)处理边缘触发类型的中断handler(handle_edge_irq)(c)处理简单类型的中断handler(handle_simple_...
173 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx]; 174return0; 175 } 这个函数用来设置GPIO中断的类型,也就是触发中断的条件,上升沿触发、下降沿触发、两者同时触发、或者禁止触发,这些设置通过写GRER和GFER两个寄存器生效,同时会保存到GPIO_IRQ_rising_edge和GPIO_IRQ_falling_edge两个...
IRQ_TYPE_NONE=0x00000000, IRQ_TYPE_EDGE_RISING=0x00000001, IRQ_TYPE_EDGE_FALLING=0x00000002, IRQ_TYPE_EDGE_BOTH= (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING), IRQ_TYPE_LEVEL_HIGH=0x00000004, IRQ_TYPE_LEVEL_LOW=0x00000008, IRQ_TYPE_LEVEL_MASK= (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_...
1);// hsilerr = set_irq_wake(gpio_to_irq(GPIO_KBR6),1);// hsilerr = set_irq_wake(gpio_to_irq(GPIO_VOL_UP),1);// hsil#endif//#ifndef CONFIG_MACH_LUCAS#ifdefined (CONFIG_MACH_CALLISTO)// hsilset_irq_type(gpio_to_irq(GPIO_SLIDE), IRQ_TYPE_EDGE_BOTH);...
type = RISING_EDGE_TRIGGER;break;caseIRQ_TYPE_EDGE_FALLING: type = FALLING_EDGE_TRIGGER;break;caseIRQ_TYPE_EDGE_BOTH: type = EITHER_EDGE_TRIGGER;break;default:return-EINVAL; } val = readl(base + INTC_ISTCR(irq)); type &=0x7;
#define IRQ_TYPE_EDGE_RISING 0x00000001 /* Edge rising type */ //上升沿触发 #define IRQ_TYPE_EDGE_FALLING 0x00000002 /* Edge falling type */ //下降沿触发 #define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING) //边沿触发 ...
#define IRQ_TYPE_NONE 0x00000000 /* Default, unspecified type */ #define IRQ_TYPE_EDGE_RISING 0x00000001 /* Edge rising type */ //上升沿触发 #define IRQ_TYPE_EDGE_FALLING 0x00000002 /* Edge falling type */ //下降沿触发 #define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_...
switch (type) //设置EXTINT0中断模式 { case IRQT_NOEDGE: //未指定的中断模式 printk(KERN_WARNING "No edge setting!\n"); break; case IRQT_RISING: //上升沿触发,设置EXTINT0相应位为0x04 newvalue = S3C2410_EXTINT_RISEEDGE; break; ...
case IRQ_TYPE_EDGE_RISING: __trigger[d->hwirq] = 2; break; case IRQ_TYPE_EDGE_FALLING: __trigger[d->hwirq] = 3; break; default: return -EINVAL; } return 0; } #ifdef CONFIG_SMP static int csky_irq_set_affinity(struct irq_data *d, const struct cpumask *mask_val, Expand Down...
>> + switch (type) { >> + case IRQ_TYPE_EDGE_FALLING: >> + src_type = SUNXI_SRC_TYPE_EDGE_FALLING; >> + break; >> + case IRQ_TYPE_EDGE_RISING: >> + src_type = SUNXI_SRC_TYPE_EDGE_RISING; >> + break; >> + case IRQ_TYPE_LEVEL_HIGH: ...