简体   繁体   中英

convert HW IRQ to Linux IRQ

I have a HW_IRQ is shared between 2 kernel modules. Module1 is loaded at the boot time and called: request_irq(linux_irq1, handler1, IRQF_SHARED, ...); . After booting up, I want to load the Module2 that shared the same HW_IRQ with the Module1 . I need to call request_irq(linux_irq2, handler2, IRQF_SHARED, ...); . Actually 'linux_irq2' is equal to 'linux_irq1', but in Module2 I can not access to private data of Module1 . Do you know how to convert HW_IRQ to 'linux_irq2' in Module2 ?

Module2 as a patch of Module1 , it has no Device Tree node.

We can map HW IRQ to Linux IRQ by this:

u32 irq;
struct irq_desc *desc;

for (irq = 0; irq < NR_IRQS; irq++) {
    desc = irq_to_desc(irq);
    if (desc && desc->irq_data.hwirq == hwirq)
        return desc->irq_data.irq;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM