So far, we have described structures used when writing drivers for input devices, and how they can be managed from the user space:
- Allocate a new input device, according to its type, polled or not, using input_allocate_polled_device() or input_allocate_device().
- Fill in the mandatory fields (if necessary):
-
- Specify the type of event the device supports by using the set_bit() helper macro on the input_dev.evbit field
- Depending on the event type, EV_REL, EV_ABS, EV_KEY, or other, indicate code this device can report using either input_dev.relbit, input_dev.absbit, input_dev.keybit, or other
- Specify input_dev.dev in order to set up a proper device tree
- Fill abs_info if necessary
- For polled devices, indicate at which interval the poll() function should be called:
- Write your open() function if necessary, in which you should prepare and set up the...