From 1932811f426fee71b7ece67e70aeba7e1b0ebb6d Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 10 May 2012 22:37:08 -0700 Subject: 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 --- drivers/input/keyboard/lm8333.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/input/keyboard/lm8333.c') diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c index 9a8c4a6cf5c6..ca168a6679de 100644 --- a/drivers/input/keyboard/lm8333.c +++ b/drivers/input/keyboard/lm8333.c @@ -29,9 +29,9 @@ #define LM8333_FIFO_TRANSFER_SIZE 16 -#define LM8333_ROW_SHIFT 4 #define LM8333_NUM_ROWS 8 - +#define LM8333_NUM_COLS 16 +#define LM8333_ROW_SHIFT 4 struct lm8333 { struct i2c_client *client; @@ -159,14 +159,13 @@ static int __devinit lm8333_probe(struct i2c_client *client, input->dev.parent = &client->dev; input->id.bustype = BUS_I2C; - input->keycode = lm8333->keycodes; - input->keycodesize = sizeof(lm8333->keycodes[0]); - input->keycodemax = ARRAY_SIZE(lm8333->keycodes); - input->evbit[0] = BIT_MASK(EV_KEY); input_set_capability(input, EV_MSC, MSC_SCAN); - matrix_keypad_build_keymap(pdata->matrix_data, LM8333_ROW_SHIFT, - input->keycode, input->keybit); + err = matrix_keypad_build_keymap(pdata->matrix_data, NULL, + LM8333_NUM_ROWS, LM8333_NUM_COLS, + lm8333->keycodes, input); + if (err) + goto free_mem; if (pdata->debounce_time) { err = lm8333_write8(lm8333, LM8333_DEBOUNCE, -- cgit v1.2.3