diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-10 22:37:08 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-10 22:38:47 -0700 |
commit | 1932811f426fee71b7ece67e70aeba7e1b0ebb6d (patch) | |
tree | ffc4598961733707a89e711b4614c8cc14446ad5 /drivers/input/keyboard/stmpe-keypad.c | |
parent | d0a3457d38adbad37e43ffe6b763360b2bfe71d9 (diff) |
Input: matrix-keymap - uninline and prepare for device tree support
Change matrix-keymap helper to be out-of-line, like sparse keymap,
allow the helper perform basic keymap validation and return errors,
and prepare for device tree support.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/stmpe-keypad.c')
-rw-r--r-- | drivers/input/keyboard/stmpe-keypad.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index 9397cf9c625..470a8778dec 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -289,19 +289,17 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev) input->id.bustype = BUS_I2C; input->dev.parent = &pdev->dev; - input_set_capability(input, EV_MSC, MSC_SCAN); + ret = matrix_keypad_build_keymap(plat->keymap_data, NULL, + STMPE_KEYPAD_MAX_ROWS, + STMPE_KEYPAD_MAX_COLS, + keypad->keymap, input); + if (ret) + goto out_freeinput; - __set_bit(EV_KEY, input->evbit); + input_set_capability(input, EV_MSC, MSC_SCAN); if (!plat->no_autorepeat) __set_bit(EV_REP, input->evbit); - input->keycode = keypad->keymap; - input->keycodesize = sizeof(keypad->keymap[0]); - input->keycodemax = ARRAY_SIZE(keypad->keymap); - - matrix_keypad_build_keymap(plat->keymap_data, STMPE_KEYPAD_ROW_SHIFT, - input->keycode, input->keybit); - for (i = 0; i < plat->keymap_data->keymap_size; i++) { unsigned int key = plat->keymap_data->keymap[i]; |