Skip to content

Commit e610802

Browse files
alexVinarskisJiri Kosina
authored andcommitted
HID: i2c-hid: introduce re-power-on quirk
It appears some keyboards from vendor 'QTEC' will not work properly until suspend & resume. Empirically narrowed down to solution of re-sending power on command _after_ initialization was completed before the end of initial probing. Signed-off-by: Aleksandrs Vinarskis <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 50a7840 commit e610802

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(4)
5252
#define I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND BIT(5)
5353
#define I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME BIT(6)
54+
#define I2C_HID_QUIRK_RE_POWER_ON BIT(7)
5455

5556
/* Command opcodes */
5657
#define I2C_HID_OPCODE_RESET 0x01
@@ -1073,7 +1074,11 @@ static int i2c_hid_core_register_hid(struct i2c_hid *ihid)
10731074
return ret;
10741075
}
10751076

1076-
return 0;
1077+
/* At least some QTEC devices need this after initialization */
1078+
if (ihid->quirks & I2C_HID_QUIRK_RE_POWER_ON)
1079+
ret = i2c_hid_set_power(ihid, I2C_HID_PWR_ON);
1080+
1081+
return ret;
10771082
}
10781083

10791084
static int i2c_hid_core_probe_panel_follower(struct i2c_hid *ihid)

0 commit comments

Comments
 (0)