Commit Graph

8276 Commits

Author SHA1 Message Date
Dmitry Torokhov
21f6b6b47c Input: ideapad_slidebar - use guard notation when acquiring spinlock
Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
e5aee2d894 Input: drv2667 - use guard notation when acquiring mutex
Using guard notation 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
cf3f3a08e1 Input: drv2665 - use guard notation when acquiring mutex
Using guard notation 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
0a54609a89 Input: drv260x - use guard notation when acquiring mutex
Using guard notation 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
6bbf7efc40 Input: kxtj9 - use guard notation when acquiring mutex/disabling irq
Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released and interrupts are
re-enabled in all code paths when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
1313f0ad81 Input: da7280 - use guard notation when acquiring mutex and spinlock
Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
0cc842d191 Input: cma3000_d0x - use guard notation when acquiring mutex
Using guard notation 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
d8a43a8363 Input: cm109 - use guard notation when acquiring mutex and spinlock
Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
61bbcc9fa1 Input: ati_remote2 - use guard notation when acquiring mutex
Using guard notation 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
f9f37373ff Input: ad714x - use guard notation when acquiring mutex
Using guard notation 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
45a8145972 Input: xpad - use guard notation when acquiring mutex and spinlock
Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:07:32 -07:00
Dmitry Torokhov
10068a36b0 Input: turbografx - use guard notation when acquiring mutex
Using guard notation 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.

Link: https://lore.kernel.org/r/20240904043104.1030257-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:07:32 -07:00
Dmitry Torokhov
d68ed9b580 Input: n64joy - use guard notation when acquiring mutex
Using guard notation 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.

Link: https://lore.kernel.org/r/20240904043104.1030257-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:07:31 -07:00
Dmitry Torokhov
63ade96711 Input: iforce - use guard notation when acquiring mutex and spinlock
Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240904043104.1030257-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:07:31 -07:00
Dmitry Torokhov
60bf2f9389 Input: gamecon - use guard notation when acquiring mutex
Using guard notation 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.

Link: https://lore.kernel.org/r/20240904043104.1030257-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:07:31 -07:00
Dmitry Torokhov
556cac064c Input: db9 - use guard notation when acquiring mutex
Using guard notation 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.

Link: https://lore.kernel.org/r/20240904043104.1030257-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:07:31 -07:00
Dmitry Torokhov
b18d9d75dd Input: st-keyscan - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-17-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
f0d8229869 Input: spear-keyboard - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-16-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
b8a3e18141 Input: pxa27x_keypad - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-15-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
9e09354cb6 Input: pmic8xxx-keypad - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-14-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
a49e229319 Input: omap4-keypad - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-13-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
405b1762ae Input: matrix_keypad - use guard notation when acquiring spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-12-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:56 -07:00
Dmitry Torokhov
e9495ead52 Input: lpc32xx-keys - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:31 -07:00
Dmitry Torokhov
02e4f823ce Input: lm8323 - use guard notation when acquiring mutexes
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:31 -07:00
Dmitry Torokhov
d1212ac94e Input: ipaq-micro-keys - use guard notation when acquiring mutex and spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:14 -07:00
Dmitry Torokhov
2f39a9fc87 Input: imx_keypad - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:14 -07:00
Dmitry Torokhov
946a48090e Input: ep93xx_keypad - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:03 -07:00
Dmitry Torokhov
932fc59b30 Input: applespi - use guard notation when acquiring spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:52:33 -07:00
Dmitry Torokhov
2e969e5b15 Input: adp5589-keys - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/20240825051627.2848495-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:52:33 -07:00
Dmitry Torokhov
2e26a76161 Input: elan_i2c - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling. This makes the code more compact and error
handling more robust by ensuring that locks are released in all
code paths when control leaves critical section and all allocated
memory is freed.

Link: https://lore.kernel.org/r/ZsrBC7qDbOvAaI-W@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:42:45 -07:00
Dmitry Torokhov
c610e95f77 Input: psmouse-smbus - use guard notation when acquiring mutex
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.

Link: https://lore.kernel.org/r/ZsrAa9XcDvHeIs9T@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:39:21 -07:00
Javier Carrasco
334ababdd1 Input: hycon-hy46xx - add missing dependency on REGMAP_I2C
hideep makes use of regmap_i2c, and it has to be selected within its
Kconfig entry to compile successfully.

