Commit Graph

1428893 Commits

Author SHA1 Message Date
Pengpeng Hou
95dffe32a6 Input: aiptek - validate raw macro indices before updating state
aiptek_irq() derives macro key indices directly from tablet reports and
then uses them to index macroKeyEvents[]. Report types 4 and 5 also save
the derived value in aiptek->lastMacro and later use that state to
release the previous key.

Validate the raw macro index once before it enters that state machine, so
lastMacro only ever stores an in-range macro key. Keep direct bounds
checks for report type 6, which reads the macro number from the packet
body and uses it immediately.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260329001711.88076-1-pengpeng@iscas.ac.cn
[dtor: fix macro fallback in report 5s to use -1]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-06 22:10:55 -07:00
Pengpeng Hou
bc561dc8ba Input: gf2k - skip invalid hat lookup values
gf2k_read() decodes the hat position from a 4-bit field and uses it
directly to index gf2k_hat_to_axis[]. The lookup table only has nine
entries, so malformed packets can read past the end of the fixed table.

Skip hat reporting when the decoded value falls outside the lookup
table instead of forcing it to the neutral position. This keeps the
fix local and avoids reporting a made-up axis state for malformed
packets.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260407120001.1-gf2k-v2-pengpeng@iscas.ac.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-06 22:10:13 -07:00
Sanjay Govind
84e7a17d18 Input: xpad - add RedOctane Games vendor id
Add vendor ID for RedOctane Games to xpad driver.

Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
Link: https://patch.msgid.link/20260311213106.271577-2-sanjay.govind9@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-03 22:36:46 -07:00
Elliot Tester
802b4c158c Input: xpad - remove stale TODO and changelog header
All items in the TODO block have since been addressed: axis tuning,
analog button handling, rumble support, and dance pad USB IDs are all
implemented. The manual changelog is also removed as history is tracked
in git.

Signed-off-by: Elliot Tester <elliotctester1@gmail.com>
Link: https://patch.msgid.link/20260325221618.135833-1-elliotctester1@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-03 22:35:34 -07:00
Johan Hovold
f13b780092 Input: usbtouchscreen - refactor endpoint lookup
Use the common USB helpers for looking up bulk and interrupt endpoints
(and determining endpoint numbers) instead of open coding.

Note that the NEXIO data interface has two bulk endpoints (see commit
5197424cdc ("Input: usbtouchscreen - add NEXIO (or iNexio) support")
for the descriptors).

The lookup in probe handles both bulk-in and interrupt-in endpoints and
was added to handle NEXIO devices. Replace the open coded lookup with a
lookup for the common interrupt endpoint and an explicit fallback
accepting a bulk endpoint.

This iterates over the (two) endpoints twice for NEXIO devices but makes
it more clear what is going on.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260401082212.2180434-1-johan@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-01 10:37:38 -07:00
Griffin Kroah-Hartman
df53055c54 Input: aw86927 - add support for Awinic AW86938
Add support for the I2C-connected Awinic AW86938 LRA haptic controller.

The AW86938 has a similar but slightly different register layout. In
particular, the boost mode register values.

