aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/hid/hid-uclogic-params.h
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2019-02-10 12:14:04 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-02-21 12:00:54 +0100
commit8a47670c35e2a8e70753eabd96d4f8d8b3c0eeba (patch)
tree04f2534d1aa1d1eb94a1e6fedfae0995055591f5 /drivers/hid/hid-uclogic-params.h
parentHID: uclogic: Support faking Wacom pad device ID (diff)
downloadwireguard-linux-8a47670c35e2a8e70753eabd96d4f8d8b3c0eeba.tar.xz
wireguard-linux-8a47670c35e2a8e70753eabd96d4f8d8b3c0eeba.zip
HID: uclogic: Support Gray-coded rotary encoders
Add support for converting Gray-coded rotary encoder input into dial input compatible with HID standard. Needed for Ugee G5 support. 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.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 4ba6ecc2b8b8..ba48b1c7a0e5 100644
--- a/drivers/hid/hid-uclogic-params.h
+++ b/drivers/hid/hid-uclogic-params.h
@@ -88,6 +88,12 @@ struct uclogic_params_frame {
*/
unsigned int id;
/*
+ * Number of the least-significant bit of the 2-bit state of a rotary
+ * encoder, in the report. Cannot point to a 2-bit field crossing a
+ * byte boundary. Zero if not present. Only valid if "id" is not zero.
+ */
+ unsigned int re_lsb;
+ /*
* 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
@@ -168,6 +174,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.re_lsb = %u\n" \
".frame.dev_id_byte = %u\n" \
".pen_frame_flag = 0x%02x\n"
@@ -185,6 +192,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
(_params)->frame.desc_ptr, \
(_params)->frame.desc_size, \
(_params)->frame.id, \
+ (_params)->frame.re_lsb, \
(_params)->frame.dev_id_byte, \
(_params)->pen_frame_flag