Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | matrix_keymap_data |
struct | matrix_keypad_platform_data |
Macros | |
#define | MATRIX_MAX_ROWS 32 |
#define | MATRIX_MAX_COLS 32 |
#define | KEY(row, col, val) |
#define | KEY_ROW(k) (((k) >> 24) & 0xff) |
#define | KEY_COL(k) (((k) >> 16) & 0xff) |
#define | KEY_VAL(k) ((k) & 0xffff) |
#define | MATRIX_SCAN_CODE(row, col, row_shift) (((row) << (row_shift)) + (col)) |
Functions | |
int | matrix_keypad_build_keymap (const struct matrix_keymap_data *keymap_data, const char *keymap_name, unsigned int rows, unsigned int cols, unsigned short *keymap, struct input_dev *input_dev) |
#define KEY | ( | row, | |
col, | |||
val | |||
) |
Definition at line 11 of file matrix_keypad.h.
Definition at line 16 of file matrix_keypad.h.
Definition at line 15 of file matrix_keypad.h.
Definition at line 17 of file matrix_keypad.h.
#define MATRIX_MAX_COLS 32 |
Definition at line 9 of file matrix_keypad.h.
#define MATRIX_MAX_ROWS 32 |
Definition at line 8 of file matrix_keypad.h.
#define MATRIX_SCAN_CODE | ( | row, | |
col, | |||
row_shift | |||
) | (((row) << (row_shift)) + (col)) |
Definition at line 19 of file matrix_keypad.h.
int matrix_keypad_build_keymap | ( | const struct matrix_keymap_data * | keymap_data, |
const char * | keymap_name, | ||
unsigned int | rows, | ||
unsigned int | cols, | ||
unsigned short * | keymap, | ||
struct input_dev * | input_dev | ||
) |
matrix_keypad_build_keymap - convert platform keymap into matrix keymap : keymap supplied by the platform code : name of device tree property containing keymap (if device tree support is enabled). : number of rows in target keymap array : number of cols in target keymap array : expanded version of keymap that is suitable for use by matrix keyboard driver : input devices for which we are setting up the keymap
This function converts platform keymap (encoded with KEY() macro) into an array of keycodes that is suitable for using in a standard matrix keyboard driver that uses row and col as indices.
If is not supplied and device tree support is enabled it will attempt load the keymap from property specified by argument (or "linux,keymap" if is NULL).
Callers are expected to set up input_dev->dev.parent before calling this function.
Definition at line 129 of file matrix-keymap.c.