summaryrefslogtreecommitdiffstats
path: root/drivers/hid
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-4.18/wacom' into for-linusJiri Kosina2018-06-081-35/+39
|\ | | | | | | Support for "In Range" flag for Wacom Intuos/Bamboo devices from Jason Gerecke
| * HID: wacom: Support "in range" for Intuos/Bamboo tablets where possibleJason Gerecke2018-05-221-35/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 1st-generation Intuos tablets (CTL-X80) include an "in range" flag like some professional tablets. To ensure the pen remains usable at as large as distance as possible (and to preemptively disable touch when it is nearby) we need to ensure that we handle these "in range" events. Handling of tool type identification has been moved to occur only when the pen is fully in prox rather than any time the "stylus_in_proximity" flag changes (which is controlled by the further-out "in range" flag). Link: https://sourceforge.net/p/linuxwacom/bugs/358/ Link: https://github.com/linuxwacom/xf86-input-wacom/issues/14 Link: https://github.com/linuxwacom/xf86-input-wacom/issues/17 Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Tested-by: Ping Cheng <ping.cheng@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | Merge branch 'for-4.18/upstream' into for-linusJiri Kosina2018-06-081-1/+0Star
|\ \
| * | HID: quirks: remove Delcom Visual Signal Indicator from ↵Heiner Kallweit2018-05-301-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hid_have_special_driver[] Delcom offers different types of products sharing the same USB VID/PID as the Visual Signal Indicator. Other products need to be handled by HID Generic what's not possible currently because USB VID/PID are listed in hid_have_special_driver[]. After e04a0442d33b ("HID: core: remove the absolute need of hid_have_special_driver[]") we can now remove the Delcom entry. If a Visual Signal Indicator device is plugged-in, HID core will start a reprobe if hid-led driver is available. If another device with same USB VID/PID is plugged-in, then hid-led can be blacklisted and HID Generic handles the device. Thanks to Delcom for providing test devices. Reported-by: Douglas Lovett <dlovett@delcomproducts.com> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'for-4.18/rmi' into for-linusJiri Kosina2018-06-081-0/+20
|\ \ \ | | | | | | | | | | | | RMI4 correct split report handling from Benjamin Tissoires
| * | | HID: rmi: use HID_QUIRK_NO_INPUT_SYNCBenjamin Tissoires2018-05-301-0/+20
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we receive a RMI4 report, we should not unconditionally send an input_sync event. Instead, we should let the rmi4 transport layer do it for us. This fixes a situation where we might receive X in a report and the rest in a subsequent one. And this messes up user space. Link: https://bugs.freedesktop.org/show_bug.cgi?id=100436 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Oscar Morante <spacepluk@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'for-4.18/plantronics' into for-linusJiri Kosina2018-06-081-1/+5
|\ \ \
| * | | HID: hid-plantronics: Re-resend Update to map button for PTT productsTerry Junge2018-05-161-1/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Add a mapping for Push-To-Talk joystick trigger button. Tested on ChromeBox/ChromeBook with various Plantronics devices. Signed-off-by: Terry Junge <terry.junge@plantronics.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'for-4.18/multitouch' into for-linusJiri Kosina2018-06-086-131/+266
|\ \ \ | | | | | | | | | | | | | | | | - improvement of duplicate usage handling in hid-input from Benjamin Tissoires - Win 8.1 precisioun touchpad spec implementation from Benjamin Tissoires
| * | | HID: multitouch: fix calculation of last slot field in multi-touch reportsBen Chan2018-05-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to [1] and also seemingly agreed by [2], the Scan Time usage (0x0D 0x56) is a report level usage, not a contact level usage. However, the hid-multitouch driver currently includes HID_DG_SCANTIME when calculating `td->last_slot_field', which may lead to mt_complete_slot() being prematurely called in certain cases (e.g. when each touch input report includes more than one contact and the Scan Time usage appears before any contact logical collection). This patch fixes the issue by skipping mt_store_field() on HID_DG_SCANTIME, similar to how HID_DG_CONTACTCOUNT and HID_DG_CONTACTMAX are handled. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections#windows-precision-touchpad-input-reports [2] https://patchwork.kernel.org/patch/1742181/ Fixes: 29cc309d8bf19 ("HID: hid-multitouch: forward MSC_TIMESTAMP") Signed-off-by: Ben Chan <benchan@chromium.org> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: multitouch: fix types returned from mt_need_to_apply_feature()Jiri Kosina2018-05-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some exit paths from mt_need_to_apply_feature() returned int instead of bool; fix that up. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: multitouch: implement precision touchpad latency and switchesBenjamin Tissoires2018-04-261-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Win 8.1 precision touchpad spec introduce new modes for touchpads that can come in handy[1]. Implement the settings of these modes, so we are not taken off-guard if a firmware decides to enforce them. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: multitouch: simplify the settings of the various featuresBenjamin Tissoires2018-04-261-71/+60Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Win8 spec also declare other features we want to support: latency and surface and button switches. Though it doesn't seem we need to activate those by default, we have been proved in the past that manufacturers rely on the Windows driver behavior so we better mimic it to prevent further issues. The current way of setting the features is cumbersome. It avoids iterating over the list of features, but the way we store/retrieve the data just doesn't scale with more than two values. So iterate over the features when we decide to switch on the device and make it simpler to extend. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: multitouch: make use of HID_QUIRK_INPUT_PER_APPBenjamin Tissoires2018-04-261-39/+33Star
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now have HID_QUIRK_INPUT_PER_APPLICATION that splits the devices into several devices. This helps us as we can now rely on hid-input to set the names for us. Also, this helps removing some magical numbers '0' when calling .input_configured(). The only thing to take care of is that the field .report in struct hid_input is now null. We need to iterate over the full list of reports attached to a hid_input. This is required for some Advanced Silicon touchscreen to correctly apply the HID_QUIRK_INPUT_PER_APPLICATION as they have 2 reports associated with the hidinput node. One contains the Input data, the other one contains the Output data. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | HID: input: append a suffix matching the applicationBenjamin Tissoires2018-04-261-8/+59
| | | | | | | | | | | | | | | | | | | | | | | | Given that we create one input node per application, we should name the input node accordingly to not lose userspace. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | HID: generic: create one input report per application typeBenjamin Tissoires2018-04-265-10/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not a good idea to try to fit all types of applications in the same input report. There are a lot of devices that are needing the quirk HID_MULTI_INPUT but this quirk doesn't match the actual HID description as it is based on the report ID. Given that most devices with MULTI_INPUT I can think of split nicely the devices inputs into application, it is a good thing to split the devices by default based on this assumption. Also make hid-multitouch following this rule, to not have to deal with too many input created. While we are at it, fix some checkpatch complaints about converting 'unsigned' to 'unsigned int'. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | HID: store the full list of reports in the hidinputBenjamin Tissoires2018-04-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were only storing the report in case of QUIRK_MULTI_INPUT. It is interesting for the upcoming HID_QUIRK_INPUT_PER_APP to also store the full list of reports that are attached to it. We need the full list because a device (Advanced Silicon has some) might want to use a different report ID for the Input reports and the Output reports. Storing the full list allows the drivers to have all the data. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | HID: input: do not increment usages when a duplicate is foundBenjamin Tissoires2018-04-171-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is something that bothered us from a long time. When hid-input doesn't know how to map a usage, it uses *_MISC. But there is something else which increments the usage if the evdev code is already used. This leads to few issues: - some devices may have their ABS_X mapped to ABS_Y if they export a bad set of usages (see the DragonRise joysticks IIRC -> fixed in a specific HID driver) - *_MISC + N might (will) conflict with other defined axes (my Logitech H800 exports some multitouch axes because of that) - this prevents to freely add some new evdev usages, because "hey, my headset will now report ABS_COFFEE, and it's not coffee capable". So let's try to kill this nonsense, and hope we won't break too many devices. I my headset case, the ABS_MISC axes are created because of some proprietary usages, so we might not break that many devices. For backward compatibility, a quirk HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE is created and can be applied to any device that needs this behavior. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'for-4.18/i2c-hid' into for-linusJiri Kosina2018-06-081-8/+25
|\ \ \ | | | | | | | | | | | | Assorted smaller fixes to i2c-hid driver
| * | | HID: i2c-hid: remove i2c_hid_open_mutSebastian Andrzej Siewior2018-05-301-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 85ae91133152 ("HID: i2c-hid: remove custom locking from i2c_hid_open/close") there are no more users of i2c_hid_open_mut. Remove the unused mutex. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Jiri Kosina <jikos@kernel.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: i2c-hid: check if device is there before really probingDmitry Torokhov2018-05-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On many Chromebooks touch devices are multi-sourced; the components are electrically compatible and one can be freely swapped for another without changing the OS image or firmware. To avoid bunch of scary messages when device is not actually present in the system let's try testing basic communication with it and if there is no response terminate probe early with -ENXIO. Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: i2c-hid: Silently fail probe for CHPN0001 touchscreenHans de Goede2018-04-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CHPN0001 ACPI device has a _CID of PNP0C50 and even has the _DSM to get the HID descriptor address, but it is not a HID device at all. It uses its own protocol which is handled by the (still being upstreamed) chipone_icn8505 driver. I guess the _CID and the _DSM are the result of a copy and paste job when the vendor was building the ACPI tables. Before this patch the i2c_hid_driver's probe function will fail with a "hid_descr_cmd failed" error. This commit makes the i2c_hid_driver's probe function instead silently ignored devices with an ACPI id of CHPN0001. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: i2c-hid: Move i2c_hid_acpi_pdata error reporting to inside the functionHans de Goede2018-04-161-6/+5Star
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Log an error in all error paths of i2c_hid_acpi_pdata() instead of having the caller log a generic error. This is a preparation patch for allowing i2c_hid_acpi_pdata() to fail silently under certain conditions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'for-4.18/hid-steam' into for-linusJiri Kosina2018-06-084-0/+1129
|\ \ \ | | | | | | | | | | | | Valve Steam Controller support from Rodrigo Rivas Costa
| * | | HID: steam: select CONFIG_POWER_SUPPLYArnd Bergmann2018-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the power supply APIs requires selecting the appropriate Kconfig symbol, otherwise we get this build failure: drivers/hid/hid-steam.o: In function `steam_unregister': hid-steam.c:(.text+0x1cc): undefined reference to `power_supply_unregister' drivers/hid/hid-steam.o: In function `steam_battery_get_property': hid-steam.c:(.text+0x2d2): undefined reference to `power_supply_get_drvdata' drivers/hid/hid-steam.o: In function `steam_raw_event': hid-steam.c:(.text+0xcba): undefined reference to `power_supply_changed' drivers/hid/hid-steam.o: In function `steam_register': hid-steam.c:(.text+0x13e3): undefined reference to `power_supply_register' hid-steam.c:(.text+0x13fe): undefined reference to `power_supply_powers' Fixes: f82719790751 ("HID: steam: add battery device.") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: steam: add missing fields in client initializationJiri Kosina2018-05-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ->product, ->version and ->type fields in the client struct were left out unitialized from the hid device fields; fix that. Reported-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: steam: add battery device.Rodrigo Rivas Costa2018-05-151-1/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The wireless Steam Controller is battery operated, so add the battery device and power information. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: add driver for Valve Steam ControllerRodrigo Rivas Costa2018-05-154-0/+986
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways to connect the Steam Controller: directly to the USB or with the USB wireless adapter. Both methods are similar, but the wireless adapter can connect up to 4 devices at the same time. The wired device will appear as 3 interfaces: a virtual mouse, a virtual keyboard and a custom HID device. The wireless device will appear as 5 interfaces: a virtual keyboard and 4 custom HID devices, that will remain silent until a device is actually connected. The custom HID device has a report descriptor with all vendor specific usages, so the hid-generic is not very useful. In a PC/SteamBox Valve Steam Client provices a software translation by using hidraw and a creates a uinput virtual gamepad and XTest keyboard/mouse. This driver intercepts the hidraw usage, so it can get out of the way when the Steam Client is in use. Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'for-4.18/hid-redragon' into for-linusJiri Kosina2018-06-084-0/+95
|\ \ \ | | | | | | | | | | | | Redragon Asura support from Robert Munteanu
| * | | HID: redragon: Fix modifier keys for Redragon Asura KeyboardRobert Munteanu2018-04-174-0/+95
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new driver for the Redragon Asura keyboard. The Asura keyboard contains an error in the HID descriptor which causes all modifier keys to be mapped to left shift. Additionally, we suppress the creation of a second, not working, keyboard device. Signed-off-by: Robert Munteanu <rombert@apache.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | Merge branch 'for-4.18/alps' into for-linusJiri Kosina2018-06-081-5/+25
|\ \ \ | | | | | | | | | | | | | | | | hid-alps driver cleanups wrt. t4_read_write_register() handling from Christophe Jaillet
| * | | HID: alps: Fix some style in 't4_read_write_register()'Christophe JAILLET2018-04-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Better indent the code to improve readability. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: alps: Check errors returned by 't4_read_write_register()'Christophe JAILLET2018-04-261-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If only the first 't4_read_write_register()' call fails, the error code will be overwritten and lost. Directly report the error instead. While at it, log some errors if 't4_read_write_register()' fails, as done in the rest of the driver. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: alps: Save a memory allocation in 't4_read_write_register()' when ↵Christophe JAILLET2018-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writing data if 'read_flag' is false, there is no need to allocate and free memory. We can simply avoid the memory allocation and pass NULL to kfree. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | HID: alps: Report an error if we receive invalid data in ↵Christophe JAILLET2018-04-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 't4_read_write_register()' If the data received is not what is expected, we should return an error. Otherwise, we return 0 or a positive value which will be interpreted as success, but '*read_val' has not been updated. Fixes: 73196ebe134d ("HID: alps: add support for Alps T4 Touchpad device") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | | HID: core: fix hid_hw_open() commentHisao Tanabe2018-05-161-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | Fix comment typo for hid_hw_open(). [jkosina@suse.cz: write at least some changelog] Signed-off-by: Hisao Tanabe <xtanabe@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: i2c-hid: Add RESEND_REPORT_DESCR quirk for Toshiba Click Mini L9W-BHans de Goede2018-05-092-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 0457:10fb touchscreen found on the Toshiba Click Mini L9W-B needs to have a report-decriptors command send to it on resume in order for the touchscreen to start generating events again on resume. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: intel-ish-hid: use put_device() instead of kfree()Arvind Yadav2018-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Never directly free @dev after calling device_register(), even if it returned an error. Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: intel_ish-hid: Stop using a static local buffer in get_report()Hans de Goede2018-04-251-10/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hid_ishtp_get_report() may be called by multiple callers at the same time, causing trouble with the static local buffer used. Also there is no reason to use a non stack buffer, the buffer is tiny and ishtp_cl_send() copies its contents so the lifetime is not an issue either. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: intel_ish-hid: Move header size check to inside the loopHans de Goede2018-04-251-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the headersize check outside of the loop, the second time through the loop the: "payload_len = recv_msg->hdr.size;" statement may deref recv_msg while it is pointing outside of our input buffer. Move the headersize check to inside the loop to fix this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: wacom: Release device resource data obtained by devres_alloc()Arvind Yadav2018-04-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Free device resource data, if __wacom_devm_sysfs_create_group is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | HID: lenovo: Add support for IBM/Lenovo Scrollpoint micepgzh2018-04-253-3/+48
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | The IBM/Lenovo Scrollpoint mice feature a trackpoint-like stick instead of a scrolling wheel capable of 2-D (vertical+horizontal) scrolling. hid-generic does only expose 1-D (vertical) scrolling functionality for these mice. This patch adds support for horizontal scrolling for the IBM/Lenovo Scrollpoint mice to hid-lenovo. [jkosina@suse.cz: remove change versioning from git changelog] Signed-off-by: Peter Ganzhorn <peter.ganzhorn@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Peter De Wachter <pdewacht@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: i2c-hid: fix inverted return value from i2c_hid_command()Jiri Kosina2018-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | i2c_hid_command() returns non-zero in error cases (the actual errno). Error handling in for I2C_HID_QUIRK_RESEND_REPORT_DESCR case in i2c_hid_resume() had the check inverted; fix that. Fixes: 3e83eda467 ("HID: i2c-hid: Fix resume issue on Raydium touchscreen device") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: i2c-hid: Fix resume issue on Raydium touchscreen deviceAaron Ma2018-04-122-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When Rayd touchscreen resumed from S3, it issues too many errors like: i2c_hid i2c-RAYD0001:00: i2c_hid_get_input: incomplete report (58/5442) And all the report data are corrupted, touchscreen is unresponsive. Fix this by re-sending report description command after resume. Add device ID as a quirk. Cc: stable@vger.kernel.org Signed-off-by: Aaron Ma <aaron.ma@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: wacom: bluetooth: send exit report for recent Bluetooth devicesAaron Armstrong Skomra2018-04-121-30/+46
| | | | | | | | | | | | | | | | | | | | | | The code path for recent Bluetooth devices omits an exit report which resets all the values of the device. Fixes: 4922cd26f0 ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface") Cc: <stable@vger.kernel.org> # 4.11 Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com> Reviewed-by: Ping Cheng <ping.cheng@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: hidraw: Fix crash on HIDIOCGFEATURE with a destroyed deviceRodrigo Rivas Costa2018-04-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing `ioctl(HIDIOCGFEATURE)` in a tight loop on a hidraw device and then disconnecting the device, or unloading the driver, can cause a NULL pointer dereference. When a hidraw device is destroyed it sets 0 to `dev->exist`. Most functions check 'dev->exist' before doing its work, but `hidraw_get_report()` was missing that check. Cc: stable@vger.kernel.org Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: input: fix battery level reporting on BT miceDmitry Torokhov2018-04-091-7/+17
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 581c4484769e ("HID: input: map digitizer battery usage") assumed that devices having input (qas opposed to feature) report for battery strength would report the data on their own, without the need to be polled by the kernel; unfortunately it is not so. Many wireless mice do not send unsolicited reports with battery strength data and have to be polled explicitly. As a complication, stylus devices on digitizers are not normally connected to the base and thus can not be polled - the base can only determine battery strength in the stylus when it is in proximity. To solve this issue, we add a special flag that tells the kernel to avoid polling the device (and expect unsolicited reports) and set it when report field with physical usage of digitizer stylus (HID_DG_STYLUS). Unless this flag is set, and we have not seen the unsolicited reports, the kernel will attempt to poll the device when userspace attempts to read "capacity" and "state" attributes of power_supply object corresponding to the devices battery. Fixes: 581c4484769e ("HID: input: map digitizer battery usage") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198095 Cc: stable@vger.kernel.org Reported-and-tested-by: Martin van Es <martin@mrvanes.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge branch 'for-linus' of ↵Linus Torvalds2018-04-0523-214/+1052
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID updates from Jiri Kosina: - 3rd generation Wacom Intuos BT device support from Aaron Armstrong Skomra - support for NSG-MR5U and NSG-MR7U devices from Todd Kelner - multitouch Razer Blade Stealth support from Benjamin Tissoires - Elantech touchpad support from Alexandrov Stansilav - a few other scattered-around fixes and cleanups to drivers and generic code * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (31 commits) HID: google: Enable PM Full On mode when adjusting backlight HID: google: add google hammer HID driver HID: core: reset the quirks before calling probe again HID: multitouch: do not set HID_QUIRK_NO_INIT_REPORTS HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUT HID: use BIT() macro for quirks too HID: use BIT macro instead of plain integers for flags HID: multitouch: remove dead zones of Razer Blade Stealth HID: multitouch: export a quirk for the button handling of touchpads HID: usbhid: extend the polling interval configuration to keyboards HID: ntrig: document sysfs interface HID: wacom: wacom_wac_collection() is local to wacom_wac.c HID: wacom: generic: add the "Report Valid" usage HID: wacom: generic: Support multiple tools per report HID: wacom: Add support for 3rd generation Intuos BT HID: core: rewrite the hid-generic automatic unbind HID: sony: Add touchpad support for NSG-MR5U and NSG-MR7U remotes HID: hid-multitouch: Use true and false for boolean values HID: hid-ntrig: use true and false for boolean values HID: logitech-hidpp: document sysfs interface ...
| * Merge branch 'for-4.17/wacom' into for-linusJiri Kosina2018-04-052-48/+179
| |\ | | | | | | | | | Pull support for 3rd generation Intuos BT device
| | * HID: wacom: wacom_wac_collection() is local to wacom_wac.cJiri Kosina2018-03-071-1/+1
| | | | | | | | | | | | | | | | | | ... and therefore should be static. Signed-off-by: Jiri Kosina <jkosina@suse.cz>