The AW86938 also has some extra features that aren't implemented
in this driver yet.

Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
Link: https://patch.msgid.link/20260302-aw86938-driver-v4-3-92c865df9cca@fairphone.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-01 09:08:33 -07:00
Griffin Kroah-Hartman
b73724b1de dt-bindings: input: awinic,aw86927: Add Awinic AW86938
Add bindings for the Awinic AW86938 haptic chip which can be found in
smartphones. These two chips require a similar devicetree configuration,
but have a register layout that's not 100% compatible.
Still, because chip model is fully detectable via ID register, these
chips can be documnented in the same file.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
Link: https://patch.msgid.link/20260302-aw86938-driver-v4-2-92c865df9cca@fairphone.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-01 09:08:32 -07:00
Griffin Kroah-Hartman
53ba7a47d3 Input: aw86927 - respect vibration magnitude levels
Previously the gain value was hardcoded. Take the magnitude passed via
the input API and configure the gain register accordingly.

Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
Link: https://patch.msgid.link/20260302-aw86938-driver-v4-1-92c865df9cca@fairphone.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-04-01 09:08:32 -07:00
Johan Hovold
4decd8f4ae Input: synaptics_usb - refactor endpoint lookup
Use the common USB helper for looking up interrupt-in endpoints instead
of open coding.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260330095948.1663141-4-johan@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-30 16:54:41 -07:00
Johan Hovold
5bb3ab0daa Input: appletouch - refactor endpoint lookup
Use the common USB helpers for looking up interrupt-in endpoints (and
determining endpoint numbers) instead of open coding.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260330095948.1663141-3-johan@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-30 16:54:41 -07:00
Johan Hovold
a7675c1f1f Input: keyspan-remote - refactor endpoint lookup
Use the common USB helper for looking up interrupt-in endpoints instead
of open coding.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260330095948.1663141-2-johan@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-30 16:54:41 -07:00
Oliver Neukum
734fd5ba78 Input: pegasus_notetaker - use HID defines
The driver uses its own definitions for HID requests.
This leads to duplication and obfuscation. Use HID's
definitions.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://patch.msgid.link/20260325143256.371854-2-oneukum@suse.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 09:09:51 -07:00
Oliver Neukum
ffd01c3bcc Input: aiptek - use HID headers
The driver uses its own definitions for HID requests.
This leads to duplication and obfuscation. Use HID's
definitions.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://patch.msgid.link/20260325143256.371854-1-oneukum@suse.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 09:09:51 -07:00
Val Packett
653f3100f5 Input: goodix-berlin - report a resolution of 10 units/mm
Without a reported resolution, userspace was assuming 1 unit/mm which
is wildly wrong: a regular smartphone is clearly not 2.4 meters tall.
Most applications do not care much for this kind of raw mm value,
but Phosh's on-screen keyboard would accidentally trigger swipe-to-close
gestures due to misinterpreting small movements as huge ones.

Do what the older goodix.c driver does and set the resolution to 10
units/mm to make sure the numbers calculated by userspace are reasonable.

Signed-off-by: Val Packett <val@packett.cool>
Link: https://patch.msgid.link/20260321073242.556253-1-val@packett.cool
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 09:08:17 -07:00
Dmitry Torokhov
79df764dbe Input: zinitix - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:54:00 -07:00
Dmitry Torokhov
35ee82990d Input: wm97xx - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:54:00 -07:00
Dmitry Torokhov
da52f4b27a Input: wdt87xx_i2c - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:59 -07:00
Dmitry Torokhov
e65407f838 Input: tsc2007 - use guard notation when acquiring mutexes
This makes the code more compact and error handling more robust.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:59 -07:00
Dmitry Torokhov
600a2db76b Input: sx8654 - use IRQF_NOAUTOEN when requesting interrupt
Instead of requesting interrupt normally and immediately disabling it
with call to disable_irq() use IRQF_NOAUTOEN to keep it disabled until
it is needed. This avoids a tiny window when interrupt is enabled but
not needed.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:59 -07:00
Dmitry Torokhov
a8f56931c4 Input: sx8654 - use guard notation when acquiring spinlock
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:59 -07:00
Dmitry Torokhov
dc05a01180 Input: sur40 - use guard notation when acquiring spinlock
Guard notation simplifies code.

Also use list_first_entry() instead of list_entry() to emphasize intent.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:59 -07:00
Dmitry Torokhov
8665ceb926 Input: stmfts - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:58 -07:00
Dmitry Torokhov
e3e82a9d08 Input: raydium_i2c_ts - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:58 -07:00
Dmitry Torokhov
738de07ddf Input: pixcir_i2c_ts - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:58 -07:00
Dmitry Torokhov
9f33f4fd39 Input: novatek-nvt-ts - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:58 -07:00
Dmitry Torokhov
7c011b6ddb Input: mxs-lradc-ts - use guard notation when acquiring spinlock
Guard notation simplifies code and shows critical section more clearly.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-25 07:53:57 -07:00
Dmitry Torokhov
03bf327434 Input: msg2638 - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:56 -07:00
Dmitry Torokhov
11a64d6bb7 Input: mms114 - use guard notation when acquiring mutex
Guard notation simplifies code.

