Skip to content

Commit fd70466

Browse files
khfengJiri Kosina
authored andcommitted
HID: i2c-hid: Reset ALPS touchpads on resume
Commit 52cf93e ("HID: i2c-hid: Don't reset device upon system resume") fixes many touchpads and touchscreens, however ALPS touchpads start to trigger IRQ storm after system resume. Since it's total silence from ALPS, let's bring the old behavior back to ALPS touchpads. Fixes: 52cf93e ("HID: i2c-hid: Don't reset device upon system resume") Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 0c84322 commit fd70466

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
4949
#define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
5050
#define I2C_HID_QUIRK_BOGUS_IRQ BIT(4)
51+
#define I2C_HID_QUIRK_RESET_ON_RESUME BIT(5)
5152

5253
/* flags */
5354
#define I2C_HID_STARTED 0
@@ -174,6 +175,8 @@ static const struct i2c_hid_quirks {
174175
I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
175176
{ USB_VENDOR_ID_ELAN, HID_ANY_ID,
176177
I2C_HID_QUIRK_BOGUS_IRQ },
178+
{ USB_VENDOR_ID_ALPS_JP, HID_ANY_ID,
179+
I2C_HID_QUIRK_RESET_ON_RESUME },
177180
{ 0, 0 }
178181
};
179182

@@ -1214,8 +1217,15 @@ static int i2c_hid_resume(struct device *dev)
12141217
* solves "incomplete reports" on Raydium devices 2386:3118 and
12151218
* 2386:4B33 and fixes various SIS touchscreens no longer sending
12161219
* data after a suspend/resume.
1220+
*
1221+
* However some ALPS touchpads generate IRQ storm without reset, so
1222+
* let's still reset them here.
12171223
*/
1218-
ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
1224+
if (ihid->quirks & I2C_HID_QUIRK_RESET_ON_RESUME)
1225+
ret = i2c_hid_hwreset(client);
1226+
else
1227+
ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
1228+
12191229
if (ret)
12201230
return ret;
12211231

0 commit comments

Comments
 (0)