DIGImend patches, part VI
cover DIGImend patches, part VI
Hi everyone,
This series is a follow up to [1], [2], [3], [4] and [5] upstreaming 7 more patches from the DIGImend project.
After 3 months, I'm happy to write that this is the last batch of patches :) Once the patchset is applied, DIGImend and the mainline kernel will have the same code... And I'll finally add support for my tablet. This should also allow Stefan and Alberto to continue with their work.
This last patchset is a bit of a mix. The patches don't necessarily make sense together, but I needed to send them at some point to include all features from DIGImend, so they ended up in the last batch.
Thanks a lot to Jiří for the reviews these months, 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/
[4] https://lore.kernel.org/linux-input/[email protected]/T/
[5] https://lore.kernel.org/linux-input/[email protected]/T/
Nikolai Kondrashov (6):
HID: uclogic: Move param printing to a function
HID: uclogic: Return raw parameters from v2 pen init
HID: uclogic: Do not focus on touch ring only
HID: uclogic: Always shift touch reports to zero
HID: uclogic: Differentiate touch ring and touch strip
HID: uclogic: Switch to Digitizer usage for styluses
Roman Romanenko (1):
HID: uclogic: Add pen support for XP-PEN Star 06
drivers/hid/hid-ids.h | 1 + drivers/hid/hid-kye.c | 12 +- drivers/hid/hid-uclogic-core.c | 29 ++-- drivers/hid/hid-uclogic-params.c | 267 ++++++++++++++++++++++++------- drivers/hid/hid-uclogic-params.h | 143 +++-------------- drivers/hid/hid-uclogic-rdesc.c | 70 ++++++-- drivers/hid/hid-uclogic-rdesc.h | 12 +- drivers/hid/hid-viewsonic.c | 2 +- 8 files changed, 315 insertions(+), 221 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/7 HID: uclogic: Move param printing to a function
From: Nikolai Kondrashov <[email protected]>
Move parameter printing from a format string/argument list to a function to allow printing the full parameters, which now wouldn't fit into a single print call.
--- drivers/hid/hid-uclogic-core.c | 4 +- drivers/hid/hid-uclogic-params.c | 89 +++++++++++++++++++++++- drivers/hid/hid-uclogic-params.h | 116 ++----------------------------- 3 files changed, 93 insertions(+), 116 deletions(-)
drivers/hid/hid-uclogic-core.c +2 -2
@@ -209,8 +209,8 @@ static int uclogic_probe(struct hid_device *hdev, goto failure; } params_initialized = true; -hid_dbg (hdev,"parameters:\n" UCLOGIC_PARAMS_FMT_STR , -UCLOGIC_PARAMS_FMT_ARGS (&drvdata->params)); +hid_dbg (hdev,"parameters:\n" ); +uclogic_params_hid_dbg (hdev, &drvdata->params);if (drvdata->params.invalid) {hid_info (hdev,"interface is invalid, ignoring\n" ); rc = -ENODEV ;
drivers/hid/hid-uclogic-params.c +87 -2
101 lines not on this page · raw message
drivers/hid/hid-uclogic-params.h +4 -112
132 lines not on this page · raw message
Signature · 1 line
2.25.1
kernel test robot
build botRe: [PATCH for-5.19/uclogic 1/7] HID: uclogic: Move param printing to a function
Thank you for the patch! Perhaps something to improve:
Hi "José,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hid/for-next]
[cannot apply to v5.18-rc5 next-20220506]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Jos-Exp-sito/DIGImend-patches-part-VI/20220509-000510 base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220509/[email protected]/config) compiler: m68k-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/4c0671e4ce0687136ff71aa65539cd3a2798d99d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jos-Exp-sito/DIGImend-patches-part-VI/20220509-000510
git checkout 4c0671e4ce0687136ff71aa65539cd3a2798d99d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/hid/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/hid/hid-uclogic-params.c:48: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Dump tablet interface pen parameters with hid_dbg(), indented with one tab.
drivers/hid/hid-uclogic-params.c:80: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Dump tablet interface frame parameters with hid_dbg(), indented with two
drivers/hid/hid-uclogic-params.c:105: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Dump tablet interface parameters with hid_dbg().
vim +48 drivers/hid/hid-uclogic-params.c
46
47 /**
> 48 * Dump tablet interface pen parameters with hid_dbg(), indented with one tab.
49 *
50 * @hdev: The HID device the pen parameters describe.
51 * @pen: The pen parameters to dump.
52 */
53 static void uclogic_params_pen_hid_dbg(const struct hid_device *hdev,
54 const struct uclogic_params_pen *pen)
55 {
56 size_t i;
57
58 hid_dbg(hdev, "\t.usage_invalid = %s\n",
59 (pen->usage_invalid ? "true" : "false"));
60 hid_dbg(hdev, "\t.desc_ptr = %p\n", pen->desc_ptr);
61 hid_dbg(hdev, "\t.desc_size = %u\n", pen->desc_size);
62 hid_dbg(hdev, "\t.id = %u\n", pen->id);
63 hid_dbg(hdev, "\t.subreport_list = {\n");
64 for (i = 0; i < ARRAY_SIZE(pen->subreport_list); i++) {
65 hid_dbg(hdev, "\t\t{0x%02hhx, %hhu}%s\n",
66 pen->subreport_list[i].value,
67 pen->subreport_list[i].id,
68 i < (ARRAY_SIZE(pen->subreport_list) - 1) ? "," : "");
69 }
70 hid_dbg(hdev, "\t}\n");
71 hid_dbg(hdev, "\t.inrange = %s\n",
72 uclogic_params_pen_inrange_to_str(pen->inrange));
73 hid_dbg(hdev, "\t.fragmented_hires = %s\n",
74 (pen->fragmented_hires ? "true" : "false"));
75 hid_dbg(hdev, "\t.tilt_y_flipped = %s\n",
76 (pen->tilt_y_flipped ? "true" : "false"));
77 }
78 Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
Re: [PATCH for-5.19/uclogic 1/7] HID: uclogic: Move param printing to a function
Quoted 7 lines · kernel test robot
Hi "José,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hid/for-next]
[cannot apply to v5.18-rc5 next-20220506]
[If your patch is applied to the wrong git tree, kindly drop us a note.
Missing --base=<commit> argument, the patch applies without issues on for-5.19/uclogic.
Let me now if you need me to resend it,
Jose
Quoted 70 lines
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]url: https://github.com/intel-lab-lkp/linux/commits/Jos-Exp-sito/DIGImend-patches-part-VI/20220509-000510 base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220509/202205090129.trznWqE6-lkp(a)intel.com/config) compiler: m68k-linux-gcc (GCC) 11.3.0reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/4c0671e4ce0687136ff71aa65539cd3a2798d99d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jos-Exp-sito/DIGImend-patches-part-VI/20220509-000510
git checkout4c0671e4ce0687136ff71aa65539cd3a2798d99d
# save the config file
mkdirbuild_dir&& cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bashdrivers/hid/If you fix the issue, kindly add following tag as appropriate
Reported-by kernel test robot <[email protected]>All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/hid/hid-uclogic-params.c:48: warning: This comment starts with '/**', but isn't a kernel-doc comment. ReferDocumentation/doc-guide/kernel-doc.rst* Dump tablet interface pen parameters with
hid_dbg(), indented with one tab.
drivers/hid/hid-uclogic-params.c:80: warning: This comment starts with '/**', but isn't a kernel-doc comment. ReferDocumentation/doc-guide/kernel-doc.rst
* Dump tablet interface frame parameters withhid_dbg(), indented with two
drivers/hid/hid-uclogic-params.c:105: warning: This comment starts with '/**', but isn't a kernel-doc comment. ReferDocumentation/doc-guide/kernel-doc.rst
* Dump tablet interface parameters withhid_dbg().vim +48
drivers/hid/hid-uclogic-params.c46 47 /**Quoted 1 line
48 * Dump tablet interface pen parameters with
hid_dbg(), indented with one tab.49 * 50 * @hdev: The HID device the pen parameters describe. 51 * @pen: The pen parameters to dump. 52 */ 53 static void uclogic_params_pen_hid_dbg(const struct hid_device *hdev, 54 const struct uclogic_params_pen *pen) 55 { 56 size_t i; 57 58 hid_dbg(hdev, "\t.usage_invalid = %s\n", 59 (pen->usage_invalid ? "true" : "false")); 60 hid_dbg(hdev, "\t.desc_ptr = %p\n", pen->desc_ptr); 61 hid_dbg(hdev, "\t.desc_size = %u\n", pen->desc_size); 62 hid_dbg(hdev, "\t.id = %u\n", pen->id); 63 hid_dbg(hdev, "\t.subreport_list = {\n"); 64 for (i = 0; i < ARRAY_SIZE(pen->subreport_list); i++) { 65 hid_dbg(hdev, "\t\t{0x%02hhx, %hhu}%s\n", 66 pen->subreport_list[i].value, 67 pen->subreport_list[i].id, 68 i < (ARRAY_SIZE(pen->subreport_list) - 1) ? "," : ""); 69 } 70 hid_dbg(hdev, "\t}\n"); 71 hid_dbg(hdev, "\t.inrange = %s\n", 72 uclogic_params_pen_inrange_to_str(pen->inrange)); 73 hid_dbg(hdev, "\t.fragmented_hires = %s\n", 74 (pen->fragmented_hires ? "true" : "false")); 75 hid_dbg(hdev, "\t.tilt_y_flipped = %s\n", 76 (pen->tilt_y_flipped ? "true" : "false")); 77 } 78Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
kernel test robot
build botRe: [PATCH for-5.19/uclogic 1/7] HID: uclogic: Move param printing to a function
In reply to José ExpósitoThank you for the patch! Perhaps something to improve:
Hi "José,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hid/for-next]
[cannot apply to v5.18-rc5 next-20220506]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Jos-Exp-sito/DIGImend-patches-part-VI/20220509-000510 base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next config: x86_64-randconfig-a003-20220509 (https://download.01.org/0day-ci/archive/20220509/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a385645b470e2d3a1534aae618ea56b31177639f)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/4c0671e4ce0687136ff71aa65539cd3a2798d99d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jos-Exp-sito/DIGImend-patches-part-VI/20220509-000510
git checkout 4c0671e4ce0687136ff71aa65539cd3a2798d99d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hid/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/hid/hid-uclogic-params.c:48: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Dump tablet interface pen parameters with hid_dbg(), indented with one tab.
drivers/hid/hid-uclogic-params.c:80: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Dump tablet interface frame parameters with hid_dbg(), indented with two
drivers/hid/hid-uclogic-params.c:105: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Dump tablet interface parameters with hid_dbg().
vim +48 drivers/hid/hid-uclogic-params.c
46
47 /**
> 48 * Dump tablet interface pen parameters with hid_dbg(), indented with one tab.
49 *
50 * @hdev: The HID device the pen parameters describe.
51 * @pen: The pen parameters to dump.
52 */
53 static void uclogic_params_pen_hid_dbg(const struct hid_device *hdev,
54 const struct uclogic_params_pen *pen)
55 {
56 size_t i;
57
58 hid_dbg(hdev, "\t.usage_invalid = %s\n",
59 (pen->usage_invalid ? "true" : "false"));
60 hid_dbg(hdev, "\t.desc_ptr = %p\n", pen->desc_ptr);
61 hid_dbg(hdev, "\t.desc_size = %u\n", pen->desc_size);
62 hid_dbg(hdev, "\t.id = %u\n", pen->id);
63 hid_dbg(hdev, "\t.subreport_list = {\n");
64 for (i = 0; i < ARRAY_SIZE(pen->subreport_list); i++) {
65 hid_dbg(hdev, "\t\t{0x%02hhx, %hhu}%s\n",
66 pen->subreport_list[i].value,
67 pen->subreport_list[i].id,
68 i < (ARRAY_SIZE(pen->subreport_list) - 1) ? "," : "");
69 }
70 hid_dbg(hdev, "\t}\n");
71 hid_dbg(hdev, "\t.inrange = %s\n",
72 uclogic_params_pen_inrange_to_str(pen->inrange));
73 hid_dbg(hdev, "\t.fragmented_hires = %s\n",
74 (pen->fragmented_hires ? "true" : "false"));
75 hid_dbg(hdev, "\t.tilt_y_flipped = %s\n",
76 (pen->tilt_y_flipped ? "true" : "false"));
77 }
78 Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
PATCH 2/7 HID: uclogic: Return raw parameters from v2 pen init
In reply to José ExpósitoFrom: Nikolai Kondrashov <[email protected]>
Return the raw parameters buffer from uclogic_params_pen_init_v2(), if requested, as a way to identify the tablet.
--- drivers/hid/hid-uclogic-params.c | 92 ++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 34 deletions(-)
drivers/hid/hid-uclogic-params.c +58 -34
@@ -338,28 +338,45 @@ static s32 uclogic_params_get_le24(const void *p)* uclogic_params_pen_init_v2() - initialize tablet interface pen * input and retrieve its parameters from the device, using v2 protocol. * -* @pen: Pointer to the pen parameters to initialize (to be -* cleaned up with uclogic_params_pen_cleanup()). Not modified in -* case of error, or if parameters are not found. Cannot be NULL. -* @pfound: Location for a flag which is set to true if the parameters -* were found, and to false if not (e.g. device was -* incompatible). Not modified in case of error. Cannot be NULL. -* @hdev: The HID device of the tablet interface to initialize and get -* parameters from. Cannot be NULL. +* @pen: Pointer to the pen parameters to initialize (to be +* cleaned up with uclogic_params_pen_cleanup()). Not +* modified in case of error, or if parameters are not +* found. Cannot be NULL. +* @pfound: Location for a flag which is set to true if the +* parameters were found, and to false if not (e.g. +* device was incompatible). Not modified in case of +* error. Cannot be NULL. +* @pparams_ptr: Location for a kmalloc'ed pointer to the retrieved raw +* parameters, which could be used to identify the tablet +* to some extent. Should be freed with kfree after use. +* NULL, if not needed. Not modified in case of error. +* Only set if *pfound is set to true. +* @pparams_len: Location for the length of the retrieved raw +* parameters. NULL, if not needed. Not modified in case +* of error. Only set if *pfound is set to true. +* @hdev: The HID device of the tablet interface to initialize +* and get parameters from. Cannot be NULL. * * Returns: * Zero, if successful. A negative errno code on error. */ static int uclogic_params_pen_init_v2 (struct uclogic_params_pen *pen,bool *pfound, +__u8 **pparams_ptr, +size_t *pparams_len,struct hid_device *hdev) {int rc;bool found = false; -/* Buffer for (part of) the string descriptor */ +/* Buffer for (part of) the parameter string descriptor */ __u8 *buf =NULL ; -/* Descriptor length required */ -const int len =18 ; +/* Parameter string descriptor required length */ +const int params_len_min =18 ; +/* Parameter string descriptor accepted length */ +const int params_len_max =32 ; +/* Parameter string descriptor received length */ +int params_len; +size_t i;s32 resolution;/* Pen report descriptor template parameters */ s32 desc_params[UCLOGIC_RDESC_PEN_PH_ID_NUM ];
@@ -377,7 +394,7 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen,* the Windows driver traffic. * NOTE: This enables fully-functional tablet mode. */ - rc =uclogic_params_get_str_desc (&buf, hdev,200 , len); + rc =uclogic_params_get_str_desc (&buf, hdev,200 , params_len_max);if (rc == -EPIPE ) {hid_dbg (hdev,"string descriptor with pen parameters not found, assuming not compatible\n" );
@@ -385,27 +402,28 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen, }else if (rc <0 ) {hid_err (hdev,"failed retrieving pen parameters: %d\n" , rc); goto cleanup; - }else if (rc != len) { + }else if (rc < params_len_min) {hid_dbg (hdev, -"string descriptor with pen parameters has invalid length (got %d, expected %d), assuming not compatible\n" , - rc, len); +"string descriptor with pen parameters is too short (got %d, expected at least %d), assuming not compatible\n" , + rc, params_len_min); + goto finish; + } + + params_len = rc; + +/* +* Check it's not just a catch-all UTF-16LE-encoded ASCII +* string (such as the model name) some tablets put into all +* unknown string descriptors. +*/ +for (i =2 ; + i < params_len && + (buf[i] >=0x20 && buf[i] <0x7f && buf[i +1 ] ==0 ); + i +=2 ); +if (i >= params_len) { +hid_dbg (hdev, +"string descriptor with pen parameters seems to contain only text, assuming not compatible\n" ); goto finish; - }else { -size_t i; -/* -* Check it's not just a catch-all UTF-16LE-encoded ASCII -* string (such as the model name) some tablets put into all -* unknown string descriptors. -*/ -for (i =2 ; - i < len && - (buf[i] >=0x20 && buf[i] <0x7f && buf[i +1 ] ==0 ); - i +=2 ); -if (i >= len) { -hid_dbg (hdev, -"string descriptor with pen parameters seems to contain only text, assuming not compatible\n" ); - goto finish; - } }/*
@@ -429,8 +447,6 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen, desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_LM ] *1000 / resolution; } -kfree (buf); - buf =NULL ;/* * Generate pen report descriptor
@@ -456,6 +472,13 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen, pen->fragmented_hires = true; pen->tilt_y_flipped = true; found = true; +if (pparams_ptr !=NULL ) { + *pparams_ptr = buf; + buf =NULL ; + } +if (pparams_len !=NULL ) + *pparams_len = params_len; + finish: *pfound = found; rc =0 ;
@@ -828,7 +851,8 @@ static int uclogic_params_huion_init(struct uclogic_params *params, "transition firmware detected, not probing pen v2 parameters\n"); }else {/* Try to probe v2 pen parameters */ - rc =uclogic_params_pen_init_v2 (&p.pen, &found, hdev); + rc =uclogic_params_pen_init_v2 (&p.pen, &found, +NULL ,NULL , hdev);if (rc !=0 ) {hid_err (hdev,"failed probing pen v2 parameters: %d\n" , rc);
Signature · 1 line
2.25.1
PATCH 3/7 HID: uclogic: Do not focus on touch ring only
In reply to José ExpósitoFrom: Nikolai Kondrashov <[email protected]>
Accommodate both touch ring and touch strip in naming throughout hid-uclogic by talking about abstract "touch" instead of "touch ring", wherever possible.
--- drivers/hid/hid-uclogic-core.c | 20 +++++++++----------- drivers/hid/hid-uclogic-params.c | 20 ++++++++++---------- drivers/hid/hid-uclogic-params.h | 27 ++++++++++++++------------- drivers/hid/hid-uclogic-rdesc.c | 4 ++-- drivers/hid/hid-uclogic-rdesc.h | 8 ++++---- 5 files changed, 39 insertions(+), 40 deletions(-)
drivers/hid/hid-uclogic-core.c +9 -11
@@ -134,7 +134,7 @@ static int uclogic_input_configured(struct hid_device *hdev,* Disable EV_MSC reports for touch ring interfaces to * make the Wacom driver pickup touch ring extents */ -if (frame->touch_ring_byte >0 ) +if (frame->touch_byte >0 )__clear_bit (EV_MSC , hi->input->evbit); } }
@@ -351,9 +351,8 @@ static int uclogic_raw_event_frame(/* If need to, and can, set pad device ID for Wacom drivers */ if (frame->dev_id_byte >0 && frame->dev_id_byte < size) {/* If we also have a touch ring and the finger left it */ -if (frame->touch_ring_byte >0 && - frame->touch_ring_byte < size && - data[frame->touch_ring_byte] ==0 ) { +if (frame->touch_byte >0 && frame->touch_byte < size && + data[frame->touch_byte] ==0 ) { data[frame->dev_id_byte] =0 ; }else { data[frame->dev_id_byte] =0xf ;
@@ -387,16 +386,15 @@ static int uclogic_raw_event_frame( }/* If need to, and can, transform the touch ring reports */ -if (frame->touch_ring_byte >0 && frame->touch_ring_byte < size && - frame->touch_ring_flip_at !=0 ) { -__s8 value = data[frame->touch_ring_byte]; - +if (frame->touch_byte >0 && frame->touch_byte < size && + frame->touch_flip_at !=0 ) { +__s8 value = data[frame->touch_byte];if (value !=0 ) { - value = frame->touch_ring_flip_at - value; + value = frame->touch_flip_at - value;if (value <0 ) - value = frame->touch_ring_max + value; + value = frame->touch_max + value; - data[frame->touch_ring_byte] = value; + data[frame->touch_byte] = value; } }
drivers/hid/hid-uclogic-params.c +10 -10
@@ -93,10 +93,10 @@ static void uclogic_params_frame_hid_dbg(hid_dbg (hdev,"\t\t.suffix = %s\n" , frame->suffix);hid_dbg (hdev,"\t\t.re_lsb = %u\n" , frame->re_lsb);hid_dbg (hdev,"\t\t.dev_id_byte = %u\n" , frame->dev_id_byte); -hid_dbg (hdev,"\t\t.touch_ring_byte = %u\n" , frame->touch_ring_byte); -hid_dbg (hdev,"\t\t.touch_ring_max = %hhd\n" , frame->touch_ring_max); -hid_dbg (hdev,"\t\t.touch_ring_flip_at = %hhd\n" , - frame->touch_ring_flip_at); +hid_dbg (hdev,"\t\t.touch_byte = %u\n" , frame->touch_byte); +hid_dbg (hdev,"\t\t.touch_max = %hhd\n" , frame->touch_max); +hid_dbg (hdev,"\t\t.touch_flip_at = %hhd\n" , + frame->touch_flip_at);hid_dbg (hdev,"\t\t.bitmap_dial_byte = %u\n" , frame->bitmap_dial_byte); }
@@ -877,7 +877,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params, &p.frame_list[1 ], uclogic_rdesc_v2_frame_touch_ring_arr, uclogic_rdesc_v2_frame_touch_ring_size, - UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID); + UCLOGIC_RDESC_V2_FRAME_TOUCH_ID);if (rc !=0 ) { hid_err(hdev, "failed creating v2 frame touch ring parameters: %d\n",
@@ -886,10 +886,10 @@ static int uclogic_params_huion_init(struct uclogic_params *params, } p.frame_list[1 ].suffix ="Touch Ring" ; p.frame_list[1 ].dev_id_byte = -UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_DEV_ID_BYTE ; - p.frame_list[1 ].touch_ring_byte =5 ; - p.frame_list[1 ].touch_ring_max =12 ; - p.frame_list[1 ].touch_ring_flip_at =6 ; +UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE ; + p.frame_list[1 ].touch_byte =5 ; + p.frame_list[1 ].touch_max =12 ; + p.frame_list[1 ].touch_flip_at =6 ;/* Create v2 frame dial parameters */ rc = uclogic_params_frame_init_with_desc(
@@ -917,7 +917,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID ; p.pen.subreport_list[1 ].value =0xf0 ; p.pen.subreport_list[1 ].id = -UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID ; +UCLOGIC_RDESC_V2_FRAME_TOUCH_ID ; p.pen.subreport_list[2 ].value =0xf1 ; p.pen.subreport_list[2 ].id =UCLOGIC_RDESC_V2_FRAME_DIAL_ID ;
drivers/hid/hid-uclogic-params.h +14 -13
@@ -128,31 +128,32 @@ struct uclogic_params_frame {* 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. The ID byte will be set -* to zero whenever the byte pointed by "touch_ring_byte" is zero, if +* to zero whenever the byte pointed by "touch_byte" is zero, if * the latter is valid. Only valid if "id" is not zero. */ unsigned int dev_id_byte;/* -* Offset of the touch ring state byte, in the report. +* Offset of the touch ring/strip state byte, in the report. * Zero if not present. If dev_id_byte is also valid and non-zero, * then the device ID byte will be cleared when the byte pointed to by * this offset is zero. Only valid if "id" is not zero. */ -unsigned int touch_ring_byte; - -/* -* Maximum value of the touch ring report. -* The minimum valid value is considered to be one, -* with zero being out-of-proximity (finger lift) value. -*/ -__s8 touch_ring_max; - +unsigned int touch_byte;/* -* The value to anchor the reversed reports at. +* The value to anchor the reversed touch ring/strip reports at. * I.e. one, if the reports should be flipped without offset. * Zero if no reversal should be done. +* Only valid if "touch_byte" is valid and not zero. +*/ +__s8 touch_flip_at; +/* +* Maximum value of the touch ring/strip report around which the value +* should be wrapped when flipping according to "touch_flip_at". +* The minimum valid value is considered to be one, with zero being +* out-of-proximity (finger lift) value. +* Only valid if "touch_flip_at" is valid and not zero. */ -__s8 touch_ring_flip_at; +__s8 touch_max;/* * 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
drivers/hid/hid-uclogic-rdesc.c +2 -2
@@ -718,8 +718,8 @@ const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {0x05 ,0x01 ,/* Usage Page (Desktop), */ 0x09 ,0x07 ,/* Usage (Keypad), */ 0xA1 ,0x01 ,/* Collection (Application), */ -0x85 ,UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID , -/* Report ID (DIAL_ID), */ +0x85 ,UCLOGIC_RDESC_V2_FRAME_TOUCH_ID , +/* Report ID (TOUCH_ID), */ 0x14 ,/* Logical Minimum (0), */ 0x05 ,0x0D ,/* Usage Page (Digitizer), */ 0x09, 0x39, /* Usage (Tablet Function Keys), */
drivers/hid/hid-uclogic-rdesc.h +4 -4
@@ -131,15 +131,15 @@ extern const size_t uclogic_rdesc_v1_frame_size;extern const __u8 uclogic_rdesc_v2_frame_buttons_arr[];extern const size_t uclogic_rdesc_v2_frame_buttons_size; -/* Report ID for tweaked v2 frame touch ring reports */ -#define UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID 0xf8 +/* Report ID for tweaked v2 frame touch ring/strip reports */ +#define UCLOGIC_RDESC_V2_FRAME_TOUCH_ID 0xf8/* Fixed report descriptor for (tweaked) v2 frame touch ring reports */ extern const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[];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 +/* Device ID byte offset in v2 frame touch ring/strip reports */ +#define UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE 0x4/* Report ID for tweaked v2 frame dial reports */ #define UCLOGIC_RDESC_V2_FRAME_DIAL_ID 0xf9
Signature · 1 line
2.25.1
PATCH 4/7 HID: uclogic: Always shift touch reports to zero
In reply to José ExpósitoFrom: Nikolai Kondrashov <[email protected]>
Always decrement touch report values to have the range start with zero, regardless if flipped or not. This fixes the future non-flipped touch strip reports.
--- drivers/hid/hid-uclogic-core.c | 15 ++++++++------- drivers/hid/hid-uclogic-params.c | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-)
drivers/hid/hid-uclogic-core.c +8 -7
@@ -386,15 +386,16 @@ static int uclogic_raw_event_frame( }/* If need to, and can, transform the touch ring reports */ -if (frame->touch_byte >0 && frame->touch_byte < size && - frame->touch_flip_at !=0 ) { +if (frame->touch_byte >0 && frame->touch_byte < size) {__s8 value = data[frame->touch_byte]; -if (value !=0 ) { - value = frame->touch_flip_at - value; -if (value <0 ) - value = frame->touch_max + value; - data[frame->touch_byte] = value; +if (value !=0 ) { +if (frame->touch_flip_at !=0 ) { + value = frame->touch_flip_at - value; +if (value <=0 ) + value = frame->touch_max + value; + } + data[frame->touch_byte] = value -1 ; } }
drivers/hid/hid-uclogic-params.c +1 -1
@@ -889,7 +889,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE ; p.frame_list[1 ].touch_byte =5 ; p.frame_list[1 ].touch_max =12 ; - p.frame_list[1 ].touch_flip_at =6 ; + p.frame_list[1 ].touch_flip_at =7 ;/* Create v2 frame dial parameters */ rc = uclogic_params_frame_init_with_desc(
Signature · 1 line
2.25.1
PATCH 5/7 HID: uclogic: Differentiate touch ring and touch strip
In reply to José ExpósitoFrom: Nikolai Kondrashov <[email protected]>
Improve support for touch strips.
--- drivers/hid/hid-uclogic-params.c | 84 +++++++++++++++++++++++--------- drivers/hid/hid-uclogic-rdesc.c | 48 ++++++++++++++++++ drivers/hid/hid-uclogic-rdesc.h | 4 ++ 3 files changed, 112 insertions(+), 24 deletions(-)
drivers/hid/hid-uclogic-params.c +60 -24
@@ -808,6 +808,14 @@ static int uclogic_params_huion_init(struct uclogic_params *params,static const char transition_ver[] ="HUION_T153_160607" ;char *ver_ptr =NULL ;const size_t ver_len =sizeof (transition_ver) +1 ; +__u8 *params_ptr =NULL ; +size_t params_len =0 ; +/* Parameters string descriptor of a model with touch ring (HS610) */ +const __u8 touch_ring_model_params_buf[] = { +0x13 ,0x03 ,0x70 ,0xC6 ,0x00 ,0x06 ,0x7C ,0x00 , +0xFF ,0x1F ,0xD8 ,0x13 ,0x03 ,0x0D ,0x10 ,0x01 , +0x04 ,0x3C ,0x3E + };/* Check arguments */ if (params ==NULL || hdev ==NULL ) {
@@ -852,7 +860,8 @@ static int uclogic_params_huion_init(struct uclogic_params *params, }else {/* Try to probe v2 pen parameters */ rc =uclogic_params_pen_init_v2 (&p.pen, &found, -NULL ,NULL , hdev); + ¶ms_ptr, ¶ms_len, + hdev);if (rc !=0 ) {hid_err (hdev,"failed probing pen v2 parameters: %d\n" , rc);
@@ -872,24 +881,58 @@ static int uclogic_params_huion_init(struct uclogic_params *params, goto cleanup; } -/* Create v2 frame touch ring parameters */ - rc =uclogic_params_frame_init_with_desc ( +/* Link from pen sub-report */ + p.pen.subreport_list[0 ].value =0xe0 ; + p.pen.subreport_list[0 ].id = +UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID ; + +/* If this is the model with touch ring */ +if (params_ptr !=NULL && + params_len ==sizeof (touch_ring_model_params_buf) && +memcmp (params_ptr, touch_ring_model_params_buf, + params_len) ==0 ) { +/* Create touch ring parameters */ + rc =uclogic_params_frame_init_with_desc ( &p.frame_list[1 ], uclogic_rdesc_v2_frame_touch_ring_arr, uclogic_rdesc_v2_frame_touch_ring_size,UCLOGIC_RDESC_V2_FRAME_TOUCH_ID ); -if (rc !=0 ) { -hid_err (hdev, -"failed creating v2 frame touch ring parameters: %d\n" , - rc); - goto cleanup; +if (rc !=0 ) { +hid_err (hdev, +"failed creating v2 frame touch ring parameters: %d\n" , + rc); + goto cleanup; + } + p.frame_list[1 ].suffix ="Touch Ring" ; + p.frame_list[1 ].dev_id_byte = +UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE ; + p.frame_list[1 ].touch_byte =5 ; + p.frame_list[1 ].touch_max =12 ; + p.frame_list[1 ].touch_flip_at =7 ; + }else { +/* Create touch strip parameters */ + rc =uclogic_params_frame_init_with_desc ( + &p.frame_list[1 ], + uclogic_rdesc_v2_frame_touch_strip_arr, + uclogic_rdesc_v2_frame_touch_strip_size, +UCLOGIC_RDESC_V2_FRAME_TOUCH_ID ); +if (rc !=0 ) { +hid_err (hdev, +"failed creating v2 frame touch strip parameters: %d\n" , + rc); + goto cleanup; + } + p.frame_list[1 ].suffix ="Touch Strip" ; + p.frame_list[1 ].dev_id_byte = +UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE ; + p.frame_list[1 ].touch_byte =5 ; + p.frame_list[1 ].touch_max =8 ; } - p.frame_list[1 ].suffix ="Touch Ring" ; - p.frame_list[1 ].dev_id_byte = -UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE ; - p.frame_list[1 ].touch_byte =5 ; - p.frame_list[1 ].touch_max =12 ; - p.frame_list[1 ].touch_flip_at =7 ; + +/* Link from pen sub-report */ + p.pen.subreport_list[1 ].value =0xf0 ; + p.pen.subreport_list[1 ].id = +UCLOGIC_RDESC_V2_FRAME_TOUCH_ID ;/* Create v2 frame dial parameters */ rc = uclogic_params_frame_init_with_desc(
@@ -908,19 +951,11 @@ static int uclogic_params_huion_init(struct uclogic_params *params,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 -*/ - p.pen.subreport_list[0 ].value =0xe0 ; - p.pen.subreport_list[0 ].id = -UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID ; - p.pen.subreport_list[1 ].value =0xf0 ; - p.pen.subreport_list[1 ].id = -UCLOGIC_RDESC_V2_FRAME_TOUCH_ID ; +/* Link from pen sub-report */ 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" );
@@ -961,6 +996,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,memset (&p,0 ,sizeof (p)); rc =0 ; cleanup: +kfree (params_ptr);kfree (ver_ptr);uclogic_params_cleanup (&p);return rc;
drivers/hid/hid-uclogic-rdesc.c +48 -0
54 lines not on this page · raw message
drivers/hid/hid-uclogic-rdesc.h +4 -0
@@ -138,6 +138,10 @@ extern const size_t uclogic_rdesc_v2_frame_buttons_size;extern const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[];extern const size_t uclogic_rdesc_v2_frame_touch_ring_size; +/* Fixed report descriptor for (tweaked) v2 frame touch strip reports */ +extern const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[]; +extern const size_t uclogic_rdesc_v2_frame_touch_strip_size; +/* Device ID byte offset in v2 frame touch ring/strip reports */ #define UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE 0x4
Signature · 1 line
2.25.1
PATCH 6/7 HID: uclogic: Add pen support for XP-PEN Star 06
In reply to José ExpósitoFrom: Roman Romanenko <[email protected]>
Similar to other UGEE pens, but the IDs were missing.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-uclogic-core.c | 2 ++ drivers/hid/hid-uclogic-params.c | 2 ++ 3 files changed, 5 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -1260,6 +1260,7 @@#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540 0x0075#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640 0x0094#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01 0x0042 +#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06 0x0078#define USB_DEVICE_ID_UGEE_TABLET_G5 0x0074#define USB_DEVICE_ID_UGEE_TABLET_EX07S 0x0071#define USB_DEVICE_ID_UGEE_TABLET_RAINBOW_CV720 0x0055
drivers/hid/hid-uclogic-core.c +2 -0
@@ -521,6 +521,8 @@ static const struct hid_device_id uclogic_devices[] = { USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640) }, { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01) }, + { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, + USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06) }, { } }; MODULE_DEVICE_TABLE(hid, uclogic_devices);
drivers/hid/hid-uclogic-params.c +2 -0
@@ -1195,6 +1195,8 @@ int uclogic_params_init(struct uclogic_params *params, USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540):case VID_PID (USB_VENDOR_ID_UGEE ,USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640 ): +case VID_PID (USB_VENDOR_ID_UGEE , +USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06 ):case VID_PID (USB_VENDOR_ID_UGEE ,USB_DEVICE_ID_UGEE_TABLET_RAINBOW_CV720 ):/* If this is the pen interface */
Signature · 1 line
2.25.1
PATCH 7/7 HID: uclogic: Switch to Digitizer usage for styluses
In reply to José ExpósitoFrom: Nikolai Kondrashov <[email protected]>
The (incorrect) "Pen" (0x02) application usage used in replacement report descriptors throughout the drivers leads to all tablets recognized as a "direct" input device (i.e. a tablet monitor) by recent kernels, which messes up desktop environments [1].
Replace the application usage with "Digitizer" (0x01) for each non-display graphics tablet.
[1] https://lore.kernel.org/linux-input/[email protected]/
--- drivers/hid/hid-kye.c | 12 ++++++------ drivers/hid/hid-uclogic-rdesc.c | 18 +++++++++--------- drivers/hid/hid-viewsonic.c | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-)
drivers/hid/hid-kye.c +6 -6
@@ -33,7 +33,7 @@ static __u8 easypen_i405x_rdesc_fixed[] = {0xB1 ,0x02 ,/* Feature (Variable), */ 0xC0 ,/* End Collection, */ 0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x10 ,/* Report ID (16), */ 0x09, 0x20, /* Usage (Stylus), */
@@ -91,7 +91,7 @@ static __u8 mousepen_i608x_rdesc_fixed[] = {0xB1 ,0x02 ,/* Feature (Variable), */ 0xC0 ,/* End Collection, */ 0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x10 ,/* Report ID (16), */ 0x09, 0x20, /* Usage (Stylus), */
@@ -190,7 +190,7 @@ static __u8 mousepen_i608x_v2_rdesc_fixed[] = {0xB1 ,0x02 ,/* Feature (Variable), */ 0xC0 ,/* End Collection, */ 0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x10 ,/* Report ID (16), */ 0x09, 0x20, /* Usage (Stylus), */
@@ -289,7 +289,7 @@ static __u8 easypen_m610x_rdesc_fixed[] = {0xB1 ,0x02 ,/* Feature (Variable), */ 0xC0 ,/* End Collection, */ 0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x10 ,/* Report ID (16), */ 0x09, 0x20, /* Usage (Stylus), */
@@ -368,7 +368,7 @@ static __u8 pensketch_m912_rdesc_fixed[] = {0xB1 ,0x02 ,/* Feature (Variable), */ 0xC0 ,/* End Collection, */ 0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x10 ,/* Report ID (16), */ 0x09, 0x20, /* Usage (Stylus), */
@@ -497,7 +497,7 @@ static __u8 easypen_m406xe_rdesc_fixed[] = {0xB1 ,0x02 ,/* Feature (Variable), */ 0xC0 ,/* End Collection, */ 0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x10 ,/* Report ID (16), */ 0x09, 0x20, /* Usage (Stylus), */
drivers/hid/hid-uclogic-rdesc.c +9 -9
@@ -21,7 +21,7 @@/* Fixed WP4030U report descriptor */ __u8 uclogic_rdesc_wp4030u_fixed_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x09 ,/* Report ID (9), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -66,7 +66,7 @@ const size_t uclogic_rdesc_wp4030u_fixed_size =/* Fixed WP5540U report descriptor */ __u8 uclogic_rdesc_wp5540u_fixed_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x09 ,/* Report ID (9), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -143,7 +143,7 @@ const size_t uclogic_rdesc_wp5540u_fixed_size =/* Fixed WP8060U report descriptor */ __u8 uclogic_rdesc_wp8060u_fixed_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x09 ,/* Report ID (9), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -220,7 +220,7 @@ const size_t uclogic_rdesc_wp8060u_fixed_size =/* Fixed WP1062 report descriptor */ __u8 uclogic_rdesc_wp1062_fixed_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x09 ,/* Report ID (9), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -268,7 +268,7 @@ const size_t uclogic_rdesc_wp1062_fixed_size =/* Fixed PF1209 report descriptor */ __u8 uclogic_rdesc_pf1209_fixed_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x09 ,/* Report ID (9), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -345,7 +345,7 @@ const size_t uclogic_rdesc_pf1209_fixed_size =/* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */ __u8 uclogic_rdesc_twhl850_fixed0_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x09 ,/* Report ID (9), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -457,7 +457,7 @@ const size_t uclogic_rdesc_twhl850_fixed2_size =/* Fixed TWHA60 report descriptor, interface 0 (stylus) */ __u8 uclogic_rdesc_twha60_fixed0_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x09 ,/* Report ID (9), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -534,7 +534,7 @@ const size_t uclogic_rdesc_twha60_fixed1_size =/* Fixed report descriptor template for (tweaked) v1 pen reports */ const __u8 uclogic_rdesc_v1_pen_template_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x07 ,/* Report ID (7), */ 0x09 ,0x20 ,/* Usage (Stylus), */
@@ -588,7 +588,7 @@ const size_t uclogic_rdesc_v1_pen_template_size =/* Fixed report descriptor template for (tweaked) v2 pen reports */ const __u8 uclogic_rdesc_v2_pen_template_arr[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x08 ,/* Report ID (8), */ 0x09 ,0x20 ,/* Usage (Stylus), */
drivers/hid/hid-viewsonic.c +1 -1
@@ -24,7 +24,7 @@/* Fixed report descriptor of PD1011 signature pad */ static __u8 pd1011_rdesc_fixed[] = {0x05 ,0x0D ,/* Usage Page (Digitizer), */ -0x09 ,0x02 ,/* Usage (Pen), */ +0x09 ,0x01 ,/* Usage (Digitizer), */ 0xA1 ,0x01 ,/* Collection (Application), */ 0x85 ,0x02 ,/* Report ID (2), */ 0x09 ,0x20 ,/* Usage (Stylus), */
Signature · 1 line
2.25.1
Jiri Kosina
maintainerQuoted 10 lines · José Expósito
Hi everyone,
This series is a follow up to [1], [2], [3], [4] and [5] upstreaming 7 more patches from the DIGImend project.
After 3 months, I'm happy to write that this is the last batch of patches :) Once the patchset is applied, DIGImend and the mainline kernel will have the same code... And I'll finally add support for my tablet. This should also allow Stefan and Alberto to continue with their work.
This is now in hid.git#for-5.19/uclogic. Thanks for all the work,
Signature · 2 lines
Jiri Kosina SUSE Labs