From: "José Expósito" <jose.exposito89@gmail.com>
To: jikos@kernel.org
Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
"José Expósito" <jose.exposito89@gmail.com>
Subject: [PATCH for-5.18/uclogic 3/4] HID: uclogic: Allow three frame parameter sets
Date: Thu, 3 Mar 2022 08:47:33 +0100 [thread overview]
Message-ID: <20220303074734.7235-4-jose.exposito89@gmail.com> (raw)
In-Reply-To: <20220303074734.7235-1-jose.exposito89@gmail.com>
From: Nikolai Kondrashov <spbnick@gmail.com>
Allow three frame parameter sets per each UC-Logic tablet interface.
Bump the number of supported subreports to three as well to accommodate
ID routing. This allows supporting the dial on Huion Q620M.
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
drivers/hid/hid-uclogic-params.h | 52 +++++++++++++++++++++++++++++---
1 file changed, 47 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h
index 8042820e78b1..f2649e8f959d 100644
--- a/drivers/hid/hid-uclogic-params.h
+++ b/drivers/hid/hid-uclogic-params.h
@@ -73,8 +73,8 @@ struct uclogic_params_pen {
unsigned int desc_size;
/* Report ID, if reports should be tweaked, zero if not */
unsigned int id;
- /* The list of subreports */
- struct uclogic_params_pen_subreport subreport_list[1];
+ /* The list of subreports, only valid if "id" is not zero */
+ struct uclogic_params_pen_subreport subreport_list[3];
/* Type of in-range reporting, only valid if "id" is not zero */
enum uclogic_params_pen_inrange inrange;
/*
@@ -194,7 +194,7 @@ struct uclogic_params {
* The list of frame control parameters and optional report descriptor
* parts. Only valid, if "invalid" is false.
*/
- struct uclogic_params_frame frame_list[1];
+ struct uclogic_params_frame frame_list[3];
};
/* Initialize a tablet interface and discover its parameters */
@@ -210,6 +210,8 @@ extern int uclogic_params_init(struct uclogic_params *params,
".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" \
@@ -221,7 +223,25 @@ extern int uclogic_params_init(struct uclogic_params *params,
".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[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"
/* Tablet interface parameters *printf format arguments */
#define UCLOGIC_PARAMS_FMT_ARGS(_params) \
@@ -233,6 +253,10 @@ extern int uclogic_params_init(struct uclogic_params *params,
(_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"), \
@@ -244,7 +268,25 @@ extern int uclogic_params_init(struct uclogic_params *params,
(_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[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,
--
2.25.1
next prev parent reply other threads:[~2022-03-03 7:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 7:47 [PATCH for-5.18/uclogic 0/4] DIGImend patches, part III José Expósito
2022-03-03 7:47 ` [PATCH for-5.18/uclogic 1/4] HID: uclogic: Add support for touch ring reports José Expósito
2022-03-03 7:47 ` [PATCH for-5.18/uclogic 2/4] HID: uclogic: Support custom device suffix for frames José Expósito
2022-03-03 7:47 ` José Expósito [this message]
2022-03-03 7:47 ` [PATCH for-5.18/uclogic 4/4] HID: uclogic: Add support for Huion touch ring reports José Expósito
2022-04-11 14:53 ` [PATCH for-5.18/uclogic 0/4] DIGImend patches, part III Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220303074734.7235-4-jose.exposito89@gmail.com \
--to=jose.exposito89@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=spbnick@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).