Skip to Content
Linux Device Drivers Development
book

Linux Device Drivers Development

by John Madieu
October 2017
Intermediate to advanced
586 pages
14h 8m
English
Packt Publishing
Content preview from Linux Device Drivers Development

Inputting device structures

First of all, the main file to include, in order to interface with the input subsystem is linux/input.h:

#include <linux/input.h> 

No matter what type of input device it is, and what type of event it sends, an input device is represented in the kernel as an instance of struct input_dev:

struct input_dev { const char *name; const char *phys; unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; unsigned long absbit[BITS_TO_LONGS(ABS_CNT)]; unsigned long mscbit[BITS_TO_LONGS(MSC_CNT)]; unsigned int repeat_key; int rep[REP_CNT]; struct input_absinfo *absinfo; unsigned long key[BITS_TO_LONGS(KEY_CNT)]; int (*open)(struct input_dev *dev); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini
Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 9781785280009Supplemental Content