diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-08-25 22:24:13 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-08-28 01:05:39 -0400 |
commit | 77a53fd21870c726b670c0d8179294ac1ea33468 (patch) | |
tree | a936dfad89adadd165fb4e114d3f8e71736585f9 /drivers/input/keyboard/w90p910_keypad.c | |
parent | 8fbac18e8edd974b5234d96a9b8e2a26ab2ac556 (diff) |
Input: matrix-keypad - add function to build device keymap
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/w90p910_keypad.c')
-rw-r--r-- | drivers/input/keyboard/w90p910_keypad.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c index b8598ae124ee..2d03dd0f9e07 100644 --- a/drivers/input/keyboard/w90p910_keypad.c +++ b/drivers/input/keyboard/w90p910_keypad.c | |||
@@ -126,7 +126,6 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev) | |||
126 | struct resource *res; | 126 | struct resource *res; |
127 | int irq; | 127 | int irq; |
128 | int error; | 128 | int error; |
129 | int i; | ||
130 | 129 | ||
131 | if (!pdata) { | 130 | if (!pdata) { |
132 | dev_err(&pdev->dev, "no platform data defined\n"); | 131 | dev_err(&pdev->dev, "no platform data defined\n"); |
@@ -197,19 +196,8 @@ static int __devinit w90p910_keypad_probe(struct platform_device *pdev) | |||
197 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); | 196 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); |
198 | input_set_capability(input_dev, EV_MSC, MSC_SCAN); | 197 | input_set_capability(input_dev, EV_MSC, MSC_SCAN); |
199 | 198 | ||
200 | for (i = 0; i < keymap_data->keymap_size; i++) { | 199 | matrix_keypad_build_keymap(keymap_data, W90P910_ROW_SHIFT, |
201 | unsigned int key = keymap_data->keymap[i]; | 200 | input_dev->keycode, input_dev->keybit); |
202 | unsigned int row = KEY_ROW(key); | ||
203 | unsigned int col = KEY_COL(key); | ||
204 | unsigned short keycode = KEY_VAL(key); | ||
205 | unsigned int scancode = MATRIX_SCAN_CODE(row, col, | ||
206 | W90P910_ROW_SHIFT); | ||
207 | |||
208 | keypad->keymap[scancode] = keycode; | ||
209 | __set_bit(keycode, input_dev->keybit); | ||
210 | } | ||
211 | __clear_bit(KEY_RESERVED, input_dev->keybit); | ||
212 | |||
213 | 201 | ||
214 | error = request_irq(keypad->irq, w90p910_keypad_irq_handler, | 202 | error = request_irq(keypad->irq, w90p910_keypad_irq_handler, |
215 | IRQF_DISABLED, pdev->name, keypad); | 203 | IRQF_DISABLED, pdev->name, keypad); |