Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Linux Device Driver Development - Second Edition

You're reading from  Linux Device Driver Development - Second Edition

Product type Book
Published in Apr 2022
Publisher Packt
ISBN-13 9781803240060
Pages 708 pages
Edition 2nd Edition
Languages
Author (1):
John Madieu John Madieu
Profile icon John Madieu

Table of Contents (23) Chapters

Preface 1. Section 1 -Linux Kernel Development Basics
2. Chapter 1: Introduction to Kernel Development 3. Chapter 2: Understanding Linux Kernel Module Basic Concepts 4. Chapter 3: Dealing with Kernel Core Helpers 5. Chapter 4: Writing Character Device Drivers 6. Section 2 - Linux Kernel Platform Abstraction and Device Drivers
7. Chapter 5: Understanding and Leveraging the Device Tree 8. Chapter 6: Introduction to Devices, Drivers, and Platform Abstraction 9. Chapter 7: Understanding the Concept of Platform Devices and Drivers 10. Chapter 8: Writing I2C Device Drivers 11. Chapter 9: Writing SPI Device Drivers 12. Section 3 - Making the Most out of Your Hardware
13. Chapter 10: Understanding the Linux Kernel Memory Allocation 14. Chapter 11: Implementing Direct Memory Access (DMA) Support 15. Chapter 12: Abstracting Memory Access – Introduction to the Regmap API: a Register Map Abstraction 16. Chapter 13: Demystifying the Kernel IRQ Framework 17. Chapter 14: Introduction to the Linux Device Model 18. Section 4 - Misc Kernel Subsystems for the Embedded World
19. Chapter 15: Digging into the IIO Framework 20. Chapter 16: Getting the Most Out of the Pin Controller and GPIO Subsystems 21. Chapter 17: Leveraging the Linux Kernel Input Subsystem 22. Other Books You May Enjoy

Introduction to the Linux kernel input subsystem – its data structures and APIs

The main data structures and APIs of this subsystem can be found in the include/linux/input.h files. The following line is required in any input device driver:

#include <linux/input.h>

Whatever type of input device it is, whatever type of event it sends, an input device is represented in the kernel as an instance of the 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}