Home > other >  How Linux device tree through access to interrupt irq number
How Linux device tree through access to interrupt irq number

Time:10-18

Linux interrupt these days, there are many don't understand, ask the great spirit,
 request_irq (unsigned int irq, irq_handler_t handler, unsigned long flags, 
Const char * name, void * dev)

For the first parameter of interrupt application function, irq, originally understand is your own hardware interrupt number on the manual, later found out that is wrong, should be in the Linux kernel irq number,
For example, samsung exynos4412 GPX1_1 and corresponding hardware interrupt GPX1_2 number of chips is 25, 26


When using request_irq first parameter needs a transformation process, the following

 request_irq (IRQ_EINT (9), key_handler, IRQF_TRIGGER_FALLING, "KEY1", NULL); 

Complete the interrupt application,

Now don't understand is that in the device tree form, how to do, I'm a reference of this blog post on http://blog.csdn.net/zqixiao_09/article/details/50916212 (device tree) and http://blog.csdn.net/zqixiao_09/article/details/50908125 (interrupt-driven)
Equipment under the tree interrupt the following

Driver get interrupted the following

64 65 lines of code acquisition equipment resources, and then 68 rows produced resource res - 67 & gt; Start can be directly assigned to an irq parameters? Platform_get_resource has taken the hardware interrupt number is converted to a Linux interrupt number? Don't know if I understand right, if so, what is among this process?

CodePudding user response:

Have a great god to explain no, don't understand

CodePudding user response:

No one answer that their top,

CodePudding user response:

Answer, first IORESOURCE_IRQ out this property is already allocated good interrupt,

Platform is not the same, but the idea is roughly same,
In the device tree interrupt common configuration of two kinds: 1. 2. Interrupts attribute custom a gpio, processing
in the driveDefined as interrupts attribute node in the kernel, the priority is dealing with the interruption of attributes:
I remember correctly
Start_kernel - & gt; Init_IRQ - & gt; Irqchip_init - & gt; Of_irq_init
This is qualcomm process, in the of_irq_init will scan device tree node and initialize the interrupt controller
I'm not sure if you have a classic gpio_to_irq this API, this function after a moment, and then according to the above process after a moment, should be able to understand the entire process a bit deep,

CodePudding user response:

https://blog.csdn.net/weixin_42462202/article/details/86751040
  • Related