Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215999 > unrolled thread

[PATCH] Input: elan_i2c - Recovery exception ic type

Started byduson <dusonlin@emc.com.tw>
First post2015-08-31 03:50 +0200
Last post2015-08-31 03:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] Input: elan_i2c - Recovery exception ic type duson <dusonlin@emc.com.tw> - 2015-08-31 03:50 +0200

#1215999 — [PATCH] Input: elan_i2c - Recovery exception ic type

Fromduson <dusonlin@emc.com.tw>
Date2015-08-31 03:50 +0200
Subject[PATCH] Input: elan_i2c - Recovery exception ic type
Message-ID<q3moq-1wF-17@gated-at.bofh.it>
When driver get exception ic type (0xFF), maybe occurred from wrong
I2C protocol communication, system crash or other unknown situation,
we need to reset ic type from iap_version.
---
 drivers/input/mouse/elan_i2c_core.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 5b5f403..39d9929 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -4,7 +4,7 @@
  * Copyright (c) 2013 ELAN Microelectronics Corp.
  *
  * Author: 林政維 (Duson Lin) <dusonlin@emc.com.tw>
- * Version: 1.5.9
+ * Version: 1.6.0
  *
  * Based on cyapa driver:
  * copyright (c) 2011-2012 Cypress Semiconductor, Inc.
@@ -40,7 +40,7 @@
 #include "elan_i2c.h"
 
 #define DRIVER_NAME		"elan_i2c"
-#define ELAN_DRIVER_VERSION	"1.5.9"
+#define ELAN_DRIVER_VERSION	"1.6.0"
 #define ETP_MAX_PRESSURE	255
 #define ETP_FWIDTH_REDUCE	90
 #define ETP_FINGER_WIDTH	15
@@ -247,15 +247,19 @@ static int elan_query_device_info(struct elan_tp_data *data)
 	if (error)
 		return error;
 
-	error = data->ops->get_sm_version(data->client, &data->ic_type,
-					  &data->sm_version);
+	error = data->ops->get_version(data->client, true, &data->iap_version);
 	if (error)
 		return error;
 
-	error = data->ops->get_version(data->client, true, &data->iap_version);
+	error = data->ops->get_sm_version(data->client, &data->ic_type,
+					  &data->sm_version);
 	if (error)
 		return error;
 
+	/* exception type, need reset from iap_version */
+	if (data->ic_type == 0xFF)
+		data->ic_type = data->iap_version;
+
 	error = data->ops->get_pressure_adjustment(data->client,
 						   &data->pressure_adjustment);
 	if (error)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web