Input: ALPS - do not set REL_X/REL_Y capabilities on the touchpad
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 12 Dec 2009 07:54:54 +0000 (23:54 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 12 Dec 2009 07:55:23 +0000 (23:55 -0800)
Relative events are only reported via secondary device therefore device
associated with the touchpad should not advertise these capabilities.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/mouse/alps.c

index a3f492a50850f5004fd711d1bcda595453ec222d..b03e7e0b40990c79900a043ea18aa6976de5b1e4 100644 (file)
@@ -487,6 +487,17 @@ int alps_init(struct psmouse *psmouse)
        if (alps_hw_init(psmouse))
                goto init_fail;
 
+       /*
+        * Undo part of setup done for us by psmouse core since touchpad
+        * is not a relative device.
+        */
+       __clear_bit(EV_REL, dev1->evbit);
+       __clear_bit(REL_X, dev1->relbit);
+       __clear_bit(REL_Y, dev1->relbit);
+
+       /*
+        * Now set up our capabilities.
+        */
        dev1->evbit[BIT_WORD(EV_KEY)] |= BIT_MASK(EV_KEY);
        dev1->keybit[BIT_WORD(BTN_TOUCH)] |= BIT_MASK(BTN_TOUCH);
        dev1->keybit[BIT_WORD(BTN_TOOL_FINGER)] |= BIT_MASK(BTN_TOOL_FINGER);