]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
HID: uclogic: Handle wireless device reconnection
authorJosé Expósito <jose.exposito89@gmail.com>
Mon, 26 Dec 2022 12:54:52 +0000 (13:54 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 18 Jan 2023 08:44:57 +0000 (09:44 +0100)
commita251d6576d2a29fc0806ef4775719e3b6e672d91
treedc01207f77f9300469c0ca9f7e8916a3e7bfd178
parentbd85c131b2e3edf2cf1a498652e8c3a066a338e7
HID: uclogic: Handle wireless device reconnection

UGEEv2 tablets with battery can be connected using a USB cable or a USB
Bluetooth dongle.

When the Bluetooth dongle is used, the connection to that tablet can be
lost because the tablet is out of the range of the receiver or because
it was switched off using the switch placed in the back of the tablet's
frame.

After losing connection, the tablet is able to reconnect automatically
and its firmware sends a special packet indicating that the device was
reconnected. In response to this packet, the tablet needs to receive the
same array of magic data it expects on probe to enable its interfaces.

This patch implements a generic mechanism to hook raw events and
schedule a work to perform any custom action.

Tested-by: Mia Kanashi <chad@redpilled.dev>
Tested-by: Andreas Grosse <andig.mail@t-online.de>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-uclogic-core-test.c [new file with mode: 0644]
drivers/hid/hid-uclogic-core.c
drivers/hid/hid-uclogic-params-test.c
drivers/hid/hid-uclogic-params.c
drivers/hid/hid-uclogic-params.h