mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
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>
This commit is contained in:
parent
e661d0a044
commit
6b30c73e9f
@ -783,19 +783,26 @@ static int elantech_packet_check_v4(struct psmouse *psmouse)
|
|||||||
struct elantech_data *etd = psmouse->private;
|
struct elantech_data *etd = psmouse->private;
|
||||||
unsigned char *packet = psmouse->packet;
|
unsigned char *packet = psmouse->packet;
|
||||||
unsigned char packet_type = packet[3] & 0x03;
|
unsigned char packet_type = packet[3] & 0x03;
|
||||||
|
unsigned int ic_version;
|
||||||
bool sanity_check;
|
bool sanity_check;
|
||||||
|
|
||||||
if (etd->tp_dev && (packet[3] & 0x0f) == 0x06)
|
if (etd->tp_dev && (packet[3] & 0x0f) == 0x06)
|
||||||
return PACKET_TRACKPOINT;
|
return PACKET_TRACKPOINT;
|
||||||
|
|
||||||
|
/* This represents the version of IC body. */
|
||||||
|
ic_version = (etd->fw_version & 0x0f0000) >> 16;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sanity check based on the constant bits of a packet.
|
* Sanity check based on the constant bits of a packet.
|
||||||
* The constant bits change depending on the value of
|
* The constant bits change depending on the value of
|
||||||
* the hardware flag 'crc_enabled' but are the same for
|
* the hardware flag 'crc_enabled' and the version of
|
||||||
* every packet, regardless of the type.
|
* the IC body, but are the same for every packet,
|
||||||
|
* regardless of the type.
|
||||||
*/
|
*/
|
||||||
if (etd->crc_enabled)
|
if (etd->crc_enabled)
|
||||||
sanity_check = ((packet[3] & 0x08) == 0x00);
|
sanity_check = ((packet[3] & 0x08) == 0x00);
|
||||||
|
else if (ic_version == 7 && etd->samples[1] == 0x2A)
|
||||||
|
sanity_check = ((packet[3] & 0x1c) == 0x10);
|
||||||
else
|
else
|
||||||
sanity_check = ((packet[0] & 0x0c) == 0x04 &&
|
sanity_check = ((packet[0] & 0x0c) == 0x04 &&
|
||||||
(packet[3] & 0x1c) == 0x10);
|
(packet[3] & 0x1c) == 0x10);
|
||||||
@ -1116,6 +1123,7 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
|
|||||||
* Avatar AVIU-145A2 0x361f00 ? clickpad
|
* Avatar AVIU-145A2 0x361f00 ? clickpad
|
||||||
* Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons
|
* Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons
|
||||||
* Fujitsu LIFEBOOK E554 0x570f01 40, 14, 0c 2 hw buttons
|
* Fujitsu LIFEBOOK E554 0x570f01 40, 14, 0c 2 hw buttons
|
||||||
|
* Fujitsu T725 0x470f01 05, 12, 09 2 hw buttons
|
||||||
* Fujitsu H730 0x570f00 c0, 14, 0c 3 hw buttons (**)
|
* Fujitsu H730 0x570f00 c0, 14, 0c 3 hw buttons (**)
|
||||||
* Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons
|
* Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons
|
||||||
* Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*)
|
* Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*)
|
||||||
@ -1651,6 +1659,16 @@ int elantech_init(struct psmouse *psmouse)
|
|||||||
etd->capabilities[0], etd->capabilities[1],
|
etd->capabilities[0], etd->capabilities[1],
|
||||||
etd->capabilities[2]);
|
etd->capabilities[2]);
|
||||||
|
|
||||||
|
if (etd->hw_version != 1) {
|
||||||
|
if (etd->send_cmd(psmouse, ETP_SAMPLE_QUERY, etd->samples)) {
|
||||||
|
psmouse_err(psmouse, "failed to query sample data\n");
|
||||||
|
goto init_fail;
|
||||||
|
}
|
||||||
|
psmouse_info(psmouse,
|
||||||
|
"Elan sample query result %02x, %02x, %02x\n",
|
||||||
|
etd->samples[0], etd->samples[1], etd->samples[2]);
|
||||||
|
}
|
||||||
|
|
||||||
if (elantech_set_absolute_mode(psmouse)) {
|
if (elantech_set_absolute_mode(psmouse)) {
|
||||||
psmouse_err(psmouse,
|
psmouse_err(psmouse,
|
||||||
"failed to put touchpad into absolute mode.\n");
|
"failed to put touchpad into absolute mode.\n");
|
||||||
|
@ -129,6 +129,7 @@ struct elantech_data {
|
|||||||
unsigned char reg_26;
|
unsigned char reg_26;
|
||||||
unsigned char debug;
|
unsigned char debug;
|
||||||
unsigned char capabilities[3];
|
unsigned char capabilities[3];
|
||||||
|
unsigned char samples[3];
|
||||||
bool paritycheck;
|
bool paritycheck;
|
||||||
bool jumpy_cursor;
|
bool jumpy_cursor;
|
||||||
bool reports_pressure;
|
bool reports_pressure;
|
||||||
|
Loading…
Reference in New Issue
Block a user