From: Thanh Nguyen <thanhnguyxn07@gmail.com>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com,
Thanh Nguyen <thanhnguyxn07@gmail.com>
Subject: [PATCH] Input: zinitix: don't use finger_mask as bitmask when reporting contacts
Date: Tue, 7 Apr 2026 22:14:40 -0500 [thread overview]
Message-ID: <20260408031440.955-1-thanhnguyxn07@gmail.com> (raw)
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@gmail.com>
---
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
next reply other threads:[~2026-04-08 3:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 3:14 Thanh Nguyen [this message]
2026-04-08 4:51 ` [PATCH] Input: zinitix: don't use finger_mask as bitmask when reporting contacts Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260408031440.955-1-thanhnguyxn07@gmail.com \
--to=thanhnguyxn07@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.