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>
This commit is contained in:
Dmitry Torokhov
2012-05-10 22:37:08 -07:00
parent d0a3457d38
commit 1932811f42
22 changed files with 265 additions and 209 deletions

View File

@@ -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);