How to Use an External IRQ in a Linux Driver?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to Use an External IRQ in a Linux Driver?

1,601 次查看
Steve_W
Contributor I

I am working with the LS1046A and I need to use external IRQ6 in a driver to measure a pulse train with minimal latency. For this reason I don't want to use the pin configured as a GPIO. Is there an example of how to configure an external IRQ in the device tree and a code example showing what is required to handle the IRQ in my driver?

Thanks, Steve.

标签 (1)
0 项奖励
回复
1 回复

1,581 次查看
yipingwang
NXP TechSupport
NXP TechSupport

The usage of external IRQ is same as other IP's irq, normally you need:
1) enable IRQ pin function in RCW, bit 373-381
I checked the default rcw, IRQ already supported by default.

2) Add interrupt related description in dts node
interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;

Please be aware that the irq in dts is calculated as : irq = hwirq - 32.
According to chapter <interrupt assignment > of LS1046A, the hwirq num of IRQ6 is 177, so in dts file it should be 177 - 32 = 145.

There is no device connected with IRQ6, The following steps.
3) map hwirq to Linux irq
4) request irq in device driver.