aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/imx_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/imx_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/imx_keypad.c')
-rw-r--r--drivers/input/keyboard/imx_keypad.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index fb87b3bcadb9..6ee7421e2321 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -481,7 +481,7 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
481 } 481 }
482 482
483 if (keypad->rows_en_mask > ((1 << MAX_MATRIX_KEY_ROWS) - 1) || 483 if (keypad->rows_en_mask > ((1 << MAX_MATRIX_KEY_ROWS) - 1) ||
484 keypad->cols_en_mask > ((1 << MAX_MATRIX_KEY_COLS) - 1)) { 484 keypad->cols_en_mask > ((1 << MAX_MATRIX_KEY_COLS) - 1)) {
485 dev_err(&pdev->dev, 485 dev_err(&pdev->dev,
486 "invalid key data (too many rows or colums)\n"); 486 "invalid key data (too many rows or colums)\n");
487 error = -EINVAL; 487 error = -EINVAL;
@@ -496,14 +496,17 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
496 input_dev->dev.parent = &pdev->dev; 496 input_dev->dev.parent = &pdev->dev;
497 input_dev->open = imx_keypad_open; 497 input_dev->open = imx_keypad_open;
498 input_dev->close = imx_keypad_close; 498 input_dev->close = imx_keypad_close;
499 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
500 input_dev->keycode = keypad->keycodes;
501 input_dev->keycodesize = sizeof(keypad->keycodes[0]);
502 input_dev->keycodemax = ARRAY_SIZE(keypad->keycodes);
503 499
504 matrix_keypad_build_keymap(keymap_data, MATRIX_ROW_SHIFT, 500 error = matrix_keypad_build_keymap(keymap_data, NULL,
505 keypad->keycodes, input_dev->keybit); 501 MAX_MATRIX_KEY_ROWS,
502 MAX_MATRIX_KEY_COLS,
503 keypad->keycodes, input_dev);
504 if (error) {
505 dev_err(&pdev->dev, "failed to build keymap\n");
506 goto failed_clock_put;
507 }
506 508
509 __set_bit(EV_REP, input_dev->evbit);
507 input_set_capability(input_dev, EV_MSC, MSC_SCAN); 510 input_set_capability(input_dev, EV_MSC, MSC_SCAN);
508 input_set_drvdata(input_dev, keypad); 511 input_set_drvdata(input_dev, keypad);
509 512