Also stop trying to check if input device is opened/in use in the
interrupt handler - the interrupt is disabled when device is closed or
suspended.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:55 -07:00
Dmitry Torokhov
7e1e5722e8 Input: mk712 - 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.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:55 -07:00
Dmitry Torokhov
8e4ae01d84 Input: melfas_mip4 - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:54 -07:00
Dmitry Torokhov
a00a9fad1c Input: lpc32xx_ts - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:53 -07:00
Dmitry Torokhov
3092610fdc Input: iqs7211 - use cleanup facility for fwnodes
Use __free(fwnode_handle) cleanup facility to ensure that references to
acquired fwnodes are dropped at appropriate times automatically.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:53 -07:00
Dmitry Torokhov
3b5e7a6265 Input: iqs5xx - simplify parsing of firmware blob
Do not define or use iqs5xx_ihex_rec structure: the original code was
using just a couple of fields in it and instead used it to calculate
offset to record data. The data field was actually reserving space for
checksum.

Instead iterate through fields and advance pointer explicitly.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:52 -07:00
Dmitry Torokhov
582f32aa89 Input: iqs5xx - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code and error
handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:52 -07:00
Dmitry Torokhov
f1324109d1 Input: ipaq-micro-ts - use guard notation when acquiring mutex/spinlock
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:51 -07:00
Dmitry Torokhov
445dcfc7f6 Input: imx6ul_tsc - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:50 -07:00
Dmitry Torokhov
d2862b87ad Input: imagis - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:50 -07:00
Dmitry Torokhov
ded32cc611 Input: hycon-hy46xx - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:49 -07:00
Dmitry Torokhov
5568c1aeb3 Input: hideep - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code and error
handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:49 -07:00
Dmitry Torokhov
777f5b42f8 Input: goodix - switch to using cleanup functions in firmware code
Start using __free(firmware) to simplify the code and error handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:27 -07:00
Dmitry Torokhov
576c99f1a3 Input: exc3000 - use guard notation when acquiring mutex
Guard notation simplifies code.

Note that callers of exc3000_vendor_data_request() always expect
response, so it was adjusted to always wait for it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:26 -07:00
Dmitry Torokhov
cec3bcec6f Input: elo - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:26 -07:00
Dmitry Torokhov
e5c79d9f65 Input: elants_i2c - switch to using cleanup facilities
Start using __free() and guard() primitives to simplify the code
and error handling.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:25 -07:00
Dmitry Torokhov
8c187a4c15 Input: ektf2127 - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:24 -07:00
Dmitry Torokhov
6e9b9192d6 Input: eeti_ts - use guard notation when acquiring mutexes
This makes the code more compact and error handling more robust.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:24 -07:00
Dmitry Torokhov
df2e75e070 Input: edt-ft5x06 - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:23 -07:00
Dmitry Torokhov
a0a92414af Input: cyttsp - use guard notation when acquiring mutex
Guard notation simplifies code.

Also fix the touchscreen not being marked as suspended when noone has
opened/is using it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:23 -07:00
Dmitry Torokhov
37115e7df5 Input: chipone_icn8318 - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:22 -07:00
Dmitry Torokhov
b29be7bae3 Input: bu21029_ts - use guard notation when acquiring mutex
Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:21 -07:00
Dmitry Torokhov
24b3bc4a8f Input: auo-pixcir-ts - use guard notation when acquiring mutexes
This makes the code more compact and error handling more robust.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-03-24 21:14:21 -07:00