Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: elantech - v4 is a clickpad, with only one button

Add pointer and buttonpad properties for v4 hardware.

Also, Jachiet reported that on Asus UX31, right button has no effect.
It turns out v4 has only one button, the right-button effect is
implemented with software when Windows driver is installed, or in
firmware when touchpad is in relative mode. So remove BTN_RIGHT
while at it.

Reported-by: Jachiet Louis <louis@jachiet.com>
Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

JJ Ding and committed by
Dmitry Torokhov
e3dde4fb a67ada7a

+4 -2
+4 -2
drivers/input/mouse/elantech.c
··· 486 486 unsigned char *packet = psmouse->packet; 487 487 488 488 input_report_key(dev, BTN_LEFT, packet[0] & 0x01); 489 - input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); 490 489 input_mt_report_pointer_emulation(dev, true); 491 490 input_sync(dev); 492 491 } ··· 966 967 if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width)) 967 968 return -1; 968 969 970 + __set_bit(INPUT_PROP_POINTER, dev->propbit); 969 971 __set_bit(EV_KEY, dev->evbit); 970 972 __set_bit(EV_ABS, dev->evbit); 971 973 __clear_bit(EV_REL, dev->evbit); ··· 1017 1017 */ 1018 1018 psmouse_warn(psmouse, "couldn't query resolution data.\n"); 1019 1019 } 1020 - 1020 + /* v4 is clickpad, with only one button. */ 1021 + __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); 1022 + __clear_bit(BTN_RIGHT, dev->keybit); 1021 1023 __set_bit(BTN_TOOL_QUADTAP, dev->keybit); 1022 1024 /* For X to recognize me as touchpad. */ 1023 1025 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);