diff options
| -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 | ||
