Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 26dd6a5

Browse files
khfengJiri Kosina
authored andcommitted
HID: i2c-hid: Skip SET_POWER SLEEP for Cirque touchpad on system suspend
There's a Cirque touchpad that wakes system up without anything touched the touchpad. The input report is empty when this happens. The reason is stated in HID over I2C spec, 7.2.8.2: "If the DEVICE wishes to wake the HOST from its low power state, it can issue a wake by asserting the interrupt." This is fine if OS can put system back to suspend by identifying input wakeup count stays the same on resume, like Chrome OS Dark Resume [0]. But for regular distro such policy is lacking. Though the change doesn't bring any impact on power consumption for touchpad is minimal, other i2c-hid device may depends on SLEEP control power. So use a quirk to limit the change scope. [0] https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/power_manager/docs/dark_resume.md Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b6eda11 commit 26dd6a5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

drivers/hid/hid-ids.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@
298298

299299
#define USB_VENDOR_ID_CIDC 0x1677
300300

301+
#define I2C_VENDOR_ID_CIRQUE 0x0488
302+
#define I2C_PRODUCT_ID_CIRQUE_1063 0x1063
303+
301304
#define USB_VENDOR_ID_CJTOUCH 0x24b8
302305
#define USB_DEVICE_ID_CJTOUCH_MULTI_TOUCH_0020 0x0020
303306
#define USB_DEVICE_ID_CJTOUCH_MULTI_TOUCH_0040 0x0040

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#define I2C_HID_QUIRK_RESET_ON_RESUME BIT(2)
5050
#define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(3)
5151
#define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(4)
52+
#define I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND BIT(5)
5253

5354
/* Command opcodes */
5455
#define I2C_HID_OPCODE_RESET 0x01
@@ -131,6 +132,8 @@ static const struct i2c_hid_quirks {
131132
I2C_HID_QUIRK_RESET_ON_RESUME },
132133
{ USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720,
133134
I2C_HID_QUIRK_BAD_INPUT_SIZE },
135+
{ I2C_VENDOR_ID_CIRQUE, I2C_PRODUCT_ID_CIRQUE_1063,
136+
I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND },
134137
/*
135138
* Sending the wakeup after reset actually break ELAN touchscreen controller
136139
*/
@@ -956,7 +959,8 @@ static int i2c_hid_core_suspend(struct i2c_hid *ihid, bool force_poweroff)
956959
return ret;
957960

958961
/* Save some power */
959-
i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP);
962+
if (!(ihid->quirks & I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND))
963+
i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP);
960964

961965
disable_irq(client->irq);
962966

0 commit comments

Comments
 (0)