diff mbox

[Raring,pull-request] fix Cypress PS/2 for Dell XPS12

Message ID 1361472665.3827.41.camel@fourier
State New
Headers show

Pull-request

git://kernel.ubuntu.com/kamal/ubuntu-raring.git cypress-xps12

Commit Message

Kamal Mostafa Feb. 21, 2013, 6:51 p.m. UTC
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(-)

Comments

Tim Gardner Feb. 21, 2013, 7:39 p.m. UTC | #1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512


- -- 
Tim Gardner tim.gardner@canonical.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBCgAGBQJRJnf6AAoJED12yEX6FEfK2XQQAIMOW5tVOHNUfoDQNBfE6agu
Z6fx1G3PNIe/Jb6Cgci7Yczz6srJ2MQnUMgR0H4UfC5cv4lW8deKEkxItAoN+nYo
gGa+6xa3k5/3K6c8/dYKYqYj3wwPL0qgoY7utY/1jZ74c+IMOK+eQK7vASk0QRQ5
1q71wjFesNlaUUZn+gEXN4sYSO41UMQ/LBMBiAO6g7EofYwtmnlI2knxumIzHS3Z
7YRbowQEEUm4ol3Kl1LnZmZcLudwVVxJVc7SWMsgAb3GBuznNfQZCVMPkn26iyLs
CRY2nPujE/YPByxNXznLT/1hsH59MEAyflOJ/e/1oqm9ZViz5wiiFwsnPD1MkfYQ
WLINBxjaXlY6BfIsFyY1CdFhwGmITcUfq28OL5QBlxPv85o1PO6kPuWJT81lsVCN
TYCo/6lAuwQX1/GrnxELuEPi8v2/swCzyD+G25XrfZ6JSIzubB/u2I2F821vVnWT
KoOBmk/Y8Ysk14ek0ZyacjwljF0sRGw9WapyjnnKQXDEWpF9jbkVZQ1UtyLMd9jS
1W3B57JX1K824BYsall7WA1CleCRbPqXNbTuWDT7Gn9AVQ7y7fnKTTqQXCRZm80V
pQMvu8L1y9EQA90ffQ/C632OWd/BHmAULcZb3b3X3XXA//CwZBPZnmBdpPXoacyP
O44Mg/S4vsuQNQKoLopI
=BHGy
-----END PGP SIGNATURE-----
diff mbox

Patch

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;
 }