How to Use an External IRQ in a Linux Driver?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to Use an External IRQ in a Linux Driver?

1,541件の閲覧回数
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,521件の閲覧回数
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.