diff options
author | Aleksandrs Vinarskis <alex.vinarskis@gmail.com> | 2024-10-31 08:31:41 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.com> | 2024-12-11 15:05:46 +0100 |
commit | e61080220ae7b52920aed292c8d399ea8ce7cfdb (patch) | |
tree | 68500c87946c5a225b472252d214b7e45cf8d33f | |
parent | 50a78409a2157c0340572beecab86e2b263fe2a2 (diff) |
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 <alex.vinarskis@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid-core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 4e87380d3edd..c1c2ef9a9d68 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -51,6 +51,7 @@ #define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(4) #define I2C_HID_QUIRK_NO_SLEEP_ON_SUSPEND BIT(5) #define I2C_HID_QUIRK_DELAY_WAKEUP_AFTER_RESUME BIT(6) +#define I2C_HID_QUIRK_RE_POWER_ON BIT(7) /* Command opcodes */ #define I2C_HID_OPCODE_RESET 0x01 @@ -1073,7 +1074,11 @@ static int i2c_hid_core_register_hid(struct i2c_hid *ihid) return ret; } - return 0; + /* At least some QTEC devices need this after initialization */ + if (ihid->quirks & I2C_HID_QUIRK_RE_POWER_ON) + ret = i2c_hid_set_power(ihid, I2C_HID_PWR_ON); + + return ret; } static int i2c_hid_core_probe_panel_follower(struct i2c_hid *ihid) |