[PATCH] Input: zinitix: don't use finger_mask as bitmask when reporting contacts
From: Thanh Nguyen
Date: Tue Apr 07 2026 - 23:16:00 EST
The zinitix touchscreen driver was treating touch_event.finger_mask as a
bitmask to iterate through finger slots. However, on some devices (e.g.,
Samsung Galaxy A3 2015), finger_mask behaves as a finger count rather than
a bitmask, causing multitouch to malfunction.
Instead of relying on finger_mask as a bitmask, iterate through all
possible finger slots and check if SUB_BIT_EXIST is set for each slot.
This restores proper multitouch functionality on affected devices.
Fixes: e941dc13fd (")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221278
Signed-off-by: Thanh Nguyen <thanhnguyxn07@xxxxxxxxx>
---
drivers/input/touchscreen/zinitix.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscreen/zinitix.c
index 716d6fa60..b80525443 100644
--- a/drivers/input/touchscreen/zinitix.c
+++ b/drivers/input/touchscreen/zinitix.c
@@ -445,7 +445,6 @@ static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler)
struct bt541_ts_data *bt541 = bt541_handler;
struct i2c_client *client = bt541->client;
struct touch_event touch_event;
- unsigned long finger_mask;
__le16 icon_events;
int error;
int i;
@@ -470,11 +469,12 @@ static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler)
zinitix_report_keys(bt541, le16_to_cpu(icon_events));
}
- finger_mask = touch_event.finger_mask;
- for_each_set_bit(i, &finger_mask, MAX_SUPPORTED_FINGER_NUM) {
+ /* Process all finger slots and check if they exist, rather than relying on finger_mask as a bitmask.
+ * On some devices (e.g., Samsung A3 2015), finger_mask behaves as finger count rather than bitmask.
+ * Only process contacts that are actually reported as existing. */
+ for (i = 0; i < MAX_SUPPORTED_FINGER_NUM; i++) {
const struct point_coord *p = &touch_event.point_coord[i];
- /* Only process contacts that are actually reported */
if (p->sub_status & SUB_BIT_EXIST)
zinitix_report_finger(bt541, i, p);
}
--
2.51.0.windows.2