How to arrive at irq base for an mfd device?

妖精的绣舞 提交于 2019-12-11 19:34:05

问题


In an MFD device. I wanted to understand, how do we arrive at irq base. Is it a random number.?

Please some one explain.


回答1:


Basically one first needs to associate a particular IRQ number with an actual physical hardware interrupt before attempting to register an ISR for that IRQ number. This is commonly done in the Linux kernel using irq_domain_add_linear().

In the past, IRQ numbers could be chosen so they matched the hardware IRQ line into the root interrupt controller (i.e. the component actually firing the interrupt line to the CPU) nowadays this number is just a number.

The irq_alloc_desc*() and irq_free_desc*() APIs provide allocation of irq numbers, but they don't provide any support for reverse mapping of the controller-local IRQ (hwirq) number into the Linux IRQ number space.

The current design of the Linux kernel uses a single large number space where each separate IRQ source is assigned a different number. This is simple when there is only one interrupt controller, but in systems with multiple interrupt controllers the kernel must ensure that each one gets assigned non-overlapping allocations of Linux IRQ numbers.

More details in the Linux-kernel Documentation/IRQ-domain.txt.



来源:https://stackoverflow.com/questions/18186730/how-to-arrive-at-irq-base-for-an-mfd-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!