Skip to contentSkip to conversation

DIGImend patches, part IV

PATCH In review José Expósito 2 participants 6 messages Apr 14, 2022 – Apr 21, 2022 HID

lore
Share & tools
lore
#0 lore raw

cover DIGImend patches, part IV

Hi everyone,

This series is a follow up to [1], [2] and [3] and upstreams 4 more patches authored by Nikolai from the DIGImend project.

Patches 1 and 2 are simple code clean up.

Patch 3 adds support for "bitmap dials". This kind of dials send 01 and 10 binary values rather than the usual 1 and -1.

The last patch adds support for the Huion Q620M drawing tablet, which has a bitmap dial.

Thank you very much in advance to Jiří for his work reviewing all the patches I have sent so far,
José Expósito

[1] https://lore.kernel.org/linux-input/[email protected]/T/
[2] https://lore.kernel.org/linux-input/[email protected]/T/
[3] https://lore.kernel.org/linux-input/[email protected]/T/

Nikolai Kondrashov (4):
HID: uclogic: Compress params format string
HID: uclogic: Reduce indent for params format str/args
HID: uclogic: Add support for bitmap dials
HID: uclogic: Add support for Huion Q620M

 drivers/hid/hid-uclogic-core.c   |   6 +
 drivers/hid/hid-uclogic-params.c |  20 ++++
 drivers/hid/hid-uclogic-params.h | 187 ++++++++++++++++++-------------
 drivers/hid/hid-uclogic-rdesc.c  |  50 +++++++++
 drivers/hid/hid-uclogic-rdesc.h  |  10 ++
 5 files changed, 192 insertions(+), 81 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 HID: uclogic: Compress params format string

From: Nikolai Kondrashov <[email protected]>

Shorten the format string for printing out UC-Logic interface parameters so that it fits into a single log message.

---
 drivers/hid/hid-uclogic-params.h | 90 ++++++++++++++++++--------------
 1 file changed, 51 insertions(+), 39 deletions(-)
