diff options
author | JJ Ding <jj_ding@emc.com.tw> | 2011-11-09 01:13:14 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-11-10 00:19:47 -0500 |
commit | 3940d6185a982a970ff562e085caccbdd62f40bb (patch) | |
tree | c162bbf91f5cd5cd00e8acc2797ca365716ca004 /drivers/input | |
parent | b42c909743595208f7987e331f0921b73af2ce25 (diff) |
Input: elantech - adjust hw_version detection logic
This patch fixes some v3 hardware (fw_version: 0x150500) wrongly detected
as v2 hardware.
Reported-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: JJ Ding <jj_ding@emc.com.tw>
Tested-By: Marc Dietrich <marvin24@gmx.de>
Acked-by: Éric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/elantech.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 09b93b11a274..e2a9867c19d5 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -1210,18 +1210,28 @@ static int elantech_reconnect(struct psmouse *psmouse) | |||
1210 | */ | 1210 | */ |
1211 | static int elantech_set_properties(struct elantech_data *etd) | 1211 | static int elantech_set_properties(struct elantech_data *etd) |
1212 | { | 1212 | { |
1213 | /* This represents the version of IC body. */ | ||
1213 | int ver = (etd->fw_version & 0x0f0000) >> 16; | 1214 | int ver = (etd->fw_version & 0x0f0000) >> 16; |
1214 | 1215 | ||
1216 | /* Early version of Elan touchpads doesn't obey the rule. */ | ||
1215 | if (etd->fw_version < 0x020030 || etd->fw_version == 0x020600) | 1217 | if (etd->fw_version < 0x020030 || etd->fw_version == 0x020600) |
1216 | etd->hw_version = 1; | 1218 | etd->hw_version = 1; |
1217 | else if (etd->fw_version < 0x150600) | 1219 | else { |
1218 | etd->hw_version = 2; | 1220 | switch (ver) { |
1219 | else if (ver == 5) | 1221 | case 2: |
1220 | etd->hw_version = 3; | 1222 | case 4: |
1221 | else if (ver == 6) | 1223 | etd->hw_version = 2; |
1222 | etd->hw_version = 4; | 1224 | break; |
1223 | else | 1225 | case 5: |
1224 | return -1; | 1226 | etd->hw_version = 3; |
1227 | break; | ||
1228 | case 6: | ||
1229 | etd->hw_version = 4; | ||
1230 | break; | ||
1231 | default: | ||
1232 | return -1; | ||
1233 | } | ||
1234 | } | ||
1225 | 1235 | ||
1226 | /* | 1236 | /* |
1227 | * Turn on packet checking by default. | 1237 | * Turn on packet checking by default. |