Specifications
Chapter 2
Drivers and Interfaces
This chapter discusses the available input device drivers and their user space interfaces. Several
parts of the Linux kernel source code are examined to give both a decent understanding and
an overview. Current issues regarding user input are addressed where applicable. All relevant
kernel configuration options are described and mentioned at appropriate passages. As further
reading, [Low04] deepens the configuration and compilation of the Linux kernel.
Several sections of this chapter are discussing source code of the Linux kernel. These
excerpts are based on version 2.6.9 of the Linux kernel. The mentioned path names are relative
to the root of the source tree of the Linux kernel (Appendix D, §D.1). A practical look at the
design and implementation of the Linux version 2.6 is given in [Lov03]. The architecture of
the Linux kernel version 2.6 is comprehensively described in [Mau03].
The first section of this chapter discusses the Linux input core which is the most imp ortant
driver for input devices: it connects input device drivers (e.g. keyboard drivers, §2.2) with
input event handlers (e.g. event interface, §2.5). The event handlers are responsible to deliver
occurring input events to both user space and kernel space. Section §2.3 and Section §2.4
describe Linux support for input devices which are connected using either USB or Bluetooth.
In general, USB and Bluetooth input devices depend on the Linux input core, too. The
Advanced Configuration and Power Interface (ACPI) defines several buttons which trigger
input events. Section §2.6 discusses the Linux ACPI implementation concerning ACPI events.
Input interfaces offered by specific input device drivers are discussed in Section §2.7 at the end
of the chapter.
2.1 Input Core
The most significant driver regarding input devices is the input core driver input.c, which
is found in the directory drivers/input. This driver chains input device drivers with input
event handlers and implements the generic input interface for Linux input devices. The input
device drivers communicate with the hardware and report occurring events to the input core.
Consecutively, the events are passed on to the event handlers by the input core driver. The
event handlers subsequently distribute the input events to different interfaces—user space
interfaces as well as kernel space interfaces. The cooperation of input devices, their drivers,
the input core and the event handlers is shown in Figure 2.1.
Beside others, the input core implements the functions input register device() and
input unregister device(). An input device driver needs to register itself by calling the
5