Fixes: aa2f62cf21 ("Input: add driver for the Hycon HY46XX touchpanel series")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241002-input-hycon-hy46xx-select-remap-i2c-v1-1-08f6e83b268a@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 04:44:03 -07:00
Javier Carrasco
2f548325ae Input: hideep - add missing dependency on REGMAP_I2C
hideep makes use of regmap_i2c, and it has to be selected within its
Kconfig entry to compile successfully.

Fixes: 842ff28616 ("Input: add support for HiDeep touchscreen")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241002-input-hideep-select-remap-i2c-v1-1-6b0fa1dd5fc5@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 04:43:58 -07:00
Shen Lichuan
515ef92b49 Input: correct typos in multiple comments across misc drivers
Fixed some confusing typos that were currently identified witch codespell,
the details are as follows:

-in the code comments:
drivers/input/misc/drv2665.c:18: Contol ==> Control
drivers/input/misc/drv2667.c:19: Contol ==> Control
drivers/input/misc/ideapad_slidebar.c:26: meaningfull ==> meaningful
drivers/input/misc/ims-pcu.c:742: bootoloader ==> bootloader
drivers/input/misc/kxtj9.c:28: funtion ==> function
drivers/input/misc/soc_button_array.c:518: indentical ==> identical
drivers/input/misc/wistron_btns.c:274: satelite ==> satellite
drivers/input/misc/yealink.c:380: singe ==> single
drivers/input/misc/yealink.c:617: coresponding ==> corresponding

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://lore.kernel.org/r/20240926075515.10042-1-shenlichuan@vivo.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-30 08:00:16 -07:00
Yu Jiaoliang
b0352120af input: Fix typos in comments across various files
This commit fixes several typographical errors in comments within
the driver/input directory. No functional changes are made.

Detected using codespell.

Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
Link: https://lore.kernel.org/r/20240926031457.3479350-1-yujiaoliang@vivo.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-30 07:58:33 -07:00
Joel Selvaraj
c7bf046925 Input: novatek-nvt-ts - add support for NT36672A touchscreen
Extend the novatek touchscreen driver to support NT36672A chip which
is found in phones like qcom/sdm845-xiaomi-beryllium-tianma.dts.
Added devicetree support for the driver and used i2c chip data to handle
the variation in chip id and wake type. Also added vcc and iovcc
regulators which are used to power the touchscreen hardware.

Signed-off-by: Joel Selvaraj <joelselvaraj.oss@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240601-nvt-ts-devicetree-regulator-support-v5-3-aa9bf986347d@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-29 19:10:44 -07:00
Joel Selvaraj
c12fbeb200 Input: novatek-nvt-ts - replace generic i2c device id with specific IC variant
This is done in preparation to introduce other variants of the Novatek NVT
touchscreen controller that can be supported by the driver.

Signed-off-by: Joel Selvaraj <joelselvaraj.oss@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240601-nvt-ts-devicetree-regulator-support-v5-1-aa9bf986347d@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-29 19:10:43 -07:00
Shen Lichuan
55bef83509 Input: Convert comma to semicolon
To ensure code clarity and prevent potential errors, it's advisable
to employ the ';' as a statement separator, except when ',' are
intentionally used for specific purposes.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://lore.kernel.org/r/20240918032246.9147-1-shenlichuan@vivo.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-18 03:48:00 -07:00
Rob Herring (Arm)
c7c878ff32 Input: tegra-kbc - use of_property_read_variable_u32_array() and of_property_present()
There's no need to get the length of an DT array property before
parsing the array. of_property_read_variable_u32_array() takes a
minimum and maximum length and returns the actual length (or error
code).

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.

Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240913200827.546649-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-13 23:16:23 -07:00
Jinjie Ruan
dcd18a3fb1 Input: ps2-gpio - use IRQF_NO_AUTOEN flag in request_irq()
disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Fixes: 9ee0a05588 ("Input: PS/2 gpio bit banging driver for serio bus")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20240912033013.2610949-1-ruanjinjie@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-13 10:20:48 -07:00
David Lechner
82abef590e Input: ims-pcu - fix calling interruptible mutex
Fix calling scoped_cond_guard() with mutex instead of mutex_intr.

scoped_cond_guard(mutex, ...) will call mutex_lock() instead of
mutex_lock_interruptible().

