Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kamal Mostafa and committed by
Dmitry Torokhov
81bb5d31 2d9f0d96

+13 -6
+13 -6
drivers/input/mouse/cypress_ps2.c
··· 236 236 cytp->fw_version = param[2] & FW_VERSION_MASX; 237 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 246 psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); 240 247 psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n", 241 248 cytp->tp_metrics_supported); ··· 264 257 cytp->tp_max_pressure = CYTP_MAX_PRESSURE; 265 258 cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; 266 259 cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; 260 + 261 + if (!cytp->tp_metrics_supported) 262 + return 0; 267 263 268 264 memset(param, 0, sizeof(param)); 269 265 if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_TP_METRICS, param) == 0) { ··· 325 315 326 316 static int cypress_query_hardware(struct psmouse *psmouse) 327 317 { 328 - struct cytp_data *cytp = psmouse->private; 329 318 int ret; 330 319 331 320 ret = cypress_read_fw_version(psmouse); 332 321 if (ret) 333 322 return ret; 334 323 335 - if (cytp->tp_metrics_supported) { 336 - ret = cypress_read_tp_metrics(psmouse); 337 - if (ret) 338 - return ret; 339 - } 324 + ret = cypress_read_tp_metrics(psmouse); 325 + if (ret) 326 + return ret; 340 327 341 328 return 0; 342 329 }