aboutsummaryrefslogtreecommitdiff
path: root/drivers/hid
AgeCommit message (Collapse)AuthorFilesLines
2019-03-19HID: intel-ish-hid: Add match callback to ishtp bus typeHong Liu3-4/+23
Currently we depend on the guid check in ishtp_cl_driver.probe to match the device and driver. However Linux device core first calls the match() callback to decide the matching of driver and device, and then does some preparation before calling the driver probe function. If we return error in the driver probe, it needs to tear down all the preparation work and retry with next driver. Adding the match callback can avoid the unnecessary entry into unmatched driver probe function for ishtp clients reported by FW. Signed-off-by: Hong Liu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-03-19HID: logitech: check the return value of create_singlethread_workqueueKangjie Lu1-1/+7
create_singlethread_workqueue may fail and return NULL. The fix checks if it is NULL to avoid NULL pointer dereference. Also, the fix moves the call of create_singlethread_workqueue earlier to avoid resource-release issues. Signed-off-by: Kangjie Lu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-03-18HID: Increase maximum report size allowed by hid_field_extract()Kai-Heng Feng1-3/+3
Commit 71f6fa90a353 ("HID: increase maximum global item tag report size to 256") increases the max report size from 128 to 256. We also need to update the report size in hid_field_extract() otherwise it complains and truncates now valid report size: [ 406.165461] hid-sensor-hub 001F:8086:22D8.0002: hid_field_extract() called with n (192) > 32! (kworker/5:1) BugLink: https://bugs.launchpad.net/bugs/1818547 Fixes: 71f6fa90a353 ("HID: increase maximum global item tag report size to 256") Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-03-18HID: intel-ish: enable raw interface to HID devices on ISHHyungwoo Yang3-14/+74
Raw interface is often used to update firmwares in HID devices. We are enabling the interface to support in-field firmware update for the HID devices attached to ISH. Signed-off-by: Hyungwoo Yang <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-03-18HID: steam: fix deadlock with input devices.Rodrigo Rivas Costa1-7/+19
When using this driver with the wireless dongle and some usermode program that monitors every input device (acpid, for example), while another usermode client opens and closes the low-level device repeadedly, the system eventually deadlocks. The reason is that steam_input_register_device() must not be called with the mutex held, because the input subsystem has its own synchronization that clashes with this one: it is possible that steam_input_open() is called before input_register_device() returns, and since steam_input_open() needs to lock the mutex, it deadlocks. However we must hold the mutex when calling any function that sends commands to the controller. If not, random commands end up falling fail. Reported-by: Simon Gene Gottlieb <[email protected]> Signed-off-by: Rodrigo Rivas Costa <[email protected]> Tested-by: Simon Gene Gottlieb <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-03-11HID: uclogic: remove redudant duplicated null check on ver_ptrColin Ian King1-4/+0
Currently ver_ptr is being null checked twice, once before calling usb_string and once afterwards. The second null check is redundant and can be removed, remove it. Detected by CoverityScan, CID#1477308 ("Logically dead code") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-03-11HID: quirks: Drop misused kernel-doc annotationAndy Shevchenko1-1/+1
The kernel-doc annotation is misused for hid_mouse_ignore_list. The script complains about it: drivers/hid/hid-quirks.c:894: warning: cannot understand function prototype: 'const struct hid_device_id hid_mouse_ignore_list[] = ' Drop the annotation to make script happy. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-03-11HID: hid-asus: select CONFIG_POWER_SUPPLYArnd Bergmann1-0/+1
The newly added power supply code fails to link when the power supply core code is disabled: drivers/hid/hid-asus.o: In function `asus_battery_get_property': hid-asus.c:(.text+0x11de): undefined reference to `power_supply_get_drvdata' drivers/hid/hid-asus.o: In function `asus_probe': hid-asus.c:(.text+0x170c): undefined reference to `devm_power_supply_register' hid-asus.c:(.text+0x1734): undefined reference to `power_supply_powers' drivers/hid/hid-asus.o: In function `asus_raw_event': hid-asus.c:(.text+0x1914): undefined reference to `power_supply_changed' Select the subsystem from Kconfig as we do for other hid drivers already. Fixes: 6311d329e12a ("HID: hid-asus: Add BT keyboard dock battery monitoring support") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-03-11HID: quirks: use correct format chars in dbg_hidLouis Taylor1-2/+2
When building with -Wformat, clang warns: drivers/hid/hid-quirks.c:1075:27: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] bl_entry->driver_data, bl_entry->vendor, ^~~~~~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ drivers/hid/hid-quirks.c:1076:4: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] bl_entry->product); ^~~~~~~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ drivers/hid/hid-quirks.c:1242:12: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] quirks, hdev->vendor, hdev->product); ^~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ drivers/hid/hid-quirks.c:1242:26: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] quirks, hdev->vendor, hdev->product); ^~~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ 4 warnings generated. This patch fixes the format strings to use the correct format type for unsigned ints. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Louis Taylor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-03-05Merge branch 'for-5.1/wacom' into for-linusJiri Kosina2-21/+35
Wacom driver cleanups from Gustavo A. R. Silva and Jason Gerecke Support for Pro Pen slim from Jason Gerecke
2019-03-05Merge branch 'for-5.1/i2c-hid' into for-linusJiri Kosina6-84/+55
Fix dmesg flood for Elan touchpanels which are too slow to assert IRQ from Kai-Heng Feng
2019-03-05Merge branch 'for-5.1/ish' into for-linusJiri Kosina8-26/+26
Power management improvements from Song Hongyan Switch to new UUID API from Andy Shevchenko Generalization the driver bindin to support more than just sensors from Srinivas Pandruvada
2019-03-05Merge branch 'for-5.1/hid-uclogic' into for-linusJiri Kosina11-558/+2412
hid-uclogic driver revamp, in order to support wider range of Huion tablets, from Nikolai Kondrashov
2019-03-05Merge branch 'for-5.1/hid-topseed' into for-linusJiri Kosina2-0/+4
Toshiba WT10A tablet bluetooth keyboard support from Hans de Goede
2019-03-05Merge branch 'for-5.1/hid-sony' into for-linusJiri Kosina1-10/+21
Fixes for Shanwan PS3 support from Hongye Yuan
2019-03-05Merge branch 'for-5.1/hid-maltron' into for-linusJiri Kosina4-0/+174
Support for Maltron L90 from William Whistler
2019-03-05Merge branch 'for-5.1/hid-logitech' into for-linusJiri Kosina4-0/+68
Logitech WingMan Formula GP fix from Jarrad Whitaker
2019-03-05Merge branch 'for-5.1/hid-elan' into for-linusJiri Kosina1-1/+1
2019-03-05Merge branch 'for-5.1/hid-asus' into for-linusJiri Kosina2-16/+234
Asus Transbook T100CHI and T90CHI support from NOGUCHI Hiroshi
2019-02-21HID: Remove Waltop tablets from hid_have_special_driverNikolai Kondrashov1-9/+0
Tested with a Waltop tablet and it seems to work fine. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: Remove KYE tablets from hid_have_special_driverNikolai Kondrashov1-5/+0
Tested with one KYE tablet and it seems to work fine. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: Remove hid-uclogic entries from hid_have_special_driverNikolai Kondrashov1-17/+0
Tested with a couple UC-Logic tablets and it seems to work fine. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Do not initialize non-USB devicesNikolai Kondrashov1-2/+4
Do not try to initialize UC-Logic tablets if the underlying device is not a USB device, but e.g. a uhid device. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Add support for Ugee G5Nikolai Kondrashov5-0/+104
Add support for Ugee G5 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Support Gray-coded rotary encodersNikolai Kondrashov2-0/+37
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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Support faking Wacom pad device IDNikolai Kondrashov2-0/+19
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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Add support for XP-Pen Deco 01Nikolai Kondrashov5-0/+65
Add support for XP-Pen Deco 01 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Add support for XP-Pen Star G640Nikolai Kondrashov3-0/+5
Add support for XP-Pen Star G640 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Add support for XP-Pen Star G540Nikolai Kondrashov3-0/+5
Add support for XP-Pen Star G540 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Add support for Ugee EX07S frame controlsNikolai Kondrashov3-2/+61
Add proper support for Ugee EX07(S) frame controls to hid-uclogic. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Add support for Ugee M540Nikolai Kondrashov2-3/+26
Add support for Ugee M540 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Add support for Ugee 2150Nikolai Kondrashov3-0/+5
Add support for Ugee 2150 to hid-uclogic. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Support v2 protocolNikolai Kondrashov3-0/+278
Add support for UC-Logic v2 protocol to hid-uclogic. This adds support for a bunch of new Huion models. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Support fragmented high-res reportsNikolai Kondrashov2-0/+33
Support parsing fragmented high-resolution reports in hid-uclogic to support v2 reporting protocol. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Support in-range reporting emulationNikolai Kondrashov3-0/+58
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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Designate current protocol v1Nikolai Kondrashov3-43/+43
Designate the current UC-Logic tablet initialization protocol v1, in preparation for adding support for v2 protocol. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Extract tablet parameter discovery into a moduleNikolai Kondrashov4-327/+1090
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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: uclogic: Extract report descriptors to a moduleNikolai Kondrashov4-540/+745
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 <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: Clarify vendor ID reuse by Ugee tabletsNikolai Kondrashov3-8/+8
Add "_UCLOGIC" to Ugee tablet device ID macros so it's clear they come with UC-Logic vendor ID. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: viewsonic: Support PD1011 signature padNikolai Kondrashov4-0/+118
Add support for ViewSonic PD1011 signature (display) pad, which is also sold by Signotec under a different name. Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-21HID: kye: Add support for EasyPen M406XENikolai Kondrashov3-0/+85
Originally contributed by Andrey Alekseenko <[email protected]>. Signed-off-by: Andrey Alekseenko <[email protected]> Signed-off-by: Nikolai Kondrashov <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-20HID: wacom: Add support for Pro Pen slimJason Gerecke1-0/+2
Wacom has introduced a new pen compatible with its MobileStudio Pro and other tablets. Although adding it to the tool ID tablet is not strictly necessary unrecognized pens are reported as BTN_TOOL_PEN already, unless the tablet sends the "eraser" bit, when BTN_TOOL_RUBBER is used instead), we'll keep it updated anyway. Signed-off-by: Jason Gerecke <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
2019-02-20HID: roccat: Mark expected switch fall-throughGustavo A. R. Silva1-0/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warning: drivers/hid/hid-roccat-kone.c: In function ‘kone_keep_values_up_to_date’: drivers/hid/hid-roccat-kone.c:784:20: warning: this statement may fall through [-Wimplicit-fallthrough=] kone->actual_dpi = kone->profiles[event->value - 1]. ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ startup_dpi; ~~~~~~~~~~~ drivers/hid/hid-roccat-kone.c:786:2: note: here case kone_mouse_event_osd_profile: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-02-15HID: intel-ish-hid: remove data[128] usage on stack when sending HBM requestHong Liu3-63/+38
Instead of using an 128-byte on-stack array to store the request, we can instantiate the request on stack directly. This can save the stack usage of these functions, since most of the requests are much smaller than 128 bytes. Signed-off-by: Hong Liu <[email protected]> Tested-by: Hongyan Song <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-02-15HID: intel-ish-hid: move doorbell writing before flushHong Liu1-2/+2
Reading of IPC_REG_ISH_HOST_FWSTS will flush both message register and doorbell. So move the doorbell write before reading of IPC_REG_ISH_HOST_FWSTS. Signed-off-by: Hong Liu <[email protected]> Tested-by: Hongyan Song <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-02-15HID: intel-ish-hid: Optimize writing ipc message from queueHong Liu2-18/+3
Currently we are using one additional static variable and a spinlock to prevent contention of writing IPC messages to ISH hardware, which is not necessary. Once ISH is ready to accept new data, we can push new data to hardware. This pushing of new data is already protected by wr_processing_spinlock for contention, which is enough. So use this spinlock to check both readiness for accepting new data and once ready allow writing of ipc message from queue to ISH hardware. While here, cleaned up some space after return. Signed-off-by: Hong Liu <[email protected]> Tested-by: Hongyan Song <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-02-15HID: intel-ish-hid: avoid binding wrong ishtp_cl_deviceHong Liu1-1/+3
When performing a warm reset in ishtp bus driver, the ishtp_cl_device will not be removed, its fw_client still points to the already freed ishtp_device.fw_clients array. Later after driver finishing ishtp client enumeration, this dangling pointer may cause driver to bind the wrong ishtp_cl_device to the new client, causing wrong callback to be called for messages intended for the new client. This helps in development of firmware where frequent switching of firmwares is required without Linux reboot. Signed-off-by: Hong Liu <[email protected]> Tested-by: Hongyan Song <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-02-15HID: wacom: Mark expected switch fall-throughGustavo A. R. Silva1-0/+1
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warning: drivers/hid/wacom_wac.c: In function ‘wacom_setup_pen_input_capabilities’: drivers/hid/wacom_wac.c:3506:3: warning: this statement may fall through [-Wimplicit-fallthrough=] __clear_bit(ABS_MISC, input_dev->absbit); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/hid/wacom_wac.c:3508:2: note: here case WACOM_MO: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <[email protected]> Acked-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2019-02-14HID: fix Logitech WingMan Formula GP joined axesJarrad Whitaker4-0/+68
The Logitech WingMan Formula GP by default presents a combined accelerate/brake axis, so this patch assigns it to hid-logitech in order to benefit from the axis-splitting logic in lg4ff. There is also a fixed report descriptor for the resulting report. Signed-off-by: Jarrad Whitaker <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>