aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-11-07 07:28:00 -0500
committerJiri Kosina <jkosina@suse.cz>2017-11-09 06:51:24 -0500
commit402946a8ef71ebfd1cbb19829db2da62906f0519 (patch)
tree838d60cdfed9990a41789fca113d4830edcd8c8e
parentcde3076bdc38bf436e517a379759a9092c6ffd4f (diff)
HID: i2c-hid: Add no-irq-after-reset quirk for 0911:5288 device
Several cheap Apollo Lake based laptops / 2-in-1s use an i2c-hid mt touchpad which is advertised by the DSDT with an ACPI HID of "SYNA3602", this touchpad can be found on e.g. the Cube Thinker and the EZBook 3 Pro. On my "T-bao Tbook air" the i2c-hid driver fails to bind to this touchpad: "i2c_hid i2c-SYNA3602:00: failed to reset device.". After some debuging this it seems that this touchpad simply never sends an interrupt after a reset as expected by the i2c hid driver. This commit adds a quirk for this device, making i2c_hid_command sleep 100ms after a reset instead of waiting for an irq, fixing i2c-hid failing to bind to this touchpad. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-ids.h3
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index b397a14ab970..bb8e54fbbc21 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -507,6 +507,9 @@
507#define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003 507#define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003
508#define USB_DEVICE_ID_GYRATION_REMOTE_3 0x0008 508#define USB_DEVICE_ID_GYRATION_REMOTE_3 0x0008
509 509
510#define I2C_VENDOR_ID_HANTICK 0x0911
511#define I2C_PRODUCT_ID_HANTICK_5288 0x5288
512
510#define USB_VENDOR_ID_HANWANG 0x0b57 513#define USB_VENDOR_ID_HANWANG 0x0b57
511#define USB_DEVICE_ID_HANWANG_TABLET_FIRST 0x5000 514#define USB_DEVICE_ID_HANWANG_TABLET_FIRST 0x5000
512#define USB_DEVICE_ID_HANWANG_TABLET_LAST 0x8fff 515#define USB_DEVICE_ID_HANWANG_TABLET_LAST 0x8fff
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 77396145d2d0..3e0652b6f657 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -46,6 +46,7 @@
46 46
47/* quirks to control the device */ 47/* quirks to control the device */
48#define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0) 48#define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
49#define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
49 50
50/* flags */ 51/* flags */
51#define I2C_HID_STARTED 0 52#define I2C_HID_STARTED 0
@@ -168,6 +169,8 @@ static const struct i2c_hid_quirks {
168 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV }, 169 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
169 { USB_VENDOR_ID_WEIDA, USB_DEVICE_ID_WEIDA_8755, 170 { USB_VENDOR_ID_WEIDA, USB_DEVICE_ID_WEIDA_8755,
170 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV }, 171 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
172 { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
173 I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
171 { 0, 0 } 174 { 0, 0 }
172}; 175};
173 176
@@ -252,7 +255,9 @@ static int __i2c_hid_command(struct i2c_client *client,
252 255
253 ret = 0; 256 ret = 0;
254 257
255 if (wait) { 258 if (wait && (ihid->quirks & I2C_HID_QUIRK_NO_IRQ_AFTER_RESET)) {
259 msleep(100);
260 } else if (wait) {
256 i2c_hid_dbg(ihid, "%s: waiting...\n", __func__); 261 i2c_hid_dbg(ihid, "%s: waiting...\n", __func__);
257 if (!wait_event_timeout(ihid->wait, 262 if (!wait_event_timeout(ihid->wait,
258 !test_bit(I2C_HID_RESET_PENDING, &ihid->flags), 263 !test_bit(I2C_HID_RESET_PENDING, &ihid->flags),