aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/tca8418_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/tca8418_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/tca8418_keypad.c')
-rw-r--r--drivers/input/keyboard/tca8418_keypad.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index 958ec107bfbc..5f87b28b3192 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -342,21 +342,20 @@ static int __devinit tca8418_keypad_probe(struct i2c_client *client,
342 input->id.product = 0x001; 342 input->id.product = 0x001;
343 input->id.version = 0x0001; 343 input->id.version = 0x0001;
344 344
345 input->keycode = keypad_data->keymap; 345 error = matrix_keypad_build_keymap(pdata->keymap_data, NULL,
346 input->keycodesize = sizeof(keypad_data->keymap[0]); 346 pdata->rows, pdata->cols,
347 input->keycodemax = max_keys; 347 keypad_data->keymap, input);
348 if (error) {
349 dev_dbg(&client->dev, "Failed to build keymap\n");
350 goto fail2;
351 }
348 352
349 __set_bit(EV_KEY, input->evbit);
350 if (pdata->rep) 353 if (pdata->rep)
351 __set_bit(EV_REP, input->evbit); 354 __set_bit(EV_REP, input->evbit);
352
353 input_set_capability(input, EV_MSC, MSC_SCAN); 355 input_set_capability(input, EV_MSC, MSC_SCAN);
354 356
355 input_set_drvdata(input, keypad_data); 357 input_set_drvdata(input, keypad_data);
356 358
357 matrix_keypad_build_keymap(pdata->keymap_data, row_shift,
358 input->keycode, input->keybit);
359
360 if (pdata->irq_is_gpio) 359 if (pdata->irq_is_gpio)
361 client->irq = gpio_to_irq(client->irq); 360 client->irq = gpio_to_irq(client->irq);
362 361