问题
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*()
andirq_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