summaryrefslogtreecommitdiff
path: root/drivers/input
AgeCommit message (Collapse)AuthorFilesLines
2024-09-06Input: alps - use guard notation when acquiring mutexDmitry Torokhov1-21/+27
This makes the code more compact and error handling more robust by ensuring that mutexes are released in all code paths when control leaves critical section. Acked-by: Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/ZsrBkWIpyEqzClUG@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-06Input: i8042 - add TUXEDO Stellaris 16 Gen5 AMD to i8042 quirk tableWerner Sembach1-0/+23
Some TongFang barebones have touchpad and/or keyboard issues after suspend, fixable with nomux + reset + noloop + nopnp. Luckily, none of them have an external PS/2 port so this can safely be set for all of them. I'm not entirely sure if every device listed really needs all four quirks, but after testing and production use, no negative effects could be observed when setting all four. Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240905164851.771578-1-wse@tuxedocomputers.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-06Merge branch 'ib/6.11-rc6-matrix-keypad-spitz' into nextDmitry Torokhov28-340/+913
Bring in changes removing support for platform data from matrix-keypad driver.
2024-09-06Input: matrix_keypad - remove support for platform dataDmitry Torokhov1-71/+3
There are no more users of struct matrix_keypad_platform_data in the kernel, remove support for it from the driver. Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240805014710.1961677-6-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-06Input: matrix_keypad - switch to gpiod API and generic device propertiesDmitry Torokhov1-156/+185
gpiod API and generic device properties work with software nodes and static properties, which will allow removing platform data support from the driver, simplifying and streamlining the code. Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240805014710.1961677-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-06Input: matrix_keypad - remove support for clustered interruptDmitry Torokhov1-39/+22
There are no users of this functionality in the mainline kernel (it was only available to boards using platform data and not device tree). Remove it to simplify the code. Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240805014710.1961677-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-04Input: synaptics-rmi4 - fix crash when DPM query is not supportedDmitry Torokhov1-3/+2
Stop clobbering "item" variable when checking if the device supports querying DPM values because its original value is still needed in case when we need to fall back to the old way of figuring sensor size. Reported-by: Richard Acayan <mailingradian@gmail.com> Tested-by: Richard Acayan <mailingradian@gmail.com> Fixes: 14d650fcb7fb ("Input: synaptics-rmi4 - add support for querying DPM value (F12)") Link: https://lore.kernel.org/r/ZtdQW7nqAOEJDNBN@radian Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-02Merge tag 'scmi-updates-6.12' of ↵Arnd Bergmann3-0/+237
https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers Arm SCMI updates for v6.12 Few main features include: 1. SCMI transport as stand-alone drivers Currently the SCMI transport layer is being built embedded into in the core SCMI stack. Some of these transports, despite being currently part of the main SCMI module, are indeed also registered with different subsystems like optee or virtio, and actively probed also by those. This leads to a few awkward and convoluted tricks to properly handle such interactions at boot time in the SCMI stack. This change adds the new logic to the core SCMI stack so that each existing transport is transitioned to be a standi-alone driver. With that all the probe deferral and awkward retries between the SCMI core stack and the transports has been removed, since no more needed. 2. Support for obtaining transport descriptors from the devicetree SCMI platform firmwares might have different designs depending on the platform. Some of the transport descriptors rely on such design. E.g. the maximum receive channel timeout value might vary depending on the specific underlying hardware and firmware design choices. This change adds support for max-rx-timeout-ms property to describe the transport needs of a specific platform design. It will be extended in the future to obtain other such hardware/firmware dependent transport related descriptors. 3. NXP i.MX95 specific SCMI vendor protocol extensions SCMI specification allows vendor or platform-specific extensions to the interface. NXP i.MX95 System Manager(SM) that implements SCMI extends the interface to implement couple of vendor/platform specific protocol, namely: a. Battery Backed Module(BBM) Protocol This protocol is intended provide access to the battery-backed module. This contains persistent storage (GPR), an RTC, and the ON/OFF button. The protocol can also provide access to similar functions implemented via external board components. b. MISC Protocol for misc settings This includes controls that are misc settings/actions that must be exposed from the SM to agents. They are device specific and are usually define to access bit fields in various mix block control modules, IOMUX_GPR, and other GPR/CSR owned by the SM. 4. SCMI debug/tracking metrics Since SCMI involves interaction with the entity(software, firmware and/or hardware) providing services or features, it is quite useful to track certain metrics(for pure debugging purposes) like how many messages were sent or received, were there any failures, what kind of failures, ..etc. This feature adds support for the same via debugfs. Apart from these main features, there are some miscellaneous updates, fixes and cleanups. * tag 'scmi-updates-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (31 commits) rtc: support i.MX95 BBM RTC input: keyboard: support i.MX95 BBM module firmware: imx: Add i.MX95 MISC driver firmware: arm_scmi: Add initial support for i.MX MISC protocol firmware: arm_scmi: Add initial support for i.MX BBM protocol firmware: arm_scmi: Add NXP i.MX95 SCMI documentation dt-bindings: firmware: Add i.MX95 SCMI Extension protocol firmware: arm_scmi: Replace comma with the semicolon firmware: arm_scmi: Replace the use of of_node_put() to __free(device_node) firmware: arm_scmi: Fix trivial whitespace/coding style issues firmware: arm_scmi: Use max-rx-timeout-ms from devicetree dt-bindings: firmware: arm,scmi: Introduce property max-rx-timeout-ms firmware: arm_scmi: Remove const from transport descriptors firmware: arm_scmi: Simplify with scoped for each OF child loop firmware: arm_scmi: Update various protocols versions firmware: arm_scmi: Remove legacy transport-layer code firmware: arm_scmi: Make VirtIO transport a standalone driver firmware: arm_scmi: Make OPTEE transport a standalone driver firmware: arm_scmi: Make SMC transport a standalone driver firmware: arm_scmi: Make MBOX transport a standalone driver ... Link: https://lore.kernel.org/r/20240830135918.2383664-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-09-01Input: zinitix - varying icon status registersLinus Walleij1-2/+35
The different revisions of the Zinitix BTXXX touchscreens place the icon status register (to read out touchkey status) in different places. Use the chip revision bits to discern between the different versions at runtime. This makes touchkeys work on the BT404 on the Samsung Codina GT-I8160 mobile phone. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240830-zinitix-tk-versions-v2-2-90eae6817eda@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-01Input: zinitix - read and cache device version numbersLinus Walleij1-0/+36
The chip hardware revision, firmware version and regdata revision is needed to discern because for example touchkeys are handled by different registers on different versions of the chip. Example output from BT404: Zinitix-TS 3-0020: chip revision 4040 firmware version 0088 regdata version 0004 Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240830-zinitix-tk-versions-v2-1-90eae6817eda@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-01Input: snvs_pwrkey - use devm_clk_get_optional_enabled()Dmitry Torokhov1-23/+1
Switch to using devm_clk_get_optional_enabled() helper instead of acquiring the clock with devm_clk_get_optional(), enabling it, and defining and installing a custom devm action to call clk_disable(). Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/ZtDDGMaOFlMYjOrt@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-31Merge tag 'input-for-v6.11-rc5' of ↵Linus Torvalds1-45/+13
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fix from Dmitry Torokhov: - a fix for Cypress PS/2 touchpad for regression introduced in 6.11 merge window where a timeout condition is incorrectly reported for all extended Cypress commands * tag 'input-for-v6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: cypress_ps2 - fix waiting for command response
2024-08-29Input: bcm5974 - use guard notation when acquiring mutexDmitry Torokhov1-22/+13
This makes the code more compact and error handling more robust by ensuring that mutexes are released in all code paths when control leaves critical section. Acked-by: Henrik Rydberg <rydberg@bitmath.org> Link: https://lore.kernel.org/r/ZsrBVO2w9WwX73iU@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-29Input: matrix-keymap - switch to using __free() cleanup facilityDmitry Torokhov1-16/+9
Use __free(kfree) cleanup facility in matrix_keypad_parse_keymap() to automatically free temporarily allocated memory. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/ZspoEPdTcH-hpciy@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-29Input: cypress_ps2 - fix waiting for command responseDmitry Torokhov1-45/+13
Commit 8bccf667f62a ("Input: cypress_ps2 - report timeouts when reading command status") uncovered an existing problem with cypress_ps2 driver: it tries waiting on a PS/2 device waitqueue without using the rest of libps2. Unfortunately without it nobody signals wakeup for the waiting process, and each "extended" command was timing out. But the rest of the code simply did not notice it. Fix this by switching from homegrown way of sending request to get command response and reading it to standard ps2_command() which does the right thing. Reported-by: Woody Suwalski <terraluna977@gmail.com> Tested-by: Woody Suwalski <terraluna977@gmail.com> Fixes: 8bccf667f62a ("Input: cypress_ps2 - report timeouts when reading command status") Link: https://lore.kernel.org/r/a8252e0f-dab4-ef5e-2aa1-407a6f4c7204@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-29Input: adp5588-keys - add support for pure gpioUtsav Agarwal1-13/+35
Keypad specific setup is relaxed if no keypad rows/columns are specified, enabling a purely gpio operation. Reviewed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com> Link: https://lore.kernel.org/r/20240826-adp5588_gpio_support-v11-2-3e5ac2bd31b7@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-29Input: adp5588-keys - use guard notation when acquiring mutexesDmitry Torokhov1-32/+17
This makes the code more compact and error handling more robust. Acked-by: Michael Hennerich <michael.hennerich@analog.com> Link: https://lore.kernel.org/r/20240826-adp5588_gpio_support-v11-1-3e5ac2bd31b7@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-28input: keyboard: support i.MX95 BBM modulePeng Fan3-0/+237
The BBM module provides BUTTON feature. To i.MX95, this module is managed by System Manager and exported using System Management Control Interface(SCMI). Linux could use i.MX SCMI BBM Extension protocol to use BUTTON feature. This driver is to use SCMI interface to enable pwrkey. Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Message-Id: <20240823-imx95-bbm-misc-v2-v8-7-e600ed9e9271@nxp.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-08-28Input: mt6779-keypad - use devm_clk_get_enabled()Dmitry Torokhov1-17/+1
Switch to using devm_clk_get_enable() helper instead of acquiring the clock with devm_clk_get(), enabling it, and defining and installing a custom devm action to call clk_disable(). Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/Zs4UWGKt3hLjNmoP@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-27Input: mt6779-keypad - fix module autoloadingLiao Chen1-0/+1
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Signed-off-by: Liao Chen <liaochen4@huawei.com> Link: https://lore.kernel.org/r/20240827123411.431388-1-liaochen4@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-26Input: wistron_btns - use kmemdup_array instead of kmemdup for multiple ↵Shen Lichuan1-2/+2
allocation Let the kmemdup_array() take care about multiplication and possible overflows. Using kmemdup_array() is more appropriate and makes the code easier to audit. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> Link: https://lore.kernel.org/r/20240826045253.3503-1-shenlichuan@vivo.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-24Input: evdev - limit amount of data for writesDmitry Torokhov1-0/+7
Limit amount of data that can be written into an evdev instance at a given time to 4096 bytes (170 input events) to avoid holding evdev->mutex for too long and starving other users. Reviewed-by: Jeff LaBundy <jeff@labundy.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Link: https://lore.kernel.org/r/Zr5L8TUzkJcB9HcF@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-24Merge tag 'input-for-v6.11-rc4' of ↵Linus Torvalds8-30/+53
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - a tweak to uinput interface to reject requests with abnormally large number of slots. 100 slots/contacts should be enough for real devices - support for FocalTech FT8201 added to the edt-ft5x06 driver - tweaks to i8042 to handle more devices that have issue with its emulation - Synaptics touchpad switched to native SMbus/RMI mode on HP Elitebook 840 G2 - other minor fixes * tag 'input-for-v6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: himax_hx83112b - fix incorrect size when reading product ID Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3 Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table Input: uinput - reject requests with unreasonable number of slots Input: edt-ft5x06 - add support for FocalTech FT8201 dt-bindings: input: touchscreen: edt-ft5x06: Document FT8201 support Input: adc-joystick - fix optional value handling Input: synaptics - enable SMBus for HP Elitebook 840 G2 Input: ads7846 - ratelimit the spi_sync error message
2024-08-22Input: keypad-nomadik-ske - remove the driverDmitry Torokhov3-390/+0
The users of this driver were removed in 2013 in commit 28633c54bda6 ("ARM: ux500: Rip out keypad initialisation which is no longer used"). Remove the driver as well. Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/Zr-gX0dfN4te_8VG@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-20Input: himax_hx83112b - fix incorrect size when reading product IDDmitry Torokhov1-12/+2
We need to read a u32 value (4 bytes), not size of a pointer to that value. Also, himax_read_mcu() wrapper is an overkill, remove it and use himax_bus_read() directly. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202408200301.Ujpj7Vov-lkp@intel.com/ Fixes: 0944829d491e ("Input: himax_hx83112b - implement MCU register reading") Tested-by: Felix Kaechele <felix@kaechele.ca> Link: https://lore.kernel.org/r/ZsPdmtfC54R7JVxR@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-19Input: colibri-vf50-ts - make use of the helper function dev_err_probe()Cai Huoqing1-7/+3
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20210916153148.14045-1-caihuoqing@baidu.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-19Input: i8042 - use new forcenorestore quirk to replace old buggy quirk ↵Werner Sembach1-9/+1
combination The old quirk combination sometimes cause a laggy keyboard after boot. With the new quirk the initial issue of an unresponsive keyboard after s3 resume is also fixed, but it doesn't have the negative side effect of the sometimes laggy keyboard. Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Cc: stable@vger.kernel.org Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20240104183118.779778-3-wse@tuxedocomputers.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-19Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3Werner Sembach2-6/+14
On s3 resume the i8042 driver tries to restore the controller to a known state by reinitializing things, however this can confuse the controller with different effects. Mostly occasionally unresponsive keyboards after resume. These issues do not rise on s0ix resume as here the controller is assumed to preserved its state from before suspend. This patch adds a quirk for devices where the reinitialization on s3 resume is not needed and might be harmful as described above. It does this by using the s0ix resume code path at selected locations. This new quirk goes beyond what the preexisting reset=never quirk does, which only skips some reinitialization steps. Signed-off-by: Werner Sembach <wse@tuxedocomputers.com> Cc: stable@vger.kernel.org Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20240104183118.779778-2-wse@tuxedocomputers.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-19Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk tableTakashi Iwai1-0/+9
Yet another quirk entry for Fujitsu laptop. Lifebook E756 requires i8041.nomux for keeping the touchpad working after suspend/resume. Link: https://bugzilla.suse.com/show_bug.cgi?id=1229056 Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240814100630.2048-1-tiwai@suse.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: cyttsp4 - remove driverDmitry Torokhov9-3005/+56
The cyttsp4 touchscreen driver was contributed in 2013 and since then has seen no updates. The driver uses platform data (no device tree support) and there are no users of it in the mainline kernel. There were occasional fixes to it for issues either found by static code analysis tools or via visual inspection, but otherwise the driver is completely untested. Remove the driver. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/ZrAZ2cUow_z838tp@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: cyttsp - use devm_regulator_bulk_get_enable()Dmitry Torokhov2-31/+8
The driver does not try to power down the rails at system suspend or when touchscreen is not in use, but rather enables regulators at probe time. Power savings are achieved by requesting the controller to enter low power mode. Switch to devm_regulator_bulk_get_enable() instead of separately requesting regulators, enabling them, and installing a custom devm-action to disable them on unbind/remove, which simplifies the code. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/ZrAgj9rG6oVqfdoK@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: cyttsp - stop including gpio.hDmitry Torokhov1-1/+0
The driver does not use legacy GPIO API, stop including this header. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/ZrAaOu_vf-cVBhRn@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: ilitek_ts_i2c - stop including gpio.hDmitry Torokhov1-1/+0
The driver does not use legacy GPIO API, stop including this header. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/ZrAaHWNvaAfDlDfI@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: ilitek_ts_i2c - add report id message validationEmanuele Ghidoli1-0/+7
Ensure that the touchscreen response has correct "report id" byte before processing the touch data and discard other messages. Fixes: 42370681bd46 ("Input: Add support for ILITEK Lego Series") Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Link: https://lore.kernel.org/r/20240805085511.43955-3-francesco@dolcini.it Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: ilitek_ts_i2c - avoid wrong input subsystem syncEmanuele Ghidoli1-6/+5
For different reasons i2c transaction may fail or report id in the message may be wrong. Avoid closing the frame in this case as it will result in all contacts being dropped, indicating that nothing is touching the screen anymore, while usually it is not the case. Fixes: 42370681bd46 ("Input: Add support for ILITEK Lego Series") Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Link: https://lore.kernel.org/r/20240805085511.43955-2-francesco@dolcini.it Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: synaptics-rmi4 - add support for querying DPM value (F12)Marge Yang1-10/+34
Newer firmware allows to query touchpad resolution information by reading from resolution register. Presence of resolution register is signalled via bit 29 of the "register presence" register. On devices that lack this resolution register we fall back to using pitch and number of receivers data to calculate size of the sensor. Signed-off-by: Marge Yang <marge.yang@tw.synaptics.com> Signed-off-by: Vincent Huang <Vincent.Huang@tw.synaptics.com> Link: https://lore.kernel.org/r/20240805083636.1381205-1-marge.yang@tw.synaptics.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: tsc2004/5 - use guard notation when acquiring mutexes/locksDmitry Torokhov1-101/+81
This makes the code more compact and error handling more robust. Link: https://lore.kernel.org/r/20240711172719.1248373-6-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: tsc2004/5 - respect "wakeup-source" propertyDmitry Torokhov1-1/+2
Do not mark the device as wakeup-enabled by default, respect the standard "wakeup-source" property. Link: https://lore.kernel.org/r/20240711172719.1248373-5-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: tsc2004/5 - do not use irq_set_irq_wake() directlyDmitry Torokhov1-1/+12
Instead of setting irq_set_irq_wake() directly in probe(), mark the device as wakeup-capable, and use enable_irq_wake() and disable_irq_wake() in suspend/resume path. This also allows changing the wakeup setting dynamically at runtime using /sys/devices/.../tsc2005/power/wakeup. Reviewed-By: Sebastian Reichel <sre@kernel.org> Link: https://lore.kernel.org/r/20240711172719.1248373-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: tsc2004/5 - fix reset handling on probeDmitry Torokhov1-13/+15
When the driver has been converted to use gpiod API it was requesting and asserting the reset on probe, but never deasserted it. However because of incorrect annotations in device tree marking reset line as active high whereas in reality it is active low, the end result was that the chip was never reset on probe. With polarity of the reset line now corrected this became a problem. Fix this by calling tsc200x_reset() from tsc200x_probe() to properly complete the reset sequence and move requesting the reset GPIO and VIO supply closer to the point where we need to start talking to the hardware. Fixes: d257f2980feb ("Input: tsc2005 - convert to gpiod") Link: https://lore.kernel.org/r/20240711172719.1248373-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: tsc2004/5 - do not hard code interrupt triggerDmitry Torokhov1-4/+2
Instead of hard-coding interrupt trigger rely on ACPI/DT/board code to set it up appropriately. Link: https://lore.kernel.org/r/20240711172719.1248373-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: tsc2004/5 - fix handling of VIO power supplyDmitry Torokhov4-36/+4
The chip needs to be powered up before calling tsc200x_stop_scan() which communicates with it; move the call to enable the regulator earlier in tsc200x_probe(). At the same time switch to using devm_regulator_get_enable() to simplify error handling. This also makes sure that regulator is not shut off too early when unbinding the driver. Link: https://lore.kernel.org/r/20240711172719.1248373-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: uinput - reject requests with unreasonable number of slotsDmitry Torokhov1-0/+14
From: Dmitry Torokhov <dmitry.torokhov@gmail.com> When exercising uinput interface syzkaller may try setting up device with a really large number of slots, which causes memory allocation failure in input_mt_init_slots(). While this allocation failure is handled properly and request is rejected, it results in syzkaller reports. Additionally, such request may put undue burden on the system which will try to free a lot of memory for a bogus request. Fix it by limiting allowed number of slots to 100. This can easily be extended if we see devices that can track more than 100 contacts. Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reported-by: syzbot <syzbot+0122fa359a69694395d5@syzkaller.appspotmail.com> Closes: https://syzkaller.appspot.com/bug?extid=0122fa359a69694395d5 Link: https://lore.kernel.org/r/Zqgi7NYEbpRsJfa2@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-05Input: edt-ft5x06 - add support for FocalTech FT8201Felix Kaechele1-0/+6
The driver supports the FT8201 chip as well. It registers up to 10 touch points. Tested on: Lenovo ThinkSmart View (CD-18781Y), LCM: BOE TV080WXM-LL4 Signed-off-by: Felix Kaechele <felix@kaechele.ca> Link: https://lore.kernel.org/r/20240804031310.331871-3-felix@kaechele.ca Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-31Input: tc3589x - use of_property_present()Rob Herring (Arm)1-2/+1
Use of_property_present() to test for property presence rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240731191312.1710417-14-robh@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-31Input: adc-joystick - fix optional value handlingJohn Keeping1-2/+5
The abs-fuzz and abs-flat properties are documented as optional. When these are absent, fwnode_property_read_u32() will leave the input unchanged, meaning that an axis either picks up the value for the previous axis or an uninitialized value. Explicitly set these values to zero when they are unspecified to match the documented behaviour in the device tree bindings. Signed-off-by: John Keeping <jkeeping@inmusicbrands.com> Link: https://lore.kernel.org/r/20240731093310.3696919-1-jkeeping@inmusicbrands.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-29Input: MT - limit max slotsTetsuo Handa1-0/+3
syzbot is reporting too large allocation at input_mt_init_slots(), for num_slots is supplied from userspace using ioctl(UI_DEV_CREATE). Since nobody knows possible max slots, this patch chose 1024. Reported-by: syzbot <syzbot+0122fa359a69694395d5@syzkaller.appspotmail.com> Closes: https://syzkaller.appspot.com/bug?extid=0122fa359a69694395d5 Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-07-29minmax: don't use max() in situations that want a C constant expressionLinus Torvalds1-1/+1
We only had a couple of array[] declarations, and changing them to just use 'MAX()' instead of 'max()' fixes the issue. This will allow us to simplify our min/max macros enormously, since they can now unconditionally use temporary variables to avoid using the argument values multiple times. Cc: David Laight <David.Laight@aculab.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-07-29Input: spear-keyboard - switch to devm_clk_get_prepared()Christophe JAILLET1-15/+1
Use devm_clk_get_prepared() in order to remove a clk_unprepare() in an error handling path of the probe and from the .remove() function. This done, the whole .remove() function can also be axed because 'input_dev' is a managed resource allocated with devm_input_allocate_device() and we can fully rely on devm for cleaning up. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/062986b0a5105cbc61330da0e55b22c00e2c1c4f.1722062145.git.christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-25Merge tag 'driver-core-6.11-rc1' of ↵Linus Torvalds6-10/+10
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the big set of driver core changes for 6.11-rc1. Lots of stuff in here, with not a huge diffstat, but apis are evolving which required lots of files to be touched. Highlights of the changes in here are: - platform remove callback api final fixups (Uwe took many releases to get here, finally!) - Rust bindings for basic firmware apis and initial driver-core interactions. It's not all that useful for a "write a whole driver in rust" type of thing, but the firmware bindings do help out the phy rust drivers, and the driver core bindings give a solid base on which others can start their work. There is still a long way to go here before we have a multitude of rust drivers being added, but it's a great first step. - driver core const api changes. This reached across all bus types, and there are some fix-ups for some not-common bus types that linux-next and 0-day testing shook out. This work is being done to help make the rust bindings more safe, as well as the C code, moving toward the end-goal of allowing us to put driver structures into read-only memory. We aren't there yet, but are getting closer. - minor devres cleanups and fixes found by code inspection - arch_topology minor changes - other minor driver core cleanups All of these have been in linux-next for a very long time with no reported problems" * tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (55 commits) ARM: sa1100: make match function take a const pointer sysfs/cpu: Make crash_hotplug attribute world-readable dio: Have dio_bus_match() callback take a const * zorro: make match function take a const pointer driver core: module: make module_[add|remove]_driver take a const * driver core: make driver_find_device() take a const * driver core: make driver_[create|remove]_file take a const * firmware_loader: fix soundness issue in `request_internal` firmware_loader: annotate doctests as `no_run` devres: Correct code style for functions that return a pointer type devres: Initialize an uninitialized struct member devres: Fix memory leakage caused by driver API devm_free_percpu() devres: Fix devm_krealloc() wasting memory driver core: platform: Switch to use kmemdup_array() driver core: have match() callback in struct bus_type take a const * MAINTAINERS: add Rust device abstractions to DRIVER CORE device: rust: improve safety comments MAINTAINERS: add Danilo as FIRMWARE LOADER maintainer MAINTAINERS: add Rust FW abstractions to FIRMWARE LOADER firmware: rust: improve safety comments ...