diff options
| -rw-r--r-- | drivers/input/mouse/elantech.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b96e978a37b7..9640232a868d 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
| @@ -473,8 +473,15 @@ static void elantech_report_absolute_v3(struct psmouse *psmouse, | |||
| 473 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); | 473 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); |
| 474 | input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2); | 474 | input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2); |
| 475 | input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3); | 475 | input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3); |
| 476 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | 476 | |
| 477 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | 477 | /* For clickpads map both buttons to BTN_LEFT */ |
| 478 | if (etd->fw_version & 0x001000) { | ||
| 479 | input_report_key(dev, BTN_LEFT, packet[0] & 0x03); | ||
| 480 | } else { | ||
| 481 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | ||
| 482 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | ||
| 483 | } | ||
| 484 | |||
| 478 | input_report_abs(dev, ABS_PRESSURE, pres); | 485 | input_report_abs(dev, ABS_PRESSURE, pres); |
| 479 | input_report_abs(dev, ABS_TOOL_WIDTH, width); | 486 | input_report_abs(dev, ABS_TOOL_WIDTH, width); |
| 480 | 487 | ||
| @@ -484,10 +491,17 @@ static void elantech_report_absolute_v3(struct psmouse *psmouse, | |||
| 484 | static void elantech_input_sync_v4(struct psmouse *psmouse) | 491 | static void elantech_input_sync_v4(struct psmouse *psmouse) |
| 485 | { | 492 | { |
| 486 | struct input_dev *dev = psmouse->dev; | 493 | struct input_dev *dev = psmouse->dev; |
| 494 | struct elantech_data *etd = psmouse->private; | ||
| 487 | unsigned char *packet = psmouse->packet; | 495 | unsigned char *packet = psmouse->packet; |
| 488 | 496 | ||
| 489 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | 497 | /* For clickpads map both buttons to BTN_LEFT */ |
| 490 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | 498 | if (etd->fw_version & 0x001000) { |
| 499 | input_report_key(dev, BTN_LEFT, packet[0] & 0x03); | ||
| 500 | } else { | ||
| 501 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | ||
| 502 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | ||
| 503 | } | ||
| 504 | |||
| 491 | input_mt_report_pointer_emulation(dev, true); | 505 | input_mt_report_pointer_emulation(dev, true); |
| 492 | input_sync(dev); | 506 | input_sync(dev); |
| 493 | } | 507 | } |
