diff options
author | Kamal Mostafa <kamal@canonical.com> | 2013-02-21 14:55:05 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-02-22 03:09:04 -0500 |
commit | 81bb5d31fbf3893a8e041c649dea704dd11d5272 (patch) | |
tree | 0f15ec75a2f473f2750f74e4eacdfdcfb09708f9 /drivers/input | |
parent | 2d9f0d964be94fd51c7303288c6f9c88bf2381fe (diff) |
Input: cypress_ps2 - fix trackpadi found in Dell XPS12
Avoid firmware glitch in Cypress PS/2 Trackpad firmware version 11
(as observed in Dell XPS12) which prevents driver from recognizing
the trackpad.
BugLink: http://launchpad.net/bugs/1103594
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Cc: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/cypress_ps2.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index 1673dc6c8092..f51765fff054 100644 --- a/drivers/input/mouse/cypress_ps2.c +++ b/drivers/input/mouse/cypress_ps2.c | |||
@@ -236,6 +236,13 @@ static int cypress_read_fw_version(struct psmouse *psmouse) | |||
236 | cytp->fw_version = param[2] & FW_VERSION_MASX; | 236 | cytp->fw_version = param[2] & FW_VERSION_MASX; |
237 | cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0; | 237 | cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0; |
238 | 238 | ||
239 | /* | ||
240 | * Trackpad fw_version 11 (in Dell XPS12) yields a bogus response to | ||
241 | * CYTP_CMD_READ_TP_METRICS so do not try to use it. LP: #1103594. | ||
242 | */ | ||
243 | if (cytp->fw_version >= 11) | ||
244 | cytp->tp_metrics_supported = 0; | ||
245 | |||
239 | psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); | 246 | psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); |
240 | psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n", | 247 | psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n", |
241 | cytp->tp_metrics_supported); | 248 | cytp->tp_metrics_supported); |
@@ -258,6 +265,9 @@ static int cypress_read_tp_metrics(struct psmouse *psmouse) | |||
258 | cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; | 265 | cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; |
259 | cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; | 266 | cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; |
260 | 267 | ||
268 | if (!cytp->tp_metrics_supported) | ||
269 | return 0; | ||
270 | |||
261 | memset(param, 0, sizeof(param)); | 271 | memset(param, 0, sizeof(param)); |
262 | if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_TP_METRICS, param) == 0) { | 272 | if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_TP_METRICS, param) == 0) { |
263 | /* Update trackpad parameters. */ | 273 | /* Update trackpad parameters. */ |
@@ -315,18 +325,15 @@ static int cypress_read_tp_metrics(struct psmouse *psmouse) | |||
315 | 325 | ||
316 | static int cypress_query_hardware(struct psmouse *psmouse) | 326 | static int cypress_query_hardware(struct psmouse *psmouse) |
317 | { | 327 | { |
318 | struct cytp_data *cytp = psmouse->private; | ||
319 | int ret; | 328 | int ret; |
320 | 329 | ||
321 | ret = cypress_read_fw_version(psmouse); | 330 | ret = cypress_read_fw_version(psmouse); |
322 | if (ret) | 331 | if (ret) |
323 | return ret; | 332 | return ret; |
324 | 333 | ||
325 | if (cytp->tp_metrics_supported) { | 334 | ret = cypress_read_tp_metrics(psmouse); |
326 | ret = cypress_read_tp_metrics(psmouse); | 335 | if (ret) |
327 | if (ret) | 336 | return ret; |
328 | return ret; | ||
329 | } | ||
330 | 337 | ||
331 | return 0; | 338 | return 0; |
332 | } | 339 | } |