-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Input: pxa27x_keypad - introduce driver structure and use KEY() to de…
…fine matrix keys 1. Introduce the "struct pxa27x_keypad" structure for driver specific information, such as "struct clk", generated matrix key codes and so on 2. Use KEY() macro to define matrix keys, instead of original 8x8 map this makes definition easier with keypad where keys are sparse 3. Keep a generated array in "struct pxa27x_keypad" for fast lookup 4. Separate the matrix scan into a dedicated function for readability and report only those keys whose state has been changed, instead of report all states 5. Make use of KPAS to decide the faster path if only one key has been detected Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
- Loading branch information
Eric Miao
authored and
Dmitry Torokhov
committed
Jan 31, 2008
1 parent
1a1cd73
commit 1814db6
Showing
2 changed files
with
184 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
#define PXAKBD_MAXROW 8 | ||
#define PXAKBD_MAXCOL 8 | ||
#ifndef __ASM_ARCH_PXA27x_KEYPAD_H | ||
#define __ASM_ARCH_PXA27x_KEYPAD_H | ||
|
||
#include <linux/input.h> | ||
|
||
#define MAX_MATRIX_KEY_ROWS (8) | ||
#define MAX_MATRIX_KEY_COLS (8) | ||
|
||
struct pxa27x_keypad_platform_data { | ||
int nr_rows, nr_cols; | ||
int keycodes[PXAKBD_MAXROW][PXAKBD_MAXCOL]; | ||
|
||
/* code map for the matrix keys */ | ||
unsigned int matrix_key_rows; | ||
unsigned int matrix_key_cols; | ||
unsigned int *matrix_key_map; | ||
int matrix_key_map_size; | ||
|
||
#ifdef CONFIG_PM | ||
u32 reg_kpc; | ||
u32 reg_kprec; | ||
#endif | ||
}; | ||
|
||
#define KEY(row, col, val) (((row) << 28) | ((col) << 24) | (val)) | ||
|
||
#endif /* __ASM_ARCH_PXA27x_KEYPAD_H */ |