diff options
Diffstat (limited to 'drivers/input/mouse/elantech.c')
-rw-r--r-- | drivers/input/mouse/elantech.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b18862b2a70e..48311204ba51 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -185,7 +185,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
185 | struct elantech_data *etd = psmouse->private; | 185 | struct elantech_data *etd = psmouse->private; |
186 | unsigned char *packet = psmouse->packet; | 186 | unsigned char *packet = psmouse->packet; |
187 | int fingers; | 187 | int fingers; |
188 | static int old_fingers; | ||
189 | 188 | ||
190 | if (etd->fw_version < 0x020000) { | 189 | if (etd->fw_version < 0x020000) { |
191 | /* | 190 | /* |
@@ -203,10 +202,13 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
203 | } | 202 | } |
204 | 203 | ||
205 | if (etd->jumpy_cursor) { | 204 | if (etd->jumpy_cursor) { |
206 | /* Discard packets that are likely to have bogus coordinates */ | 205 | if (fingers != 1) { |
207 | if (fingers > old_fingers) { | 206 | etd->single_finger_reports = 0; |
207 | } else if (etd->single_finger_reports < 2) { | ||
208 | /* Discard first 2 reports of one finger, bogus */ | ||
209 | etd->single_finger_reports++; | ||
208 | elantech_debug("discarding packet\n"); | 210 | elantech_debug("discarding packet\n"); |
209 | goto discard_packet_v1; | 211 | return; |
210 | } | 212 | } |
211 | } | 213 | } |
212 | 214 | ||
@@ -238,9 +240,6 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
238 | } | 240 | } |
239 | 241 | ||
240 | input_sync(dev); | 242 | input_sync(dev); |
241 | |||
242 | discard_packet_v1: | ||
243 | old_fingers = fingers; | ||
244 | } | 243 | } |
245 | 244 | ||
246 | /* | 245 | /* |
@@ -258,6 +257,14 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse) | |||
258 | input_report_key(dev, BTN_TOUCH, fingers != 0); | 257 | input_report_key(dev, BTN_TOUCH, fingers != 0); |
259 | 258 | ||
260 | switch (fingers) { | 259 | switch (fingers) { |
260 | case 3: | ||
261 | /* | ||
262 | * Same as one finger, except report of more than 3 fingers: | ||
263 | * byte 3: n4 . w1 w0 . . . . | ||
264 | */ | ||
265 | if (packet[3] & 0x80) | ||
266 | fingers = 4; | ||
267 | /* pass through... */ | ||
261 | case 1: | 268 | case 1: |
262 | /* | 269 | /* |
263 | * byte 1: . . . . . x10 x9 x8 | 270 | * byte 1: . . . . . x10 x9 x8 |
@@ -310,6 +317,7 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse) | |||
310 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); | 317 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); |
311 | input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2); | 318 | input_report_key(dev, BTN_TOOL_DOUBLETAP, fingers == 2); |
312 | input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3); | 319 | input_report_key(dev, BTN_TOOL_TRIPLETAP, fingers == 3); |
320 | input_report_key(dev, BTN_TOOL_QUADTAP, fingers == 4); | ||
313 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | 321 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); |
314 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | 322 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); |
315 | 323 | ||
@@ -467,6 +475,7 @@ static void elantech_set_input_params(struct psmouse *psmouse) | |||
467 | break; | 475 | break; |
468 | 476 | ||
469 | case 2: | 477 | case 2: |
478 | __set_bit(BTN_TOOL_QUADTAP, dev->keybit); | ||
470 | input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0); | 479 | input_set_abs_params(dev, ABS_X, ETP_XMIN_V2, ETP_XMAX_V2, 0, 0); |
471 | input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0); | 480 | input_set_abs_params(dev, ABS_Y, ETP_YMIN_V2, ETP_YMAX_V2, 0, 0); |
472 | input_set_abs_params(dev, ABS_HAT0X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0); | 481 | input_set_abs_params(dev, ABS_HAT0X, ETP_2FT_XMIN, ETP_2FT_XMAX, 0, 0); |
@@ -733,13 +742,13 @@ int elantech_init(struct psmouse *psmouse) | |||
733 | etd->capabilities = param[0]; | 742 | etd->capabilities = param[0]; |
734 | 743 | ||
735 | /* | 744 | /* |
736 | * This firmware seems to suffer from misreporting coordinates when | 745 | * This firmware suffers from misreporting coordinates when |
737 | * a touch action starts causing the mouse cursor or scrolled page | 746 | * a touch action starts causing the mouse cursor or scrolled page |
738 | * to jump. Enable a workaround. | 747 | * to jump. Enable a workaround. |
739 | */ | 748 | */ |
740 | if (etd->fw_version == 0x020022) { | 749 | if (etd->fw_version == 0x020022 || etd->fw_version == 0x020600) { |
741 | pr_info("firmware version 2.0.34 detected, enabling jumpy cursor workaround\n"); | 750 | pr_info("firmware version 2.0.34/2.6.0 detected, enabling jumpy cursor workaround\n"); |
742 | etd->jumpy_cursor = 1; | 751 | etd->jumpy_cursor = true; |
743 | } | 752 | } |
744 | 753 | ||
745 | if (elantech_set_absolute_mode(psmouse)) { | 754 | if (elantech_set_absolute_mode(psmouse)) { |