Getting access to the input handler from the IRQ l

2019-08-18 23:29发布

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条回答
霸刀☆藐视天下
2楼-- · 2019-08-19 00:07

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.

查看更多
登录 后发表回答