Fixes: 703f12672e ("Input: ims-pcu - switch to using cleanup functions")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240910-input-misc-ims-pcu-fix-mutex-intr-v1-1-bdd983685c43@baylibre.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-10 16:13:44 -07:00
Dmitry Torokhov
4172a64ef2 Input: zforce_ts - switch to using asynchronous probing
The driver waits for the device to boot, which can be a lengthy
process. Switch it to asynchronous probing to allow more devices
to be probed simultaneously.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-19-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:47 -07:00
Dmitry Torokhov
6a5180c619 Input: zforce_ts - remove assert/deassert wrappers
The wrappers are extremely simple, used once, and do not bring much
value. Remove them.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-18-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:47 -07:00
Dmitry Torokhov
7846bd8b8d Input: zforce_ts - do not hardcode interrupt level
Stop forcing interrupt to be low level triggered and instead rely on the
platform to define proper trigger to allow flexibility in board designs.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-17-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:47 -07:00
Dmitry Torokhov
8f2ef2610f Input: zforce_ts - switch to using devm_regulator_get_enable()
The driver does not actively manage regulator state past probe() time,
so we can use devm_regulator_get_enable() to simplify the code.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-16-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:47 -07:00
Dmitry Torokhov
16ff0224d8 Input: zforce_ts - stop treating VDD regulator as optional
This regulator is not optional from the controller point of view,
so stop treating it as such. For hard-wired designs that omit the
regulator from their device trees regulator subsystem will create
a dummy instance.

This may introduce unnecessary delay of 100us in case of dummy
regulator, but if it is important the driver should be marked as
using asynchronous probing to avoid even longer delays waiting for
the command completions.

Also use usleep_range() instead of udelay() to avoid spinning.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-15-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:46 -07:00
Dmitry Torokhov
b5ed81cc7b Input: zforce_ts - make zforce_idtable constant
The I2C ID table is not supposed to change; mark it as const.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-14-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:46 -07:00
Dmitry Torokhov
7e168b81e6 Input: zforce_ts - use dev_err_probe() where appropriate
Use dev_err_probe() helper to log deferrals in the devices_deferred
debugfs file and avoid extra messages in the logs.

Also rename "ret" variables holding error codes only to "error".

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-13-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:46 -07:00
Dmitry Torokhov
c4a8349262 Input: zforce_ts - do not ignore errors when acquiring regulator
We should abort probe on any error besides -ENOENT which signifies that
the regulator is not defined in device tree or elsewhere, not only
when we see -EPROBE_DEFER.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-12-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:46 -07:00
Dmitry Torokhov
43a48ec581 Input: zforce_ts - make parsing of contacts less confusing
Zforce touch data packet consists of a byte representing number of
contacts followed by several chunks with length of 9 bytes representing
each contact. Instead of accounting for the leading byte by increasing
offset of each field in contacts by one introduce a pointer to contact
data and point it appropriately. This avoids awkward constructs like:

	point.prblty = payload[9 * i + 9];

which makes it seem like there is off-by-one error, in favor of more
straightforward:

	point.prblty = p[8];

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:46 -07:00
Dmitry Torokhov
83b6549ee1 Input: zforce_ts - switch to using get_unaligned_le16
Instead of doing conversion from little-endian data to CPU endianness
by hand use existing helpers.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:46 -07:00
Dmitry Torokhov
5c2002677e Input: zforce_ts - use guard notation when acquiring mutexes
Guard notation allows for simpler code and ensures that mutexes are
automatically released in all code paths.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:46 -07:00
Dmitry Torokhov
9ba33f6145 Input: zforce_ts - ensure that pm_stay_awake() and pm_relax() are balanced
There is a small chance that ts->suspending flag may change while the
interrupt handler is running. To make sure call to pm_relax() is not
skipped on accident use a temporary to hold the original value at the
beginning of interrupt. Use READ_ONCE() so that the value is actually
fetched at the right time.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:45 -07:00
Dmitry Torokhov
f388412f70 Input: zforce_ts - remove unneeded locking
There is no need to have a lock around calls to i2c_master_send() and
i2c_master_recv() as they are not issued concurrently and they are not
sharing any buffers. Also there is no need for command_mutex as all
commands are issued sequentially.

