Skip to content

Commit 293c485

Browse files
PolyMeilexJiri Kosina
authored andcommitted
HID: i2c-hid: Delayed i2c resume wakeup for 0x0d42 Goodix touchpad
Patch for Goodix 27c6:0d42 touchpads found in Inspiron 5515 laptops. After resume from suspend, one can communicate with this device just fine. We can read data from it or request a reset, but for some reason the interrupt line will not go up when new events are available. (it can correctly respond to a reset with an interrupt tho) The only way I found to wake this device up is to send anything to it after ~1.5s mark, for example a simple read request, or power mode change. In this patch, I simply delay the resume steps with msleep, this will cause the set_power request to happen after the ~1.5s barrier causing the device to resume its event interrupts. Sleep was used rather than delayed_work to make this workaround as non-invasive as possible. [[email protected]: shortlog update] Signed-off-by: Bartłomiej Maryńczak <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 2934b12 commit 293c485

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/hid/hid-ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@
509509
#define I2C_DEVICE_ID_GOODIX_01E8 0x01e8
510510
#define I2C_DEVICE_ID_GOODIX_01E9 0x01e9
511511
#define I2C_DEVICE_ID_GOODIX_01F0 0x01f0
512+
#define I2C_DEVICE_ID_GOODIX_0D42 0x0d42
512513

513514
#define USB_VENDOR_ID_GOODTOUCH 0x1aad
514515
#define USB_DEVICE_ID_GOODTOUCH_000f 0x000f

drivers/hid/i2c-hid/i2c-hid-core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(3)
5151
#define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(4)
5252
#define I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND BIT(5)
53+
#define I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME BIT(6)
5354

5455
/* Command opcodes */
5556
#define I2C_HID_OPCODE_RESET 0x01
@@ -140,6 +141,8 @@ static const struct i2c_hid_quirks {
140141
{ USB_VENDOR_ID_ELAN, HID_ANY_ID,
141142
I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET |
142143
I2C_HID_QUIRK_BOGUS_IRQ },
144+
{ I2C_VENDOR_ID_GOODIX, I2C_DEVICE_ID_GOODIX_0D42,
145+
I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME },
143146
{ 0, 0 }
144147
};
145148

@@ -981,6 +984,13 @@ static int i2c_hid_core_resume(struct i2c_hid *ihid)
981984
return -ENXIO;
982985
}
983986

987+
/* On Goodix 27c6:0d42 wait extra time before device wakeup.
988+
* It's not clear why but if we send wakeup too early, the device will
989+
* never trigger input interrupts.
990+
*/
991+
if (ihid->quirks & I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME)
992+
msleep(1500);
993+
984994
/* Instead of resetting device, simply powers the device on. This
985995
* solves "incomplete reports" on Raydium devices 2386:3118 and
986996
* 2386:4B33 and fixes various SIS touchscreens no longer sending

0 commit comments

Comments
 (0)