Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97507
b: refs/heads/master
c: 471637a
h: refs/heads/master
i:
  97505: 20c01b7
  97503: 234cea0
v: v3
  • Loading branch information
Antonio Ospite authored and Dmitry Torokhov committed May 28, 2008
1 parent b0eced9 commit f9ecff7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57f5b1590f2d801a3a7f072e2c65f14d4545852c
refs/heads/master: 471637a575329f9250e7e4099e84084820a35e11
38 changes: 25 additions & 13 deletions trunk/drivers/input/keyboard/pxa27x_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,31 @@ static void pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
set_bit(code, input_dev->keybit);
}

for (i = 0; i < pdata->direct_key_num; i++)
set_bit(pdata->direct_key_map[i], input_dev->keybit);

keypad->rotary_up_key[0] = pdata->rotary0_up_key;
keypad->rotary_up_key[1] = pdata->rotary1_up_key;
keypad->rotary_down_key[0] = pdata->rotary0_down_key;
keypad->rotary_down_key[1] = pdata->rotary1_down_key;
keypad->rotary_rel_code[0] = pdata->rotary0_rel_code;
keypad->rotary_rel_code[1] = pdata->rotary1_rel_code;

if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
set_bit(pdata->rotary0_up_key, input_dev->keybit);
set_bit(pdata->rotary0_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary0_rel_code, input_dev->relbit);

if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
set_bit(pdata->rotary1_up_key, input_dev->keybit);
set_bit(pdata->rotary1_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary1_rel_code, input_dev->relbit);
if (pdata->enable_rotary0) {
if (pdata->rotary0_up_key && pdata->rotary0_down_key) {
set_bit(pdata->rotary0_up_key, input_dev->keybit);
set_bit(pdata->rotary0_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary0_rel_code, input_dev->relbit);
}

if (pdata->enable_rotary1) {
if (pdata->rotary1_up_key && pdata->rotary1_down_key) {
set_bit(pdata->rotary1_up_key, input_dev->keybit);
set_bit(pdata->rotary1_down_key, input_dev->keybit);
} else
set_bit(pdata->rotary1_rel_code, input_dev->relbit);
}
}

static inline unsigned int lookup_matrix_keycode(
Expand Down Expand Up @@ -484,8 +491,13 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev)
keypad->input_dev = input_dev;
input_set_drvdata(input_dev, keypad);

input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
BIT_MASK(EV_REL);
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
if ((keypad->pdata->enable_rotary0 &&
keypad->pdata->rotary0_rel_code) ||
(keypad->pdata->enable_rotary1 &&
keypad->pdata->rotary1_rel_code)) {
input_dev->evbit[0] |= BIT_MASK(EV_REL);
}

pxa27x_keypad_build_keycode(keypad);
platform_set_drvdata(pdev, keypad);
Expand Down

0 comments on commit f9ecff7

Please sign in to comment.