summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-uclogic-rdesc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* HID: uclogic: constify fixed up report descriptorThomas Weißschuh2024-09-051-10/+10
| | | | | | | | | Now that the HID core can handle const report descriptors, constify them where possible. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240828-hid-const-fixup-2-v1-14-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
* Merge branch 'for-6.11/uclogic' into for-linusBenjamin Tissoires2024-07-161-4/+5
|\ | | | | | | | | | | Couple of hid-uclogic fixes by José Expósito: - Support HUION devices with up to 20 buttons - Use Rx and Ry for touch strips
| * HID: uclogic: Use Rx and Ry for touch stripsJosé Expósito2024-06-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, HUION devices use ABS_WHEEL as the usage for touch strips. There are 2 main issues with this approach: The first one is that the descriptor for touch rings (uclogic_rdesc_v2_frame_touch_ring_arr) also uses ABS_WHEEL. >From user-space it is impossible to know which device sends the events. The second one is that Wacom uses ABS_RX/ABS_RY to notify events from touch strips and user-space was designed to handle those axes. Change the usage of touch strips to Rx/Ry to fix both issues. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/989 Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
| * HID: uclogic: Support HUION devices with up to 20 buttonsJosé Expósito2024-06-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The HID descriptor for HUION tablets was limited to 13 buttons. However, there are devices with more buttons in their frames. So far, the device with more buttons released by HUION is the Huion Kamvas Pro 24 (GT-240, QHD) [1], with 20 buttons. Tweak the HID descriptor to support it. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/989 [1] Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
* | HID: uclogic: Avoid linking common code into multiple modulesJosé Expósito2024-06-191-0/+2
|/ | | | | | | | | | | | | | | | | The hid-uclogic-params.o and hid-uclogic-rdesc.o files are linked into both the driver module and the unit test, which triggers a W=1 warning: scripts/Makefile.build:236: drivers/hid/Makefile: hid-uclogic-rdesc.o is added to multiple modules: hid-uclogic hid-uclogic-test scripts/Makefile.build:236: drivers/hid/Makefile: hid-uclogic-params.o is added to multiple modules: hid-uclogic hid-uclogic-test Avoids this by moving these two files into a separate module that is used by the driver and the unit test. Reported-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
* HID: uclogic: Refactor UGEEv2 probe magic dataJosé Expósito2023-01-181-0/+6
| | | | | | | | | | | | | A fututure patch will need to use the array of magic data that the UGEEv2 devices expect on probe and the endpoint number. Move them to a common place. Refactor, no functional changes. Tested-by: Mia Kanashi <chad@redpilled.dev> Tested-by: Andreas Grosse <andig.mail@t-online.de> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge branch 'for-6.2/uclogic' into for-linusJiri Kosina2022-12-131-0/+34
|\ | | | | | | - XP-PEN Deco LW support (José Expósito)
| * HID: uclogic: Add support for XP-PEN Deco LWJosé Expósito2022-11-041-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The XP-PEN Deco LW is a UGEE v2 device with a frame with 8 buttons. Its pen has 2 buttons, supports tilt and pressure. It can be connected by USB cable or using a USB Bluetooth dongle to use it in wireless mode. When it is connected using the dongle, the device battery is used to power it. Its vendor, product and version are identical to the Deco L. The only difference reported by its firmware is the product name. In order to add support for battery reporting, add a new HID descriptor and a quirk to detect the wireless version of the tablet. Link: https://github.com/DIGImend/digimend-kernel-drivers/issues/635 Tested-by: Mia Kanashi <chad@redpilled.dev> Tested-by: Andreas Grosse <andig.mail@t-online.de> Tested-by: Mia Kanashi <chad@redpilled.dev> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: uclogic: Fix frame templates for big endian architecturesJosé Expósito2022-11-141-1/+1
|/ | | | | | | | | | | | | | | | When parsing a frame template with a placeholder indicating the number of buttons present on the frame its value was incorrectly set on big endian architectures due to double little endian conversion. In order to reproduce the issue and verify the fix, run the HID KUnit tests on the PowerPC architecture: $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/hid \ --arch=powerpc --cross_compile=powerpc64-linux-gnu- Fixes: 867c89254425 ("HID: uclogic: Allow to generate frame templates") Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Add support for UGEE v2 mouse framesJosé Expósito2022-08-251-0/+34
| | | | | | | | | Add the required HID descriptors and the initialization function for UGEE v2 frames with a mouse in the frame. Tested-by: Jouke Witteveen <j.witteveen@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Add support for UGEE v2 dial framesJosé Expósito2022-08-251-0/+40
| | | | | | | | | Add the required HID descriptors and the initialization function for UGEE v2 frames with a bitmap dial. Tested-by: Jouke Witteveen <j.witteveen@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Fix warning in uclogic_rdesc_template_applyJosé Expósito2022-08-251-1/+1
| | | | | | | | | | | | | | Building with Sparse enabled prints this warning: warning: incorrect type in assignment (different base types) expected signed int x got restricted __le32 [usertype] Cast the return value of cpu_to_le32() to fix the warning. Fixes: 08177f4 ("HID: uclogic: merge hid-huion driver in hid-uclogic") Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Add support for XP-PEN Deco LJosé Expósito2022-06-151-0/+102
| | | | | | | | | | | | | | | | | | The XP-PEN Deco L (UGEE) needs to be initialized by sending a buffer of magic data, discovered by sniffing the Windows driver traffic. In order to differentiate UGEE tablets that need this kind of initialization from the previous ones, name them v2 internally and create an entry point for them. After initialization, the template report descriptors can be discovered by parsing a string descriptor, similar to the one exposed by HUION v1 devices. Add all the required elements to support the device. Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Allow to generate frame templatesJosé Expósito2022-06-151-3/+11
| | | | | | | | | Add a new template placeholder to allow configuring the number of buttons in the drawing tablet frame and update the KUnit tests to cover the new case. Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Make template placeholder IDs genericJosé Expósito2022-06-151-7/+7
| | | | | | | | | | | | | Up until now, the report descriptor template parameter IDs were only used with pen report descriptors and they were named accordingly. Rename the enum and the total number of IDs to make them interface agnostic. Refactor, no functional changes. Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Switch to Digitizer usage for stylusesNikolai Kondrashov2022-05-111-9/+9
| | | | | | | | | | | | | | | | 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/f39ce5d5-bd5b-bd3f-3ea2-9b2a89ba1eb1@gmail.com/ Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Differentiate touch ring and touch stripNikolai Kondrashov2022-05-111-0/+48
| | | | | | | | Improve support for touch strips. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Do not focus on touch ring onlyNikolai Kondrashov2022-05-111-2/+2
| | | | | | | | | | Accommodate both touch ring and touch strip in naming throughout hid-uclogic by talking about abstract "touch" instead of "touch ring", wherever possible. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Add support for Huion Q620MNikolai Kondrashov2022-04-211-0/+50
| | | | | | | | The Huion Q620M tablet needs a v2 frame dial. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Add support for Huion touch ring reportsNikolai Kondrashov2022-04-111-8/+57
| | | | | | | | Support touch ring reports found in Huion HS610 to the UC-Logic driver. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Put version first in rdesc namespaceNikolai Kondrashov2022-03-011-14/+14
| | | | | | | | | Put general hardware version before everything else in uclogic_rdesc_ namespace. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Use "frame" instead of "buttonpad"Nikolai Kondrashov2022-03-011-16/+16
| | | | | | | | | Use the term "frame" instead of "buttonpad" for consistency, in UC-Logic driver. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Use different constants for frame report IDsNikolai Kondrashov2022-03-011-4/+5
| | | | | | | | | Allow to set the report ID in UCLOGIC_RDESC_FRAME_BYTES instead of using a hardcoded value. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Specify total report size to buttonpad macroNikolai Kondrashov2022-03-011-6/+6
| | | | | | | | | Simplify the UCLOGIC_RDESC_BUTTONPAD_BYTES macro by passing as param the size of the report to pad to in bytes. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Support Huion 13th frame buttonNikolai Kondrashov2022-02-161-4/+4
| | | | | | | | | Support reporting 13th frame button for Huion tablets. This supports reporting the button in the center of the dial for Huion HS610. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uclogic: Support Huion tilt reportingNikolai Kondrashov2022-02-161-1/+11
| | | | | | | | | | | Add support for Huion v2 protocol tilt reporting. Describe reports as angles in degrees, which is not exactly true, but there doesn't seem to be a straightforward, consistent conversion possible, and what's reported would have to be enough. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: hid-uclogic-rdesc: Kernel-doc is for functions and structsLee Jones2021-04-071-1/+1
| | | | | | | | | | | | Fixes the following W=1 kernel build warning(s): drivers/hid/hid-uclogic-rdesc.c:645: warning: wrong kernel-doc identifier on line: Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: linux-input@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
* HID: uclogic: Add support for Ugee G5Nikolai Kondrashov2019-02-211-0/+54
| | | | | | | Add support for Ugee G5 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
* HID: uclogic: Add support for XP-Pen Deco 01Nikolai Kondrashov2019-02-211-0/+35
| | | | | | | Add support for XP-Pen Deco 01 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
* HID: uclogic: Add support for Ugee EX07S frame controlsNikolai Kondrashov2019-02-211-0/+27
| | | | | | | Add proper support for Ugee EX07(S) frame controls to hid-uclogic. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
* HID: uclogic: Support v2 protocolNikolai Kondrashov2019-02-211-0/+63
| | | | | | | | Add support for UC-Logic v2 protocol to hid-uclogic. This adds support for a bunch of new Huion models. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
* HID: uclogic: Designate current protocol v1Nikolai Kondrashov2019-02-211-8/+8
| | | | | | | | Designate the current UC-Logic tablet initialization protocol v1, in preparation for adding support for v2 protocol. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
* HID: uclogic: Extract report descriptors to a moduleNikolai Kondrashov2019-02-211-0/+683
As hid-uclogic has a lot of report descriptors already and there's going to be more, move them out of the driver code and into a separate module. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>