diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-11 01:37:08 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-11 01:38:47 -0400 |
commit | 1932811f426fee71b7ece67e70aeba7e1b0ebb6d (patch) | |
tree | ffc4598961733707a89e711b4614c8cc14446ad5 /drivers/input/keyboard/ep93xx_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/ep93xx_keypad.c')
-rw-r--r-- | drivers/input/keyboard/ep93xx_keypad.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index df194bdaab50..c46fc8185469 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c | |||
@@ -303,19 +303,16 @@ static int __devinit ep93xx_keypad_probe(struct platform_device *pdev) | |||
303 | input_dev->open = ep93xx_keypad_open; | 303 | input_dev->open = ep93xx_keypad_open; |
304 | input_dev->close = ep93xx_keypad_close; | 304 | input_dev->close = ep93xx_keypad_close; |
305 | input_dev->dev.parent = &pdev->dev; | 305 | input_dev->dev.parent = &pdev->dev; |
306 | input_dev->keycode = keypad->keycodes; | ||
307 | input_dev->keycodesize = sizeof(keypad->keycodes[0]); | ||
308 | input_dev->keycodemax = ARRAY_SIZE(keypad->keycodes); | ||
309 | 306 | ||
310 | input_set_drvdata(input_dev, keypad); | 307 | err = matrix_keypad_build_keymap(keymap_data, NULL, |
308 | EP93XX_MATRIX_ROWS, EP93XX_MATRIX_COLS, | ||
309 | keypad->keycodes, input_dev); | ||
310 | if (err) | ||
311 | goto failed_free_dev; | ||
311 | 312 | ||
312 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | ||
313 | if (keypad->pdata->flags & EP93XX_KEYPAD_AUTOREPEAT) | 313 | if (keypad->pdata->flags & EP93XX_KEYPAD_AUTOREPEAT) |
314 | input_dev->evbit[0] |= BIT_MASK(EV_REP); | 314 | __set_bit(EV_REP, input_dev->evbit); |
315 | 315 | input_set_drvdata(input_dev, keypad); | |
316 | matrix_keypad_build_keymap(keymap_data, 3, | ||
317 | input_dev->keycode, input_dev->keybit); | ||
318 | platform_set_drvdata(pdev, keypad); | ||
319 | 316 | ||
320 | err = request_irq(keypad->irq, ep93xx_keypad_irq_handler, | 317 | err = request_irq(keypad->irq, ep93xx_keypad_irq_handler, |
321 | 0, pdev->name, keypad); | 318 | 0, pdev->name, keypad); |
@@ -326,6 +323,7 @@ static int __devinit ep93xx_keypad_probe(struct platform_device *pdev) | |||
326 | if (err) | 323 | if (err) |
327 | goto failed_free_irq; | 324 | goto failed_free_irq; |
328 | 325 | ||
326 | platform_set_drvdata(pdev, keypad); | ||
329 | device_init_wakeup(&pdev->dev, 1); | 327 | device_init_wakeup(&pdev->dev, 1); |
330 | 328 | ||
331 | return 0; | 329 | return 0; |