Linux Device Driver-Input subsystem

Source: Internet
Author: User

The input subsystem is the middle layer driven by all I/O devices. How can I provide interfaces for various input devices in the lower layer and a unified interface for the upper layer?

According to the kernel code, there are two linked lists in the input subsystem: input_dev_list and input_handler_list. When registering an input_dev, it is mounted to input_dev_list and matched to input_handler_list, when registering an input_handler, it will be mounted to input_handler_list and matched to input_dev on input_dev_list. When the matching succeeds, the connect function of the handler will be called, this function generally creates and registers an input_handle, which contains information related to input_dev and input_handler, in this way, when the lower layer reports an event to the input subsystem, you can use input_handle to find the corresponding input_handler and call the relevant functions to further provide services for the previous time.

For example, the relationship between input_dev, input_handler, input_handle, and 3 is represented. One type of handler can be associated with multiple hardware devices. One hardware device can be associated with multiple handler devices. For example, a touch screen device can be used as an event device, a mouse device, or a touch device. Therefore, a device must be connected to multiple platform drivers. A platform driver serves not only one device, but also an upper-layer driver for a, B, and C3 Touch devices. Therefore, one-to-multiple connection is required.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.