问题
Whilst researching the input event system in the kernel, I came across the need to access the input handlers that have already been registered with an IRQ lane given only the irq lane (just the integer). Is there a method to access ALL event handlers associated with an IRQ? I am looking to map each list of handlers from a given input device (say mouse) to each possible event that the device could make.
Not sure if it matters, but I am working with the AOSP for ARM devices.
回答1:
There is an irq_to_desc function that gets the irq_desc associated with the irq (in linux/irqdesc.h). Get the irq_desc.irq_data.
The handle_irq member is a high level flow handler that iterates the irq_desc.action members and calls their action->handler (irq, action->dev_id). The irq_desc.action->handler is an instance of a handler for the interrupt, bit action is an array of interrupt handlers. The driver handler is in there. The dev_id is a void* cookie that points to the input_dev structure, which can identify the input device.
来源:https://stackoverflow.com/questions/48361894/getting-access-to-the-input-handler-from-the-irq-lane