Skip to content

Commit 76cdc08

Browse files
Alberto Panizzodtor
authored andcommitted
Input: add imx-keypad driver to support the IMX Keypad Port
The IMX family of Application Processors is shipped with a Keypad Port supported by this driver. The peripheral can control up to an 8x8 matrix key pad where all the scanning is done via software. The hardware provides two interrupts: one for key presses (KDI) and one for all key releases (KRI). There is also a simple circuit for glitch reduction (said for synchronization) made by two series of 3 D-latches clocked by the keypad-clock that stabilize the interrupts sources. KDI and KRI are fired only if the respective conditions are maintained for at last 4 keypad-clock cycle. Since those circuits are poor for a correct debounce process (the keypad-clock frequency is 32K and bounces longer than 94us are not masked) the driver, when an interrupt arrives, samples the matrix with a period of 10ms until the readins are stable for IMX_KEYPAD_SCANS_FOR_STABILITY times (currently set at 3). After getting stable result appropriate events are sent through the input stack. If some keys are maintained pressed, the driver continues to scan the matrix with a longer period (60ms) to catch possible multiple key presses without overloading the cpu. This process ends when all keys are released. This driver is tested to build in kernel or as a module and follow the specification of Freescale Application processors: i.MX25 i.MX27 i.MX31 i.MX35 i.MX51 especially tested on i.MX31. Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1 parent 429722e commit 76cdc08

3 files changed

Lines changed: 604 additions & 0 deletions

File tree

‎drivers/input/keyboard/Kconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ config KEYBOARD_MAX7359
292292
To compile this driver as a module, choose M here: the
293293
module will be called max7359_keypad.
294294

295+
config KEYBOARD_IMX
296+
tristate "IMX keypad support"
297+
depends on ARCH_MXC
298+
help
299+
Enable support for IMX keypad port.
300+
301+
To compile this driver as a module, choose M here: the
302+
module will be called imx_keypad.
303+
295304
config KEYBOARD_NEWTON
296305
tristate "Newton keyboard"
297306
select SERIO

‎drivers/input/keyboard/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
1717
obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
1818
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
1919
obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
20+
obj-$(CONFIG_KEYBOARD_IMX) += imx_keypad.o
2021
obj-$(CONFIG_KEYBOARD_HP6XX) += jornada680_kbd.o
2122
obj-$(CONFIG_KEYBOARD_HP7XX) += jornada720_kbd.o
2223
obj-$(CONFIG_KEYBOARD_LKKBD) += lkkbd.o

0 commit comments

Comments
 (0)