summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-core.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2019-02-10 13:14:03 +0300
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-02-21 14:00:54 +0300
commitfde44ac556359b0fd56e11b889686377392b7407 (patch)
tree57cee5ed3a302ee5d1996b8278da900a3ef573fe /drivers/hid/hid-uclogic-core.c
parent08367be171b0b7d6ff030a351a58d34f77803685 (diff)
downloadlinux-fde44ac556359b0fd56e11b889686377392b7407.tar.xz
HID: uclogic: Support faking Wacom pad device ID
Add support for inserting a Wacom pad device ID into hid-uclogic reports. This allows reporting dial inputs in a way compatible with the Wacom driver. Needed for Ugee G5 support in particular. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/hid-uclogic-core.c')
-rw-r--r--drivers/hid/hid-uclogic-core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index e4324ad86e58..f5fb612daa1e 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -300,6 +300,16 @@ static int uclogic_raw_event(struct hid_device *hdev,
}
}
+ /* Tweak frame control reports, if necessary */
+ if ((report->type == HID_INPUT_REPORT) &&
+ (report->id == params->frame.id)) {
+ /* If need to, and can, set pad device ID for Wacom drivers */
+ if (params->frame.dev_id_byte > 0 &&
+ params->frame.dev_id_byte < size) {
+ data[params->frame.dev_id_byte] = 0xf;
+ }
+ }
+
return 0;
}