HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses
authorHans de Goede <hdegoede@redhat.com>
Mon, 19 Oct 2020 07:48:14 +0000 (09:48 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 22 Oct 2020 11:42:34 +0000 (13:42 +0200)
commit3c785a06dee99501a17f8e8cf29b2b7e3f1e94ea
treea40ffcd211f2aac5f60dcb349e99d815a366f221
parentb59f38dbfd5d19eb7e03d8b639f0c0d385ba8cc5
HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses

The usb-hid keyboard-dock for the Acer Switch 10 SW5-012 model declares
an application and hid-usage page of 0x0088 for the INPUT(4) report which
it sends. This reports contains 2 8-bit fields which are declared as
HID_MAIN_ITEM_VARIABLE.

The keyboard-touchpad combo never actually generates this report, except
when the touchpad is toggled on/off with the Fn + F7 hotkey combo. The
toggle on/off is handled inside the keyboard-dock, when the touchpad is
toggled off it simply stops sending events.

When the touchpad is toggled on/off an INPUT(4) report is generated with
the first content byte set to 120/121, before this commit the kernel
would report this as ABS_MISC 120/121 events.

Patch the descriptor to replace the HID_MAIN_ITEM_VARIABLE with
HID_MAIN_ITEM_RELATIVE (because no key-presss release events are send)
and add mappings for the 0x00880078 and 0x00880079 usages to generate
touchpad on/off key events when the touchpad is toggled on/off.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-ite.c