Getting access to the input handler from the IRQ lane

喜你入骨 提交于 2019-12-13 03:51:30

问题


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

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