aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2009-04-19 02:43:57 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-04-19 02:44:59 -0400
commite06003af56c386018f0c209608ac6c6662228cc0 (patch)
tree4db5a03163a51f900dc3f777929017b92dedca7b /arch/arm/mach-ep93xx
parent864fe73c312ca8e177da01207ce86fb1b80b3e54 (diff)
Input: add matrix keypad driver for Cirrus EP93xx
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>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h b/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
new file mode 100644
index 000000000000..83f31cd0a274
--- /dev/null
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
@@ -0,0 +1,42 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
3 */
4
5#ifndef __ASM_ARCH_EP93XX_KEYPAD_H
6#define __ASM_ARCH_EP93XX_KEYPAD_H
7
8#define MAX_MATRIX_KEY_ROWS (8)
9#define MAX_MATRIX_KEY_COLS (8)
10
11/* flags for the ep93xx_keypad driver */
12#define EP93XX_KEYPAD_DISABLE_3_KEY (1<<0) /* disable 3-key reset */
13#define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */
14#define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */
15#define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */
16#define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */
17#define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */
18
19/**
20 * struct ep93xx_keypad_platform_data - platform specific device structure
21 * @matrix_key_rows: number of rows in the keypad matrix
22 * @matrix_key_cols: number of columns in the keypad matrix
23 * @matrix_key_map: array of keycodes defining the keypad matrix
24 * @matrix_key_map_size: ARRAY_SIZE(matrix_key_map)
25 * @debounce: debounce start count; terminal count is 0xff
26 * @prescale: row/column counter pre-scaler load value
27 * @flags: see above
28 */
29struct ep93xx_keypad_platform_data {
30 unsigned int matrix_key_rows;
31 unsigned int matrix_key_cols;
32 unsigned int *matrix_key_map;
33 int matrix_key_map_size;
34 unsigned int debounce;
35 unsigned int prescale;
36 unsigned int flags;
37};
38
39/* macro for creating the matrix_key_map table */
40#define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val))
41
42#endif /* __ASM_ARCH_EP93XX_KEYPAD_H */