Re: [DIGImend-devel] huoin kernel module
Brought to you by:
spb_nick
|
From: Nikolai K. <sp...@gm...> - 2014-12-13 16:42:01
|
Hi Vince,
On 12/07/2014 04:26 AM, Vince Herried wrote:
> Here is my patch containing both the attempt to change the report id to 6
> and the additional probe that I discovered.
Thanks! Although, could you please send patches uncompressed? They're not that
big, and this way they're easier to reply to. Thank you.
First of all, to make this work you'll need to add a description of the button
report to the report descriptor, under a new ID. From your description of
reports and from what I see in the kernel source (drivers/hid/hid-input.c,
hidinput_configure_usage) you'll need 24 constant bits and
then 8 input bits mapped to the button usage page codes 1-8. Both application
and physical collections of this report need to be non-general desktop to be
mapped to BTN_0-BTN_9, perhaps vendor-specific will do.
Then you'll need to change ID of button reports from 7 to the ID of the report
you added in huion_raw_report. Note that you should leave pen input reports
arriving with the same ID unmodified.
See some comments on the patch below.
> --- hid-huion.c 2014-10-28 12:01:32.000000000 -0400
> +++ /home/vince/Documents/Huion/digimend-kernel-drivers-master/hid-huion.c 2014-12-06 21:18:07.767367504 -0500
> static const __u8 huion_tablet_rdesc_template[] = {
> 0x05, 0x0D, /* Usage Page (Digitizer), */
> 0x09, 0x02, /* Usage (Pen), */
> 0xA1, 0x01, /* Collection (Application), */
> +#ifdef Report6
> + 0x85, 0x06,
> +#else
> 0x85, 0x07, /* Report ID (7), */
> +#endif
Instead of changing the ID of the pen report description, you need to add
another report description with different ID.
> 0x09, 0x20, /* Usage (Stylus), */
> 0xA0, /* Collection (Physical), */
> 0x14, /* Logical Minimum (0), */
> @@ -65,7 +80,7 @@
> 0xA4, /* Push, */
> 0x05, 0x01, /* Usage Page (Desktop), */
> 0x65, 0x13, /* Unit (Inch), */
> - 0x55, 0xFD, /* Unit Exponent (-3), */
> + 0x55, 0xFD, /* Unit Exponent (-3), 0x55,0x0d ? */
0xFD is correct. The official report descriptor tool is violating the
specification by storing unit exponent as 0x0D, although the drivers follow
suit.
> @@ -259,10 +297,14 @@
> /* If this is a pen input report */
> if (intf->cur_altsetting->desc.bInterfaceNumber == 0 &&
> report->type == HID_INPUT_REPORT &&
> - report->id == 0x07 && size >= 2)
> + report->id == 0x07 && size >= 2)
> + {
> /* Invert the in-range bit */
> data[1] ^= 0x40;
> -
> + #ifdef Report6
> + report->id = 0x06;
> + #endif
> + }
You should replace report ID for button reports only. Conversely, you should
invert the in-range bit for pen reports only.
Still, I'm not sure if replacing report ID in this way will work.
Nick
> On Sat, Dec 6, 2014 at 4:17 PM, Nikolai Kondrashov <sp...@gm... <mailto:sp...@gm...>> wrote:
>
> Hi Vince,
>
>
> On 12/06/2014 04:49 AM, Vince Herried wrote:
>
> I tried changing the report id from 7 -> 6.
> Didn't work.
>
> In the if statement where you check for report->id == 7
> and also the report descriptor.
>
>
> I added code to include the 0x7b probe. Seems to be working fine.
>
> What can I do to make some progress on this?
>
>
> Can you send a patch with your changes?
> If you can't make a patch, can you send the modified code?
>
> Thank you.
>
> Nick
>
>
|