]> git.ipfire.org Git - thirdparty/linux.git/commit
Input: mms114 - fix touch indexing for MMS134S and MMS136
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 23 Jun 2026 05:35:18 +0000 (22:35 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 23 Jun 2026 06:04:19 +0000 (23:04 -0700)
commita6ac4e24c1a8a533bb61035184fdcc7eede4cc8d
treecaa0973d4adb7ad63494003761c1e2645c4db6d5
parentdf2b818fa009c10ff6ba875a1663ff001cda9558
Input: mms114 - fix touch indexing for MMS134S and MMS136

The MMS134S and MMS136 touch controllers have an event size of 6 bytes
rather than 8 bytes. When __mms114_read_reg() reads the touch data
packet from the device into the touch buffer, the events are packed
tightly at 6-byte intervals. However, the driver iterates through the
events using standard C array indexing (touch[index]), where each
element is sizeof(struct mms114_touch) (8 bytes) apart. As a result, any
touch events beyond the first one are read from incorrect offsets and
parsed improperly.

Fix this by explicitly calculating the byte offset for each touch event
based on the device's specific event size.

Fixes: 53fefdd1d3a3 ("Input: mms114 - support MMS136")
Fixes: ab108678195f ("Input: mms114 - support MMS134S")
Reported-by: sashiko-bot@kernel.org
Assisted-by: Antigravity:gemini-3.5-flash
Reviewed-by: Bryam Vargas <hexlabsecurity@proton.me>
Link: https://patch.msgid.link/20260616050912.1531241-1-dmitry.torokhov@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/mms114.c