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/imx_keypad.c | |
parent | d0a3457d38adbad37e43ffe6b763360b2bfe71d9 (diff) | |
download | kernel_goldelico_gta04-1932811f426fee71b7ece67e70aeba7e1b0ebb6d.zip kernel_goldelico_gta04-1932811f426fee71b7ece67e70aeba7e1b0ebb6d.tar.gz kernel_goldelico_gta04-1932811f426fee71b7ece67e70aeba7e1b0ebb6d.tar.bz2 |
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.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index fb87b3b..6ee7421 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) } if (keypad->rows_en_mask > ((1 << MAX_MATRIX_KEY_ROWS) - 1) || - keypad->cols_en_mask > ((1 << MAX_MATRIX_KEY_COLS) - 1)) { + keypad->cols_en_mask > ((1 << MAX_MATRIX_KEY_COLS) - 1)) { dev_err(&pdev->dev, "invalid key data (too many rows or colums)\n"); error = -EINVAL; @@ -496,14 +496,17 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev) input_dev->dev.parent = &pdev->dev; input_dev->open = imx_keypad_open; input_dev->close = imx_keypad_close; - input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); - input_dev->keycode = keypad->keycodes; - input_dev->keycodesize = sizeof(keypad->keycodes[0]); - input_dev->keycodemax = ARRAY_SIZE(keypad->keycodes); - matrix_keypad_build_keymap(keymap_data, MATRIX_ROW_SHIFT, - keypad->keycodes, input_dev->keybit); + error = matrix_keypad_build_keymap(keymap_data, NULL, + MAX_MATRIX_KEY_ROWS, + MAX_MATRIX_KEY_COLS, + keypad->keycodes, input_dev); + if (error) { + dev_err(&pdev->dev, "failed to build keymap\n"); + goto failed_clock_put; + } + __set_bit(EV_REP, input_dev->evbit); input_set_capability(input_dev, EV_MSC, MSC_SCAN); input_set_drvdata(input_dev, keypad); |