diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-11 07:37:08 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-05-11 07:38:47 +0200 |
commit | 1932811f426fee71b7ece67e70aeba7e1b0ebb6d (patch) | |
tree | ffc4598961733707a89e711b4614c8cc14446ad5 /drivers/input/keyboard/tca8418_keypad.c | |
parent | Input: adp5588 - add support for gpio names (diff) | |
download | linux-1932811f426fee71b7ece67e70aeba7e1b0ebb6d.tar.xz linux-1932811f426fee71b7ece67e70aeba7e1b0ebb6d.zip |
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.c | 15 |
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, input->id.product = 0x001; input->id.version = 0x0001; - input->keycode = keypad_data->keymap; - input->keycodesize = sizeof(keypad_data->keymap[0]); - input->keycodemax = max_keys; + error = matrix_keypad_build_keymap(pdata->keymap_data, NULL, + pdata->rows, pdata->cols, + keypad_data->keymap, input); + if (error) { + dev_dbg(&client->dev, "Failed to build keymap\n"); + goto fail2; + } - __set_bit(EV_KEY, input->evbit); if (pdata->rep) __set_bit(EV_REP, input->evbit); - input_set_capability(input, EV_MSC, MSC_SCAN); input_set_drvdata(input, keypad_data); - matrix_keypad_build_keymap(pdata->keymap_data, row_shift, - input->keycode, input->keybit); - if (pdata->irq_is_gpio) client->irq = gpio_to_irq(client->irq); |