Shows the layering of input device drivers in Linux. From this figure, we can easily see how Linux designs the driver architecture of input devices.Introduction and structure of input subsystemNext, we will analyze the driver layers of the input subsystem and the implementation principles of the device driver layer.
Input subsystem device driver layer implementation principle
In Linux, the input device is described using the input_dev struct, which is defined in input. h. The device driver can be implemented by following the steps below.
1) set the events that the input device supports in the driver module loading function;
2) register the input device to the input subsystem;
3 ). when an input operation occurs on the input device (for example, when the keyboard is pressed/lifted, the touch screen is touched/lifted/moved, and the mouse is moved/clicked/lifted ), submits events and corresponding key values/coordinates.
Original link http://www.ourunix.org/post/292.html