summaryrefslogtreecommitdiffstats
path: root/drivers/hid
AgeCommit message (Collapse)AuthorFilesLines
2019-04-23HID: quirks: do not blacklist Logitech devicesBenjamin Tissoires1-5/+0
I am actually suggesting people to not populate this list, and I should probably start to apply my advices to myself. The end result means that if your initrd is lacking hid-logitech-dj or hid-logitech-hidpp, but still contains hid-generic, then your keyboard will work during pre-init. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-04-23Merge branch 'for-5.1/upstream-fixes' into for-5.2/logitechBenjamin Tissoires10-21/+48
2019-04-23HID: intel-ish-hid: Add Comet Lake PCI device IDSrinivas Pandruvada2-0/+2
Add Comet Lake PCI device ID to the supported device list. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-19Merge branch 'for-linus' of ↵Linus Torvalds1-1/+16
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - several new key mappings for HID - a host of new ACPI IDs used to identify Elan touchpads in Lenovo laptops * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ HID: input: add mapping for "Toggle Display" key HID: input: add mapping for "Full Screen" key HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys HID: input: add mapping for Expose/Overview key HID: input: fix mapping of aspect ratio key [media] doc-rst: switch to new names for Full Screen/Aspect keys Input: document meanings of KEY_SCREEN and KEY_ZOOM Input: elan_i2c - add hardware ID for multiple Lenovo laptops
2019-04-17HID: u2fzero: fail probe if not using USB transportJiri Kosina1-0/+3
u2fzero driver is USB-only. Therefore we have to give up in ->probe() callback in case we're called with non-USB transport driver bound, otherwise the kernel will crash trying to use USBHID API on a non-USB transport. Fixes: 42337b9d4d958("HID: add driver for U2F Zero built-in LED and RNG") Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-15HID: u2fzero: fix compiling error in u2fzero_probe()Mao Wenan1-0/+1
There is one compiling error in u2fzero_probe()->u2fzero_init_hwrng(), this is because HW_RANDOM is not set. drivers/hid/hid-u2fzero.o: In function `u2fzero_probe': hid-u2fzero.c:(.text+0xc70): undefined reference to `devm_hwrng_register' Fixes: 42337b9d4d958("HID: add driver for U2F Zero built-in LED and RNG") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Mao Wenan <maowenan@huawei.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-11Revert "HID: i2c-hid: Disable runtime PM on Synaptics touchpad"Hui Wang2-3/+0
This reverts commit 74e7c6c877f620d65a8269692d089bbd066f626c. It finally turns out the touchpad is an engineering sample and it is not the Synaptics touchpad. Let us revert this patch otherwise it will affect the real Synaptics touchpad. Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-10HID: add driver for U2F Zero built-in LED and RNGAndrej Shadura4-0/+388
U2F Zero supports custom commands for blinking the LED and getting data from the internal hardware RNG. Expose the blinking function as a LED device, and the internal hardware RNG as an HWRNG so that it can be used to feed the enthropy pool. Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-05HID: core: Do not call request_module() in async contextHans de Goede1-2/+4
request_module() may not be called form async context and in some cases hid devices may be added from an async context. One example of this happening is under hyperv, where this was triggering a WARN_ON in request_module(): [ 11.174497] hid_add_device+0xee/0x2b0 [hid] [ 11.174499] mousevsc_probe+0x223/0x2eb [hid_hyperv] [ 11.174501] vmbus_probe+0x3a/0x90 [ 11.174504] really_probe+0x229/0x420 [ 11.174506] driver_probe_device+0x115/0x130 [ 11.174507] __driver_attach_async_helper+0x87/0x90 [ 11.174509] async_run_entry_fn+0x37/0x150 This commit skips the request_module(), falling back to the old behavior of letting userspace deal with this, in case we are called from an async context. Cc: Lili Deng <v-lide@microsoft.com> Reported-by: Lili Deng <v-lide@microsoft.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-04-04HID: intel-ish-hid: fix spelling mistake "multipe" -> "multiple"Colin Ian King1-1/+1
There is a spelling mistake in a dev_err message, fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-04-03HID: macally: Add support for Macally ikey keyboardAlex Henrie4-0/+57
This enables the power and equals keys on the Macally ikey keyboard. Based on the Cougar gaming keyboard HID driver, which uses the same vendor ID. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-04-03HID: intel-ish-hid: ISH firmware loader client driverRushikesh S Kadam4-0/+1104
This driver adds support for loading Intel Integrated Sensor Hub (ISH) firmware from host file system to ISH SRAM and start execution. At power-on, the ISH subsystem shall boot to an interim Shim loader-firmware, which shall expose an ISHTP loader device. The driver implements an ISHTP client that communicates with the Shim ISHTP loader device over the intel-ish-hid stack, to download the main ISH firmware. Signed-off-by: Rushikesh S Kadam <rushikesh.s.kadam@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Nick Crews <ncrews@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-03HID: input: add mapping for Assistant keyDmitry Torokhov1-0/+1
According to HUTRR89 usage 0x1cb from the consumer page was assigned to allow launching desktop-aware assistant application, so let's add the mapping. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-02HID: core: Call request_module before doing device_addHans de Goede1-0/+8
Recent kernels allow the generic-hid driver to be used as fallback for devices with a specialized driver, when the hiddev is not listed in hid_have_special_driver. Over time we are removing more and more devices from the hid_have_special_driver table as devices get tested to support this setup. Before this commit the following happens when a HID device which has a special-driver and is no longer listed in hid_have_special_driver, gets enumerated: 1) device_add() gets called 2) bus_add_device() looks for a matching already registered hid driver, and bind hid-generic to the new device 3) kobject_uevent(&dev->kobj, KOBJ_ADD) gets called notifying userspace of the new hid_dev. udev calls modprobe based on the modalias in the uevent 4) The special driver gets loaded by modprobe 5) __hid_bus_reprobe_drivers() unbinds hid-generic and binds the new driver There are a couple of downsides to this: a) The probing messages printend when a HID driver bounds show up twice in dmesg, which is confusing for the user b) The (un)binding typically causes one or more evdev device-nodes to get (un)registered firing of udev events to which e.g. the xserver responds by (un)registering xinput devices and reporting this to interested clients. IOW the i. bind generic, ii. unbind generic, iii. bind special driver dance sets in motion a whole chain of events each step, while we really only want the events from step iii. to be reported to userspace. This commits introduces a request_module call before the device_add() call, so that the special-driver is loaded when step 2) looks for a matching driver and we directly bind the specialized driver. Note the request_module call translates to an execve("/sbin/modprobe", ...) and we now do this for each HID device added. So this is not entirely free, but adding HID devices is not something which happens 100s of times a second, so this should be fine. Signed-off-by: Hans de Goede <hdegoede@redhat.com> [bentiss: fixed typo in commit message found by checkpatch.pl] Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-04-02HID: core: move Usage Page concatenation to Main itemNicolas Saenz Julienne1-12/+24
As seen on some USB wireless keyboards manufactured by Primax, the HID parser was using some assumptions that are not always true. In this case it's s the fact that, inside the scope of a main item, an Usage Page will always precede an Usage. The spec is not pretty clear as 6.2.2.7 states "Any usage that follows is interpreted as a Usage ID and concatenated with the Usage Page". While 6.2.2.8 states "When the parser encounters a main item it concatenates the last declared Usage Page with a Usage to form a complete usage value." Being somewhat contradictory it was decided to match Window's implementation, which follows 6.2.2.8. In summary, the patch moves the Usage Page concatenation from the local item parsing function to the main item parsing function. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Terry Junge <terry.junge@poly.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-04-01HID: i2c-hid: Disable runtime PM on Synaptics touchpadHui Wang2-0/+3
We have a new Dell laptop which has the synaptics I2C touchpad (06cb:7e7e) on it. After booting up the Linux, the touchpad doesn't work, there is no interrupt when touching the touchpad, after disable the runtime PM, everything works well. I also tried the quirk of I2C_HID_QUIRK_DELAY_AFTER_SLEEP, it is better after applied this quirk, there are interrupts but data it reports is invalid. Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-01HID: logitech-hidpp: change low battery level threshold from 31 to 30 percentHans de Goede1-1/+5
According to hidpp20_batterylevel_get_battery_info my Logitech K270 keyboard reports only 2 battery levels. This matches with what I've seen after testing with batteries at varying level of fullness, it always reports either 5% or 30%. Windows reports "battery good" for the 30% level. I've captured an USB trace of Windows reading the battery and it is getting the same info as the Linux hidpp code gets. Now that Linux handles these devices as hidpp devices, it reports the battery as being low as it treats anything under 31% as low, this leads to the user constantly getting a "Keyboard battery is low" warning from GNOME3, which is very annoying. This commit fixes this by changing the low threshold to anything under 30%, which I assume is what Windows does. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-01HID: logitech-hidpp: remove hidpp_is_connected()Hans de Goede1-7/+2
Remove the hidpp_is_connected() function wrapper, and have the callers directly call hidpp_root_get_protocol_version() instead. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-01HID: logitech-hidpp: simplify printing of HID++ versionHans de Goede1-14/+6
Simply always print the HID++ version on hidpp_root_get_protocol_version success. This also fixes the version not being printed when a HID++ device connected through a receiver is already connected when the hidpp driver is loaded. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-27HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630Jeffrey Hugo1-1/+4
Similar to commit edfc3722cfef ("HID: quirks: Fix keyboard + touchpad on Toshiba Click Mini not working"), the Lenovo Miix 630 has a combo keyboard/touchpad device with vid:pid of 04F3:0400, which is shared with Elan touchpads. The combo on the Miix 630 has an ACPI id of QTEC0001, which is not claimed by the elan_i2c driver, so key on that similar to what was done for the Toshiba Click Mini. Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-27HID: picolcd: Convert to use sysfs_streq()Andy Shevchenko1-12/+6
Convert to use sysfs_streq() instead of custom approach. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-27HID: hid-sensor-custom: simplify getting .driver_dataWolfram Sang1-8/+4
We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-26HID: input: add mapping for "Toggle Display" keyDmitry Torokhov1-0/+8
According to HUT 1.12 usage 0xb5 from the generic desktop page is reserved for switching between external and internal display, so let's add the mapping. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-03-26HID: input: add mapping for "Full Screen" keyDmitry Torokhov1-0/+1
According to HUT 1.12 usage 0x232 from the consumer page is reserved for switching application between full screen and windowed mode, so let's add the mapping. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-03-26HID: input: add mapping for keyboard Brightness Up/Down/Toggle keysDmitry Torokhov1-0/+4
According to HUTRR73 usages 0x79, 0x7a and 0x7c from the consumer page correspond to Brightness Up/Down/Toggle keys, so let's add the mappings. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-03-26HID: input: add mapping for Expose/Overview keyDmitry Torokhov1-0/+2
According to HUTRR77 usage 0x29f from the consumer page is reserved for the Desktop application to present all running user’s application windows. Linux defines KEY_SCALE to request Compiz Scale (Expose) mode, so let's add the mapping. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-03-26HID: input: fix mapping of aspect ratio keyDmitry Torokhov1-1/+1
According to HUTRR37 usage 0x6d from the consumer usage page corresponds to action that selects the next available supported aspect ratio option on a device which outputs or displays video. However KEY_ZOOM means activate "Full Screen" mode, KEY_ASPECT_RATIO should be used instead. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-03-20HID: logitech: Handle 0 scroll events for the m560Peter Hutterer1-2/+3
hidpp_scroll_counter_handle_scroll() doesn't expect a 0-value scroll event, it gets interpreted as a negative scroll direction event. This can cause scroll direction resets and thus broken scrolling. Fixes: 4435ff2f09a2fc ("HID: logitech: Enable high-resolution scrolling on Logitech mice") Cc: stable@vger.kernel.org # v5.0 Reported-and-tested-by: Aimo Metsälä <aimetsal@outlook.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-03-19HID: debug: fix race condition with between rdesc_show() and device removalHe, Bo1-0/+5
There is a race condition that could happen if hid_debug_rdesc_show() is running while hdev is in the process of going away (device removal, system suspend, etc) which could result in NULL pointer dereference: BUG: unable to handle kernel paging request at 0000000783316040 CPU: 1 PID: 1512 Comm: getevent Tainted: G U O 4.19.20-quilt-2e5dc0ac-00029-gc455a447dd55 #1 RIP: 0010:hid_dump_device+0x9b/0x160 Call Trace: hid_debug_rdesc_show+0x72/0x1d0 seq_read+0xe0/0x410 full_proxy_read+0x5f/0x90 __vfs_read+0x3a/0x170 vfs_read+0xa0/0x150 ksys_read+0x58/0xc0 __x64_sys_read+0x1a/0x20 do_syscall_64+0x55/0x110 entry_SYSCALL_64_after_hwframe+0x49/0xbe Grab driver_input_lock to make sure the input device exists throughout the whole process of dumping the rdesc. [jkosina@suse.cz: update changelog a bit] Signed-off-by: he, bo <bo.he@intel.com> Signed-off-by: "Zhang, Jun" <jun.zhang@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Add interface function for PCI device pointerSrinivas Pandruvada1-0/+13
Instead of directly accessing PCI device poitner via struct ishtp_cl, create interface function for same. This is required for DMA transfer. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Use the new interface functions in HID ish clientSrinivas Pandruvada3-41/+35
Only include intel-ish-client-if.h, which has all interfaces required to implment ISHTP client. There is no longer any direct field access from core ISHTP only include files. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Move functions related to bus and deviceSrinivas Pandruvada3-16/+26
Move function idefinitions related to bus and device to common header file. Also create new function to get fw client id and move ish_hw_reset() from inline to exported function. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Add interface functions for struct ishtp_clSrinivas Pandruvada1-0/+42
Instead of directly accessing members of struct ishtp_cl, create interface functions to access them. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Move the common functions from client.hSrinivas Pandruvada2-50/+0
Move the interface functions in client.h to common include. These are already abstracted well to use as is. Also move any associated structures used by these functions. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Store ishtp_cl_device instance in deviceSrinivas Pandruvada1-0/+1
Store ishtp_cl_device pointer in device struct private data. In this way we can get ishtp_cl_device * from device struct pointer. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Move driver registry functionsSrinivas Pandruvada3-31/+6
Move the driver registry with the ishtp bus to the common interface file, which clients can include. Also rename __ishtp_cl_driver_register() to ishtp_cl_driver_register() and removed define for ishtp_cl_driver_register. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Simplify ishtp_cl_link()Srinivas Pandruvada3-12/+6
All callers will only use ISHTP_HOST_CLIENT_ID_ANY, so get rid of option to pass this additional id. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19HID: intel-ish-hid: Hide members of struct ishtp_cl_deviceSrinivas Pandruvada6-29/+66
ISH clients don't need to access any field of struct ishtp_cl_device. To avoid this create an interface functions instead where it is required. In the case of ishtp_cl_allocate(), modify the parameters so that the clients don't have to dereference. Clients can also use tracing, here a new interface is added to get the common trace function pointer, instead of direct call. The new interface functions defined in one external header file, named intel-ish-client-if.h. This is the only header files all ISHTP clients must include. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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 <hong.liu@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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 <kjlu@umn.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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 <kai.heng.feng@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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 <hyungwoo.yang@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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 <simon@gottliebtfreitag.de> Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> Tested-by: Simon Gene Gottlieb <simon@gottliebtfreitag.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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 <colin.king@canonical.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
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 <andriy.shevchenko@linux.intel.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
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 <arnd@arndb.de> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
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 <louis@kragniz.eu> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
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