Skip to content

Commit 3e83eda

Browse files
pyma1Jiri Kosina
authored andcommitted
HID: i2c-hid: Fix resume issue on Raydium touchscreen device
When Rayd touchscreen resumed from S3, it issues too many errors like: i2c_hid i2c-RAYD0001:00: i2c_hid_get_input: incomplete report (58/5442) And all the report data are corrupted, touchscreen is unresponsive. Fix this by re-sending report description command after resume. Add device ID as a quirk. Cc: [email protected] Signed-off-by: Aaron Ma <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 619d3a2 commit 3e83eda

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/hid/hid-ids.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,9 @@
525525
#define I2C_VENDOR_ID_HANTICK 0x0911
526526
#define I2C_PRODUCT_ID_HANTICK_5288 0x5288
527527

528+
#define I2C_VENDOR_ID_RAYD 0x2386
529+
#define I2C_PRODUCT_ID_RAYD_3118 0x3118
530+
528531
#define USB_VENDOR_ID_HANWANG 0x0b57
529532
#define USB_DEVICE_ID_HANWANG_TABLET_FIRST 0x5000
530533
#define USB_DEVICE_ID_HANWANG_TABLET_LAST 0x8fff

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
/* quirks to control the device */
4848
#define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
4949
#define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
50+
#define I2C_HID_QUIRK_RESEND_REPORT_DESCR BIT(2)
5051

5152
/* flags */
5253
#define I2C_HID_STARTED 0
@@ -171,6 +172,8 @@ static const struct i2c_hid_quirks {
171172
I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
172173
{ I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
173174
I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
175+
{ I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_3118,
176+
I2C_HID_QUIRK_RESEND_REPORT_DESCR },
174177
{ 0, 0 }
175178
};
176179

@@ -1220,6 +1223,16 @@ static int i2c_hid_resume(struct device *dev)
12201223
if (ret)
12211224
return ret;
12221225

1226+
/* RAYDIUM device (2386:3118) need to re-send report descr cmd
1227+
* after resume, after this it will be back normal.
1228+
* otherwise it issues too many incomplete reports.
1229+
*/
1230+
if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) {
1231+
ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0);
1232+
if (!ret)
1233+
return ret;
1234+
}
1235+
12231236
if (hid->driver && hid->driver->reset_resume) {
12241237
ret = hid->driver->reset_resume(hid);
12251238
return ret;

0 commit comments

Comments
 (0)