aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/matrix_keypad.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-08-25 22:24:13 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-08-28 01:05:39 -0400
commit77a53fd21870c726b670c0d8179294ac1ea33468 (patch)
treea936dfad89adadd165fb4e114d3f8e71736585f9 /drivers/input/keyboard/matrix_keypad.c
parent8fbac18e8edd974b5234d96a9b8e2a26ab2ac556 (diff)
Input: matrix-keypad - add function to build device keymap
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/matrix_keypad.c')
-rw-r--r--drivers/input/keyboard/matrix_keypad.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 541b981ff075..91cfe5170265 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -319,7 +319,6 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev)
319 struct input_dev *input_dev; 319 struct input_dev *input_dev;
320 unsigned short *keycodes; 320 unsigned short *keycodes;
321 unsigned int row_shift; 321 unsigned int row_shift;
322 int i;
323 int err; 322 int err;
324 323
325 pdata = pdev->dev.platform_data; 324 pdata = pdev->dev.platform_data;
@@ -363,18 +362,10 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev)
363 362
364 input_dev->keycode = keycodes; 363 input_dev->keycode = keycodes;
365 input_dev->keycodesize = sizeof(*keycodes); 364 input_dev->keycodesize = sizeof(*keycodes);
366 input_dev->keycodemax = pdata->num_row_gpios << keypad->row_shift; 365 input_dev->keycodemax = pdata->num_row_gpios << row_shift;
367
368 for (i = 0; i < keymap_data->keymap_size; i++) {
369 unsigned int key = keymap_data->keymap[i];
370 unsigned int row = KEY_ROW(key);
371 unsigned int col = KEY_COL(key);
372 unsigned short code = KEY_VAL(key);
373 366
374 keycodes[MATRIX_SCAN_CODE(row, col, row_shift)] = code; 367 matrix_keypad_build_keymap(keymap_data, row_shift,
375 __set_bit(code, input_dev->keybit); 368 input_dev->keycode, input_dev->keybit);
376 }
377 __clear_bit(KEY_RESERVED, input_dev->keybit);
378 369
379 input_set_capability(input_dev, EV_MSC, MSC_SCAN); 370 input_set_capability(input_dev, EV_MSC, MSC_SCAN);
380 input_set_drvdata(input_dev, keypad); 371 input_set_drvdata(input_dev, keypad);