linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: elan_i2c - +200 ms delay before setting to ABS mode
@ 2016-06-07 13:34 Chris Chiu
  2016-06-20 17:42 ` Dmitry Torokhov
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Chiu @ 2016-06-07 13:34 UTC (permalink / raw)
  To: Dmitry Torokhov, duson, Charlie Mooney, Michele Curti,
	Krzysztof Kozlowski, Benson Leung, linux-input, linux-kernel
  Cc: linux, Chris Chiu

When performing a warm reboot from a system which does not correctly
support ELAN I2C touchpads, the touchpad will sometimes enter standard
mouse mode, cursor then never respond to touchpad event, and making the
driver discard the HID reports and flood dmesg with following error
messages.
"elan_i2c i2c-ELAN1000:00: invalid report id data (1)"

This change is from ELAN's correction. It needs 200ms delay before
set_mode() so that the mode setting will correctly take effect.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
---
 drivers/input/mouse/elan_i2c_core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 2f58985..95080f9 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -210,18 +210,20 @@ static int __elan_initialize(struct elan_tp_data *data)
 		return error;
 	}
 
-	data->mode |= ETP_ENABLE_ABS;
-	error = data->ops->set_mode(client, data->mode);
+	error = data->ops->sleep_control(client, false);
 	if (error) {
 		dev_err(&client->dev,
-			"failed to switch to absolute mode: %d\n", error);
+			"failed to wake device up: %d\n", error);
 		return error;
 	}
 
-	error = data->ops->sleep_control(client, false);
+	msleep(200);
+
+	data->mode |= ETP_ENABLE_ABS;
+	error = data->ops->set_mode(client, data->mode);
 	if (error) {
 		dev_err(&client->dev,
-			"failed to wake device up: %d\n", error);
+			"failed to switch to absolute mode: %d\n", error);
 		return error;
 	}
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-28  1:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 13:34 [PATCH] Input: elan_i2c - +200 ms delay before setting to ABS mode Chris Chiu
2016-06-20 17:42 ` Dmitry Torokhov
2016-06-21  1:31   ` 廖崇榮
2016-06-21 12:40   ` 廖崇榮
2016-06-21 14:42     ` Daniel Drake
2016-06-22 12:00       ` 廖崇榮
2016-06-28  1:41       ` 廖崇榮

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).