From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12E31C55171 for ; Thu, 30 Jul 2026 19:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oZqy2KiailBWbxdwbEZpw+HvFPOjzz7WcrT6wURhw9c=; b=U+QyhdV31yOU1mRMrgUO1EGaqp 41fWA5qIZprHv1+OV0has5Tth4aim8ZfbRWpJIaJyA9aPSQYkr0xsIoS2U1GuX9X/Ha+Oqfg1F+4J VgO+TzQwBtFpRL6qejHR34kOILNrTTqSN6nQ54KcRcjpbs4/1XWN0/o4wbBlD9RxJwCQeiiwE3N4h F5ZSeId6dLzdqkGWBN5e/ZApcwwCNwD4fVnZXBidwDOi8diTGMNAbY/Rj5OkzKAA7OC34auduFhRZ o7bOR5kLPd3PGCrv3gnGUIjZ4zxMSV953eMsPQN/76NItRHH8ia0WNCtxerMrQEUUoEbLzlM1lsef LUCU9OMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wpWkT-0000000BGZ2-1gjH; Thu, 30 Jul 2026 19:48:58 +0000 Received: from layka.disroot.org ([178.21.23.139]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wpWkL-0000000BGXa-0EwM for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2026 19:48:51 +0000 Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6B59641B83; Thu, 30 Jul 2026 21:48:47 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id XI_ohf7IfS-w; Thu, 30 Jul 2026 21:48:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1785440926; bh=Kx/SqQ5YypakUXn6zd5yZDIz4kpBBehlvhVjWn5tQFo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=HQhm7n1uHtUAchYEysLVLhkwrzhRjkM+V8qbu+3yo7A8nHamF8sOq7X4pO1vIX1qV uy2FVNe79/tlDoFBPBWSvZeiIUu07UdOM8Vt9a3yLIGvPm2vK8316i/DaoiNX9EIy7 tbzTjqzF+v6F9r7m8OYpl/HKuFBsvWGpmX7wFsDsrRjXXP3Qc1WdBoVDi6RHdnz8Hc 90w4C6pFf0EBRpj/9Mj1ZyOnNC1k6X4c3z1P/soFT+nfqM0fQNvUc6NpBd7lfw9GqN x3D6oQb6yXVO3wQkSj7BjlHaXnFkI6Jst0oYvw71wTs6Yldb85VI+ZmjMt1/sGtbmn yfv1zb+QVXxlQ== From: Kaustabh Chakraborty Date: Fri, 31 Jul 2026 01:18:21 +0530 Subject: [PATCH v2 1/5] Input: zinitix - check all available fingers for every touch event MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260731-zinitix-modes-v2-1-ffe2ec9a9031@disroot.org> References: <20260731-zinitix-modes-v2-0-ffe2ec9a9031@disroot.org> In-Reply-To: <20260731-zinitix-modes-v2-0-ffe2ec9a9031@disroot.org> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Srba , Linus Walleij , Peter Griffin , Alim Akhtar Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kaustabh Chakraborty X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260730_124849_674996_0527ED2E X-CRM114-Status: GOOD ( 19.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When this initial driver was first added to tree, that is, in commit 26822652c85e ("Input: add zinitix touchscreen driver"), the touch_event struct had a field called finger_cnt. It was supposed to report how many fingers are touching the screen. But then, in commit e941dc13fd37 ("Input: zinitix - do not report shadow fingers"), some touchscreens reportedly exposed a bit mask for the fingers, instead of the count. So the code was changed to bitwise iteration. With my testing on the ZT7548 touchscreen of the Galaxy J6, I find the former to be true. This shows that there's two valid methods depending on what hardware the driver is made to work on. One solution is to implement both methods, and use some flag to select between the two. However, this introduces more implementation overhead, and a possibility of regression on devices the driver is expected to work. Instead, unconditionally check all fingers. The finger_mask field is now left unused, thus serving as padding bytes in the struct. For each finger, zinitix_report_finger() is called if the status reports the SUB_BIT_EXIST bit, so phantom fingers are not going to be a thing. Moreover, the android driver [1] does exactly that, so it's a tried method of implementation. Link: https://android.googlesource.com/kernel/bcm/+/23d376ef33aa4c500a5ea24a290f029d5f8e2de3/drivers/input/touchscreen/zinitix_touch.c#1942 [1] Signed-off-by: Kaustabh Chakraborty --- drivers/input/touchscreen/zinitix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscreen/zinitix.c index 0c36765bd79f..3421b8ffb19b 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,8 +469,7 @@ 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) { + 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 */ -- 2.54.0