aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/hid (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-09-02Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hidLinus Torvalds7-2/+28
Pull HID fixes from Jiri Kosina: - data sanitization and validtion fixes for report descriptor parser from Marc Zyngier - memory leak fix for hid-elan driver from Dinghao Liu - two device-specific quirks * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: core: Sanitize event code and type when mapping input HID: core: Correctly handle ReportSize being zero HID: elan: Fix memleak in elan_input_configured HID: microsoft: Add rumble support for the 8bitdo SN30 Pro+ controller HID: quirks: Set INCREMENT_USAGE_ON_DUPLICATE for all Saitek X52 devices
2020-09-01HID: core: Sanitize event code and type when mapping inputMarc Zyngier2-0/+6
When calling into hid_map_usage(), the passed event code is blindly stored as is, even if it doesn't fit in the associated bitmap. This event code can come from a variety of sources, including devices masquerading as input devices, only a bit more "programmable". Instead of taking the event code at face value, check that it actually fits the corresponding bitmap, and if it doesn't: - spit out a warning so that we know which device is acting up - NULLify the bitmap pointer so that we catch unexpected uses Code paths that can make use of untrusted inputs can now check that the mapping was indeed correct and bail out if not. Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2020-09-01HID: core: Correctly handle ReportSize being zeroMarc Zyngier1-2/+13
It appears that a ReportSize value of zero is legal, even if a bit non-sensical. Most of the HID code seems to handle that gracefully, except when computing the total size in bytes. When fed as input to memset, this leads to some funky outcomes. Detect the corner case and correctly compute the size. Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2020-09-01HID: elan: Fix memleak in elan_input_configuredDinghao Liu1-0/+2
When input_mt_init_slots() fails, input should be freed to prevent memleak. When input_register_device() fails, we should call input_mt_destroy_slots() to free memory allocated by input_mt_init_slots(). Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-31HID: microsoft: Add rumble support for the 8bitdo SN30 Pro+ controllerNicholas Miell2-0/+3
When operating in XInput mode, the 8bitdo SN30 Pro+ requires the same quirk as the official Xbox One Bluetooth controllers for rumble to function. Other controllers like the N30 Pro 2, SF30 Pro, SN30 Pro, etc. probably also need this quirk, but I do not have the hardware to test. Signed-off-by: Nicholas Miell <nmiell@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-31HID: quirks: Set INCREMENT_USAGE_ON_DUPLICATE for all Saitek X52 devicesNirenjan Krishnan2-0/+4
The Saitek X52 family of joysticks has a pair of axes that were originally (by the Windows driver) used as mouse pointer controls. The corresponding usage page is the Game Controls page, which is not recognized by the generic HID driver, and therefore, both axes get mapped to ABS_MISC. The quirk makes the second axis get mapped to ABS_MISC+1, and therefore made available separately. One Saitek X52 device is already fixed. This patch fixes the other two known devices with VID/PID 06a3:0255 and 06a3:0762. Signed-off-by: Nirenjan Krishnan <nirenjan@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-25Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hidLinus Torvalds8-42/+49
Pull HID fixes from Jiri Kosina: - regression fix / revert of a commit that intended to reduce probing delay by ~50ms, but introduced a race that causes quite a few devices not to enumerate, or get stuck on first IRQ - buffer overflow fix in hiddev, from Peilin Ye * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: Revert "HID: usbhid: do not sleep when opening device" HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage() HID: quirks: Always poll three more Lenovo PixArt mice HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commands HID: macally: Constify macally_id_table HID: cougar: Constify cougar_id_table
2020-08-23treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva9-27/+20
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-08-18Revert "HID: usbhid: do not sleep when opening device"Jiri Kosina2-31/+24
This reverts commit d3132792285859253c466354fd8d54d1fe0ba786. This patch causes a regression with quite a few devices, as probing fails because of the race where the first IRQ is dropped on the floor (after hid_device_io_start() happens, but before the 50ms timeout passess), and report descriptor never gets parsed and populated. As this is just a boot time micro-optimization, let's revert the patch for 5.9 now, and fix this properly eventually for next merge window. Link: https://bugzilla.kernel.org/show_bug.cgi?id=208935 Reported-by: Johannes Hirte <johannes.hirte@datenkhaos.de> Reported-by: Marius Zachmann <mail@mariuszachmann.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-17HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage()Peilin Ye1-0/+4
`uref->usage_index` is not always being properly checked, causing hiddev_ioctl_usage() to go out of bounds under some cases. Fix it. Reported-by: syzbot+34ee1b45d88571c2fa8b@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=f2aebe90b8c56806b050a20b36f51ed6acabe802 Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-17HID: quirks: Always poll three more Lenovo PixArt miceSebastian Parschauer2-0/+6
The PixArt OEM mice are known for disconnecting every minute in runlevel 1 or 3 if they are not always polled. One Lenovo PixArt mouse is already fixed. Got two references for 17ef:602e and three references for 17ef:6019 misbehaving like this. Got one direct bug report for 17ef:6093 from Wyatt Ward (wyatt8740). So add HID_QUIRK_ALWAYS_POLL for all of them. Link: https://github.com/sriemer/fix-linux-mouse issue 22 Signed-off-by: Sebastian Parschauer <s.parschauer@gmx.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-17HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON commandsHans de Goede1-9/+13
Before this commit i2c_hid_parse() consists of the following steps: 1. Send power on cmd 2. usleep_range(1000, 5000) 3. Send reset cmd 4. Wait for reset to complete (device interrupt, or msleep(100)) 5. Send power on cmd 6. Try to read HID descriptor Notice how there is an usleep_range(1000, 5000) after the first power-on command, but not after the second power-on command. Testing has shown that at least on the BMAX Y13 laptop's i2c-hid touchpad, not having a delay after the second power-on command causes the HID descriptor to read as all zeros. In case we hit this on other devices too, the descriptor being all zeros can be recognized by the following message being logged many, many times: hid-generic 0018:0911:5288.0002: unknown main item tag 0x0 At the same time as the BMAX Y13's touchpad issue was debugged, Kai-Heng was working on debugging some issues with Goodix i2c-hid touchpads. It turns out that these need a delay after a PWR_ON command too, otherwise they stop working after a suspend/resume cycle. According to Goodix a delay of minimal 60ms is needed. Having multiple cases where we need a delay after sending the power-on command, seems to indicate that we should always sleep after the power-on command. This commit fixes the mentioned issues by moving the existing 1ms sleep to the i2c_hid_set_power() function and changing it to a 60ms sleep. Cc: stable@vger.kernel.org BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208247 Reported-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Reported-and-tested-by: Andrea Borgia <andrea@borgia.bo.it> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-17HID: macally: Constify macally_id_tableRikard Falkeborn1-1/+1
macally_id_table is not modified and can be made const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-17HID: cougar: Constify cougar_id_tableRikard Falkeborn1-1/+1
cougar_id_table[] is not changed and can be made const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-08-10Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hidLinus Torvalds14-150/+404
Pull HID updates from Jiri Kosina: - fix for some modern devices that return multi-byte battery report, from Grant Likely - fix for devices with Resolution Multiplier, from Peter Hutterer - device probing speed increase, from Dmitry Torokhov - ThinkPad 10 Ultrabook Keyboard support, from Hans de Goede - other small assorted fixes and device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: quirks: add NOGET quirk for Logitech GROUP HID: Replace HTTP links with HTTPS ones HID: udraw-ps3: Replace HTTP links with HTTPS ones HID: mcp2221: Replace HTTP links with HTTPS ones HID: input: Fix devices that return multiple bytes in battery report HID: lenovo: Fix spurious F23 key press report during resume from suspend HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard fn_lock support HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard support HID: lenovo: Rename fn_lock sysfs attr handlers to make them generic HID: lenovo: Factor out generic parts of the LED code HID: lenovo: Merge tpkbd and cptkbd data structures HID: intel-ish-hid: Replace PCI_DEV_FLAGS_NO_D3 with pci_save_state HID: Wiimote: Treat the d-pad as an analogue stick HID: input: do not run GET_REPORT unless there's a Resolution Multiplier HID: usbhid: remove redundant assignment to variable retval HID: usbhid: do not sleep when opening device
2020-08-10Merge branch 'for-5.9/wiimote' into for-linusJiri Kosina3-24/+50
2020-08-10Merge branch 'for-5.9/lenovo' into for-linusJiri Kosina2-79/+282
- ThinkPad 10 Ultrabook Keyboard support, from Hans de Goede
2020-08-10Merge branch 'for-5.9/intel-ish' into for-linusJiri Kosina1-5/+11
2020-08-10Merge branch 'for-5.9/core-v2' into for-linusJiri Kosina3-38/+55
- fix for some modern devices that return multi-byte battery report, from Grant Likely - fix for devices with Resolution Multiplier, from Peter Hutterer - device probing speed increase, from Dmitry Torokhov
2020-07-21HID: quirks: add NOGET quirk for Logitech GROUPIkjoon Jang2-0/+2
Add HID_QUIRK_NOGET for Logitech GROUP device. Logitech GROUP is a compound with camera and audio. When the HID interface in an audio device is requested to get specific report id, all following control transfers are stalled and never be restored back. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=203419 Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-20HID: Replace HTTP links with HTTPS onesAlexander A. Klimov2-2/+2
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-20HID: udraw-ps3: Replace HTTP links with HTTPS onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Acked-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-20HID: mcp2221: Replace HTTP links with HTTPS onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-17Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid into masterLinus Torvalds9-6/+47
Pull HID fixes from Jiri Kosina: - linked list race condition fix in hid-steam driver from Rodrigo Rivas Costa - assorted deviceID-specific quirks and other small cosmetic cleanups * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: logitech-hidpp: avoid repeated "multiplier = " log messages HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff HID: quirks: Ignore Simply Automated UPB PIM HID: apple: Disable Fn-key key-re-mapping on clone keyboards MAINTAINERS: update uhid and hid-wiimote entry HID: steam: fixes race in handling device list. HID: magicmouse: do not set up autorepeat HID: alps: support devices with report id 2 HID: quirks: Always poll Obins Anne Pro 2 keyboard HID: i2c-hid: add Mediacom FlexBook edge13 to descriptor override
2020-07-14HID: input: Fix devices that return multiple bytes in battery reportGrant Likely1-3/+3
Some devices, particularly the 3DConnexion Spacemouse wireless 3D controllers, return more than just the battery capacity in the battery report. The Spacemouse devices return an additional byte with a device specific field. However, hidinput_query_battery_capacity() only requests a 2 byte transfer. When a spacemouse is connected via USB (direct wire, no wireless dongle) and it returns a 3 byte report instead of the assumed 2 byte battery report the larger transfer confuses and frightens the USB subsystem which chooses to ignore the transfer. Then after 2 seconds assume the device has stopped responding and reset it. This can be reproduced easily by using a wired connection with a wireless spacemouse. The Spacemouse will enter a loop of resetting every 2 seconds which can be observed in dmesg. This patch solves the problem by increasing the transfer request to 4 bytes instead of 2. The fix isn't particularly elegant, but it is simple and safe to backport to stable kernels. A further patch will follow to more elegantly handle battery reports that contain additional data. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Darren Hart <darren@dvhart.com> Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: stable@vger.kernel.org Tested-by: Darren Hart <dvhart@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: lenovo: Fix spurious F23 key press report during resume from suspendHans de Goede1-0/+7
The Ultrabook Keyboard sends a spurious F23 key-press when resuming from suspend. GNOME uses F23 to toggle the touchpad on/off so this causes the OSD graphics for the touchpad toggle to show on resume. The keyboard does not actually have a F23 key, se we can simple fix it by marking the 0x00070072 HID usage, which normally is F23, to be ignored. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard fn_lock supportHans de Goede1-1/+71
Add support for setting the Fn lock value of the ThinkPad 10 Ultrabook Keyboard through sysfs, re-using the fn_lock sysfs attribute read/write helpers from the existing ThinkPad Compact Keyboard with TrackPoint support. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard supportHans de Goede2-0/+106
Some of the function keys special functions all use the same 0x000c0001 usage code, add a mapping for these based on the usage_index; And add support for the Speaker and Mic mute LEDs integrated into the F1 and F4 keys. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: lenovo: Rename fn_lock sysfs attr handlers to make them genericHans de Goede1-11/+17
Except for a single call, there is nothing keyboard-model specific about the cptkbd fn_lock sysfs attr handlers, rename them dropping the cptkbd post-/pre-fix, so that they can be re-used for supporting Fn-lock on the Thinkpad 10 ultrabook kbd. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: lenovo: Factor out generic parts of the LED codeHans de Goede1-40/+58
Factor out the generic parts of the tpkbd LED code, so that they can be re-used for supporting the LEDs on the Thinkpad 10 ultrabook kbd. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: lenovo: Merge tpkbd and cptkbd data structuresHans de Goede1-30/+26
Merge the tpkbd and cptkbd data structures, into a single unified structure instead of having a separate data structure per keyboard type. This is a preparation patch for making the tpkbd LED functions more generic, so that they can be re-used for supporting the LEDs on the Thinkpad 10 ultrabook keyboard. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: logitech-hidpp: avoid repeated "multiplier = " log messagesMaciej S. Szmigiero1-1/+1
These messages appear each time the mouse wakes from sleep, in my case (Logitech M705), every minute or so. Let's downgrade them to the "debug" level so they don't fill the kernel log by default. While we are at it, let's make clear that this is a wheel multiplier (and not, for example, XY movement multiplier). Fixes: 4435ff2f09a2 ("HID: logitech: Enable high-resolution scrolling on Logitech mice") Cc: stable@vger.kernel.org Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Reviewed-by: Harry Cutts <hcutts@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xffMazin Rezk1-3/+3
Some parts of hid-logitech-dj explicitly referred to 0xff for the receiver index. This patch changes those references to the HIDPP_RECEIVER_INDEX definition. Signed-off-by: Mazin Rezk <mnrzk@protonmail.com> Reviewed-by: Filipe LaĆ­ns <lains@archlinux.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-07-07HID: intel-ish-hid: Replace PCI_DEV_FLAGS_NO_D3 with pci_save_stateKai-Heng Feng1-5/+11
PCI_DEV_FLAGS_NO_D3 should not be used outside of PCI core. Instead, we can use pci_save_state() to hint PCI core that the device should stay at D0 during suspend. By doing so, PCI core will let the upstream bridges also stays at D0 so the entire hierarchy is in the correct power state as PCI spec mandates. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-24HID: quirks: Ignore Simply Automated UPB PIMJames Hilliard2-0/+3
As this is a cypress HID->COM RS232 style device that is handled by the cypress_M8 driver we also need to add it to the ignore list in hid-quirks. Cc: stable <stable@vger.kernel.org> Signed-off-by: James Hilliard <james.hilliard1@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-24HID: apple: Disable Fn-key key-re-mapping on clone keyboardsHans de Goede1-0/+18
The Maxxter KB-BT-001 Bluetooth keyboard, which looks somewhat like the Apple Wireless Keyboard, is using the vendor and product IDs (05AC:0239) of the Apple Wireless Keyboard (2009 ANSI version) <sigh>. But its F1 - F10 keys are marked as sending F1 - F10, not the special functions hid-apple.c maps them too; and since its descriptors do not contain the HID_UP_CUSTOM | 0x0003 usage apple-hid looks for for the Fn-key, apple_setup_input() never gets called, so F1 - F6 are mapped to key-codes which have not been set in the keybit array causing them to not send any events at all. The lack of a usage code matching the Fn key in the clone is actually useful as this allows solving this problem in a generic way. This commits adds a fn_found flag and it adds a input_configured callback which checks if this flag is set once all usages have been mapped. If it is not set, then assume this is a clone and clear the quirks bitmap so that the hid-apple code does not add any special handling to this keyboard. This fixes F1 - F6 not sending anything at all and F7 - F12 sending the wrong codes on the Maxxter KB-BT-001 Bluetooth keyboard and on similar clones. Cc: Joao Moreno <mail@joaomoreno.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-19HID: Wiimote: Treat the d-pad as an analogue stickDaniel G. Morse3-24/+50
The controllers from the Super Nintendo Classic Edition (AKA the SNES Mini) appear as a Classic Controller Pro when connected to a Wii Remote. All the buttons work as the same, with the d-pad being mapped the same as the d-pad on the Classic Controller Pro. This differs from the behaviour of most controllers with d-pads and no analogue sticks, where the d-pad maps to ABS_HAT1X for left and right, and ABS_HAT1Y for up and down. This patch adds an option to the hid-wiimote module to make the Super Nintendo Classic Controller behave this way. The patch has been tested with a Super Nintendo Classic Controller plugged into a Wii Remote in both with the option both enabled and disabled. When enabled the d-pad acts as the analogue control, and when disabled it acts as it did before the patch was applied. This patch has not been tested with e Wii Classic Controller (either the original or the pro version) as I do not have one of these controllers. Although I have not tested it with these controllers, I think it is likely this patch will also work with the NES Classic Edition Controllers. Signed-off-by: Daniel G. Morse <dmorse@speedfox.co.uk> Reviewed-by: David Rheinsberg <david.rheinsberg@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-19HID: steam: fixes race in handling device list.Rodrigo Rivas Costa1-2/+4
Using uhid and KASAN this driver crashed because it was getting several connection events where it only expected one. Then the device was added several times to the static device list and it got corrupted. This patch checks if the device is already in the list before adding it. Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> Tested-by: Siarhei Vishniakou <svv@google.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-16HID: magicmouse: do not set up autorepeatDmitry Torokhov1-0/+6
Neither the trackpad, nor the mouse want input core to generate autorepeat events for their buttons, so let's reset the bit (as hid-input sets it for these devices based on the usage vendor code). Cc: stable@vger.kernel.org Reported-by: Yariv <oigevald+kernel@gmail.com> Tested-by: Yariv <oigevald+kernel@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-16HID: alps: support devices with report id 2Caiyuan Xie1-0/+2
Add support for devices which that have reports with id == 2 Signed-off-by: Caiyuan Xie <caiyuan.xie@cn.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-16HID: quirks: Always poll Obins Anne Pro 2 keyboardSebastian Parschauer2-0/+2
The Obins Anne Pro 2 keyboard (04d9:a293) disconnects after a few minutes of inactivity when using it wired and typing does not result in any input events any more. This is a common firmware flaw. So add the ALWAYS_POLL quirk for this device. GitHub user Dietrich Moerman (dietrichm) tested the quirk and requested my help in my project https://github.com/sriemer/fix-linux-mouse issue 22 to provide this patch. Link: https://www.reddit.com/r/AnnePro/comments/gruzcb/anne_pro_2_linux_cant_type_after_inactivity/ Signed-off-by: Sebastian Parschauer <s.parschauer@gmx.de> Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-16HID: input: do not run GET_REPORT unless there's a Resolution MultiplierPeter Hutterer1-10/+20
hid-multitouch currently runs GET_REPORT for Contact Max and again to retrieve the Win8 blob. If both are within the same report, the Resolution Multiplier code calls GET_FEATURE again and this time, possibly due to timing, it causes the ILITEK-TP device interpret the GET_FEATURE as an instruction to change the mode and effectively stop the device from functioning as expected. Notably: the device doesn't even have a Resolution Multiplier so it shouldn't be affected by any of this at all. Fix this by making sure we only execute GET_REPORT if there is a Resolution Multiplier in the respective report. Where the HID_QUIRK_NO_INIT_REPORTS field is set we just bail out immediately. This shouldn't be triggered by any real device anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Wen He <wen.he_1@nxp.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-16HID: i2c-hid: add Mediacom FlexBook edge13 to descriptor overrideFederico Ricchiuto1-0/+8
The Mediacom FlexBook edge13 uses the SIPODEV SP1064 touchpad, which does not supply descriptors, so it has to be added to the override list. Signed-off-by: Federico Ricchiuto <fed.ricchiuto@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-16HID: usbhid: remove redundant assignment to variable retvalColin Ian King1-1/+1
The variable retval is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-16HID: usbhid: do not sleep when opening deviceDmitry Torokhov2-24/+31
usbhid tries to give the device 50 milliseconds to drain its queues when opening the device, but does it naively by simply sleeping in open handler, which slows down device probing (and thus may affect overall boot time). However we do not need to sleep as we can instead mark a point of time in the future when we should start processing the events. Reported-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2020-06-14treewide: replace '---help---' in Kconfig files with 'help'Masahiro Yamada3-108/+108
Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over '---help---'"), the number of '---help---' has been gradually decreasing, but there are still more than 2400 instances. This commit finishes the conversion. While I touched the lines, I also fixed the indentation. There are a variety of indentation styles found. a) 4 spaces + '---help---' b) 7 spaces + '---help---' c) 8 spaces + '---help---' d) 1 space + 1 tab + '---help---' e) 1 tab + '---help---' (correct indentation) f) 1 tab + 1 space + '---help---' g) 1 tab + 2 spaces + '---help---' In order to convert all of them to 1 tab + 'help', I ran the following commend: $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/' Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-10Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds2-6/+3
Pull input updates from Dmitry Torokhov: - a new driver for the Azoteq IQS269A capacitive touch controller - a new driver for the Cypress CY8CTMA140 touchscreen - updates to Elan and ft5x06 touchscreen drivers - assorted driver fixes - msm-vibrator has been removed as we have a more generic solution * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (28 commits) Input: adi - work around module name confict Input: iqs269a - add missing I2C dependency Input: elants - refactor elants_i2c_execute_command() Input: elants - override touchscreen info with DT properties Input: elants - remove unused axes Input: add support for Azoteq IQS269A dt-bindings: input: Add bindings for Azoteq IQS269A Input: imx_sc_key - use devm_add_action_or_reset() to handle all cleanups Input: remove msm-vibrator driver dt-bindings: Input: remove msm-vibrator Input: elants_i2c - provide an attribute to show calibration count Input: introduce input_mt_report_slot_inactive() dt-bindings: input: touchscreen: elants_i2c: convert to YAML Input: add driver for the Cypress CY8CTMA140 touchscreen dt-bindings: touchscreen: Add CY8CTMA140 bindings Input: edt-ft5x06 - prefer asynchronous probe Input: edt-ft5x06 - improve power management operations Input: edt-ft5x06 - move parameter restore into helper Input: edt-ft5x06 - fix get_default register write access Input: atkbd - receive and use physcode->keycode mapping from FW ...
2020-06-03Merge branches 'for-5.7/upstream-fixes', 'for-5.8/apple', 'for-5.8/asus', 'for-5.8/core', 'for-5.8/intel-ish', 'for-5.8/logitech', 'for-5.8/mcp2221' and 'for-5.8/multitouch' into for-linusJiri Kosina9-74/+335
2020-05-27HID: multitouch: Remove MT_CLS_WIN_8_DUALKai-Heng Feng2-50/+2
After commit c23e2043d5f7 ("HID: multitouch: do not filter mice nodes"), MT_CLS_WIN_8 also supports mouse nodes, hence make MT_CLS_WIN_8_DUAL redundant. Remove MT_CLS_WIN_8_DUAL accordingly. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2020-05-27HID: multitouch: enable multi-input as a quirk for some devicesBenjamin Tissoires1-0/+26
Two touchpad/trackstick combos are currently not behaving properly. They define a mouse emulation collection, as per Win8 requirements, but also define a separate mouse collection for the trackstick. The way the kernel currently treat the collections is that it merges both in one device. However, given that the first mouse collection already defines X,Y and left, right buttons, when mapping the events from the second mouse collection, hid-multitouch sees that these events are already mapped, and simply ignores them. To be able to report events from the tracktick, add a new quirked class for it, and manually add the 2 devices we know about. Link: https://bugzilla.kernel.org/show_bug.cgi?id=207235 Cc: stable@vger.kernel.org Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>