diff options
-rw-r--r-- | drivers/input/tablet/aiptek.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 3a5e0aafa115..86e48930dfa2 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c | |||
@@ -329,6 +329,13 @@ struct aiptek { | |||
329 | unsigned char *data; /* incoming packet data */ | 329 | unsigned char *data; /* incoming packet data */ |
330 | }; | 330 | }; |
331 | 331 | ||
332 | static const int buttonEvents[] = { | ||
333 | BTN_LEFT, BTN_RIGHT, BTN_MIDDLE, | ||
334 | BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH, | ||
335 | BTN_TOOL_BRUSH, BTN_TOOL_MOUSE, BTN_TOOL_LENS, BTN_TOUCH, | ||
336 | BTN_STYLUS, BTN_STYLUS2, | ||
337 | }; | ||
338 | |||
332 | /* | 339 | /* |
333 | * Permit easy lookup of keyboard events to send, versus | 340 | * Permit easy lookup of keyboard events to send, versus |
334 | * the bitmap which comes from the tablet. This hides the | 341 | * the bitmap which comes from the tablet. This hides the |
@@ -1728,26 +1735,14 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1728 | inputdev->relbit[0] |= | 1735 | inputdev->relbit[0] |= |
1729 | (BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL) | BIT(REL_MISC)); | 1736 | (BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL) | BIT(REL_MISC)); |
1730 | 1737 | ||
1731 | inputdev->keybit[LONG(BTN_LEFT)] |= | ||
1732 | (BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE)); | ||
1733 | |||
1734 | inputdev->keybit[LONG(BTN_DIGI)] |= | ||
1735 | (BIT(BTN_TOOL_PEN) | | ||
1736 | BIT(BTN_TOOL_RUBBER) | | ||
1737 | BIT(BTN_TOOL_PENCIL) | | ||
1738 | BIT(BTN_TOOL_AIRBRUSH) | | ||
1739 | BIT(BTN_TOOL_BRUSH) | | ||
1740 | BIT(BTN_TOOL_MOUSE) | | ||
1741 | BIT(BTN_TOOL_LENS) | | ||
1742 | BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2)); | ||
1743 | |||
1744 | inputdev->mscbit[0] = BIT(MSC_SERIAL); | 1738 | inputdev->mscbit[0] = BIT(MSC_SERIAL); |
1745 | 1739 | ||
1746 | /* Programming the tablet macro keys needs to be done with a for loop | 1740 | /* Set up key and button codes */ |
1747 | * as the keycodes are discontiguous. | 1741 | for (i = 0; i < ARRAY_SIZE(buttonEvents); ++i) |
1748 | */ | 1742 | __set_bit(buttonEvents[i], inputdev->keybit); |
1743 | |||
1749 | for (i = 0; i < ARRAY_SIZE(macroKeyEvents); ++i) | 1744 | for (i = 0; i < ARRAY_SIZE(macroKeyEvents); ++i) |
1750 | set_bit(macroKeyEvents[i], inputdev->keybit); | 1745 | __set_bit(macroKeyEvents[i], inputdev->keybit); |
1751 | 1746 | ||
1752 | /* | 1747 | /* |
1753 | * Program the input device coordinate capacities. We do not yet | 1748 | * Program the input device coordinate capacities. We do not yet |