summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/lm8333.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-05-10 22:37:08 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-05-10 22:38:47 -0700
commit1932811f426fee71b7ece67e70aeba7e1b0ebb6d (patch)
treeffc4598961733707a89e711b4614c8cc14446ad5 /drivers/input/keyboard/lm8333.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/lm8333.c')
-rw-r--r--drivers/input/keyboard/lm8333.c15
1 files changed, 7 insertions, 8 deletions
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,