Skip to content

Commit

Permalink
Input: add matrix keypad driver for Cirrus EP93xx
Browse files Browse the repository at this point in the history
This is a keyboard driver for the Cirrus Logic EP93xx keypad matrix
peripheral. This driver is based on the pxa27x_keypad driver.

[dtor@mail.ru: Plug in input_dev->keycode so keymap can be changed
		from userspace.]
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
H Hartley Sweeten authored and Dmitry Torokhov committed Apr 19, 2009
1 parent 864fe73 commit e06003a
Show file tree
Hide file tree
Showing 4 changed files with 523 additions and 0 deletions.
42 changes: 42 additions & 0 deletions arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
*/

#ifndef __ASM_ARCH_EP93XX_KEYPAD_H
#define __ASM_ARCH_EP93XX_KEYPAD_H

#define MAX_MATRIX_KEY_ROWS (8)
#define MAX_MATRIX_KEY_COLS (8)

/* flags for the ep93xx_keypad driver */
#define EP93XX_KEYPAD_DISABLE_3_KEY (1<<0) /* disable 3-key reset */
#define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */
#define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */
#define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */
#define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */
#define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */

/**
* struct ep93xx_keypad_platform_data - platform specific device structure
* @matrix_key_rows: number of rows in the keypad matrix
* @matrix_key_cols: number of columns in the keypad matrix
* @matrix_key_map: array of keycodes defining the keypad matrix
* @matrix_key_map_size: ARRAY_SIZE(matrix_key_map)
* @debounce: debounce start count; terminal count is 0xff
* @prescale: row/column counter pre-scaler load value
* @flags: see above
*/
struct ep93xx_keypad_platform_data {
unsigned int matrix_key_rows;
unsigned int matrix_key_cols;
unsigned int *matrix_key_map;
int matrix_key_map_size;
unsigned int debounce;
unsigned int prescale;
unsigned int flags;
};

/* macro for creating the matrix_key_map table */
#define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val))

#endif /* __ASM_ARCH_EP93XX_KEYPAD_H */
10 changes: 10 additions & 0 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,14 @@ config KEYBOARD_SH_KEYSC

To compile this driver as a module, choose M here: the
module will be called sh_keysc.
+
config KEYBOARD_EP93XX
tristate "EP93xx Matrix Keypad support"
depends on ARCH_EP93XX
help
Say Y here to enable the matrix keypad on the Cirrus EP93XX.

To compile this driver as a module, choose M here: the
module will be called ep93xx_keypad.

endif
1 change: 1 addition & 0 deletions drivers/input/keyboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ obj-$(CONFIG_KEYBOARD_HP7XX) += jornada720_kbd.o
obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o
obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o
obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
Loading

0 comments on commit e06003a

Please sign in to comment.