diff options
Diffstat (limited to 'drivers/input/keyboard/nomadik-ske-keypad.c')
-rw-r--r-- | drivers/input/keyboard/nomadik-ske-keypad.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index 101e245944e7..4ea4341a68c5 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c | |||
@@ -39,7 +39,8 @@ | |||
39 | #define SKE_KPRISA (0x1 << 2) | 39 | #define SKE_KPRISA (0x1 << 2) |
40 | 40 | ||
41 | #define SKE_KEYPAD_ROW_SHIFT 3 | 41 | #define SKE_KEYPAD_ROW_SHIFT 3 |
42 | #define SKE_KPD_KEYMAP_SIZE (8 * 8) | 42 | #define SKE_KPD_NUM_ROWS 8 |
43 | #define SKE_KPD_NUM_COLS 8 | ||
43 | 44 | ||
44 | /* keypad auto scan registers */ | 45 | /* keypad auto scan registers */ |
45 | #define SKE_ASR0 0x20 | 46 | #define SKE_ASR0 0x20 |
@@ -63,7 +64,7 @@ struct ske_keypad { | |||
63 | void __iomem *reg_base; | 64 | void __iomem *reg_base; |
64 | struct input_dev *input; | 65 | struct input_dev *input; |
65 | const struct ske_keypad_platform_data *board; | 66 | const struct ske_keypad_platform_data *board; |
66 | unsigned short keymap[SKE_KPD_KEYMAP_SIZE]; | 67 | unsigned short keymap[SKE_KPD_NUM_ROWS * SKE_KPD_NUM_COLS]; |
67 | struct clk *clk; | 68 | struct clk *clk; |
68 | spinlock_t ske_keypad_lock; | 69 | spinlock_t ske_keypad_lock; |
69 | }; | 70 | }; |
@@ -261,19 +262,18 @@ static int __init ske_keypad_probe(struct platform_device *pdev) | |||
261 | input->name = "ux500-ske-keypad"; | 262 | input->name = "ux500-ske-keypad"; |
262 | input->dev.parent = &pdev->dev; | 263 | input->dev.parent = &pdev->dev; |
263 | 264 | ||
264 | input->keycode = keypad->keymap; | 265 | error = matrix_keypad_build_keymap(plat->keymap_data, NULL, |
265 | input->keycodesize = sizeof(keypad->keymap[0]); | 266 | SKE_KPD_NUM_ROWS, SKE_KPD_NUM_COLS, |
266 | input->keycodemax = ARRAY_SIZE(keypad->keymap); | 267 | keypad->keymap, input); |
268 | if (error) { | ||
269 | dev_err(&pdev->dev, "Failed to build keymap\n"); | ||
270 | goto err_iounmap; | ||
271 | } | ||
267 | 272 | ||
268 | input_set_capability(input, EV_MSC, MSC_SCAN); | 273 | input_set_capability(input, EV_MSC, MSC_SCAN); |
269 | |||
270 | __set_bit(EV_KEY, input->evbit); | ||
271 | if (!plat->no_autorepeat) | 274 | if (!plat->no_autorepeat) |
272 | __set_bit(EV_REP, input->evbit); | 275 | __set_bit(EV_REP, input->evbit); |
273 | 276 | ||
274 | matrix_keypad_build_keymap(plat->keymap_data, SKE_KEYPAD_ROW_SHIFT, | ||
275 | input->keycode, input->keybit); | ||
276 | |||
277 | clk_enable(keypad->clk); | 277 | clk_enable(keypad->clk); |
278 | 278 | ||
279 | /* go through board initialization helpers */ | 279 | /* go through board initialization helpers */ |