drivers/hid/hid-uclogic-params.h +51 -39
index f2649e8f959d..ebf84b56746b 100644
@@ -203,45 +203,57 @@ extern int uclogic_params_init(struct uclogic_params *params,
 
 /* Tablet interface parameters *printf format string */
 #define UCLOGIC_PARAMS_FMT_STR \
-		".invalid = %s\n"                               \
-		".desc_ptr = %p\n"                              \
-		".desc_size = %u\n"                             \
-		".pen.desc_ptr = %p\n"                          \
-		".pen.desc_size = %u\n"                         \
-		".pen.id = %u\n"                                \
-		".pen.subreport_list[0] = {0x%02hhx, %hhu}\n"   \
-		".pen.subreport_list[1] = {0x%02hhx, %hhu}\n"   \
-		".pen.subreport_list[2] = {0x%02hhx, %hhu}\n"   \
-		".pen.inrange = %s\n"                           \
-		".pen.fragmented_hires = %s\n"                  \
-		".pen.tilt_y_flipped = %s\n"                    \
-		".frame_list[0].desc_ptr = %p\n"                \
-		".frame_list[0].desc_size = %u\n"               \
-		".frame_list[0].id = %u\n"                      \
-		".frame_list[0].suffix = %s\n"                  \
-		".frame_list[0].re_lsb = %u\n"                  \
-		".frame_list[0].dev_id_byte = %u\n"             \
-		".frame_list[0].touch_ring_byte = %u\n"         \
-		".frame_list[0].touch_ring_max = %hhd\n"        \
-		".frame_list[0].touch_ring_flip_at = %hhd\n"    \
-		".frame_list[1].desc_ptr = %p\n"                \
-		".frame_list[1].desc_size = %u\n"               \
-		".frame_list[1].id = %u\n"                      \
-		".frame_list[1].suffix = %s\n"                  \
-		".frame_list[1].re_lsb = %u\n"                  \
-		".frame_list[1].dev_id_byte = %u\n"             \
-		".frame_list[1].touch_ring_byte = %u\n"         \
-		".frame_list[1].touch_ring_max = %hhd\n"        \
-		".frame_list[1].touch_ring_flip_at = %hhd\n"    \
-		".frame_list[2].desc_ptr = %p\n"                \
-		".frame_list[2].desc_size = %u\n"               \
-		".frame_list[2].id = %u\n"                      \
-		".frame_list[2].suffix = %s\n"                  \
-		".frame_list[2].re_lsb = %u\n"                  \
-		".frame_list[2].dev_id_byte = %u\n"             \
-		".frame_list[2].touch_ring_byte = %u\n"         \
-		".frame_list[2].touch_ring_max = %hhd\n"        \
-		".frame_list[2].touch_ring_flip_at = %hhd\n"
+		".invalid = %s\n"                   \
+		".desc_ptr = %p\n"                  \
+		".desc_size = %u\n"                 \
+		".pen = {\n"                        \
+		"\t.desc_ptr = %p\n"                \
+		"\t.desc_size = %u\n"               \
+		"\t.id = %u\n"                      \
+		"\t.subreport_list = {\n"           \
+		"\t\t{0x%02hhx, %hhu},\n"           \
+		"\t\t{0x%02hhx, %hhu},\n"           \
+		"\t\t{0x%02hhx, %hhu},\n"           \
+		"\t}\n"                             \
+		"\t.inrange = %s\n"                 \
+		"\t.fragmented_hires = %s\n"        \
+		"\t.tilt_y_flipped = %s\n"          \
+		"}\n"                               \
+		".frame_list = {\n"                 \
+		"\t{\n"                             \
+		"\t\t.desc_ptr = %p\n"              \
+		"\t\t.desc_size = %u\n"             \
+		"\t\t.id = %u\n"                    \
+		"\t\t.suffix = %s\n"                \
+		"\t\t.re_lsb = %u\n"                \
+		"\t\t.dev_id_byte = %u\n"           \
+		"\t\t.touch_ring_byte = %u\n"       \
+		"\t\t.touch_ring_max = %hhd\n"      \
+		"\t\t.touch_ring_flip_at = %hhd\n"  \
+		"\t},\n"                            \
+		"\t{\n"                             \
+		"\t\t.desc_ptr = %p\n"              \
+		"\t\t.desc_size = %u\n"             \
+		"\t\t.id = %u\n"                    \
+		"\t\t.suffix = %s\n"                \
+		"\t\t.re_lsb = %u\n"                \
+		"\t\t.dev_id_byte = %u\n"           \
+		"\t\t.touch_ring_byte = %u\n"       \
+		"\t\t.touch_ring_max = %hhd\n"      \
+		"\t\t.touch_ring_flip_at = %hhd\n"  \
+		"\t},\n"                            \
+		"\t{\n"                             \
+		"\t\t.desc_ptr = %p\n"              \
+		"\t\t.desc_size = %u\n"             \
+		"\t\t.id = %u\n"                    \
+		"\t\t.suffix = %s\n"                \
+		"\t\t.re_lsb = %u\n"                \
+		"\t\t.dev_id_byte = %u\n"           \
+		"\t\t.touch_ring_byte = %u\n"       \
+		"\t\t.touch_ring_max = %hhd\n"      \
+		"\t\t.touch_ring_flip_at = %hhd\n"  \
+		"\t},\n"                            \
+		"}\n"
 
 /* Tablet interface parameters *printf format arguments */
 #define UCLOGIC_PARAMS_FMT_ARGS(_params) \
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/4 HID: uclogic: Reduce indent for params format str/args

In reply to José Expósito

From: Nikolai Kondrashov <[email protected]>

Improve legibility of UCLOGIC_PARAMS_FMT_STR/ARGS.

---
 drivers/hid/hid-uclogic-params.h | 186 +++++++++++++++----------------
 1 file changed, 93 insertions(+), 93 deletions(-)
drivers/hid/hid-uclogic-params.h +93 -93
index ebf84b56746b..78965e683d20 100644
@@ -203,102 +203,102 @@ extern int uclogic_params_init(struct uclogic_params *params,
 
 /* Tablet interface parameters *printf format string */
 #define UCLOGIC_PARAMS_FMT_STR \
-		".invalid = %s\n"                   \
-		".desc_ptr = %p\n"                  \
-		".desc_size = %u\n"                 \
-		".pen = {\n"                        \
-		"\t.desc_ptr = %p\n"                \
-		"\t.desc_size = %u\n"               \
-		"\t.id = %u\n"                      \
-		"\t.subreport_list = {\n"           \
-		"\t\t{0x%02hhx, %hhu},\n"           \
-		"\t\t{0x%02hhx, %hhu},\n"           \
-		"\t\t{0x%02hhx, %hhu},\n"           \
-		"\t}\n"                             \
-		"\t.inrange = %s\n"                 \
-		"\t.fragmented_hires = %s\n"        \
-		"\t.tilt_y_flipped = %s\n"          \
-		"}\n"                               \
-		".frame_list = {\n"                 \
-		"\t{\n"                             \
-		"\t\t.desc_ptr = %p\n"              \
-		"\t\t.desc_size = %u\n"             \
-		"\t\t.id = %u\n"                    \
-		"\t\t.suffix = %s\n"                \
-		"\t\t.re_lsb = %u\n"                \
-		"\t\t.dev_id_byte = %u\n"           \
-		"\t\t.touch_ring_byte = %u\n"       \
-		"\t\t.touch_ring_max = %hhd\n"      \
-		"\t\t.touch_ring_flip_at = %hhd\n"  \
-		"\t},\n"                            \
-		"\t{\n"                             \
-		"\t\t.desc_ptr = %p\n"              \
-		"\t\t.desc_size = %u\n"             \
-		"\t\t.id = %u\n"                    \
-		"\t\t.suffix = %s\n"                \
-		"\t\t.re_lsb = %u\n"                \
-		"\t\t.dev_id_byte = %u\n"           \
-		"\t\t.touch_ring_byte = %u\n"       \
-		"\t\t.touch_ring_max = %hhd\n"      \
-		"\t\t.touch_ring_flip_at = %hhd\n"  \
-		"\t},\n"                            \
-		"\t{\n"                             \
-		"\t\t.desc_ptr = %p\n"              \
-		"\t\t.desc_size = %u\n"             \
-		"\t\t.id = %u\n"                    \
-		"\t\t.suffix = %s\n"                \
-		"\t\t.re_lsb = %u\n"                \
-		"\t\t.dev_id_byte = %u\n"           \
-		"\t\t.touch_ring_byte = %u\n"       \
-		"\t\t.touch_ring_max = %hhd\n"      \
-		"\t\t.touch_ring_flip_at = %hhd\n"  \
-		"\t},\n"                            \
-		"}\n"
+	".invalid = %s\n"                   \
+	".desc_ptr = %p\n"                  \
+	".desc_size = %u\n"                 \
+	".pen = {\n"                        \
+	"\t.desc_ptr = %p\n"                \
+	"\t.desc_size = %u\n"               \
+	"\t.id = %u\n"                      \
+	"\t.subreport_list = {\n"           \
+	"\t\t{0x%02hhx, %hhu},\n"           \
+	"\t\t{0x%02hhx, %hhu},\n"           \
+	"\t\t{0x%02hhx, %hhu},\n"           \
+	"\t}\n"                             \
+	"\t.inrange = %s\n"                 \
+	"\t.fragmented_hires = %s\n"        \
+	"\t.tilt_y_flipped = %s\n"          \
+	"}\n"                               \
+	".frame_list = {\n"                 \
+	"\t{\n"                             \
+	"\t\t.desc_ptr = %p\n"              \
+	"\t\t.desc_size = %u\n"             \
+	"\t\t.id = %u\n"                    \
+	"\t\t.suffix = %s\n"                \
+	"\t\t.re_lsb = %u\n"                \
+	"\t\t.dev_id_byte = %u\n"           \
+	"\t\t.touch_ring_byte = %u\n"       \
+	"\t\t.touch_ring_max = %hhd\n"      \
+	"\t\t.touch_ring_flip_at = %hhd\n"  \
+	"\t},\n"                            \
+	"\t{\n"                             \
+	"\t\t.desc_ptr = %p\n"              \
+	"\t\t.desc_size = %u\n"             \
+	"\t\t.id = %u\n"                    \
+	"\t\t.suffix = %s\n"                \
+	"\t\t.re_lsb = %u\n"                \
+	"\t\t.dev_id_byte = %u\n"           \
+	"\t\t.touch_ring_byte = %u\n"       \
+	"\t\t.touch_ring_max = %hhd\n"      \
+	"\t\t.touch_ring_flip_at = %hhd\n"  \
+	"\t},\n"                            \
+	"\t{\n"                             \
+	"\t\t.desc_ptr = %p\n"              \
+	"\t\t.desc_size = %u\n"             \
+	"\t\t.id = %u\n"                    \
+	"\t\t.suffix = %s\n"                \
+	"\t\t.re_lsb = %u\n"                \
+	"\t\t.dev_id_byte = %u\n"           \
+	"\t\t.touch_ring_byte = %u\n"       \
+	"\t\t.touch_ring_max = %hhd\n"      \
+	"\t\t.touch_ring_flip_at = %hhd\n"  \
+	"\t},\n"                            \
+	"}\n"
 
 /* Tablet interface parameters *printf format arguments */
 #define UCLOGIC_PARAMS_FMT_ARGS(_params) \
-		((_params)->invalid ? "true" : "false"),                    \
-		(_params)->desc_ptr,                                        \
-		(_params)->desc_size,                                       \
-		(_params)->pen.desc_ptr,                                    \
-		(_params)->pen.desc_size,                                   \
-		(_params)->pen.id,                                          \
-		(_params)->pen.subreport_list[0].value,                     \
-		(_params)->pen.subreport_list[0].id,                        \
-		(_params)->pen.subreport_list[1].value,                     \
-		(_params)->pen.subreport_list[1].id,                        \
-		(_params)->pen.subreport_list[2].value,                     \
-		(_params)->pen.subreport_list[2].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_list[0].desc_ptr,                          \
-		(_params)->frame_list[0].desc_size,                         \
-		(_params)->frame_list[0].id,                                \
-		(_params)->frame_list[0].suffix,                            \
-		(_params)->frame_list[0].re_lsb,                            \
-		(_params)->frame_list[0].dev_id_byte,                       \
-		(_params)->frame_list[0].touch_ring_byte,                   \
-		(_params)->frame_list[0].touch_ring_max,                    \
-		(_params)->frame_list[0].touch_ring_flip_at,                \
-		(_params)->frame_list[1].desc_ptr,                          \
-		(_params)->frame_list[1].desc_size,                         \
-		(_params)->frame_list[1].id,                                \
-		(_params)->frame_list[1].suffix,                            \
-		(_params)->frame_list[1].re_lsb,                            \
-		(_params)->frame_list[1].dev_id_byte,                       \
-		(_params)->frame_list[1].touch_ring_byte,                   \
-		(_params)->frame_list[1].touch_ring_max,                    \
-		(_params)->frame_list[1].touch_ring_flip_at,                \
-		(_params)->frame_list[2].desc_ptr,                          \
-		(_params)->frame_list[2].desc_size,                         \
-		(_params)->frame_list[2].id,                                \
-		(_params)->frame_list[2].suffix,                            \
-		(_params)->frame_list[2].re_lsb,                            \
-		(_params)->frame_list[2].dev_id_byte,                       \
-		(_params)->frame_list[2].touch_ring_byte,                   \
-		(_params)->frame_list[2].touch_ring_max,                    \
-		(_params)->frame_list[2].touch_ring_flip_at
+	((_params)->invalid ? "true" : "false"),                    \
+	(_params)->desc_ptr,                                        \
+	(_params)->desc_size,                                       \
+	(_params)->pen.desc_ptr,                                    \
+	(_params)->pen.desc_size,                                   \
+	(_params)->pen.id,                                          \
+	(_params)->pen.subreport_list[0].value,                     \
+	(_params)->pen.subreport_list[0].id,                        \
+	(_params)->pen.subreport_list[1].value,                     \
+	(_params)->pen.subreport_list[1].id,                        \
+	(_params)->pen.subreport_list[2].value,                     \
+	(_params)->pen.subreport_list[2].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_list[0].desc_ptr,                          \
+	(_params)->frame_list[0].desc_size,                         \
+	(_params)->frame_list[0].id,                                \
+	(_params)->frame_list[0].suffix,                            \
+	(_params)->frame_list[0].re_lsb,                            \
+	(_params)->frame_list[0].dev_id_byte,                       \
+	(_params)->frame_list[0].touch_ring_byte,                   \
+	(_params)->frame_list[0].touch_ring_max,                    \
+	(_params)->frame_list[0].touch_ring_flip_at,                \
+	(_params)->frame_list[1].desc_ptr,                          \
+	(_params)->frame_list[1].desc_size,                         \
+	(_params)->frame_list[1].id,                                \
+	(_params)->frame_list[1].suffix,                            \
+	(_params)->frame_list[1].re_lsb,                            \
+	(_params)->frame_list[1].dev_id_byte,                       \
+	(_params)->frame_list[1].touch_ring_byte,                   \
+	(_params)->frame_list[1].touch_ring_max,                    \
+	(_params)->frame_list[1].touch_ring_flip_at,                \
+	(_params)->frame_list[2].desc_ptr,                          \
+	(_params)->frame_list[2].desc_size,                         \
+	(_params)->frame_list[2].id,                                \
+	(_params)->frame_list[2].suffix,                            \
+	(_params)->frame_list[2].re_lsb,                            \
+	(_params)->frame_list[2].dev_id_byte,                       \
+	(_params)->frame_list[2].touch_ring_byte,                   \
+	(_params)->frame_list[2].touch_ring_max,                    \
+	(_params)->frame_list[2].touch_ring_flip_at
 
 /* Get a replacement report descriptor for a tablet's interface. */
 extern int uclogic_params_get_desc(const struct uclogic_params *params,
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/4 HID: uclogic: Add support for bitmap dials

In reply to José Expósito

From: Nikolai Kondrashov <[email protected]>

A bitmap dial sends reports with a dedicated bit per direction: 1 means clockwise rotation, 2 means counterclockwise, as opposed to the normal 1 and -1 values.

---
 drivers/hid/hid-uclogic-core.c   |  6 ++++++
 drivers/hid/hid-uclogic-params.h | 15 ++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
drivers/hid/hid-uclogic-core.c +6 -0
index 96f3fb8c492c..627f1d0c52f2 100644
@@ -382,6 +382,12 @@ static int uclogic_raw_event_frame(
 		}
 	}
 
+	/* If need to, and can, transform the bitmap dial reports */
+	if (frame->bitmap_dial_byte > 0 && frame->bitmap_dial_byte < size) {
+		if (data[frame->bitmap_dial_byte] == 2)
+			data[frame->bitmap_dial_byte] = -1;
+	}
+
 	return 0;
 }
 
drivers/hid/hid-uclogic-params.h +14 -1
index 78965e683d20..e5ccc558abc3 100644
@@ -153,6 +153,13 @@ struct uclogic_params_frame {
 	 * Zero if no reversal should be done.
 	 */
 	__s8 touch_ring_flip_at;
+	/*
+	 * Offset of the bitmap dial byte, in the report. Zero if not present.
+	 * Only valid if "id" is not zero. A bitmap dial sends reports with a
+	 * dedicated bit per direction: 1 means clockwise rotation, 2 means
+	 * counterclockwise, as opposed to the normal 1 and -1.
+	 */
+	unsigned int bitmap_dial_byte;
 };
 
 /*
@@ -230,6 +237,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
 	"\t\t.touch_ring_byte = %u\n"       \
 	"\t\t.touch_ring_max = %hhd\n"      \
 	"\t\t.touch_ring_flip_at = %hhd\n"  \
+	"\t\t.bitmap_dial_byte = %u\n"      \
 	"\t},\n"                            \
 	"\t{\n"                             \
 	"\t\t.desc_ptr = %p\n"              \
@@ -241,6 +249,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
 	"\t\t.touch_ring_byte = %u\n"       \
 	"\t\t.touch_ring_max = %hhd\n"      \
 	"\t\t.touch_ring_flip_at = %hhd\n"  \
+	"\t\t.bitmap_dial_byte = %u\n"      \
 	"\t},\n"                            \
 	"\t{\n"                             \
 	"\t\t.desc_ptr = %p\n"              \
@@ -252,6 +261,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
 	"\t\t.touch_ring_byte = %u\n"       \
 	"\t\t.touch_ring_max = %hhd\n"      \
 	"\t\t.touch_ring_flip_at = %hhd\n"  \
+	"\t\t.bitmap_dial_byte = %u\n"      \
 	"\t},\n"                            \
 	"}\n"
 
@@ -281,6 +291,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
 	(_params)->frame_list[0].touch_ring_byte,                   \
 	(_params)->frame_list[0].touch_ring_max,                    \
 	(_params)->frame_list[0].touch_ring_flip_at,                \
+	(_params)->frame_list[0].bitmap_dial_byte,                  \
 	(_params)->frame_list[1].desc_ptr,                          \
 	(_params)->frame_list[1].desc_size,                         \
 	(_params)->frame_list[1].id,                                \
@@ -290,6 +301,7 @@ extern int uclogic_params_init(struct uclogic_params *params,
 	(_params)->frame_list[1].touch_ring_byte,                   \
 	(_params)->frame_list[1].touch_ring_max,                    \
 	(_params)->frame_list[1].touch_ring_flip_at,                \
+	(_params)->frame_list[1].bitmap_dial_byte,                  \
 	(_params)->frame_list[2].desc_ptr,                          \
 	(_params)->frame_list[2].desc_size,                         \
 	(_params)->frame_list[2].id,                                \
@@ -298,7 +310,8 @@ extern int uclogic_params_init(struct uclogic_params *params,
 	(_params)->frame_list[2].dev_id_byte,                       \
 	(_params)->frame_list[2].touch_ring_byte,                   \
 	(_params)->frame_list[2].touch_ring_max,                    \
-	(_params)->frame_list[2].touch_ring_flip_at
+	(_params)->frame_list[2].touch_ring_flip_at,                \
+	(_params)->frame_list[2].bitmap_dial_byte
 
 /* Get a replacement report descriptor for a tablet's interface. */
 extern int uclogic_params_get_desc(const struct uclogic_params *params,
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/4 HID: uclogic: Add support for Huion Q620M

In reply to José Expósito

From: Nikolai Kondrashov <[email protected]>

The Huion Q620M tablet needs a v2 frame dial.

---
 drivers/hid/hid-uclogic-params.c | 20 +++++++++++++
 drivers/hid/hid-uclogic-rdesc.c  | 50 ++++++++++++++++++++++++++++++++
 drivers/hid/hid-uclogic-rdesc.h  | 10 +++++++
 3 files changed, 80 insertions(+)
drivers/hid/hid-uclogic-params.c +20 -0
index 3ac45e7572a0..09c332c6a412 100644
@@ -777,6 +777,23 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
 			p.frame_list[1].touch_ring_max = 12;
 			p.frame_list[1].touch_ring_flip_at = 6;
 
+			/* Create v2 frame dial parameters */
+			rc = uclogic_params_frame_init_with_desc(
+					&p.frame_list[2],
+					uclogic_rdesc_v2_frame_dial_arr,
+					uclogic_rdesc_v2_frame_dial_size,
+					UCLOGIC_RDESC_V2_FRAME_DIAL_ID);
+			if (rc != 0) {
+				hid_err(hdev,
+					"failed creating v2 frame dial parameters: %d\n",
+					rc);
+				goto cleanup;
+			}
+			p.frame_list[2].suffix = "Dial";
+			p.frame_list[2].dev_id_byte =
+				UCLOGIC_RDESC_V2_FRAME_DIAL_DEV_ID_BYTE;
+			p.frame_list[2].bitmap_dial_byte = 5;
+
 			/*
 			 * Link button and touch ring subreports from pen
 			 * reports
@@ -787,6 +804,9 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
 			p.pen.subreport_list[1].value = 0xf0;
 			p.pen.subreport_list[1].id =
 				UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID;
+			p.pen.subreport_list[2].value = 0xf1;
+			p.pen.subreport_list[2].id =
+				UCLOGIC_RDESC_V2_FRAME_DIAL_ID;
 			goto output;
 		}
 		hid_dbg(hdev, "pen v2 parameters not found\n");
drivers/hid/hid-uclogic-rdesc.c +50 -0

56 lines not on this page · raw message

drivers/hid/hid-uclogic-rdesc.h +10 -0
index f15a9d8a946b..2ab6b7d5f5af 100644
@@ -141,6 +141,16 @@ extern const size_t uclogic_rdesc_v2_frame_touch_ring_size;
 /* Device ID byte offset in v2 frame touch ring reports */
 #define UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_DEV_ID_BYTE	0x4
 
+/* Report ID for tweaked v2 frame dial reports */
+#define UCLOGIC_RDESC_V2_FRAME_DIAL_ID 0xf9
+
+/* Fixed report descriptor for (tweaked) v2 frame dial reports */
+extern const __u8 uclogic_rdesc_v2_frame_dial_arr[];
+extern const size_t uclogic_rdesc_v2_frame_dial_size;
+
+/* Device ID byte offset in v2 frame dial reports */
+#define UCLOGIC_RDESC_V2_FRAME_DIAL_DEV_ID_BYTE	0x4
+
 /* Fixed report descriptor for Ugee EX07 frame */
 extern const __u8 uclogic_rdesc_ugee_ex07_frame_arr[];
 extern const size_t uclogic_rdesc_ugee_ex07_frame_size;
Signature · 1 line
2.25.1
maintainer
#5 lore raw
In reply to José Expósito
Quoted 21 lines · José Expósito

Hi everyone,

This series is a follow up to [1], [2] and [3] and upstreams 4 more patches authored by Nikolai from the DIGImend project.

Patches 1 and 2 are simple code clean up.

Patch 3 adds support for "bitmap dials". This kind of dials send 01 and 10 binary values rather than the usual 1 and -1.

The last patch adds support for the Huion Q620M drawing tablet, which has a bitmap dial.

Thank you very much in advance to Jiří for his work reviewing all the patches I have sent so far,
José Expósito

[1] https://lore.kernel.org/linux-input/[email protected]/T/
[2] https://lore.kernel.org/linux-input/[email protected]/T/
[3] https://lore.kernel.org/linux-input/[email protected]/T/

Quoted 5 lines

Nikolai Kondrashov (4):
HID: uclogic: Compress params format string
HID: uclogic: Reduce indent for params format str/args
HID: uclogic: Add support for bitmap dials
HID: uclogic: Add support for Huion Q620M

This is now in hid.git#for-5.19/uclogic

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs