aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid
AgeCommit message (Collapse)AuthorFilesLines
2020-05-05HID: i2c-hid: add Schneider SCL142ALM to descriptor overrideJulian Sax1-0/+8
This device uses the SIPODEV SP1064 touchpad, which does not supply descriptors, so it has to be added to the override list. Cc: [email protected] Signed-off-by: Julian Sax <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-05-05HID: intel-ish-hid: avoid bogus uninitialized-variable warningArnd Bergmann1-0/+2
Older compilers like gcc-4.8 don't see that the variable is initialized when it is used: In file included from include/linux/compiler_types.h:68:0, from <command-line>:0: drivers/hid/intel-ish-hid/ishtp-fw-loader.c: In function 'load_fw_from_host': include/linux/compiler-gcc.h:75:45: warning: 'fw_info.ldr_capability.max_dma_buf_size' may be used uninitialized in this function [-Wmaybe-uninitialized] #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^ drivers/hid/intel-ish-hid/ishtp-fw-loader.c:770:22: note: 'fw_info.ldr_capability.max_dma_buf_size' was declared here struct shim_fw_info fw_info; ^ Make sure to initialize it before returning an error from ish_query_loader_prop(). Fixes: 91b228107da3 ("HID: intel-ish-hid: ISH firmware loader client driver") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-05-04HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dockHans de Goede2-0/+2
Add a HID_QUIRK_NO_INIT_REPORTS quirk for the Dell K12A keyboard-dock, which can be used with various Dell Venue 11 models. Without this quirk the keyboard/touchpad combo works fine when connected at boot, but when hotplugged 9 out of 10 times it will not work properly. Adding the quirk fixes this. Cc: Mario Limonciello <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-29HID: mcp2221: add gpiolib dependencyArnd Bergmann1-0/+1
Without gpiolib, this driver fails to link: arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp2221_probe': hid-mcp2221.c:(.text+0x1b0): undefined reference to `devm_gpiochip_add_data' arm-linux-gnueabi-ld: drivers/hid/hid-mcp2221.o: in function `mcp_gpio_get': hid-mcp2221.c:(.text+0x30c): undefined reference to `gpiochip_get_data' Fixes: 328de1c519c5 ("HID: mcp2221: add GPIO functionality support") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Rishi Gupta <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-29HID: i2c-hid: reset Synaptics SYNA2393 on resumeDaniel Playfair Cal2-0/+5
On the Dell XPS 9570, the Synaptics SYNA2393 touchpad generates spurious interrupts after resuming from suspend until it receives some input or is reset. Add it to the quirk I2C_HID_QUIRK_RESET_ON_RESUME so that it is reset when resuming from suspend. More information about the bug can be found in this mailing list discussion: https://www.spinics.net/lists/linux-input/msg59530.html Signed-off-by: Daniel Playfair Cal <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-29HID: wacom: Report 2nd-gen Intuos Pro S center button status over BTJason Gerecke1-3/+6
The state of the center button was not reported to userspace for the 2nd-gen Intuos Pro S when used over Bluetooth due to the pad handling code not being updated to support its reduced number of buttons. This patch uses the actual number of buttons present on the tablet to assemble a button state bitmap. Link: https://github.com/linuxwacom/xf86-input-wacom/issues/112 Fixes: cd47de45b855 ("HID: wacom: Add 2nd gen Intuos Pro Small support") Signed-off-by: Jason Gerecke <[email protected]> Cc: [email protected] # v5.3+ Signed-off-by: Jiri Kosina <[email protected]>
2020-04-29HID: usbhid: Fix race between usbhid_close() and usbhid_stop()Alan Stern2-8/+30
The syzbot fuzzer discovered a bad race between in the usbhid driver between usbhid_stop() and usbhid_close(). In particular, usbhid_stop() does: usb_free_urb(usbhid->urbin); ... usbhid->urbin = NULL; /* don't mess up next start */ and usbhid_close() does: usb_kill_urb(usbhid->urbin); with no mutual exclusion. If the two routines happen to run concurrently so that usb_kill_urb() is called in between the usb_free_urb() and the NULL assignment, it will access the deallocated urb structure -- a use-after-free bug. This patch adds a mutex to the usbhid private structure and uses it to enforce mutual exclusion of the usbhid_start(), usbhid_stop(), usbhid_open() and usbhid_close() callbacks. Reported-and-tested-by: [email protected] Signed-off-by: Alan Stern <[email protected]> CC: <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-16HID: mcp2221: add GPIO functionality supportRishi Gupta1-0/+169
MCP2221 has 4 pins that can be used as GPIO or configured for alternate functionality such as clock generation and IRQ detection. This patch adds support for GPIO functionality. To set direction of a pin or to toggle its state after it has been configured as GPIO, driver sends command to mcp2221 and parses response received from mcp2221. Based on this response either 0 or appropriate error code is returned to GPIO framework. To get the direction or current state of a pin, driver sends command and read response from the device. Based on the response received from device direction or value is sent to the GPIO framework. Command from driver to mcp2221 device are output report. Response received from mcp2221 is input report. Datasheet (page 45-48) contains details about how to decode the response received from device: http://ww1.microchip.com/downloads/en/DeviceDoc/20005565B.pdf Signed-off-by: Rishi Gupta <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-16Revert "HID: wacom: generic: read the number of expected touches on a per ↵Jason Gerecke1-63/+16
collection basis" This reverts commit 15893fa40109f5e7c67eeb8da62267d0fdf0be9d. The referenced commit broke pen and touch input for a variety of devices such as the Cintiq Pro 32. Affected devices may appear to work normally for a short amount of time, but eventually loose track of actual touch state and can leave touch arbitration enabled which prevents the pen from working. The commit is not itself required for any currently-available Bluetooth device, and so we revert it to correct the behavior of broken devices. This breakage occurs due to a mismatch between the order of collections and the order of usages on some devices. This commit tries to read the contact count before processing events, but will fail if the contact count does not occur prior to the first logical finger collection. This is the case for devices like the Cintiq Pro 32 which place the contact count at the very end of the report. Without the contact count set, touches will only be partially processed. The `wacom_wac_finger_slot` function will not open any slots since the number of contacts seen is greater than the expectation of 0, but we will still end up calling `input_mt_sync_frame` for each finger anyway. This can cause problems for userspace separate from the issue currently taking place in the kernel. Only once all of the individual finger collections have been processed do we finally get to the enclosing collection which contains the contact count. The value ends up being used for the *next* report, however. This delayed use of the contact count can cause the driver to loose track of the actual touch state and believe that there are contacts down when there aren't. This leaves touch arbitration enabled and prevents the pen from working. It can also cause userspace to incorrectly treat single- finger input as gestures. Link: https://github.com/linuxwacom/input-wacom/issues/146 Signed-off-by: Jason Gerecke <[email protected]> Reviewed-by: Aaron Armstrong Skomra <[email protected]> Fixes: 15893fa40109 ("HID: wacom: generic: read the number of expected touches on a per collection basis") Cc: [email protected] # 5.3+ Signed-off-by: Jiri Kosina <[email protected]>
2020-04-15HID: alps: ALPS_1657 is too specific; use U1_UNICORN_LEGACY insteadJiri Kosina2-2/+2
HID_DEVICE_ID_ALPS_1657 PID is too specific, as there are many other ALPS hardware IDs using this particular touchpad. Rename the identifier to HID_DEVICE_ID_ALPS_U1_UNICORN_LEGACY in order to describe reality better. Fixes: 640e403b1fd24 ("HID: alps: Add AUI1657 device ID") Reported-by: Xiaojian Cao <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-14HID: alps: Add AUI1657 device IDArtem Borisov2-1/+2
This device is used on Lenovo V130-15IKB variants and uses the same registers as U1. Signed-off-by: Artem Borisov <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-14HID: fix typo in KconfigChristophe JAILLET1-2/+2
Fix 2 typos: s/Uninterruptable/Uninterruptible/ s/should't/shouldn't/ Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-14HID: logitech: Add support for Logitech G11 extra keysFabian Schindlatz2-0/+5
The Logitech G11 keyboard is a cheap variant of the G15 without the LCD screen. It uses the same layout for its extra and macro keys (G1 - G18, M1-M3, MR) and - from the input subsystem's perspective - behaves just like the G15, so we can treat it as such. Tested it with my own keyboard. Signed-off-by: Fabian Schindlatz <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-14HID: multitouch: add eGalaxTouch P80H84 supportSebastian Reichel2-0/+4
Add support for P80H84 touchscreen from eGalaxy: idVendor 0x0eef D-WAV Scientific Co., Ltd idProduct 0xc002 iManufacturer 1 eGalax Inc. iProduct 2 eGalaxTouch P80H84 2019 vDIVA_1204_T01 k4.02.146 Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-06HID: logitech: drop outdated references to unifying receiversFilipe Laíns3-6/+6
The hid-logitech-{dj,hidpp} were originally developed for unifying receivers but since then they have evolved and now support other types of receivers and devices. This patch adjusts the original descriptions with this in mind. Signed-off-by: Filipe Laíns <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-04-03HID: wacom: Read HID_DG_CONTACTMAX directly for non-generic devicesJason Gerecke1-1/+3
We've recently switched from extracting the value of HID_DG_CONTACTMAX at a fixed offset (which may not be correct for all tablets) to injecting the report into the driver for the generic codepath to handle. Unfortunately, this change was made for *all* tablets, even those which aren't generic. Because `wacom_wac_report` ignores reports from non- generic devices, the contact count never gets initialized. Ultimately this results in the touch device itself failing to probe, and thus the loss of touch input. This commit adds back the fixed-offset extraction for non-generic devices. Link: https://github.com/linuxwacom/input-wacom/issues/155 Fixes: 184eccd40389 ("HID: wacom: generic: read HID_DG_CONTACTMAX from any feature report") Signed-off-by: Jason Gerecke <[email protected]> Reviewed-by: Aaron Armstrong Skomra <[email protected]> CC: [email protected] # 5.3+ Signed-off-by: Benjamin Tissoires <[email protected]>
2020-04-01Merge branch 'for-linus' of ↵Linus Torvalds12-18/+871
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - Logitech HID++ protocol support improvement from Filipe Laíns - probe fix for Logitech-G* devices from Hans de Goede - a few other small code cleanups and support for new device IDs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: rmi: Simplify an error handling path in 'rmi_hid_read_block()' HID: intel-ish-hid: hbm.h: Replace zero-length array with flexible-array member HID: intel-ish-hid: ishtp-dev.h: Replace zero-length array with flexible-array member HID: Add driver fixing Glorious PC Gaming Race mouse report descriptor HID: lg-g15: Do not fail the probe when we fail to disable F# emulation HID: appleir: Use devm_kzalloc() instead of kzalloc() HID: appleir: Remove unnecessary goto label HID: logitech-dj: add support for the static device in the Powerplay mat/receiver HID: mcp2221: add usb to i2c-smbus host bridge HID: logitech-dj: add debug msg when exporting a HID++ report descriptors HID: quirks: Remove ITE 8595 entry from hid_have_special_driver
2020-04-01Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "My attempt to revitalize trivial queue I've been neglecting for years (what a disaster that was for this world, right? :) ) with patches collected from backlog that were still relevant and not applied elsewhere in the meantime" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: err.h: remove deprecated PTR_RET for good blk-mq: Fix typo in comment x86/boot: Fix comment spelling sh: mach-highlander: Fix comment spelling s390/dasd: Fix comment spelling mfd: wm8994: Fix comment spelling docs: Add reference in binfmt-misc.rst genirq: fix kerneldoc comment for irq_desc drm/amdgpu: fix two documentation mismatch issues HID: fix Kconfig word ordering list/hashtable: minor documentation corrections.
2020-04-01Merge branch 'for-5.7/mcp2221' into for-linusJiri Kosina4-0/+754
2020-04-01Merge branch 'for-5.7/logitech' into for-linusJiri Kosina1-2/+9
- Logitech HID++ protocol support improvement from Filipe Laíns
2020-04-01Merge branch 'for-5.7/ish' into for-linusJiri Kosina2-2/+2
- C99 code purification in intel-ish-hid from Gustavo A. R. Silva
2020-04-01Merge branch 'for-5.7/glorious' into for-linusJiri Kosina5-4/+100
- report descriptor fix for Glorious PC Gaming Race device from Samuel Čavoj
2020-04-01Merge branch 'for-5.7/core' into for-linusJiri Kosina1-3/+0
- device-specific (ITE 8595) fix from Hans de Goede
2020-04-01Merge branch 'for-5.7/appleir' into for-linusJiri Kosina2-10/+5
- small code cleanups in hid-appleir from Lucas Tanure
2020-03-23HID: rmi: Simplify an error handling path in 'rmi_hid_read_block()'Christophe JAILLET1-1/+0
The 'RMI_READ_REQUEST_PENDING' bit is already cleared in the error handling path. There is no need to reset it twice. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-21HID: intel-ish-hid: hbm.h: Replace zero-length array with flexible-array memberGustavo A. R. Silva1-1/+1
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-21HID: intel-ish-hid: ishtp-dev.h: Replace zero-length array with ↵Gustavo A. R. Silva1-1/+1
flexible-array member The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-18HID: Add driver fixing Glorious PC Gaming Race mouse report descriptorSamuel Čavoj4-0/+98
The Glorious Model O mice (and also at least the Model O-, which is driver-wise the same mouse) have a bug in the descriptor of HID Report with ID 2. This report is used for Consumer Control buttons, which can be mapped using the provided Windows only software. Here is an excerpt from the original descriptor: INPUT(2)[INPUT] Field(0) Flags( Constant Variable Absolute ) Field(1) Flags( Constant Variable Absolute ) Field(2) Flags( Constant Variable Absolute ) The issue is the Constant flag specified on all 3 fields, which causes the hid driver to ignore changes in these fields and essentialy causes the buttons to not work at all. The submitted driver patches the descriptor to end up with the following: INPUT(2)[INPUT] Field(0) Flags( Variable Relative ) Field(1) Flags( Variable Relative ) Field(2) Flags( Variable Relative ) The Constant bit is reset and the Relative bit has been set in order to prevent repeat events when holding down the button. Additionally, the device name is changed from the hardware-reported "SINOWEALTH Wired Gaming Mouse" to "Glorious Model O" or "Glorious Model D". Signed-off-by: Samuel Čavoj <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-17HID: lg-g15: Do not fail the probe when we fail to disable F# emulationHans de Goede1-2/+4
By default the G1-G12 keys on the Logitech gaming keyboards send F1 - F12 when in "generic HID" mode. The first thing the hid-lg-g15 driver does is disable this behavior. We have received a bugreport that this does not work when the keyboard is connected through an Aten KVM switch. Using a gaming keyboard with a KVM is a bit weird setup, but still we can try to fail a bit more gracefully here. On the G510 keyboards the same USB-interface which is used for the gaming keys is also used for the media-keys. Before this commit we would call hid_hw_stop() on failure to disable the F# emulation and then exit the probe method with an error code. This not only causes us to not handle the gaming-keys, but this also breaks the media keys which is a regression compared to the situation when these keyboards where handled by the generic hidinput driver. This commit changes the error handling to clear the hiddev drvdata (to disable our .raw_event handler) and then returning from the probe method with success. The net result of this is that, when connected through a KVM, things work as well as they did before the hid-lg-g15 driver was introduced. Fixes: ad4203f5a243 ("HID: lg-g15: Add support for the G510 keyboards' gaming keys") BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1806321 Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-17HID: fix Kconfig word orderingGeert Uytterhoeven1-1/+1
Fix a silly word ordering typo. Fixes: 42337b9d4d958daa ("HID: add driver for U2F Zero built-in LED and RNG") Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-17Merge branch 'for-linus' of ↵Linus Torvalds5-5/+10
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - string buffer formatting fixes in picolcd and sensor drivers, from Takashi Iwai - two new device IDs from Chen-Tsung Hsieh and Tony Fischetti * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: add ALWAYS_POLL quirk to lenovo pixart mouse HID: google: add moonball USB id HID: hid-sensor-custom: Use scnprintf() for avoiding potential buffer overflow HID: hid-picolcd_fb: Use scnprintf() for avoiding potential buffer overflow
2020-03-16HID: add ALWAYS_POLL quirk to lenovo pixart mouseTony Fischetti2-0/+2
A lenovo pixart mouse (17ef:608d) is afflicted common the the malfunction where it disconnects and reconnects every minute--each time incrementing the device number. This patch adds the device id of the device and specifies that it needs the HID_QUIRK_ALWAYS_POLL quirk in order to work properly. Signed-off-by: Tony Fischetti <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-16HID: google: add moonball USB idChen-Tsung Hsieh2-0/+3
Add 1 additional hammer-like device. Signed-off-by: Chen-Tsung Hsieh <[email protected]> Reviewed-by: Nicolas Boichat <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-13HID: appleir: Use devm_kzalloc() instead of kzalloc()Lucas Tanure1-3/+2
Signed-off-by: Lucas Tanure <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-13HID: appleir: Remove unnecessary goto labelLucas Tanure1-5/+2
Signed-off-by: Lucas Tanure <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-11HID: hid-sensor-custom: Use scnprintf() for avoiding potential buffer overflowTakashi Iwai1-3/+3
Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-11HID: hid-picolcd_fb: Use scnprintf() for avoiding potential buffer overflowTakashi Iwai1-2/+2
Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-10HID: logitech-dj: add support for the static device in the Powerplay ↵Filipe Laíns1-2/+7
mat/receiver The Logitech G Powerplay has a lightspeed receiver with a static HID++ device with ID 7 attached to it to. It is used to configure the led on the mat. For this reason I increased the max number of devices. Signed-off-by: Filipe Laíns <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-10HID: mcp2221: add usb to i2c-smbus host bridgeRishi Gupta4-0/+754
MCP2221 is a USB HID to I2C/SMbus host bridge device. This commit implements i2c and smbus host adapter support. 7-bit address and i2c multi-message transaction is also supported. Signed-off-by: Rishi Gupta <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-03-05HID: hyperv: NULL check before some freeing functions is not needed.Lucas Tanure1-4/+2
Fix below warnings reported by coccicheck: drivers/hid/hid-hyperv.c:197:2-7: WARNING: NULL check before some freeing functions is not needed. drivers/hid/hid-hyperv.c:211:2-7: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Lucas Tanure <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Reviewed-by: Wei Liu <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Signed-off-by: Wei Liu <[email protected]>
2020-02-27Merge branch 'for-linus' of ↵Linus Torvalds8-35/+63
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID subsystem fixes from Jiri Kosina: - syzkaller-reported error handling fixes in various drivers, from various people - increase of HID report buffer size to 8K, which is apparently needed by certain modern devices - a few new device-ID-specific fixes / quirks - battery charging status reporting fix in logitech-hidpp, from Filipe Laíns * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: hid-bigbenff: fix race condition for scheduled work during removal HID: hid-bigbenff: call hid_hw_stop() in case of error HID: hid-bigbenff: fix general protection fault caused by double kfree HID: i2c-hid: add Trekstor Surfbook E11B to descriptor override HID: alps: Fix an error handling path in 'alps_input_configured()' HID: hiddev: Fix race in in hiddev_disconnect() HID: core: increase HID report buffer size to 8KiB HID: core: fix off-by-one memset in hid_report_raw_event() HID: apple: Add support for recent firmware on Magic Keyboards HID: ite: Only bind to keyboard USB interface on Acer SW5-012 keyboard dock HID: logitech-hidpp: BatteryVoltage: only read chargeStatus if extPower is active
2020-02-18HID: hid-bigbenff: fix race condition for scheduled work during removalHanno Zulla1-0/+6
It's possible that there is scheduled work left while the device is already being removed, which can cause a kernel crash. Adding a flag will avoid this. Signed-off-by: Hanno Zulla <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2020-02-18HID: hid-bigbenff: call hid_hw_stop() in case of errorHanno Zulla1-5/+10
It's required to call hid_hw_stop() once hid_hw_start() was called previously, so error cases need to handle this. Also, hid_hw_close() is not necessary during removal. Signed-off-by: Hanno Zulla <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2020-02-18HID: hid-bigbenff: fix general protection fault caused by double kfreeHanno Zulla1-2/+8
The struct *bigben was allocated via devm_kzalloc() and then used as a parameter in input_ff_create_memless(). This caused a double kfree during removal of the device, since both the managed resource API and ml_ff_destroy() in drivers/input/ff-memless.c would call kfree() on it. Signed-off-by: Hanno Zulla <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2020-02-14HID: i2c-hid: add Trekstor Surfbook E11B to descriptor overrideKai-Heng Feng1-0/+8
The Surfbook E11B uses the SIPODEV SP1064 touchpad, which does not supply descriptors, so it has to be added to the override list. BugLink: https://bugs.launchpad.net/bugs/1858299 Signed-off-by: Kai-Heng Feng <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2020-02-12HID: alps: Fix an error handling path in 'alps_input_configured()'Christophe JAILLET1-1/+1
They are issues: - if 'input_allocate_device()' fails and return NULL, there is no need to free anything and 'input_free_device()' call is a no-op. It can be axed. - 'ret' is known to be 0 at this point, so we must set it to a meaningful value before returning Fixes: 2562756dde55 ("HID: add Alps I2C HID Touchpad-Stick support") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-02-12HID: hiddev: Fix race in in hiddev_disconnect()[email protected]1-1/+1
Syzbot reports that "hiddev" is used after it's free in hiddev_disconnect(). The hiddev_disconnect() function sets "hiddev->exist = 0;" so hiddev_release() can free it as soon as we drop the "existancelock" lock. This patch moves the mutex_unlock(&hiddev->existancelock) until after we have finished using it. Reported-by: [email protected] Fixes: 7f77897ef2b6 ("HID: hiddev: fix potential use-after-free") Suggested-by: Alan Stern <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-02-12HID: logitech-dj: add debug msg when exporting a HID++ report descriptorsFilipe Laíns1-0/+2
When exporting all other types of report descriptors we print a debug message. Not doing so for HID++ descriptors makes unaware users think that no HID++ descriptor was exported. Signed-off-by: Filipe Laíns <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-02-12HID: quirks: Remove ITE 8595 entry from hid_have_special_driverHans de Goede1-3/+0
The ITE 8595 chip used in various 2-in-1 keyboard docks works fine with the hid-generic driver (minus the RF_KILL key) and also keeps working fine when swapping drivers, so there is no need to have it in the hid_have_special_driver list. Note the other 2 USB ids in hid-ite.c were never added to hid_have_special_driver. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2020-02-12HID: core: fix off-by-one memset in hid_report_raw_event()Johan Korsnes1-1/+3
In case a report is greater than HID_MAX_BUFFER_SIZE, it is truncated, but the report-number byte is not correctly handled. This results in a off-by-one in the following memset, causing a kernel Oops and ensuing system crash. Note: With commit 8ec321e96e05 ("HID: Fix slab-out-of-bounds read in hid_field_extract") I no longer hit the kernel Oops as we instead fail "controlled" at probe if there is a report too long in the HID report-descriptor. hid_report_raw_event() is an exported symbol, so presumabely we cannot always rely on this being the case. Fixes: 966922f26c7f ("HID: fix a crash in hid_report_raw_event() function.") Signed-off-by: Johan Korsnes <[email protected]> Cc: Armando Visconti <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Alan Stern <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>