[D/E/OEM-OSP1-B] [PATCH 2/2] HID: i2c-hid: Send power-on command after reset

Kai-Heng Feng kai.heng.feng at canonical.com
Mon Nov 25 14:33:34 UTC 2019

From: Hans de Goede <hdegoede at redhat.com>

BugLink: https://bugs.launchpad.net/bugs/1853842

Before commit 67b18dfb8cfc ("HID: i2c-hid: Remove runtime power
management"), any i2c-hid touchscreens would typically be runtime-suspended
between the driver loading and Xorg or a Wayland compositor opening it,
causing it to be resumed again. This means that before this change,
we would call i2c_hid_set_power(OFF), i2c_hid_set_power(ON) before the
graphical session would start listening to the touchscreen.

It turns out that at least some SIS touchscreens, such as the one found
on the Asus T100HA, need a power-on command after reset, otherwise they
will not send any events.

Fixes: 67b18dfb8cfc ("HID: i2c-hid: Remove runtime power management")
Cc: Kai-Heng Feng <kai.heng.feng at canonical.com>
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
Signed-off-by: Jiri Kosina <jkosina at suse.cz>
(cherry picked from commit 43b7029f475e7497da1de1f4a1742241812bf266)
Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
 drivers/hid/i2c-hid/i2c-hid-core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index d75b8a803b5a..4009f665a230 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -449,8 +449,12 @@ static int i2c_hid_hwreset(struct i2c_client *client)
 	if (ret) {
 		dev_err(&client->dev, "failed to reset device.\n");
 		i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);
+		goto out_unlock;
+	/* At least some SIS devices need this after reset */
+	ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
 	return ret;

More information about the kernel-team mailing list