mbox series

[v3,0/4] Add support for XP-PEN Deco L

Message ID 20220531181246.190729-1-jose.exposito89@gmail.com
Headers show
Series Add support for XP-PEN Deco L | expand

Message

José Expósito May 31, 2022, 6:12 p.m. UTC
Hello everyone,

This patchset adds support for the UGEE XP-PEN Deco L tablet.
This device belongs to a family of tablets that must receive a chunk of
magic data in order to be enabled (named UGEE v2 internally).

Once the device is enabled, its parameters can be discovered by parsing
a report descriptor. HUION v1 tablets have a similar report descriptor
but, in the case of UGEE v2 tablets, the number of buttons are also
discoverable [1].

The ability to discover the number of buttons is the reason for the
first 3 patches. They enable frame templates.
Because I lack the hardware to fully test this driver, I added some
KUnit tests to make sure no bugs are introduced.
I didn't see any other test in the subsystem (and I doubt I'm the first
person writing one) so please let me know if I need to move the test to
a different place.

The last patch enables the tablet.

Best wishes,
José Expósito

[1] I don't own a HUION v1 device, so I'm not sure if the information
    about the number of buttons is also present and it is not used in
    the driver for some reason.
[2] https://lore.kernel.org/linux-input/20220516112159.GA74406@elementary/T/#t

---

v1 - Initial version
https://lore.kernel.org/linux-input/20220518224702.1409327-1-jose.exposito89@gmail.com/

v2 - Fix some errors reported by the kernel test robot:

 - Add MODULE_DESCRIPTION/LICENSE/AUTHOR to hid-uclogic-rdesc-test.c
 - Remove unused variable in uclogic_params_ugee_v2_init
 - Add sparse __force anotation in the result of cpu_to_le16
 - Add DISABLE_STRUCTLEAK_PLUGIN for KUnit tests

https://lore.kernel.org/linux-input/20220518224702.1409327-1-jose.exposito89@gmail.com/T/

v3 - This version:

 - Improve Kconfig message
 - Add .kunitconfig. Thanks to Daniel Latypov for suggesting it in an
   unrelated patch:
   https://lore.kernel.org/dri-devel/CAGS_qxpV2SsihEdgXZ6+7N0dxLmdRANq+qE4iUZ2aNrf6vuLYg@mail.gmail.com/

José Expósito (4):
  HID: uclogic: Make template placeholder IDs generic
  HID: uclogic: Add KUnit tests for uclogic_rdesc_template_apply()
  HID: uclogic: Allow to generate frame templates
  HID: uclogic: Add support for XP-PEN Deco L

 drivers/hid/.kunitconfig             |   2 +
 drivers/hid/Kconfig                  |  11 ++
 drivers/hid/Makefile                 |   3 +
 drivers/hid/hid-ids.h                |   1 +
 drivers/hid/hid-uclogic-core.c       |   2 +
 drivers/hid/hid-uclogic-params.c     | 201 +++++++++++++++++++++++-
 drivers/hid/hid-uclogic-rdesc-test.c | 219 +++++++++++++++++++++++++++
 drivers/hid/hid-uclogic-rdesc.c      | 124 ++++++++++++++-
 drivers/hid/hid-uclogic-rdesc.h      |  24 ++-
 9 files changed, 573 insertions(+), 14 deletions(-)
 create mode 100644 drivers/hid/.kunitconfig
 create mode 100644 drivers/hid/hid-uclogic-rdesc-test.c

Comments

José Expósito June 6, 2022, 10:12 a.m. UTC | #1
Hi,

On Tue, May 31, 2022 at 08:12:42PM +0200, José Expósito wrote:
> Hello everyone,
> 
> This patchset adds support for the UGEE XP-PEN Deco L tablet.
> This device belongs to a family of tablets that must receive a chunk of
> magic data in order to be enabled (named UGEE v2 internally).
>
> [...]
>
> ---
> 
> v1 - Initial version
> https://lore.kernel.org/linux-input/20220518224702.1409327-1-jose.exposito89@gmail.com/
> 
> v2 - Fix some errors reported by the kernel test robot:
> 
>  - Add MODULE_DESCRIPTION/LICENSE/AUTHOR to hid-uclogic-rdesc-test.c
>  - Remove unused variable in uclogic_params_ugee_v2_init
>  - Add sparse __force anotation in the result of cpu_to_le16
>  - Add DISABLE_STRUCTLEAK_PLUGIN for KUnit tests
> 
> https://lore.kernel.org/linux-input/20220518224702.1409327-1-jose.exposito89@gmail.com/T/
> 
> v3 - This version:
> 
>  - Improve Kconfig message
>  - Add .kunitconfig. Thanks to Daniel Latypov for suggesting it in an
>    unrelated patch:
>    https://lore.kernel.org/dri-devel/CAGS_qxpV2SsihEdgXZ6+7N0dxLmdRANq+qE4iUZ2aNrf6vuLYg@mail.gmail.com/

As mentioned in the v3 changelog, I'm working on a DRM patch including
a few KUnit tests [1].

Some interesting highlights from the comments there:

- It looks like the maintainers prefer to include a single symbol [2]
to enable all tests in the subsystem.

Jiří, Benjamin, how would you like to handle it? Would you prefer to
have a symbol for each test (HID_UCLOGIC_KUNIT_TEST)? Or a symbol for
all tests (HID_KUNIT_TEST)?

- DISABLE_STRUCTLEAK_PLUGIN is not required [3]. I'd also need to
remove it here.

Jose

[1] https://lore.kernel.org/dri-devel/20220530102017.471865-1-jose.exposito89@gmail.com/T/
[2] https://lore.kernel.org/dri-devel/CABVgOSkCxu2xBnxwc6mO2AQaqzTbDf53PJzT2QvZNyLeumt5hg@mail.gmail.com/
[3] https://lore.kernel.org/dri-devel/CAGS_qxpFO4ixW=08ZcdcD9J1kU=B3mwoBJkPW8AKu0sKs8aKfA@mail.gmail.com/