summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-core.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2022-02-10 20:04:31 +0100
committerJiri Kosina <jkosina@suse.cz>2022-02-16 16:41:54 +0100
commit1324c5ac76bf7dccdac0fb128d0a675e1ee21b39 (patch)
treee6eab2eef7135da1d41da3f6b6d95580cc385728 /drivers/hid/hid-uclogic-core.c
parenta254a9da455c171441ab3a76ed8f5d1e9412e15f (diff)
HID: uclogic: Support Huion tilt reporting
Add support for Huion v2 protocol tilt reporting. Describe reports as angles in degrees, which is not exactly true, but there doesn't seem to be a straightforward, consistent conversion possible, and what's reported would have to be enough. 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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index d8ab0139e5cd..823704bc02ef 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -304,6 +304,9 @@ static int uclogic_raw_event(struct hid_device *hdev,
mod_timer(&drvdata->inrange_timer,
jiffies + msecs_to_jiffies(100));
}
+ /* If we report tilt and Y direction is flipped */
+ if (size >= 12 && params->pen.tilt_y_flipped)
+ data[11] = -data[11];
}
/* Tweak frame control reports, if necessary */