Input: gpio_input: Fix keys with keycode 0x100-0x1ff
authorArve Hjønnevåg <arve@android.com>
Wed, 15 Jul 2009 03:58:41 +0000 (20:58 -0700)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:11 +0000 (17:49 -0700)
KEY_MAX is no longer a power of 2.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
drivers/input/misc/gpio_matrix.c

index 441cc1ce1ab7624200976c0af2e2d97882777aad..10b441101668a94b95ead237eaecfb5aecc6c902 100644 (file)
@@ -316,9 +316,8 @@ int gpio_event_matrix_func(struct input_dev *input_dev,
                kp->keypad_info = mi;
                set_bit(EV_KEY, input_dev->evbit);
                for (i = 0; i < key_count; i++) {
-                       if (mi->keymap[i])
-                               set_bit(mi->keymap[i] & KEY_MAX,
-                                       input_dev->keybit);
+                       if (mi->keymap[i] && mi->keymap[i] <= KEY_MAX)
+                               set_bit(mi->keymap[i], input_dev->keybit);
                }
 
                for (i = 0; i < mi->noutputs; i++) {