aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/samsung-keypad.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-05-11 01:37:08 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-05-11 01:38:47 -0400
commit1932811f426fee71b7ece67e70aeba7e1b0ebb6d (patch)
treeffc4598961733707a89e711b4614c8cc14446ad5 /drivers/input/keyboard/samsung-keypad.c
parentd0a3457d38adbad37e43ffe6b763360b2bfe71d9 (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/samsung-keypad.c')
-rw-r--r--drivers/input/keyboard/samsung-keypad.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index 2391ae884fee..a061ba603a29 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -454,23 +454,23 @@ static int __devinit samsung_keypad_probe(struct platform_device *pdev)
454 input_dev->name = pdev->name; 454 input_dev->name = pdev->name;
455 input_dev->id.bustype = BUS_HOST; 455 input_dev->id.bustype = BUS_HOST;
456 input_dev->dev.parent = &pdev->dev; 456 input_dev->dev.parent = &pdev->dev;
457 input_set_drvdata(input_dev, keypad);
458 457
459 input_dev->open = samsung_keypad_open; 458 input_dev->open = samsung_keypad_open;
460 input_dev->close = samsung_keypad_close; 459 input_dev->close = samsung_keypad_close;
461 460
462 input_dev->evbit[0] = BIT_MASK(EV_KEY); 461 error = matrix_keypad_build_keymap(keymap_data, NULL,
463 if (!pdata->no_autorepeat) 462 pdata->rows, pdata->cols,
464 input_dev->evbit[0] |= BIT_MASK(EV_REP); 463 keypad->keycodes, input_dev);
464 if (error) {
465 dev_err(&pdev->dev, "failed to build keymap\n");
466 goto err_put_clk;
467 }
465 468
466 input_set_capability(input_dev, EV_MSC, MSC_SCAN); 469 input_set_capability(input_dev, EV_MSC, MSC_SCAN);
470 if (!pdata->no_autorepeat)
471 __set_bit(EV_REP, input_dev->evbit);
467 472
468 input_dev->keycode = keypad->keycodes; 473 input_set_drvdata(input_dev, keypad);
469 input_dev->keycodesize = sizeof(keypad->keycodes[0]);
470 input_dev->keycodemax = pdata->rows << row_shift;
471
472 matrix_keypad_build_keymap(keymap_data, row_shift,
473 input_dev->keycode, input_dev->keybit);
474 474
475 keypad->irq = platform_get_irq(pdev, 0); 475 keypad->irq = platform_get_irq(pdev, 0);
476 if (keypad->irq < 0) { 476 if (keypad->irq < 0) {