summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-core.c
AgeCommit message (Collapse)AuthorFilesLines
2022-05-11HID: uclogic: Add pen support for XP-PEN Star 06Roman Romanenko1-0/+2
Similar to other UGEE pens, but the IDs were missing. Signed-off-by: Roman Romanenko <romu4444@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>
2022-05-11HID: uclogic: Always shift touch reports to zeroNikolai Kondrashov1-7/+8
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. 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>
2022-05-11HID: uclogic: Do not focus on touch ring onlyNikolai Kondrashov1-11/+9
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>
2022-05-11HID: uclogic: Move param printing to a functionNikolai Kondrashov1-2/+2
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. 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>
2022-05-06HID: uclogic: Support disabling pen usageNikolai Kondrashov1-0/+19
Restore the ability to disable pen usage in hid-uclogic to support e.g. keyboard interfaces which also have pen usages for some reason, but which we don't want to rewrite report descriptors for. 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>
2022-04-21HID: uclogic: Add support for bitmap dialsNikolai Kondrashov1-0/+6
A bitmap dial sends reports with a dedicated bit per direction: 1 means clockwise rotation, 2 means counterclockwise, as opposed to the normal 1 and -1 values. 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>
2022-04-11HID: uclogic: Support custom device suffix for framesNikolai Kondrashov1-21/+25
Support assigning custom device name suffixes to frame input devices instead of just "Pad". This allows distinguishing multiple frame input devices, e.g. 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>
2022-04-11HID: uclogic: Add support for touch ring reportsNikolai Kondrashov1-1/+38
Add support for touch ring to UC-Logic driver. The touch ring reports can be flipped around a specific point to match the orientation and direction reported by the Wacom drivers. The proximity will also be reported similar to the Wacom drivers. 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>
2022-03-01HID: uclogic: Support multiple frame input devicesNikolai Kondrashov1-6/+13
Add support for multiple frame input devices and their parameters to the UC-Logic driver. This prepares for creating a separate input device for Huion HS610 virtual touch ring reports. 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>
2022-03-01HID: uclogic: Switch to matching subreport bytesNikolai Kondrashov1-3/+6
Switch from matching UC-Logic subreport with a mask to a full value to support detecting Huion HS610 touch dial reports. Those would match the button mask otherwise. 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>
2022-03-01HID: uclogic: Replace pen_frame_flag with subreport_listNikolai Kondrashov1-13/+27
Replace a single pen_frame_flag in struct uclogic_params with subreport_list in struct uclogic_params_pen to prepare for handling more subreports in 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>
2022-03-01HID: uclogic: Remove pen usage maskingNikolai Kondrashov1-22/+1
Remove support for pen usage masking from hid-uclogic. Disable whole interfaces instead. Most of those interfaces are useless, and if there is one which has an unused pen usage, but also has useful reports, its report descriptor should be rewritten instead. This simplifies the code and the data structures. 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>
2022-02-16HID: uclogic: Handle virtual frame reportsNikolai Kondrashov1-5/+6
Explicitly change report ID to virtual ID and handle virtual frame reports as real for consistency. 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>
2022-02-16HID: uclogic: Skip non-input raw events earlierNikolai Kondrashov1-3/+5
Early return when a non-input raw event is received to simplify the logic present in uclogic_raw_event. 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>
2022-02-16HID: uclogic: Access pen/frame params directly in raw_event handlingNikolai Kondrashov1-13/+11
Simplify the raw event handling code by accessing the uclogic_params_pen/uclogic_params_frame structs directly. 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>
2022-02-16HID: uclogic: Split pen and frame raw event handlingNikolai Kondrashov1-75/+120
In order to avoid ending up with a big uclogic_raw_event function, split it in two smaller functions: uclogic_raw_event_pen for the pen events and uclogic_raw_event_frame for the pad events. 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>
2022-02-16HID: uclogic: Rename Huion HS64 PID to Huion Tablet 2Nikolai Kondrashov1-1/+1
Since the 006d Huion PID is used by multiple tablets (at least HS64 and HS610), rename its constant to a more general "USB_DEVICE_ID_HUION_TABLET2". 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>
2022-02-16HID: uclogic: Support Huion tilt reportingNikolai Kondrashov1-0/+3
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>
2021-12-02HID: check for valid USB device for many HID driversGreg Kroah-Hartman1-0/+3
Many HID drivers assume that the HID device assigned to them is a USB device as that was the only way HID devices used to be able to be created in Linux. However, with the additional ways that HID devices can be created for many different bus types, that is no longer true, so properly check that we have a USB device associated with the HID device before allowing a driver that makes this assumption to claim it. Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: Michael Zaidman <michael.zaidman@gmail.com> Cc: Stefan Achatz <erazor_de@users.sourceforge.net> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: linux-input@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> [bentiss: amended for thrustmater.c hunk to apply] Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20211201183503.2373082-3-gregkh@linuxfoundation.org
2021-01-08HID: uclogic: Improve support for Trust PanoraCristian Klein1-0/+2
After more discussions with the [libinput project][1], it has been determined that the uclogic driver provides better support for this tablet. Fortunately, the Trust Panora is physically and logically identical with the UGEE G5, despite having a different USB vendor and product ID. [1]: https://gitlab.freedesktop.org/libinput/libinput/-/issues/482 Signed-off-by: Cristian Klein <cristian.klein@elastisys.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-10-22HID: uclogic: Add ID for Trust Flex Design TabletMartijn van de Streek1-0/+2
The Trust Flex Design Tablet has an UGTizer USB ID and requires the same initialization as the UGTizer GP0610 to be detected as a graphics tablet instead of a mouse. Signed-off-by: Martijn van de Streek <martijn@zeewinde.xyz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-07-10Merge branch 'for-5.3/uclogic' into for-linusJiri Kosina1-0/+2
2019-06-26HID: uclogic: Add support for Huion HS64 tabletKyle Godbey1-0/+2
Add support for Huion HS64 drawing tablet to hid-uclogic Signed-off-by: Kyle Godbey <me@kyle.ee> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-06-11HID: uclogic: Add support for Ugee Rainbow CV720Wang Xuerui1-0/+2
Add support for Ugee Rainbow CV720 to hid-uclogic. Signed-off-by: Wang Xuerui <git@xen0n.name> Reviewed-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Add support for Ugee G5Nikolai Kondrashov1-0/+2
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>
2019-02-21HID: uclogic: Support Gray-coded rotary encodersNikolai Kondrashov1-0/+29
Add support for converting Gray-coded rotary encoder input into dial input compatible with HID standard. Needed for Ugee G5 support. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Support faking Wacom pad device IDNikolai Kondrashov1-0/+10
Add support for inserting a Wacom pad device ID into hid-uclogic reports. This allows reporting dial inputs in a way compatible with the Wacom driver. Needed for Ugee G5 support in particular. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Add support for XP-Pen Deco 01Nikolai Kondrashov1-0/+2
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>
2019-02-21HID: uclogic: Add support for XP-Pen Star G640Nikolai Kondrashov1-0/+2
Add support for XP-Pen Star G640 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Add support for XP-Pen Star G540Nikolai Kondrashov1-0/+2
Add support for XP-Pen Star G540 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Add support for Ugee 2150Nikolai Kondrashov1-0/+2
Add support for Ugee 2150 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Support fragmented high-res reportsNikolai Kondrashov1-0/+25
Support parsing fragmented high-resolution reports in hid-uclogic to support v2 reporting protocol. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Support in-range reporting emulationNikolai Kondrashov1-0/+54
Newer UC-Logic tablets, such as ones made by Huion have stopped reporting in-range state, but they're otherwise worthy tablets. The manufacturer was notified of the problem and promised to fix this in the future. Meanwhile, detect pen coming in range, and emulate the reports to the userspace, to make the tablets useable. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Re-initialize tablets on resumeNikolai Kondrashov1-0/+21
Re-initialize UC-Logic tablets on resume. UC-Logic tablet initialization and parameter retrieval cannot be separated for the large part, so simply discard the retrieved parameters after initialization. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Extract tablet parameter discovery into a moduleNikolai Kondrashov1-326/+102
Refactor and extract UC-Logic tablet initialization and parameter discovery into a module. For these tablets, the major part of parameter discovery cannot be separated from initialization so they have to be in the same module. Define explicitly and clearly what possible quirks the tablets may have to make the driver implementation easier and simpler. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21HID: uclogic: Extract report descriptors to a moduleNikolai Kondrashov1-0/+493
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>