diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-13 10:28:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-13 10:28:43 -0400 |
commit | aa86f26bd81a46985f1b32e513638d1c36cf3104 (patch) | |
tree | 86a3e978f511536ba2a12740b58392f3d3e13e11 /drivers/input/mouse | |
parent | be835674b55324c1abe973b15343c3663910c620 (diff) | |
parent | 3843384a055496dfed3c93ae883d964d8290fdab (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: ad7877 - keep dma rx buffers in seperate cache lines
Input: psmouse - reset all types of mice before reconnecting
Input: elantech - use all 3 bytes when checking version
Input: iforce - fix Guillemot Jet Leader 3D entry
Input: iforce - add Guillemot Jet Leader Force Feedback
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/elantech.c | 24 | ||||
-rw-r--r-- | drivers/input/mouse/elantech.h | 5 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 14 |
3 files changed, 24 insertions, 19 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 0520c2e19927..112b4ee52ff2 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -185,7 +185,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
185 | int fingers; | 185 | int fingers; |
186 | static int old_fingers; | 186 | static int old_fingers; |
187 | 187 | ||
188 | if (etd->fw_version_maj == 0x01) { | 188 | if (etd->fw_version < 0x020000) { |
189 | /* | 189 | /* |
190 | * byte 0: D U p1 p2 1 p3 R L | 190 | * byte 0: D U p1 p2 1 p3 R L |
191 | * byte 1: f 0 th tw x9 x8 y9 y8 | 191 | * byte 1: f 0 th tw x9 x8 y9 y8 |
@@ -227,7 +227,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
227 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | 227 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); |
228 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | 228 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); |
229 | 229 | ||
230 | if ((etd->fw_version_maj == 0x01) && | 230 | if (etd->fw_version < 0x020000 && |
231 | (etd->capabilities & ETP_CAP_HAS_ROCKER)) { | 231 | (etd->capabilities & ETP_CAP_HAS_ROCKER)) { |
232 | /* rocker up */ | 232 | /* rocker up */ |
233 | input_report_key(dev, BTN_FORWARD, packet[0] & 0x40); | 233 | input_report_key(dev, BTN_FORWARD, packet[0] & 0x40); |
@@ -321,7 +321,7 @@ static int elantech_check_parity_v1(struct psmouse *psmouse) | |||
321 | unsigned char p1, p2, p3; | 321 | unsigned char p1, p2, p3; |
322 | 322 | ||
323 | /* Parity bits are placed differently */ | 323 | /* Parity bits are placed differently */ |
324 | if (etd->fw_version_maj == 0x01) { | 324 | if (etd->fw_version < 0x020000) { |
325 | /* byte 0: D U p1 p2 1 p3 R L */ | 325 | /* byte 0: D U p1 p2 1 p3 R L */ |
326 | p1 = (packet[0] & 0x20) >> 5; | 326 | p1 = (packet[0] & 0x20) >> 5; |
327 | p2 = (packet[0] & 0x10) >> 4; | 327 | p2 = (packet[0] & 0x10) >> 4; |
@@ -457,7 +457,7 @@ static void elantech_set_input_params(struct psmouse *psmouse) | |||
457 | switch (etd->hw_version) { | 457 | switch (etd->hw_version) { |
458 | case 1: | 458 | case 1: |
459 | /* Rocker button */ | 459 | /* Rocker button */ |
460 | if ((etd->fw_version_maj == 0x01) && | 460 | if (etd->fw_version < 0x020000 && |
461 | (etd->capabilities & ETP_CAP_HAS_ROCKER)) { | 461 | (etd->capabilities & ETP_CAP_HAS_ROCKER)) { |
462 | __set_bit(BTN_FORWARD, dev->keybit); | 462 | __set_bit(BTN_FORWARD, dev->keybit); |
463 | __set_bit(BTN_BACK, dev->keybit); | 463 | __set_bit(BTN_BACK, dev->keybit); |
@@ -686,15 +686,14 @@ int elantech_init(struct psmouse *psmouse) | |||
686 | pr_err("elantech.c: failed to query firmware version.\n"); | 686 | pr_err("elantech.c: failed to query firmware version.\n"); |
687 | goto init_fail; | 687 | goto init_fail; |
688 | } | 688 | } |
689 | etd->fw_version_maj = param[0]; | 689 | |
690 | etd->fw_version_min = param[2]; | 690 | etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2]; |
691 | 691 | ||
692 | /* | 692 | /* |
693 | * Assume every version greater than this is new EeePC style | 693 | * Assume every version greater than this is new EeePC style |
694 | * hardware with 6 byte packets | 694 | * hardware with 6 byte packets |
695 | */ | 695 | */ |
696 | if ((etd->fw_version_maj == 0x02 && etd->fw_version_min >= 0x30) || | 696 | if (etd->fw_version >= 0x020030) { |
697 | etd->fw_version_maj > 0x02) { | ||
698 | etd->hw_version = 2; | 697 | etd->hw_version = 2; |
699 | /* For now show extra debug information */ | 698 | /* For now show extra debug information */ |
700 | etd->debug = 1; | 699 | etd->debug = 1; |
@@ -704,8 +703,9 @@ int elantech_init(struct psmouse *psmouse) | |||
704 | etd->hw_version = 1; | 703 | etd->hw_version = 1; |
705 | etd->paritycheck = 1; | 704 | etd->paritycheck = 1; |
706 | } | 705 | } |
707 | pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d\n", | 706 | |
708 | etd->hw_version, etd->fw_version_maj, etd->fw_version_min); | 707 | pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d.%d\n", |
708 | etd->hw_version, param[0], param[1], param[2]); | ||
709 | 709 | ||
710 | if (synaptics_send_cmd(psmouse, ETP_CAPABILITIES_QUERY, param)) { | 710 | if (synaptics_send_cmd(psmouse, ETP_CAPABILITIES_QUERY, param)) { |
711 | pr_err("elantech.c: failed to query capabilities.\n"); | 711 | pr_err("elantech.c: failed to query capabilities.\n"); |
@@ -720,8 +720,8 @@ int elantech_init(struct psmouse *psmouse) | |||
720 | * a touch action starts causing the mouse cursor or scrolled page | 720 | * a touch action starts causing the mouse cursor or scrolled page |
721 | * to jump. Enable a workaround. | 721 | * to jump. Enable a workaround. |
722 | */ | 722 | */ |
723 | if (etd->fw_version_maj == 0x02 && etd->fw_version_min == 0x22) { | 723 | if (etd->fw_version == 0x020022) { |
724 | pr_info("elantech.c: firmware version 2.34 detected, " | 724 | pr_info("elantech.c: firmware version 2.0.34 detected, " |
725 | "enabling jumpy cursor workaround\n"); | 725 | "enabling jumpy cursor workaround\n"); |
726 | etd->jumpy_cursor = 1; | 726 | etd->jumpy_cursor = 1; |
727 | } | 727 | } |
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h index feac5f7af966..ac57bde1bb9f 100644 --- a/drivers/input/mouse/elantech.h +++ b/drivers/input/mouse/elantech.h | |||
@@ -100,11 +100,10 @@ struct elantech_data { | |||
100 | unsigned char reg_26; | 100 | unsigned char reg_26; |
101 | unsigned char debug; | 101 | unsigned char debug; |
102 | unsigned char capabilities; | 102 | unsigned char capabilities; |
103 | unsigned char fw_version_maj; | ||
104 | unsigned char fw_version_min; | ||
105 | unsigned char hw_version; | ||
106 | unsigned char paritycheck; | 103 | unsigned char paritycheck; |
107 | unsigned char jumpy_cursor; | 104 | unsigned char jumpy_cursor; |
105 | unsigned char hw_version; | ||
106 | unsigned int fw_version; | ||
108 | unsigned char parity[256]; | 107 | unsigned char parity[256]; |
109 | }; | 108 | }; |
110 | 109 | ||
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index cbc807264940..a3c97315a473 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -1394,6 +1394,7 @@ static int psmouse_reconnect(struct serio *serio) | |||
1394 | struct psmouse *psmouse = serio_get_drvdata(serio); | 1394 | struct psmouse *psmouse = serio_get_drvdata(serio); |
1395 | struct psmouse *parent = NULL; | 1395 | struct psmouse *parent = NULL; |
1396 | struct serio_driver *drv = serio->drv; | 1396 | struct serio_driver *drv = serio->drv; |
1397 | unsigned char type; | ||
1397 | int rc = -1; | 1398 | int rc = -1; |
1398 | 1399 | ||
1399 | if (!drv || !psmouse) { | 1400 | if (!drv || !psmouse) { |
@@ -1413,10 +1414,15 @@ static int psmouse_reconnect(struct serio *serio) | |||
1413 | if (psmouse->reconnect) { | 1414 | if (psmouse->reconnect) { |
1414 | if (psmouse->reconnect(psmouse)) | 1415 | if (psmouse->reconnect(psmouse)) |
1415 | goto out; | 1416 | goto out; |
1416 | } else if (psmouse_probe(psmouse) < 0 || | 1417 | } else { |
1417 | psmouse->type != psmouse_extensions(psmouse, | 1418 | psmouse_reset(psmouse); |
1418 | psmouse_max_proto, false)) { | 1419 | |
1419 | goto out; | 1420 | if (psmouse_probe(psmouse) < 0) |
1421 | goto out; | ||
1422 | |||
1423 | type = psmouse_extensions(psmouse, psmouse_max_proto, false); | ||
1424 | if (psmouse->type != type) | ||
1425 | goto out; | ||
1420 | } | 1426 | } |
1421 | 1427 | ||
1422 | /* ok, the device type (and capabilities) match the old one, | 1428 | /* ok, the device type (and capabilities) match the old one, |