summary refs log tree commit diff
path: root/drivers/hid/hid-uclogic-params.h
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2019-02-10 12:14:03 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-02-21 12:00:54 +0100
commitfde44ac556359b0fd56e11b889686377392b7407 (patch)
tree57cee5ed3a302ee5d1996b8278da900a3ef573fe /drivers/hid/hid-uclogic-params.h
parent08367be171b0b7d6ff030a351a58d34f77803685 (diff)
downloadlinux-fde44ac556359b0fd56e11b889686377392b7407.tar.gz
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-params.h')
-rw-r--r--drivers/hid/hid-uclogic-params.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h
index 1060f70d647d..4ba6ecc2b8b8 100644
--- a/drivers/hid/hid-uclogic-params.h
+++ b/drivers/hid/hid-uclogic-params.h
@@ -87,6 +87,13 @@ struct uclogic_params_frame {
 	 * Report ID, if reports should be tweaked, zero if not.
 	 */
 	unsigned int id;
+	/*
+	 * Offset of the Wacom-style device ID byte in the report, to be set
+	 * to pad device ID (0xf), for compatibility with Wacom drivers. Zero
+	 * if no changes to the report should be made. Only valid if "id" is
+	 * not zero.
+	 */
+	unsigned int dev_id_byte;
 };
 
 /*
@@ -161,6 +168,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
 		".frame.desc_ptr = %p\n"            \
 		".frame.desc_size = %u\n"           \
 		".frame.id = %u\n"                  \
+		".frame.dev_id_byte = %u\n"         \
 		".pen_frame_flag = 0x%02x\n"
 
 /* Tablet interface parameters *printf format arguments */
@@ -177,6 +185,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
 		(_params)->frame.desc_ptr,                                  \
 		(_params)->frame.desc_size,                                 \
 		(_params)->frame.id,                                        \
+		(_params)->frame.dev_id_byte,                               \
 		(_params)->pen_frame_flag
 
 /* Get a replacement report descriptor for a tablet's interface. */