Specifications

CHAPTER 2. DRIVERS AND INTERFACES 13
Input Event Drivers
Drivers which are using the ACPI bus driver to report input events are the Asus/Medion ACPI
driver (asus acpi.c) and the IBM ThinkPad ACPI driver (thinkpad acpi.c). On supported
systems the Asus/Medion driver generates ACPI events with device class set to hotkey and
bus id set to HOTK. The value for type depends on the key pressed. As previously mentioned
data represents how often the corresponding key is pressed. The IBM ThinkPad ACPI driver
generates events with device class set to ibm/hotkey and bus id set to HKEY. While type
is always set to 0x80, the value of data depends on which key is pressed. A list of the systems
supported by the Asus/Medion and IBM ThinkPad ACPI drivers is found in Appendix C,
§C.2 and §C.5.
The Toshiba ACPI driver toshiba acpi.c does not use acpi bus generate event() to
report events. Toshiba is using proprietary technology to implement the function keys. This
proprietary hardware control interface (HCI) is used on recent Toshiba laptops. As soon as a
function key is pressed a unique value for the pressed key is stored in a specific register. This
register is called system event register. Since no interrupt occurs whenever a function key is
pressed, the system event register needs to be polled. This polling is not done in kernel space.
The Toshiba ACPI driver exports a read-write interface to user space. The location of the
interface is /proc/acpi/toshiba/keys. The read and write operations of user space process
on this interface invoke corresponding functions of the Toshiba ACPI driver, which is then
able to access the HCI. A list of the systems supported by the Toshiba ACPI driver is found
in Appendix C, §C.8.
The system event register is a FIFO register and can store values for up to 16 function
key events. A user space process reading from /proc/acpi/toshiba/keys receives two values:
hotkey ready and hotkey. If hotkey ready equals 0 it means that only one—the last—
function key event is stored in the system event register. If there is more than one function
key event stored in the system event register, hotkey ready equals 1. The value of hotkey
is set to the value of the first element—the head—of the system event register. A user space
process has to write hotkey:1 to /proc/acpi/toshiba/keys in order to flush the first element
of the FIFO register. Polling of the system event register can thereby be implemented in user
space using the system calls read(2) and write(2).
Subsystem Overview
Figure 2.4 shows the parts of the ACPI subsystem which are related to user input. The
addressed drivers for mobile computers are pooled as “Other ACPI Drivers”. The virtual file
system proc is used to implement user space interfaces. The interface /proc/acpi/other is a
wildcard for all ACPI input interfaces but the event interface (/proc/acpi/event).
The Linux kernel has to be compiled with the configuration option CONFIG ACPI set to y
to enable the ACPI core subsystem. It is not possible to compile ACPI support as module.
However, all other discussed ACPI drivers can be either compiled statically or as module by
setting the corresponding configuration option to either y or m:
CONFIG ACPI BUTTON (ACPI Button Driver)
CONFIG ACPI ASUS (Asus/Medion ACPI Driver)
CONFIG ACPI THINKPAD (IBM ThinkPad ACPI Driver)
CONFIG ACPI TOSHIBA (Toshiba ACPI Driver)