summaryrefslogtreecommitdiff
path: root/drivers/hid
AgeCommit message (Collapse)AuthorFilesLines
2024-10-04hid: intel-ish-hid: Fix uninitialized variable 'rv' in ish_fw_xfer_direct_dmaSurajSonawane24151-1/+1
Fix the uninitialized symbol 'rv' in the function ish_fw_xfer_direct_dma to resolve the following warning from the smatch tool: drivers/hid/intel-ish-hid/ishtp-fw-loader.c:714 ish_fw_xfer_direct_dma() error: uninitialized symbol 'rv'. Initialize 'rv' to 0 to prevent undefined behavior from uninitialized access. Cc: stable@vger.kernel.org Fixes: 91b228107da3 ("HID: intel-ish-hid: ISH firmware loader client driver") Signed-off-by: SurajSonawane2415 <surajsonawane0215@gmail.com> Link: https://patch.msgid.link/20241004075944.44932-1-surajsonawane0215@gmail.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-27HID: bpf: fix cfi stubs for hid_bpf_opsBenjamin Tissoires1-0/+14
With the introduction of commit e42ac1418055 ("bpf: Check unsupported ops from the bpf_struct_ops's cfi_stubs"), a HID-BPF struct_ops containing a .hid_hw_request() or a .hid_hw_output_report() was failing to load as the cfi stubs were not defined. Fix that by defining those simple static functions and restore HID-BPF functionality. This was detected with the HID selftests suddenly failing on Linus' tree. Cc: stable@vger.kernel.org # v6.11+ Fixes: 9286675a2aed ("HID: bpf: add HID-BPF hooks for hid_hw_output_report") Fixes: 8bd0488b5ea5 ("HID: bpf: add HID-BPF hooks for hid_hw_raw_requests") Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-25HID: hid-goodix: drop unsupported and undocumented DT partKrzysztof Kozlowski1-9/+0
Drop support for Devicetree from, because the binding is being reverted (on basis of duplicating existing binding) and property was not added to the original binding. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-19Merge tag 'hid-for-linus-2024091602' of ↵Linus Torvalds78-289/+1360
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - New HID over SPI driver for Goodix devices that don't follow Microsoft's HID-over-SPI specification, so a separate driver is needed. Currently supported device is GT7986U touchscreen (Charles Wang) - support for new hardware features in Wacom driver (high-res wheel scrolling, touchstrings with relative motions, support for two touchrings) (Jason Gerecke) - support for customized vendor firmware loading in intel-ish driver (Zhang Lixu) - fix for theoretical race condition in i2c-hid (Dmitry Torokhov) - support for HIDIOCREVOKE -- evdev's EVIOCREVOKE equivalent in hidraw (Peter Hutterer) - initial hidraw selftest implementation (Benjamin Tissoires) - constification of device-specific report descriptors (Thomas Weißschuh) - other small assorted fixes and device ID / quirk additions * tag 'hid-for-linus-2024091602' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (54 commits) hid: cp2112: Use irq_get_trigger_type() helper HID: i2c-hid: ensure various commands do not interfere with each other HID: multitouch: Add support for Thinkpad X12 Gen 2 Kbd Portfolio HID: wacom: Do not warn about dropped packets for first packet HID: wacom: Support sequence numbers smaller than 16-bit HID: lg: constify fixed up report descriptor HID: uclogic: constify fixed up report descriptor HID: waltop: constify fixed up report descriptor HID: sony: constify fixed up report descriptor HID: pxrc: constify fixed up report descriptor HID: steelseries: constify fixed up report descriptor HID: viewsonic: constify fixed up report descriptor HID: vrc2: constify fixed up report descriptor HID: xiaomi: constify fixed up report descriptor HID: maltron: constify fixed up report descriptor HID: keytouch: constify fixed up report descriptor HID: holtek-kbd: constify fixed up report descriptor HID: dr: constify fixed up report descriptor HID: bigbenff: constify fixed up report descriptor HID: picoLCD: Use backlight power constants ...
2024-09-13Merge branch 'for-6.12/cp2112' into for-linusBenjamin Tissoires1-5/+2
- Use irq_get_trigger_type() helper (Jinjie Ruan)
2024-09-13hid: cp2112: Use irq_get_trigger_type() helperJinjie Ruan1-5/+2
Use irq_get_trigger_type() to replace irq_get_irq_data() and then irqd_get_trigger_type(), if the irq data is NULL it will return 0. No functional changed. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://patch.msgid.link/20240913074632.3779321-1-ruanjinjie@huawei.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-13Merge branch 'for-6.12/picolcd' into for-linusBenjamin Tissoires1-2/+3
- Use backlight power constants (Thomas Zimmermann)
2024-09-13Merge branch 'for-6.12/elan' into for-linusBenjamin Tissoires3-48/+13
- Add support for one new Elan device (ekth6a12nay) (Zhaoxiong Lv)
2024-09-13Merge branch 'for-6.12/hid-playstation' into for-linusBenjamin Tissoires1-0/+20
- Enhance compatibility with clone controllers (Max Staudt)
2024-09-13Merge branch 'for-6.12/goodix-spi' into for-linusBenjamin Tissoires3-0/+825
- Add support for a new Goodix HID over SPI driver (Charles Wang) Note: this driver doesn't rely on the spefication of HID over SPI provided by Microsoft, thus needs a separate driver, not a generic bus transport low level driver.
2024-09-13Merge branch 'for-6.12/wacom' into for-linusBenjamin Tissoires2-7/+86
Various Wacom fixes (Jason Gerecke): - Support for high-resolution wheel scrolling - Support touchrings with relative motion - Support devices with two touchrings - Support sequence numbers smaller than 16-bit
2024-09-13Merge branch 'for-6.12/amd_sfh' into for-linusBenjamin Tissoires1-2/+2
- Convert comma to semicolon (Chen Ni)
2024-09-13Merge branch 'for-6.12/intel-ish' into for-linusBenjamin Tissoires3-9/+130
- Add support for vendor customized firmware loading (Zhang Lixu)
2024-09-13Merge branch 'i2c-hid' into for-linusBenjamin Tissoires1-15/+27
- ensure various commands do not interfere with each other (Dmitry Torokhov)
2024-09-13Merge branch 'for-6.12/hidraw' into for-linusBenjamin Tissoires1-4/+35
- introduction of HIDIOCREVOKE ioctl to revoke a hidraw fd opened by a regular (non-root) application (Peter Hutterer)
2024-09-13Merge branch 'for-6.12/constify-rdesc' into for-linusBenjamin Tissoires56-165/+161
- Constification of report descriptors so drivers can use read-only memory when declaring report descriptors fixups (Thomas Weißschuh)
2024-09-13Merge branch 'for-6.12/core' into for-linusBenjamin Tissoires2-25/+27
- add helper for finding a field with a certain usage (Kerem Karabay)
2024-09-13Merge branch 'for-6.11/upstream-fixes' into for-linusBenjamin Tissoires6-7/+29
Small fixes for drivers/hid: - Add support for 3 multitouch panels (He Lugang, tammy tseng and Vishnu Sankar) - Unused declarations cleanups (Yue Haibing) - Fix comma vs semicolon (Chen Ni)
2024-09-12HID: i2c-hid: ensure various commands do not interfere with each otherDmitry Torokhov1-15/+27
i2c-hid uses 2 shared buffers: command and "raw" input buffer for sending requests to peripherals and read data from peripherals when executing variety of commands. Such commands include reading of HID registers, requesting particular power mode, getting and setting reports and so on. Because all such requests use the same 2 buffers they should not execute simultaneously. Fix this by introducing "cmd_lock" mutex and acquire it whenever we needs to access ihid->cmdbuf or idid->rawbuf. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-11HID: multitouch: Add support for Thinkpad X12 Gen 2 Kbd PortfolioVishnu Sankar2-0/+7
This applies similar quirks used by previous generation device, so that Trackpoint and buttons on the touchpad works. New USB KBD PID 0x61AE for Thinkpad X12 Tab is added. Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-10HID: wacom: Do not warn about dropped packets for first packetJason Gerecke2-2/+6
The driver currently assumes that the first sequence number it will see is going to be 0. This is not a realiable assumption and can break if, for example, the tablet has already been running for some time prior to the kernel driver connecting to the device. This commit initializes the expected sequence number to -1 and will only print the "Dropped" warning the it has been updated to a non-negative value. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Tested-by: Joshua Dickens <joshua.dickens@wacom.com> Fixes: 6d09085b38e5 ("HID: wacom: Adding Support for new usages") Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-10HID: wacom: Support sequence numbers smaller than 16-bitJason Gerecke1-2/+7
The current dropped packet reporting assumes that all sequence numbers are 16 bits in length. This results in misleading "Dropped" messages if the hardware uses fewer bits. For example, if a tablet uses only 8 bits to store its sequence number, once it rolls over from 255 -> 0, the driver will still be expecting a packet "256". This patch adjusts the logic to reset the next expected packet to logical_minimum whenever it overflows beyond logical_maximum. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Tested-by: Joshua Dickens <joshua.dickens@wacom.com> Fixes: 6d09085b38e5 ("HID: wacom: Adding Support for new usages") Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-06HID: lg: constify fixed up report descriptorThomas Weißschuh1-14/+14
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/20240905-hid-const-fixup-2-v2-1-70915e0cc1c7@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05Merge tag 'hwmon-for-v6.11-rc7' into review-hansHans de Goede9-68/+73
Merge "hwmon fixes for v6.11-rc7" into review-hans to bring in commit a54da9df75cd ("hwmon: (hp-wmi-sensors) Check if WMI event data exists"). This is a dependency for a set of WMI event data refactoring changes.
2024-09-05HID: uclogic: constify fixed up report descriptorThomas Weißschuh5-28/+28
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>
2024-09-05HID: waltop: constify fixed up report descriptorThomas Weißschuh1-14/+14
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-12-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: sony: constify fixed up report descriptorThomas Weißschuh1-6/+6
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-11-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: pxrc: constify fixed up report descriptorThomas Weißschuh1-1/+1
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-10-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: steelseries: constify fixed up report descriptorThomas Weißschuh1-2/+2
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-9-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: viewsonic: constify fixed up report descriptorThomas Weißschuh1-2/+2
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-8-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: vrc2: constify fixed up report descriptorThomas Weißschuh1-1/+1
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-7-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: xiaomi: constify fixed up report descriptorThomas Weißschuh1-2/+2
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-6-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: maltron: constify fixed up report descriptorThomas Weißschuh1-2/+2
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-5-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: keytouch: constify fixed up report descriptorThomas Weißschuh1-4/+2
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-4-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: holtek-kbd: constify fixed up report descriptorThomas Weißschuh1-2/+2
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-3-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: dr: constify fixed up report descriptorThomas Weißschuh1-2/+2
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-2-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: bigbenff: constify fixed up report descriptorThomas Weißschuh1-2/+2
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-1-663b9210eb69@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-09-05HID: picoLCD: Use backlight power constantsThomas Zimmermann1-2/+3
Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-03HID: hid-sensor-custom: Convert comma to semicolonChen Ni1-1/+1
Replace a comma between expression statements by a semicolon. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-03HID: add patch for sis multitouch formattammy tseng1-0/+14
The patch is to add proper quirks for sis multitouch format Signed-off-by: tammy tseng <tammy0524@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-03HID: multitouch: Add support for lenovo Y9000P TouchpadHe Lugang2-2/+7
The 2024 Lenovo Y9000P which use GT7868Q chip also needs a fixup. The information of the chip is as follows: I2C HID v1.00 Mouse [GXTP5100:00 27C6:01E0] Signed-off-by: He Lugang <helugang@uniontech.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-03HID: amd_sfh: Convert comma to semicolonChen Ni1-2/+2
Replace a comma between expression statements by a semicolon. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-09-03HID: i2c-hid: elan: Add elan-ekth6a12nay timingZhaoxiong Lv1-0/+8
Elan-ekth6a12nay requires reset to pull down time greater than 10ms, so the configuration post_power_delay_ms is 10, and the chipset initial time is required to be greater than 300ms, so the post_gpio_reset_on_delay_ms is set to 300. Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Zhaoxiong Lv <lvzhaoxiong@huaqin.corp-partner.google.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-08-29HID: hid-goodix: Fix type promotion bug in goodix_hid_get_raw_report()Dan Carpenter1-7/+15
The issue is GOODIX_HID_PKG_LEN_SIZE is defined as sizeof(u16) which is type size_t. However, goodix_hid_check_ack_status() returns negative error codes or potentially a positive but invalid length which is too small. So when we compare "if ((response_data_len <= GOODIX_HID_PKG_LEN_SIZE)" then negative error codes are type promoted to size_t and counted as a positive large value and treated as valid. It would have been easy enough to add some casting to avoid the type promotion, however this patch takes a more thourough approach and moves the length check into goodix_hid_check_ack_status(). Now the function only return negative error codes or zero on success and the length pointer is never set to an invalid length. Fixes: 75e16c8ce283 ("HID: hid-goodix: Add Goodix HID-over-SPI driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-08-29HID: hidraw: add HIDIOCREVOKE ioctlPeter Hutterer1-4/+35
There is a need for userspace applications to open HID devices directly. Use-cases include configuration of gaming mice or direct access to joystick devices. The latter is currently handled by the uaccess tag in systemd, other devices include more custom/local configurations or just sudo. A better approach is what we already have for evdev devices: give the application a file descriptor and revoke it when it may no longer access that device. This patch is the hidraw equivalent to the EVIOCREVOKE ioctl, see commit c7dc65737c9a ("Input: evdev - add EVIOCREVOKE ioctl") for full details. An MR for systemd-logind has been filed here: https://github.com/systemd/systemd/pull/33970 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Link: https://patch.msgid.link/20240827-hidraw-revoke-v5-1-d004a7451aea@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-08-27HID: winwing: constify read-only structsThomas Weißschuh1-3/+3
These structs are never modified, so mark them as const. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240804-hid-const-winwing-v1-1-5a6c714753b1@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-08-27HID: cmedia: constify fixed up report descriptorThomas Weißschuh1-2/+2
The HID core now allows static report descriptors to be read-only, make use of it. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-7-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-08-27HID: change return type of report_fixup() to constThomas Weißschuh50-67/+67
By allowing the drivers to return a "const *" they can constify their static report arrays. This makes it clear to driver authors that the HID core will not modify those reports and they can be reused for multiple devices. Furthermore security is slightly improved as those reports are protected against accidental or malicious modifications. [bentiss: fixup hid-cougar.c and hid-multitouch.c for latest version of the master branch] Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-6-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-08-27HID: constify params and return value of fetch_item()Thomas Weißschuh1-6/+6
fetch_item() does not modify the descriptor it operates on. As a prerequisite for the constification of hid_driver::dev_rdesc, mark the parameters and return value of fetch_item() as const. Also adapt the variable types in the callers to match this constification. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-4-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2024-08-27HID: constify parameter rdesc of hid_parse_report()Thomas Weißschuh1-1/+1
The parameter is never modified, so mark it as const. This is a prerequisite for constification changes in the HID core. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-2-f53d7a7b29d8@weissschuh.net Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>