Low-Level Keypad Driver
i.MX51 EVK Linux Reference Manual
Freescale Semiconductor
20-3
where:
•
time
is the timestamp at which the key event occurred
•
code
is the
i.MX keycode for keypress or release
•
value
equals 0 for key release and 1 for keypress
The functions mentioned in this section are implemented as a low-level interface between the Linux OS
and the KPP hardware. They cannot be called from other drivers or from a user application.
The keypress and release scancodes can be derived using the following formula,
scancode (press) = (row
×
8) + col;
scancode (release) = (row
×
8) + col + 128;
20.3
Reassigning Keycodes
The keypad driver takes advantage of the input subsystem’s ability to remap key codes. A user space
application can use the
EVIOCGKEYCODE
and
EVIOCSKEYCODE
IOCTLs on the device node (for example
/dev/input/event0
) to get and set key codes. Applications such as keyfuzz and input-kbd (from the
input-utils package) use these IOCTLs which are handled by the input subsystem. See the
kernel
Documentation/input/input-programming.txt
for details on remapping codes.
20.4
Driver Features
The keypad driver supports the following features:
•
Returns the input keycode for every key that is pressed or released
•
Interrupt driver for keypress or release
•
Blocking and nonblocking reads
•
Implemented as a standard input device
20.5
Source Code Structure
shows the keypad driver source files that are available in the following directories:
<ltib_dir>/rpm/BUILD/linux/drivers/input/keyboard
<ltib_dir>/rpm/BUILD/linux/include/linux
<ltib_dir>/rpm/BUILD/linux/arch/arm/mach-mx5
Table 20-1. Keypad Driver Files
File
Description
mxc_keyb.c
Low-level driver implementation
mxc_keyb.h
Driver structures, control register address definitions
input.h
Generic Linux keycode definitions
arch/arm/mach-mx5/mx51_b
abbage.c
arch/arm/mach-mx5/device.c
Contains the platform-specific keymapping keycode array
Summary of Contents for i.MX51 EVK
Page 1: ...Part Number 924 76374 Rev 10 11 01 11 2010 i MX51 EVK Linux Reference Manual...
Page 14: ...i MX51 EVK Linux Reference Manual xiv Freescale Semiconductor...
Page 18: ...i MX51 EVK Linux Reference Manual xviii Freescale Semiconductor...
Page 24: ...i MX51 EVK Linux Reference Manual xxiv Freescale Semiconductor...
Page 38: ...Machine Specific Layer MSL i MX51 EVK Linux Reference Manual 2 8 Freescale Semiconductor...
Page 52: ...MC13892 Digitizer Driver i MX51 EVK Linux Reference Manual 5 4 Freescale Semiconductor...
Page 64: ...TV Encoder TVE Driver i MX51 EVK Linux Reference Manual 10 4 Freescale Semiconductor...
Page 82: ...Video for Linux Two V4L2 Driver i MX51 EVK Linux Reference Manual 12 8 Freescale Semiconductor...
Page 86: ...i MX5 Dual Display i MX51 EVK Linux Reference Manual 13 4 Freescale Semiconductor...
Page 100: ...X Windows Acceleration i MX51 EVK Linux Reference Manual 16 6 Freescale Semiconductor...
Page 118: ...Low Level Keypad Driver i MX51 EVK Linux Reference Manual 20 6 Freescale Semiconductor...
Page 134: ...Security Drivers i MX51 EVK Linux Reference Manual 22 10 Freescale Semiconductor...
Page 148: ...Inter IC I2C Driver i MX51 EVK Linux Reference Manual 24 4 Freescale Semiconductor...
Page 178: ...ARC USB Driver i MX51 EVK Linux Reference Manual 29 10 Freescale Semiconductor...
Page 194: ...OProfile i MX51 EVK Linux Reference Manual 33 6 Freescale Semiconductor...