aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorRene van Paassen <rene.vanpaassen@gmail.com>2007-05-21 00:31:55 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-07-10 00:35:16 -0400
commit1a54f49e8989462cfc9cab0c377b2d4e60e5b70a (patch)
tree8ee0e182a964343c2c67055a4d4932716958322e /drivers/input
parent0038cae0ffd72b75699010bd112655dc2615e2fd (diff)
Input: aiptek - use set_bit instead of bitwise or
Have to use set_bit since some bit values are over 32, and bitwise or won't work on these. To be safe for the future too, use set_bit for all input dev capabilities Signed-off-by: Rene van Paassen <rene.vanpaassen@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/tablet/aiptek.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index c18287724a1e..8c62afea5a52 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -329,6 +329,19 @@ struct aiptek {
329 unsigned char *data; /* incoming packet data */ 329 unsigned char *data; /* incoming packet data */
330}; 330};
331 331
332static const int eventTypes[] = {
333 EV_KEY, EV_ABS, EV_REL, EV_MSC,
334};
335
336static const int absEvents[] = {
337 ABS_X, ABS_Y, ABS_PRESSURE, ABS_TILT_X, ABS_TILT_Y,
338 ABS_WHEEL, ABS_MISC,
339};
340
341static const int relEvents[] = {
342 REL_X, REL_Y, REL_WHEEL,
343};
344
332static const int buttonEvents[] = { 345static const int buttonEvents[] = {
333 BTN_LEFT, BTN_RIGHT, BTN_MIDDLE, 346 BTN_LEFT, BTN_RIGHT, BTN_MIDDLE,
334 BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH, 347 BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH,
@@ -1727,17 +1740,16 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
1727 /* Now program the capacities of the tablet, in terms of being 1740 /* Now program the capacities of the tablet, in terms of being
1728 * an input device. 1741 * an input device.
1729 */ 1742 */
1730 inputdev->evbit[0] |= BIT(EV_KEY) 1743 for (i = 0; i < ARRAY_SIZE(eventTypes); ++i)
1731 | BIT(EV_ABS) 1744 __set_bit(eventTypes[i], inputdev->evbit);
1732 | BIT(EV_REL)
1733 | BIT(EV_MSC);
1734 1745
1735 inputdev->absbit[0] |= BIT(ABS_MISC); 1746 for (i = 0; i < ARRAY_SIZE(absEvents); ++i)
1747 __set_bit(absEvents[i], inputdev->absbit);
1736 1748
1737 inputdev->relbit[0] |= 1749 for (i = 0; i < ARRAY_SIZE(relEvents); ++i)
1738 (BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL) | BIT(REL_MISC)); 1750 __set_bit(relEvents[i], inputdev->relbit);
1739 1751
1740 inputdev->mscbit[0] = BIT(MSC_SERIAL); 1752 __set_bit(MSC_SERIAL, inputdev->mscbit);
1741 1753
1742 /* Set up key and button codes */ 1754 /* Set up key and button codes */
1743 for (i = 0; i < ARRAY_SIZE(buttonEvents); ++i) 1755 for (i = 0; i < ARRAY_SIZE(buttonEvents); ++i)