From patchwork Thu Feb 21 18:51:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 222399 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 549192C0085 for ; Fri, 22 Feb 2013 05:50:35 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1U8bDv-0004By-Nu; Thu, 21 Feb 2013 18:50:27 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1U8bDs-0004Bh-Hn for kernel-team@lists.ubuntu.com; Thu, 21 Feb 2013 18:50:24 +0000 Received: from c-67-160-231-42.hsd1.ca.comcast.net ([67.160.231.42] helo=[192.168.1.7]) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1U8bDs-00041f-4l; Thu, 21 Feb 2013 18:50:24 +0000 Message-ID: <1361472665.3827.41.camel@fourier> Subject: [Raring][pull-request] fix Cypress PS/2 for Dell XPS12 From: Kamal Mostafa To: kernel-team@lists.ubuntu.com Date: Thu, 21 Feb 2013 10:51:05 -0800 X-Mailer: Evolution 3.6.2-0ubuntu1 Mime-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Avoid firmware glitch in Cypress PS/2 Trackpad firmware to enable trackpad in the Dell XPS12. This patch will only affect Cypress PS/2 trackpads. This patch has been submitted upstream. Thanks, -Kamal -- >8 ------------------------ The following changes since commit 5c388d021efca5bad3b086a2bd55a7f866d709a6: UBUNTU: [Config] Add CONFIG_PS2_CYPRESS (2013-02-21 09:56:07 -0800) are available in the git repository at: git://kernel.ubuntu.com/kamal/ubuntu-raring.git cypress-xps12 for you to fetch changes up to e501ef950ce43175f89bdc398748af296a9afba1: UBUNTU: SAUCE: Input: fix Cypress PS/2 Trackpad in Dell XPS12 (2013-02-21 10:01:03 -0800) ---------------------------------------------------------------- Kamal Mostafa (1): UBUNTU: SAUCE: Input: fix Cypress PS/2 Trackpad in Dell XPS12 drivers/input/mouse/cypress_ps2.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index 37d4bea..45b3eda 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) cytp->fw_version = param[2] & FW_VERSION_MASX; cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0; + /* + * Trackpad fw_version 11 (in Dell XPS12) yields a bogus response to + * CYTP_CMD_READ_TP_METRICS so do not try to use it. LP: #1103594. + */ + if (cytp->fw_version >= 11) + cytp->tp_metrics_supported = 0; + psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n", cytp->tp_metrics_supported); @@ -258,6 +265,9 @@ static int cypress_read_tp_metrics(struct psmouse *psmouse) cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; + if (!cytp->tp_metrics_supported) + return 0; + memset(param, 0, sizeof(param)); if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_TP_METRICS, param) == 0) { /* Update trackpad parameters. */ @@ -315,18 +325,15 @@ static int cypress_read_tp_metrics(struct psmouse *psmouse) static int cypress_query_hardware(struct psmouse *psmouse) { - struct cytp_data *cytp = psmouse->private; int ret; ret = cypress_read_fw_version(psmouse); if (ret) return ret; - if (cytp->tp_metrics_supported) { - ret = cypress_read_tp_metrics(psmouse); - if (ret) - return ret; - } + ret = cypress_read_tp_metrics(psmouse); + if (ret) + return ret; return 0; }