aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/tc3589x-keypad.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-05-10 22:37:08 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-05-10 22:38:47 -0700
commit1932811f426fee71b7ece67e70aeba7e1b0ebb6d (patch)
treeffc4598961733707a89e711b4614c8cc14446ad5 /drivers/input/keyboard/tc3589x-keypad.c
parentInput: adp5588 - add support for gpio names (diff)
downloadlinux-dev-1932811f426fee71b7ece67e70aeba7e1b0ebb6d.tar.xz
linux-dev-1932811f426fee71b7ece67e70aeba7e1b0ebb6d.zip
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/tc3589x-keypad.c')
-rw-r--r--drivers/input/keyboard/tc3589x-keypad.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c
index f4da2a7a6970..7d498e698508 100644
--- a/drivers/input/keyboard/tc3589x-keypad.c
+++ b/drivers/input/keyboard/tc3589x-keypad.c
@@ -78,7 +78,7 @@
* @input: pointer to input device object
* @board: keypad platform device
* @krow: number of rows
- * @kcol: number of coloumns
+ * @kcol: number of columns
* @keymap: matrix scan code table for keycodes
* @keypad_stopped: holds keypad status
*/
@@ -333,23 +333,22 @@ static int __devinit tc3589x_keypad_probe(struct platform_device *pdev)
input->name = pdev->name;
input->dev.parent = &pdev->dev;
- input->keycode = keypad->keymap;
- input->keycodesize = sizeof(keypad->keymap[0]);
- input->keycodemax = ARRAY_SIZE(keypad->keymap);
-
input->open = tc3589x_keypad_open;
input->close = tc3589x_keypad_close;
- input_set_drvdata(input, keypad);
+ error = matrix_keypad_build_keymap(plat->keymap_data, NULL,
+ TC3589x_MAX_KPROW, TC3589x_MAX_KPCOL,
+ keypad->keymap, input);
+ if (error) {
+ dev_err(&pdev->dev, "Failed to build keymap\n");
+ goto err_free_mem;
+ }
input_set_capability(input, EV_MSC, MSC_SCAN);
-
- __set_bit(EV_KEY, input->evbit);
if (!plat->no_autorepeat)
__set_bit(EV_REP, input->evbit);
- matrix_keypad_build_keymap(plat->keymap_data, 0x3,
- input->keycode, input->keybit);
+ input_set_drvdata(input, keypad);
error = request_threaded_irq(irq, NULL,
tc3589x_keypad_irq, plat->irqtype,