diff options
author | Arjan Opmeer <arjan@opmeer.net> | 2009-02-28 16:52:40 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-02-28 17:01:39 -0500 |
commit | 9ab7b25e6a30d2292bd6d4913b71c918ee1e21b4 (patch) | |
tree | 25e029f5dfce5e0302d2583fd914f80bd4607f83 /drivers/input/mouse | |
parent | 4d368456808c977b8e9782dbe9542cf8ddedbab8 (diff) |
Input: elantech - touchpad driver miss-recognising logitech mice
Some Logitech mice react to the magic knock like Elantech touchpad would.
This leads to those mice being misdetected as Elantech touchpads. Add a
version query to elantech_detect() to distinguish the two.
[dtor@mail.ru:
- lower severity of some messages - when we are not sure yet if
device is Elantech or not not responding to knock is not an error.
]
Signed-off-by: Arjan Opmeer <arjan@opmeer.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/elantech.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b9a25d57bc5e..6ab0eb1ada1c 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -542,7 +542,7 @@ int elantech_detect(struct psmouse *psmouse, int set_properties) | |||
542 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || | 542 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || |
543 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || | 543 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || |
544 | ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { | 544 | ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { |
545 | pr_err("elantech.c: sending Elantech magic knock failed.\n"); | 545 | pr_debug("elantech.c: sending Elantech magic knock failed.\n"); |
546 | return -1; | 546 | return -1; |
547 | } | 547 | } |
548 | 548 | ||
@@ -551,8 +551,27 @@ int elantech_detect(struct psmouse *psmouse, int set_properties) | |||
551 | * set of magic numbers | 551 | * set of magic numbers |
552 | */ | 552 | */ |
553 | if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) { | 553 | if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) { |
554 | pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", | 554 | pr_debug("elantech.c: " |
555 | param[0], param[1], param[2]); | 555 | "unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", |
556 | param[0], param[1], param[2]); | ||
557 | return -1; | ||
558 | } | ||
559 | |||
560 | /* | ||
561 | * Query touchpad's firmware version and see if it reports known | ||
562 | * value to avoid mis-detection. Logitech mice are known to respond | ||
563 | * to Elantech magic knock and there might be more. | ||
564 | */ | ||
565 | if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { | ||
566 | pr_debug("elantech.c: failed to query firmware version.\n"); | ||
567 | return -1; | ||
568 | } | ||
569 | |||
570 | pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", | ||
571 | param[0], param[1], param[2]); | ||
572 | |||
573 | if (param[0] == 0 || param[1] != 0) { | ||
574 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); | ||
556 | return -1; | 575 | return -1; |
557 | } | 576 | } |
558 | 577 | ||
@@ -600,8 +619,7 @@ int elantech_init(struct psmouse *psmouse) | |||
600 | int i, error; | 619 | int i, error; |
601 | unsigned char param[3]; | 620 | unsigned char param[3]; |
602 | 621 | ||
603 | etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); | 622 | psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); |
604 | psmouse->private = etd; | ||
605 | if (!etd) | 623 | if (!etd) |
606 | return -1; | 624 | return -1; |
607 | 625 | ||
@@ -610,14 +628,12 @@ int elantech_init(struct psmouse *psmouse) | |||
610 | etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; | 628 | etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; |
611 | 629 | ||
612 | /* | 630 | /* |
613 | * Find out what version hardware this is | 631 | * Do the version query again so we can store the result |
614 | */ | 632 | */ |
615 | if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { | 633 | if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { |
616 | pr_err("elantech.c: failed to query firmware version.\n"); | 634 | pr_err("elantech.c: failed to query firmware version.\n"); |
617 | goto init_fail; | 635 | goto init_fail; |
618 | } | 636 | } |
619 | pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", | ||
620 | param[0], param[1], param[2]); | ||
621 | etd->fw_version_maj = param[0]; | 637 | etd->fw_version_maj = param[0]; |
622 | etd->fw_version_min = param[2]; | 638 | etd->fw_version_min = param[2]; |
623 | 639 | ||