summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'for-linus-2023083101' of ↵Linus Torvalds2023-09-0120-260/+1127
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Benjamin Tissoires: - devm fixes for problems that caused use-after-free reports (Rahul Rameshbabu) - Some extensive HID docs (Marco Morandini) - Constification of struct class (Ivan Orlov and Greg Kroah-Hartman) - Google Stadia Force Feedback support (Fabio Baltieri) - Various fixes and new device ID support * tag 'for-linus-2023083101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (42 commits) HID: logitech-hidpp: rework one more time the retries attempts HID: nvidia-shield: Reference hid_device devm allocation of input_dev name HID: multitouch: Correct devm device reference for hidinput input_dev name HID: uclogic: Correct devm device reference for hidinput input_dev name HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode() HID: i2c-hid: elan: Add ili9882t timing dt-bindings: input: i2c-hid: Introduce Ilitek ili9882t HID: apple: Add "Hailuck" to the list of non-apple keyboards HID: steelseries: arctis_1_battery_request[] should be static MAINTAINERS: update my email address HID: logitech-hidpp: Add support for Logitech MX Anywhere 3 mouse HID: wacom: struct name cleanup HID: wacom: remove unnecessary 'connected' variable from EKR HID: wacom: remove the battery when the EKR is off HID: nvidia-shield: Update Thunderstrike LED instance name to use id HID: nvidia-shield: Add battery support for Thunderstrike HID: nvidia-shield: Remove led_classdev_unregister in thunderstrike_create HID: hid-google-stadiaff: add support for Stadia force feedback HID: logitech-dj: Add support for a new lightspeed receiver iteration HID: logitech-hidpp: Add support for the Pro X Superlight ...
| * Merge branch 'for-6.5/upstream-fixes' into for-linusBenjamin Tissoires2023-08-312-1/+5
| |\ | | | | | | | | | Apple devices fixes by Nimish Gåtam and Nils Tonnaett
| | * HID: apple: Add "Hailuck" to the list of non-apple keyboardsNils Tonnaett2023-08-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Powzan keyboards KB750 and KB770 identify as "Hailuck Co.,Ltd USB Keyboard". Adding "Hailuck" to the list of non-apple keyboards fixes function keys for these models. Signed-off-by: Nils Tonnaett <ntonnatt@ccrma.stanford.edu> Reviewed-by: Rahul Rameshbabu <sergeantsagara@protonmail.com Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * HID: input: Fix Apple Magic Trackpad 1 Bluetooth disconnectNimish Gåtam2023-08-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When connecting the Trackpad 1 via any bluetooth adapter, the device disconnects whenever the battery level is queried. It reconnects again after a few seconds, but it's an incredibly jarring experience since it will just cut out in the middle of mouse operations. This patch ignores querying the battery and avoids disconnects. This bug is reported here: - https://bugzilla.kernel.org/show_bug.cgi?id=204589 - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1834085 It looks like a similar approach (disabling battery checking) was also suggested for the Apple Magic Mouse before a custom driver was created: https://bugzilla.kernel.org/show_bug.cgi?id=103631 Signed-off-by: Nimish Gåtam <nimishg@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Merge branch 'for-6.6/wiimote' into for-linusBenjamin Tissoires2023-08-311-10/+0
| |\ \ | | | | | | | | | | | | | | | | Drop error checking for debugfs_create_file in the wiimote driver by Osama Muhammad
| | * | HID: hid-wiimote-debug.c: Drop error checking for debugfs_create_fileOsama Muhammad2023-08-141-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the error checking for debugfs_create_file in hid-wiimote-debug.c.c. This is because the debugfs_create_file() does not return NULL but an ERR_PTR after an error. The DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes.The debugfs Api handles it gracefully. The check is unnecessary. Link to the comment above debugfs_create_file: https://elixir.bootlin.com/linux/latest/source/fs/debugfs/inode.c#L451 Signed-off-by: Osama Muhammad <osmtendev@gmail.com> Reviewed-by: David Rheinsberg <david@readahead.eu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/wacom' into for-linusBenjamin Tissoires2023-08-314-19/+37
| |\ \ \ | | | | | | | | | | | | | | | Battery fixes by Aaron Armstrong Skomra
| | * | | HID: wacom: struct name cleanupAaron Armstrong Skomra2023-08-143-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Help differentiate the two remote related "serial" struct variables by renaming "wacom_remote_data" to "wacom_remote_work_data". Signed-off-by: Aaron Skomra <skomra@gmail.com> Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: wacom: remove unnecessary 'connected' variable from EKRAaron Armstrong Skomra2023-08-143-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'connected' variable was poorly named, and this has led to some confusion. We can get the same information by checking if a serial number exists in the specified EKR slot. Signed-off-by: Aaron Skomra <skomra@gmail.com> Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: wacom: remove the battery when the EKR is offAaron Armstrong Skomra2023-08-144-4/+24
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the EKR battery remains even after we stop getting information from the device. This can lead to a stale battery persisting indefinitely in userspace. The remote sends a heartbeat every 10 seconds. Delete the battery if we miss two heartbeats (after 21 seconds). Restore the battery once we see a heartbeat again. Signed-off-by: Aaron Skomra <skomra@gmail.com> Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Fixes: 9f1015d45f62 ("HID: wacom: EKR: attach the power_supply on first connection") CC: stable@vger.kernel.org Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/steelseries' into for-linusBenjamin Tissoires2023-08-312-17/+300
| |\ \ \ | | | | | | | | | | | | | | | Add support for the Steelseries Arctis 1 XBox headset by Bastien Nocera
| | * | | HID: steelseries: arctis_1_battery_request[] should be staticJiri Kosina2023-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arctis_1_battery_request[] is not used outside of this module, and as such should be static. Fixes: a0c76896c3fbdc2 ("HID: steelseries: Add support for Arctis 1 XBox") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: steelseries: Add support for Arctis 1 XBoxBastien Nocera2023-08-142-17/+300
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the Steelseries Arctis 1 XBox headset. This driver will export the battery information from the headset, as well as the "wireless_status" property. Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/sensor-hub' into for-linusBenjamin Tissoires2023-08-311-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Allow multi-function sensor devices in sensor-hub by Daniel Thompson
| | * | | HID: sensor-hub: Allow multi-function sensor devicesDaniel Thompson2023-08-141-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Lenovo Yoga C630 has a combined keyboard and accelerometer that interfaces via i2c-hid. Currently this laptop either has a working keyboard (if CONFIG_HID_SENSOR_HUB is disabled) or a working accelerometer. only works on kernels. Put another way, most distro kernels enable CONFIG_HID_SENSOR_HUB and therefore cannot work on this device since the keyboard doesn't work! Fix this by providing a richer connect mask during the probe. With this change both keyboard and screen orientation sensors work correctly. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/roccat' into for-linusBenjamin Tissoires2023-08-3111-97/+116
| |\ \ \ | | | | | | | | | | | | | | | Constify class struct by Ivan Orlov and Greg Kroah-Hartman
| | * | | HID: hidraw: make hidraw_class structure constGreg Kroah-Hartman2023-08-141-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: linux-input@vger.kernel.org Cc: Ivan Orlov <ivan.orlov0322@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: roccat: make all 'class' structures constIvan Orlov2023-08-1410-88/+107
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Stefan Achatz <erazor_de@users.sourceforge.net> Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: linux-input@vger.kernel.org Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/nvidia' into for-linusBenjamin Tissoires2023-08-311-20/+406
| |\ \ \ | | | | | | | | | | | | | | | | | | | | LED fixes and Battery support for the Nvidia Shield by Rahul Rameshbabu
| | * | | HID: nvidia-shield: Update Thunderstrike LED instance name to use idRahul Rameshbabu2023-08-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously would let led_classdev handle renaming when name collision occurred. Now that an ID allocator is used to uniquely identify multiple Thunderstrike controllers, generate unique led device names. Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: nvidia-shield: Add battery support for ThunderstrikeRahul Rameshbabu2023-08-141-17/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use power supply API to expose battery information about connected Thunderstrike controllers to the system. Provide information on battery capacity, charge status, charger type, voltage, and temperature. Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: nvidia-shield: Remove led_classdev_unregister in thunderstrike_createRahul Rameshbabu2023-08-141-6/+7
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid calling thunderstrike_led_set_brightness from thunderstrike_create when led_classdev_unregister is called. led_classdev_unregister was called from thunderstrike_create in the error path. Calling thunderstrike_led_set_brightness in this situation is unsafe. Fixes: f88af60e74a5 ("HID: nvidia-shield: Support LED functionality for Thunderstrike") Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/logitech' into for-linusBenjamin Tissoires2023-08-313-45/+93
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Various new device ID addition and a couple of HID++ fixes to tackle the last few opened bugs (Nikita Zhandarovich and Benjamin Tissoires)
| | * | | HID: logitech-hidpp: rework one more time the retries attemptsBenjamin Tissoires2023-08-251-40/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the internal code inside a helper function, fix the initialization of the parameters used in the helper function (`hidpp->answer_available` was not reset and `*response` wasn't either), and use a `do {...} while();` loop. Fixes: 586e8fede795 ("HID: logitech-hidpp: Retry commands when device is busy") Cc: stable@vger.kernel.org Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Link: https://lore.kernel.org/r/20230621-logitech-fixes-v2-1-3635f7f9c8af@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()Nikita Zhandarovich2023-08-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently, if a call to logi_dj_recv_send_report() fails, we do not learn about the error until after sending short HID_OUTPUT_REPORT with hid_hw_raw_request(). To handle this somewhat unlikely issue, return on error in logi_dj_recv_send_report() (minding ugly sleep workaround) and take into account the result of hid_hw_raw_request(). Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: 6a9ddc897883 ("HID: logitech-dj: enable notifications on connect/disconnect") Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru> Link: https://lore.kernel.org/r/20230613101635.77820-1-n.zhandarovich@fintech.ru Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: logitech-hidpp: Add support for Logitech MX Anywhere 3 mouseMaxim Mikityanskiy2023-08-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Logitech MX Anywhere 3 connected over Bluetooth to the device table to get hidpi scroll supported. USB connection over the Unifying receiver is already supported by the wildcard entry LDJ_DEVICE(HID_ANY_ID). Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: logitech-dj: Add support for a new lightspeed receiver iterationMavroudis Chatzilazaridis2023-08-142-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lightspeed receiver for the Pro X Superlight uses 13 byte mouse reports without a report id. The workaround for such cases has been adjusted to handle these larger packets. The device now reports the status of its battery in wireless mode and libratbag now recognizes the device and it can be configured with Piper. https://github.com/libratbag/libratbag/pull/1122 Co-developed-by: Filipe Laíns <lains@riseup.net> Signed-off-by: Filipe Laíns <lains@riseup.net> Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: logitech-hidpp: Add support for the Pro X SuperlightMavroudis Chatzilazaridis2023-08-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Pro X Superlight over wired USB. The device now reports the status of its battery. Co-developed-by: Filipe Laíns <lains@riseup.net> Signed-off-by: Filipe Laíns <lains@riseup.net> Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * | | HID: logitech-hidpp: Rename HID++ "internal" error constantBastien Nocera2023-08-141-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per the upstream "hidpp" helpers commit: " There has been some confusion about error value 5 but feature specs that refer to it generally use NOT_ALLOWED. " Signed-off-by: Bastien Nocera <hadess@hadess.net> Link: https://github.com/mrubli2/hidpp/commit/80c3fecfcd89c5efe0f16feabe90a55ddfd25aaa Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/google' into for-linusBenjamin Tissoires2023-08-314-0/+167
| |\ \ \ | | | | | | | | | | | | | | | Add support for Google Stadia force feedback by Fabio Baltieri
| | * | | HID: hid-google-stadiaff: add support for Stadia force feedbackFabio Baltieri2023-08-144-0/+167
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a hid-google-stadiaff module to support rumble based force feedback on the Google Stadia controller. This works using the HID output endpoint exposed on both the USB and BLE interface. Signed-off-by: Fabio Baltieri <fabiobaltieri@chromium.org> Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge branch 'for-6.6/elan' into for-linusBenjamin Tissoires2023-08-311-12/+38
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Make use of panel follower for the Ilitek ili9882t driver by Cong Yang
| | * | | HID: i2c-hid: elan: Add ili9882t timingCong Yang2023-08-211-12/+38
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ili9882t is a TDDI IC (Touch with Display Driver). The datasheet specifies there should be 60ms between touch SDA sleep and panel RESX. Doug's series[1] allows panels and touchscreens to power on/off together, so we can add the 65 ms delay in i2c_hid_core_suspend before panel_unprepare. Because ili9882t touchscrgeen is a panel follower, and needs to use vccio-supply instead of vcc33-supply, so set it NULL to ili9882t_chip_data, then not use vcc33 regulator. [1]: https://lore.kernel.org/all/20230727171750.633410-1-dianders@chromium.org Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Cong Yang <yangcong5@huaqin.corp-partner.google.com> Acked-by: Benjamin Tissoires <bentiss@kernel.org> Link: https://lore.kernel.org/r/20230802071947.1683318-3-yangcong5@huaqin.corp-partner.google.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| * | | Merge branch 'for-6.6/devm-fixes' into for-linusBenjamin Tissoires2023-08-313-21/+7
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Fix a wrong devm attachment to the input device which now triggers a use after free with a recent devm change by Rahul Rameshbabu.
| | * | | HID: nvidia-shield: Reference hid_device devm allocation of input_dev nameRahul Rameshbabu2023-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use hid_device for devm allocation of the input_dev name to avoid a use-after-free. input_unregister_device would trigger devres cleanup of all resources associated with the input_dev, free-ing the name. The name would subsequently be used in a uevent fired at the end of unregistering the input_dev. Reported-by: Maxime Ripard <mripard@kernel.org> Closes: https://lore.kernel.org/linux-input/ZOZIZCND+L0P1wJc@penguin/T/#m443f3dce92520f74b6cf6ffa8653f9c92643d4ae Fixes: 09308562d4af ("HID: nvidia-shield: Initial driver implementation with Thunderstrike support") Suggested-by: Maxime Ripard <mripard@kernel.org> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20230824061308.222021-4-sergeantsagara@protonmail.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: multitouch: Correct devm device reference for hidinput input_dev nameRahul Rameshbabu2023-08-241-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reference the HID device rather than the input device for the devm allocation of the input_dev name. Referencing the input_dev would lead to a use-after-free when the input_dev was unregistered and subsequently fires a uevent that depends on the name. At the point of firing the uevent, the name would be freed by devres management. Use devm_kasprintf to simplify the logic for allocating memory and formatting the input_dev name string. Reported-by: Maxime Ripard <mripard@kernel.org> Closes: https://lore.kernel.org/linux-input/ZOZIZCND+L0P1wJc@penguin/T/#m443f3dce92520f74b6cf6ffa8653f9c92643d4ae Fixes: c08d46aa805b ("HID: multitouch: devm conversion") Suggested-by: Maxime Ripard <mripard@kernel.org> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20230824061308.222021-3-sergeantsagara@protonmail.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: uclogic: Correct devm device reference for hidinput input_dev nameRahul Rameshbabu2023-08-241-10/+3
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reference the HID device rather than the input device for the devm allocation of the input_dev name. Referencing the input_dev would lead to a use-after-free when the input_dev was unregistered and subsequently fires a uevent that depends on the name. At the point of firing the uevent, the name would be freed by devres management. Use devm_kasprintf to simplify the logic for allocating memory and formatting the input_dev name string. Reported-by: syzbot+3a0ebe8a52b89c63739d@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-input/ZOZIZCND+L0P1wJc@penguin/T/ Reported-by: Maxime Ripard <mripard@kernel.org> Closes: https://lore.kernel.org/linux-input/ZOZIZCND+L0P1wJc@penguin/T/#m443f3dce92520f74b6cf6ffa8653f9c92643d4ae Fixes: cce2dbdf258e ("HID: uclogic: name the input nodes based on their tool") Suggested-by: Maxime Ripard <mripard@kernel.org> Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20230824061308.222021-2-sergeantsagara@protonmail.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| * | | Merge branch 'for-6.6/cp2112' into for-linusBenjamin Tissoires2023-08-311-112/+57
| |\ \ \ | | | | | | | | | | | | | | | Cleanup of the hid-cp2112 driver by Andy Shevchenko
| | * | | HID: cp2112: Use octal permissionsAndy Shevchenko2023-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Octal permissions are preferred as stated in Documentation/dev-tools/checkpatch.rst. Replace symbolic permissions with octal permissions when creating the files. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-13-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Convert to DEVICE_ATTR_RW()Andy Shevchenko2023-07-281-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of custom wrapper, use DEVICE_tATTR_RW() directly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-12-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Use sysfs_emit() to instead of scnprintf()Andy Shevchenko2023-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-11-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Use BIT() in GPIO setter and getterAndy Shevchenko2023-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use BIT() in GPIO setter and getter for the sake of consistency with GENMASK() usage elsewhere in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-10-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Define all GPIO mask and use itAndy Shevchenko2023-07-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define all GPIO mask and use it in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-9-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Define maximum GPIO constant and use itAndy Shevchenko2023-07-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define maximum GPIO constant and use it in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-8-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Remove dead codeAndy Shevchenko2023-07-281-54/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove cp2112_allocate_irq() and counterparts that seems to be a dead code from day 1. In case somebody needs it, it can be retrieved from Git index. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-7-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Don't call ->to_irq() explicitlyAndy Shevchenko2023-07-281-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GPIO library guarantees that ->to_irq() is always exists. Moreover, it tending to become a nische thingy and has to not be used in ordinary drivers. Hence, replace that by irq_find_mapping(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-6-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Switch to for_each_set_bit() to simplify the codeAndy Shevchenko2023-07-281-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's cleaner to use for_each_set_bit() than open coding it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-5-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Make irq_chip immutableAndy Shevchenko2023-07-281-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-4-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| | * | | HID: cp2112: Use str_write_read() and str_read_write()Andy Shevchenko2023-07-281-5/+4
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use str_write_read() and str_read_write() from string_choices.h. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-3-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
| * / / HID: input: Support devices sending Eraser without InvertIllia Ostapyshyn2023-08-141-2/+16
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some digitizers (notably XP-Pen Artist 24) do not report the Invert usage when erasing. This causes the device to be permanently stuck with the BTN_TOOL_RUBBER tool after sending Eraser, as Invert is the only usage that can release the tool. In this state, Touch and Inrange are no longer reported to userspace, rendering the pen unusable. Prior to commit 87562fcd1342 ("HID: input: remove the need for HID_QUIRK_INVERT"), BTN_TOOL_RUBBER was never set and Eraser events were simply translated into BTN_TOUCH without causing an inconsistent state. Introduce HID_QUIRK_NOINVERT for such digitizers and detect them during hidinput_configure_usage(). This quirk causes the tool to be released as soon as Eraser is reported as not set. Set BTN_TOOL_RUBBER in input->keybit when mapping Eraser. Fixes: 87562fcd1342 ("HID: input: remove the need for HID_QUIRK_INVERT") Co-developed-by: Nils Fuhler <nils@nilsfuhler.de> Signed-off-by: Nils Fuhler <nils@nilsfuhler.de> Signed-off-by: Illia Ostapyshyn <ostapyshyn@sra.uni-hannover.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>