Remove both.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:45 -07:00
Dmitry Torokhov
6244559410 Input: zforce_ts - handle errors from input_mt_init_sots()
input_mt_init_slots() can potentially return error which needs to be
handled.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:45 -07:00
Dmitry Torokhov
a9d59c206c Input: zforce_ts - do not explicitly set EV_SYN, etc bits
Input core and various helpers already do that for us, so drop the code
setting these bits explicitly.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:45 -07:00
Dmitry Torokhov
f820b43754 Input: zforce_ts - remove support for platfrom data
There are no in-tree users of platform data and any new ones should
either use device tree or static device properties, so let's remove
platform data support.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:45 -07:00
Dmitry Torokhov
5e091a49da Input: zforce_ts - simplify reporting of slot state
input_mt_report_slot_state() returns true if slot is active, so we can
combine checks for point.state != STATE_UP.

Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:45 -07:00
Sudip Mukherjee
4a0467ed73 Input: zforce_ts - use devm_add_action_or_reset()
If devm_add_action() fails we are explicitly calling the cleanup to free
the resources allocated. Lets use the helper devm_add_action_or_reset()
and return directly in case of error, as we know that the cleanup
function has been already called by the helper if there was any error.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Andreas Kemnade <andreas@kemnade.info> # Tolino Shine2HD
Link: https://lore.kernel.org/r/20240824055047.1706392-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:56:45 -07:00
Dmitry Torokhov
78af00d893 Input: tegra-kbc - use guard notation when acquiring mutex and spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-18-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:34 -07:00
Dmitry Torokhov
22df24590f Input: iqs62x-keys - use cleanup facility for fwnodes
Use __free(fwnode_handle) cleanup facility to ensure that references
to acquired fwnodes are dropped at appropriate times automatically.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:28 -07:00
Dmitry Torokhov
43a365abaf Input: gpio-keys - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling. This makes the code more compact and error
handling more robust by ensuring that locks are released in all
code paths when control leaves critical section and all allocated
memory is freed.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:20 -07:00
Dmitry Torokhov
934976f61e Input: atkbd - use guard notation when acquiring mutex
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.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:11 -07:00
Dmitry Torokhov
d5322d537c Input: alps - use guard notation when acquiring mutex
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-05 22:52:37 -07:00
Dmitry Torokhov
f057b57270 Merge branch 'ib/6.11-rc6-matrix-keypad-spitz' into next
Bring in changes removing support for platform data from matrix-keypad
driver.
2024-09-05 21:49:07 -07:00
Dmitry Torokhov
de35996d4b Input: matrix_keypad - remove support for platform data
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-05 21:43:42 -07:00
Dmitry Torokhov
584bf366f8 Input: matrix_keypad - switch to gpiod API and generic device properties
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-05 21:43:42 -07:00
Dmitry Torokhov
5080f62adb Input: matrix_keypad - remove support for clustered interrupt
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-05 21:43:42 -07:00
Dmitry Torokhov
a790df272a Input: synaptics-rmi4 - fix crash when DPM query is not supported
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: 14d650fcb7 ("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-03 15:01:11 -07:00
Linus Walleij
dac973838b Input: zinitix - varying icon status registers
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-08-31 19:12:26 -07:00
Linus Walleij
5278bb4cd6 Input: zinitix - read and cache device version numbers
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-08-31 19:05:47 -07:00
Dmitry Torokhov
092b7d431f Input: snvs_pwrkey - use devm_clk_get_optional_enabled()
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-31 15:25:05 -07:00
Linus Torvalds
1934261d89 Input updates for v6.11-rc5
- a fix for Cypress PS/2 touchpad for regression introduced in 6.11
   merge window where timeout condition is incorrectly reported for
   all extended Cypress commands.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQST2eWILY88ieB2DOtAj56VGEWXnAUCZtI2cgAKCRBAj56VGEWX
 nJGNAQCYR/VQOtGBoIo4/0VdxxH6qTuLu7XhWbBdzgx8ee6t6gD/Rj94mEpOh12V
 JEd3MiDdEtQt5KwwdkzUyiHYJ0x1WAw=
 =PzXA
 -----END PGP SIGNATURE-----

Merge tag 'input-for-v6.11-rc5' of 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-31 15:32:38 +12:00
Dmitry Torokhov
30f8588239 Input: bcm5974 - use guard notation when acquiring mutex
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-29 11:00:21 -07:00
Dmitry Torokhov
40a6bb10d3 Input: matrix-keymap - switch to using __free() cleanup facility
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-29 10:59:30 -07:00
Dmitry Torokhov
c472d33bcb Input: cypress_ps2 - fix waiting for command response
Commit 8bccf667f6 ("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: 8bccf667f6 ("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-29 10:46:17 -07:00
Utsav Agarwal
dc748812fc Input: adp5588-keys - add support for pure gpio
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-28 18:50:45 -07:00
Dmitry Torokhov
f0da267996 Input: adp5588-keys - use guard notation when acquiring mutexes
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-28 18:49:05 -07:00
Dmitry Torokhov
e2e75e4202 Input: mt6779-keypad - use devm_clk_get_enabled()
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-28 11:10:05 -07:00
Liao Chen
387e4975ec Input: mt6779-keypad - fix module autoloading
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-27 08:26:01 -07:00
Shen Lichuan
b7ffc98a6a Input: wistron_btns - use kmemdup_array instead of kmemdup for multiple 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-26 10:22:00 -07:00
Dmitry Torokhov
6994d8b84b Input: evdev - limit amount of data for writes
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-23 23:51:14 -07:00
Linus Torvalds
7eb61cc674 Input updates for v6.11-rc4
- 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.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQST2eWILY88ieB2DOtAj56VGEWXnAUCZsjxKQAKCRBAj56VGEWX
 nKE9APwPOZl4TldhPLG37LCvlVmgN0cSSWY+PEEqIaxmFtezjQEAr2/qs1XknZVr
 LkuhmHxng2ZI9X4HUL+h52Lha7y4UAc=
 =3Pcb
 -----END PGP SIGNATURE-----

Merge tag 'input-for-v6.11-rc4' of 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-24 08:15:21 +08:00
Dmitry Torokhov
6c65914a40 Input: keypad-nomadik-ske - remove the driver
The users of this driver were removed in 2013 in commit 28633c54bd
("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-22 11:36:25 -07:00
Dmitry Torokhov
4e870e6bbe Input: himax_hx83112b - fix incorrect size when reading product ID
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: 0944829d49 ("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-19 17:29:14 -07:00
Cai Huoqing
105a0c76fd Input: colibri-vf50-ts - make use of the helper function dev_err_probe()
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-19 10:22:56 -07:00
Werner Sembach
aaa4ca873d Input: i8042 - use new forcenorestore quirk to replace old buggy quirk 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-18 21:28:36 -07:00
Werner Sembach
3d765ae2da Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3
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-18 21:28:23 -07:00
Takashi Iwai
7ce7c2283f Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table
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-18 20:24:56 -07:00
Dmitry Torokhov
25162a4f64 Input: cyttsp4 - remove driver
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-05 10:48:49 -07:00
Dmitry Torokhov
ae25dbac2e Input: cyttsp - use devm_regulator_bulk_get_enable()
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-05 10:48:39 -07:00
Dmitry Torokhov
7925312eca Input: cyttsp - stop including gpio.h
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-05 10:48:34 -07:00
Dmitry Torokhov
2c71e987f0 Input: ilitek_ts_i2c - stop including gpio.h
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-05 10:48:28 -07:00
Emanuele Ghidoli
208989744a Input: ilitek_ts_i2c - add report id message validation
Ensure that the touchscreen response has correct "report id" byte
before processing the touch data and discard other messages.

Fixes: 42370681bd ("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-05 10:39:20 -07:00
Emanuele Ghidoli
7d0b18cd5d Input: ilitek_ts_i2c - avoid wrong input subsystem sync
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: 42370681bd ("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-05 10:33:19 -07:00
Marge Yang
14d650fcb7 Input: synaptics-rmi4 - add support for querying DPM value (F12)
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-05 10:31:33 -07:00
Dmitry Torokhov
63f92f1138 Input: tsc2004/5 - use guard notation when acquiring mutexes/locks
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-04 18:10:41 -07:00
Dmitry Torokhov
f46b18f36c Input: tsc2004/5 - respect "wakeup-source" property
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-04 18:10:41 -07:00
Dmitry Torokhov
d086d6d803 Input: tsc2004/5 - do not use irq_set_irq_wake() directly
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-04 18:10:40 -07:00
Dmitry Torokhov
f56b591880 Input: tsc2004/5 - fix reset handling on probe
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: d257f2980f ("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-04 18:10:40 -07:00