summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-params.h
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-params.h
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-params.h')
-rw-r--r--drivers/hid/hid-uclogic-params.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h
index ba48b1c7a0e5..e8381bb77bd0 100644
--- a/drivers/hid/hid-uclogic-params.h
+++ b/drivers/hid/hid-uclogic-params.h
@@ -62,6 +62,12 @@ struct uclogic_params_pen {
* Only valid if "id" is not zero.
*/
bool fragmented_hires;
+ /*
+ * True if the pen reports tilt in bytes at offset 10 (X) and 11 (Y),
+ * and the Y tilt direction is flipped.
+ * Only valid if "id" is not zero.
+ */
+ bool tilt_y_flipped;
};
/*
@@ -171,6 +177,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
".pen.id = %u\n" \
".pen.inrange = %s\n" \
".pen.fragmented_hires = %s\n" \
+ ".pen.tilt_y_flipped = %s\n" \
".frame.desc_ptr = %p\n" \
".frame.desc_size = %u\n" \
".frame.id = %u\n" \
@@ -189,6 +196,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
(_params)->pen.id, \
uclogic_params_pen_inrange_to_str((_params)->pen.inrange), \
((_params)->pen.fragmented_hires ? "true" : "false"), \
+ ((_params)->pen.tilt_y_flipped ? "true" : "false"), \
(_params)->frame.desc_ptr, \
(_params)->frame.desc_size, \
(_params)->frame.id, \