summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-core.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2022-02-19 13:01:51 +0300
committerJiri Kosina <jkosina@suse.cz>2022-03-01 17:28:14 +0300
commite6be956fd7e834428a940e23442c5d934c1c8835 (patch)
tree87a29c73d81314f114b741ebbbb8db18e561dac4 /drivers/hid/hid-uclogic-core.c
parent8b013098be2c91ea5e15225c8b39ace08fdd7448 (diff)
downloadlinux-e6be956fd7e834428a940e23442c5d934c1c8835.tar.xz
HID: uclogic: Switch to matching subreport bytes
Switch from matching UC-Logic subreport with a mask to a full value to support detecting Huion HS610 touch dial reports. Those would match the button mask otherwise. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-uclogic-core.c')
-rw-r--r--drivers/hid/hid-uclogic-core.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index 7092f86517a5..a02edeb30a35 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -365,9 +365,12 @@ static int uclogic_raw_event(struct hid_device *hdev,
ARRAY_SIZE(params->pen.subreport_list);
/* Try to match a subreport */
for (subreport = params->pen.subreport_list;
- subreport < subreport_list_end &&
- (data[1] & subreport->mask) != subreport->mask;
- subreport++);
+ subreport < subreport_list_end; subreport++) {
+ if (subreport->value != 0 &&
+ subreport->value == data[1]) {
+ break;
+ }
+ }
/* If a subreport matched */
if (subreport < subreport_list_end) {
/* Change to subreport ID, and restart */