Commit 3940d618 authored by JJ Ding's avatar JJ Ding Committed by Dmitry Torokhov

Input: elantech - adjust hw_version detection logic

This patch fixes some v3 hardware (fw_version: 0x150500) wrongly detected
as v2 hardware.
Reported-by: default avatarMarc Dietrich <marvin24@gmx.de>
Signed-off-by: default avatarJJ Ding <jj_ding@emc.com.tw>
Tested-By: default avatarMarc Dietrich <marvin24@gmx.de>
Acked-by: default avatarÉric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent b42c9097
...@@ -1210,18 +1210,28 @@ static int elantech_reconnect(struct psmouse *psmouse) ...@@ -1210,18 +1210,28 @@ static int elantech_reconnect(struct psmouse *psmouse)
*/ */
static int elantech_set_properties(struct elantech_data *etd) static int elantech_set_properties(struct elantech_data *etd)
{ {
/* This represents the version of IC body. */
int ver = (etd->fw_version & 0x0f0000) >> 16; int ver = (etd->fw_version & 0x0f0000) >> 16;
/* Early version of Elan touchpads doesn't obey the rule. */
if (etd->fw_version < 0x020030 || etd->fw_version == 0x020600) if (etd->fw_version < 0x020030 || etd->fw_version == 0x020600)
etd->hw_version = 1; etd->hw_version = 1;
else if (etd->fw_version < 0x150600) else {
etd->hw_version = 2; switch (ver) {
else if (ver == 5) case 2:
etd->hw_version = 3; case 4:
else if (ver == 6) etd->hw_version = 2;
etd->hw_version = 4; break;
else case 5:
return -1; etd->hw_version = 3;
break;
case 6:
etd->hw_version = 4;
break;
default:
return -1;
}
}
/* /*
* Turn on packet checking by default. * Turn on packet checking by default.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment