diff options
author | Andrew Liu <andrew.liu200917@gmail.com> | 2013-11-23 10:06:36 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-11-25 18:26:17 -0800 |
commit | e4cfb034e89a1c7148f617735d92a3655d27773f (patch) | |
tree | 5fcd037bdae5695fa786ea691e671c57bb15f67b /drivers/input/keyboard/adp5589-keys.c | |
parent | 5cf0eb9875cb26ebdc60d08444272b2ea219386e (diff) |
Input: keyboard - "keycode & KEY_MAX" changes some keycode values
For exmaple, keycode: KEY_OK(0x160) is changed by "and" operation with
KEY_MAX(0x2ff) to KEY_KPENTER(96).
Signed-off-by: Andrew Liu <andrew.liu200917@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard/adp5589-keys.c')
-rw-r--r-- | drivers/input/keyboard/adp5589-keys.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c index 67d12b3427c9..60dafd4fa692 100644 --- a/drivers/input/keyboard/adp5589-keys.c +++ b/drivers/input/keyboard/adp5589-keys.c @@ -992,7 +992,8 @@ static int adp5589_probe(struct i2c_client *client, __set_bit(EV_REP, input->evbit); for (i = 0; i < input->keycodemax; i++) - __set_bit(kpad->keycode[i] & KEY_MAX, input->keybit); + if (kpad->keycode[i] <= KEY_MAX) + __set_bit(kpad->keycode[i], input->keybit); __clear_bit(KEY_RESERVED, input->keybit); if (kpad->gpimapsize) |