Commit e3dde4fb authored by JJ Ding's avatar JJ Ding Committed by Dmitry Torokhov

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: default avatarJachiet Louis <louis@jachiet.com>
Signed-off-by: default avatarJJ Ding <jj_ding@emc.com.tw>
Reviewed-by: default avatarChase Douglas <chase.douglas@canonical.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent a67ada7a
...@@ -486,7 +486,6 @@ static void elantech_input_sync_v4(struct psmouse *psmouse) ...@@ -486,7 +486,6 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
unsigned char *packet = psmouse->packet; unsigned char *packet = psmouse->packet;
input_report_key(dev, BTN_LEFT, packet[0] & 0x01); input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
input_mt_report_pointer_emulation(dev, true); input_mt_report_pointer_emulation(dev, true);
input_sync(dev); input_sync(dev);
} }
...@@ -967,6 +966,7 @@ static int elantech_set_input_params(struct psmouse *psmouse) ...@@ -967,6 +966,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width)) if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width))
return -1; return -1;
__set_bit(INPUT_PROP_POINTER, dev->propbit);
__set_bit(EV_KEY, dev->evbit); __set_bit(EV_KEY, dev->evbit);
__set_bit(EV_ABS, dev->evbit); __set_bit(EV_ABS, dev->evbit);
__clear_bit(EV_REL, dev->evbit); __clear_bit(EV_REL, dev->evbit);
...@@ -1017,7 +1017,9 @@ static int elantech_set_input_params(struct psmouse *psmouse) ...@@ -1017,7 +1017,9 @@ static int elantech_set_input_params(struct psmouse *psmouse)
*/ */
psmouse_warn(psmouse, "couldn't query resolution data.\n"); psmouse_warn(psmouse, "couldn't query resolution data.\n");
} }
/* v4 is clickpad, with only one button. */
__set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
__clear_bit(BTN_RIGHT, dev->keybit);
__set_bit(BTN_TOOL_QUADTAP, dev->keybit); __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
/* For X to recognize me as touchpad. */ /* For X to recognize me as touchpad. */
input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment