aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuson Lin2015-08-07 16:37:24 -0500
committerDmitry Torokhov2015-08-07 16:54:15 -0500
commit6b30c73e9f37183ad60c7f7050acf8e8edf91e9c (patch)
treec22b3e058c70dba67ea60182406442726b247475 /drivers/input/mouse
parente661d0a04462dd98667f8947141bd8defab5b34a (diff)
downloadkernel-omap-6b30c73e9f37183ad60c7f7050acf8e8edf91e9c.tar.gz
kernel-omap-6b30c73e9f37183ad60c7f7050acf8e8edf91e9c.tar.xz
kernel-omap-6b30c73e9f37183ad60c7f7050acf8e8edf91e9c.zip
Input: elantech - add special check for fw_version 0x470f01 touchpad
It is no need to check the packet[0] for sanity check when doing elantech_packet_check_v4() function for fw_version = 0x470f01 touchpad. Signed-off by: Duson Lin <dusonlin@emc.com.tw> Reviewed-by: Ulrik De Bie <ulrik.debie-os@e2big.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/elantech.c22
-rw-r--r--drivers/input/mouse/elantech.h1
2 files changed, 21 insertions, 2 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 22b9ca901f4e..2955f1d0ca6c 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -783,19 +783,26 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
783 struct elantech_data *etd = psmouse->private; 783 struct elantech_data *etd = psmouse->private;
784 unsigned char *packet = psmouse->packet; 784 unsigned char *packet = psmouse->packet;
785 unsigned char packet_type = packet[3] & 0x03; 785 unsigned char packet_type = packet[3] & 0x03;
786 unsigned int ic_version;
786 bool sanity_check; 787 bool sanity_check;
787 788
788 if (etd->tp_dev && (packet[3] & 0x0f) == 0x06) 789 if (etd->tp_dev && (packet[3] & 0x0f) == 0x06)
789 return PACKET_TRACKPOINT; 790 return PACKET_TRACKPOINT;
790 791
792 /* This represents the version of IC body. */
793 ic_version = (etd->fw_version & 0x0f0000) >> 16;
794
791 /* 795 /*
792 * Sanity check based on the constant bits of a packet. 796 * Sanity check based on the constant bits of a packet.
793 * The constant bits change depending on the value of 797 * The constant bits change depending on the value of
794 * the hardware flag 'crc_enabled' but are the same for 798 * the hardware flag 'crc_enabled' and the version of
795 * every packet, regardless of the type. 799 * the IC body, but are the same for every packet,
800 * regardless of the type.
796 */ 801 */
797 if (etd->crc_enabled) 802 if (etd->crc_enabled)
798 sanity_check = ((packet[3] & 0x08) == 0x00); 803 sanity_check = ((packet[3] & 0x08) == 0x00);
804 else if (ic_version == 7 && etd->samples[1] == 0x2A)
805 sanity_check = ((packet[3] & 0x1c) == 0x10);
799 else 806 else
800 sanity_check = ((packet[0] & 0x0c) == 0x04 && 807 sanity_check = ((packet[0] & 0x0c) == 0x04 &&
801 (packet[3] & 0x1c) == 0x10); 808 (packet[3] & 0x1c) == 0x10);
@@ -1116,6 +1123,7 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
1116 * Avatar AVIU-145A2 0x361f00 ? clickpad 1123 * Avatar AVIU-145A2 0x361f00 ? clickpad
1117 * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons 1124 * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons
1118 * Fujitsu LIFEBOOK E554 0x570f01 40, 14, 0c 2 hw buttons 1125 * Fujitsu LIFEBOOK E554 0x570f01 40, 14, 0c 2 hw buttons
1126 * Fujitsu T725 0x470f01 05, 12, 09 2 hw buttons
1119 * Fujitsu H730 0x570f00 c0, 14, 0c 3 hw buttons (**) 1127 * Fujitsu H730 0x570f00 c0, 14, 0c 3 hw buttons (**)
1120 * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons 1128 * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons
1121 * Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*) 1129 * Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*)
@@ -1651,6 +1659,16 @@ int elantech_init(struct psmouse *psmouse)
1651 etd->capabilities[0], etd->capabilities[1], 1659 etd->capabilities[0], etd->capabilities[1],
1652 etd->capabilities[2]); 1660 etd->capabilities[2]);
1653 1661
1662 if (etd->hw_version != 1) {
1663 if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, etd->samples)) {
1664 psmouse_err(psmouse, "failed to query sample data\n");
1665 goto init_fail;
1666 }
1667 psmouse_info(psmouse,
1668 "Elan sample query result %02x, %02x, %02x\n",
1669 etd->samples[0], etd->samples[1], etd->samples[2]);
1670 }
1671
1654 if (elantech_set_absolute_mode(psmouse)) { 1672 if (elantech_set_absolute_mode(psmouse)) {
1655 psmouse_err(psmouse, 1673 psmouse_err(psmouse,
1656 "failed to put touchpad into absolute mode.\n"); 1674 "failed to put touchpad into absolute mode.\n");
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index f965d1569cc3..e1cbf409d9c8 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -129,6 +129,7 @@ struct elantech_data {
129 unsigned char reg_26; 129 unsigned char reg_26;
130 unsigned char debug; 130 unsigned char debug;
131 unsigned char capabilities[3]; 131 unsigned char capabilities[3];
132 unsigned char samples[3];
132 bool paritycheck; 133 bool paritycheck;
133 bool jumpy_cursor; 134 bool jumpy_cursor;
134 bool reports_pressure; 135 bool reports_pressure;