From nobody Fri Jul 24 04:54:16 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F067F3AEF46; Thu, 23 Jul 2026 19:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834672; cv=none; b=en4+2pXGMbswGazog/IKZweiPnFzkft/ZNlQXyYNkp6KsV/WSRx5BJKBqPETSloUH6GVyPVJ05LCKJiFZIV5qIcP4pV/RwBDEWzSXufvHu5LvAjC56ADd/Vf7Yobc02FASLI2W70T4QjuTRwX8sF/UDoUJdkCm3gtATv1gMCFGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834672; c=relaxed/simple; bh=Kx/SqQ5YypakUXn6zd5yZDIz4kpBBehlvhVjWn5tQFo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SdX67lLIXFktZ/wJC6V70WHBcbQKB8dD3RbmulCMS2TzF4Z9CxZ7HVfxPbXslgq5jHPiABY5YMKMo0ccL8hBXvFXv4obeazhPfpYKSarAuuNN795OuHlcnku8D5CzQOnTpY58L2yd75QX4dBw8g845G2iPy7i+n4OzA5cW4eQN0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=lYt8B6Ec; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="lYt8B6Ec" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 5742F8005E; Thu, 23 Jul 2026 21:24:28 +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 wkwcVC02_uHg; Thu, 23 Jul 2026 21:24:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1784834667; bh=Kx/SqQ5YypakUXn6zd5yZDIz4kpBBehlvhVjWn5tQFo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=lYt8B6Ec8aCKgHoeIAWI5TNzhPf7xhbGeO1SuXw3/brsqt7GjpBKlviQGv4IzTLOv 5iB+qRE719Msg0JRxLIFA8Ad7h71dSJnUIB+ucopXoxJBDZfLopkg+/rr8L+LGrf4l h7kpa5AjgAw7jmgUOKGwj02GfXibxIWFx6i/sVhRP/b5XHAnl/NZZORFlRWS/7sUKB 4a/Dn1dnhaRcU3TmdHkls9hBjWSV2ORJyk8+CQM8SQ+QkTwXFcZn8nRHI9egBW1yjb 0dZlR8J1yX3DJuqQUbZsl6sOGC+wVF8PafN2uFiUMzH24ztlZQ3OJr+39aV057YtUR OZQc6EWW77pjw== From: Kaustabh Chakraborty Date: Fri, 24 Jul 2026 00:54:03 +0530 Subject: [PATCH 1/5] Input: zinitix - check all available fingers for every touch event Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260724-zinitix-modes-v1-1-f6df7d86a878@disroot.org> References: <20260724-zinitix-modes-v1-0-f6df7d86a878@disroot.org> In-Reply-To: <20260724-zinitix-modes-v1-0-f6df7d86a878@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 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/+/23d376ef33aa4c500a5ea24= a290f029d5f8e2de3/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/touchscree= n/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 =3D bt541_handler; struct i2c_client *client =3D 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)); } =20 - finger_mask =3D touch_event.finger_mask; - for_each_set_bit(i, &finger_mask, MAX_SUPPORTED_FINGER_NUM) { + for (i =3D 0; i < MAX_SUPPORTED_FINGER_NUM; i++) { const struct point_coord *p =3D &touch_event.point_coord[i]; =20 /* Only process contacts that are actually reported */ --=20 2.54.0 From nobody Fri Jul 24 04:54:16 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E672C388E53; Thu, 23 Jul 2026 19:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834680; cv=none; b=Mycan9dVdMx4kVIR/W4SCcd9a0I0kJwxvQ2uvCvIpFvSNw4TMLuGnGlA7tfthmdqbXcmcLoB8E7mg0AIlql7Ms/M5mzgyxMTYBNlEzBKpwGNFx/R1Wbs6RA8jf4Hp5SUvRan86DjSGx1cowaax0bxhtV5NUriqkXiwNfOOVbraw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834680; c=relaxed/simple; bh=J3J022ZGj9ZwKPT7jAjojwthMO7BRByaqpFAI8V+BqQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZiXYkvmqGssiFxyMaMyFeeDo7LL4DWgaHry/8sc31jr3sXhBJ49/YKqyYnjT5TJpGugQbEwVKGGfg2YhHWB6SxzHLr5ieiAp42svNoXdxp+xGW1gDX9/DaPopz7u5x4xZiq/JfqtUyVSuCbYJoQTafzR9KO2nzFb2pmHOUcs2MU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=FzMWymWb; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="FzMWymWb" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id DD2B79D778; Thu, 23 Jul 2026 21:24:36 +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 Sm6cQttzSK1e; Thu, 23 Jul 2026 21:24:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1784834676; bh=J3J022ZGj9ZwKPT7jAjojwthMO7BRByaqpFAI8V+BqQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=FzMWymWb3aucVymjRY+8heXQP/xL6u/90f0d0wa9YrMhAjvcyWfjgrw2X/R35dq9j Py3o0a2hMV2rGnQqgtJ623XpzGVTbxve3Y6TS2rUqQCe+4yLSom6MzDunY3crok5C6 s3ym6ZVQOJf/ezHYDDg5IqDHQO784+tknzMng3+stXb6RuSmmV6PJB1qDBrNxPzwyb a85dyiObGZqqVbwR5OmJbZabqwQSASX+oNkZ4h3CrXHZnxflWEIonyXc9vCO2vHdDf 2g1mj/suyQWKV/r1UUUO34OsCaA5GymUNKFGNf+fe0I76dalUoWwFSfOQmQiF4XW2e lvnhpJNfwffow== From: Kaustabh Chakraborty Date: Fri, 24 Jul 2026 00:54:04 +0530 Subject: [PATCH 2/5] Input: zinitix - do not ignore non-moving fingers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260724-zinitix-modes-v1-2-f6df7d86a878@disroot.org> References: <20260724-zinitix-modes-v1-0-f6df7d86a878@disroot.org> In-Reply-To: <20260724-zinitix-modes-v1-0-f6df7d86a878@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 With the ZT7548 touchscreen present in the Galaxy J6, multitouch does not work reliably. This is due to the fact that the driver reports fingers only when their state is changed, so it's either placed against the scren, moved, or drawn away from the screen. The function which is responsible for this is zinitix_report_finger(). This function is called from the IRQ handler, under the following condition: if (p->sub_status & SUB_BIT_EXIST) zinitix_report_finger(bt541, i, p); This implies and ensures that every valid finger must have the SUB_BIT_EXIST flag. However, at the beginning of the function, it refuses to recognize any finger if it has none of SUB_BIT_UP | SUB_BIT_DOWN | SUB_BIT_MOVE. This excludes fingers in reports which do not move from the position since the previous interrupt. Add SUB_BIT_EXIST to the list of valid bits. Signed-off-by: Kaustabh Chakraborty --- drivers/input/touchscreen/zinitix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscree= n/zinitix.c index 3421b8ffb19b..fdcb80f52c91 100644 --- a/drivers/input/touchscreen/zinitix.c +++ b/drivers/input/touchscreen/zinitix.c @@ -406,7 +406,7 @@ static void zinitix_report_finger(struct bt541_ts_data = *bt541, int slot, u16 x, y; =20 if (unlikely(!(p->sub_status & - (SUB_BIT_UP | SUB_BIT_DOWN | SUB_BIT_MOVE)))) { + (SUB_BIT_EXIST | SUB_BIT_UP | SUB_BIT_DOWN | SUB_BIT_MOVE)))) { dev_dbg(&bt541->client->dev, "unknown finger event %#02x\n", p->sub_status); return; --=20 2.54.0 From nobody Fri Jul 24 04:54:16 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 640093D954D; Thu, 23 Jul 2026 19:24:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834687; cv=none; b=uIgQ/yr5daA5T/eAFKt5UXC6T8ZGKOCmt3bLuY7xuphnTRm/qLPITEDEAcwN7k3CONLacpReAmpxzm2JLCZGe/JhG14GK77ziokxpHFfLtk8VgAWzSH/q+nyV37Db26tixWqSLa7Gi2crW2d73ZXOD8rfmtdag+meTQxA90+ag8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834687; c=relaxed/simple; bh=SbIfnvgSjJKlnfJuMv2bCPAWMoq+L0ZH2BQgEn9//Uo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tuIZkFJuRB5BqDMqrA+ICeJutKko/99o4h4pIdMtoslp6d0K+iP2CyJrEFZITvYRviZiDdNEHmhcVlvB3owRt6zAheWzhuMGdUkHD928s1XQ4LmeMYBlkpQhfNUWssXvT2GMAR/pUjzMjDvNchjzR3fjlnJNKDERZ1lBWcxu1sQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=XE5iYapV; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="XE5iYapV" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id DE2EB9D86D; Thu, 23 Jul 2026 21:24:43 +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 Nv_NDWa0Tz9x; Thu, 23 Jul 2026 21:24:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1784834683; bh=SbIfnvgSjJKlnfJuMv2bCPAWMoq+L0ZH2BQgEn9//Uo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=XE5iYapVu+jR+7F/FAMsNEo5Vi9OASVv9c3qYfW0x+tRvh6LC0BJ7SwKgFdXOYMUT XX1KOvqsGlirZfx5eSYxO7UUQbfJOLEYV7hy81EEMOAgOJYI0Fp6zOK2n/J7ggxWfR Nte+Xjca8f7V4sVH+gEKFk2KuWNgdvdCm6CsIPQ5kCjxccdC7uzkF/CHHXHiKlfkBc vNqpwB7M7unl+blyOZA5/uFKnx+Nw+tYL7j75w/6sdXwSnukMdpHpV5pouYk1MILZ6 x9yRbEGqPAA6pNS0noEiMJ/aDUgA1xEAfjIqbNkB9mQn8cDgdgI6Y3yyDLF4Au2xWU x/HG6xFM3VYHA== From: Kaustabh Chakraborty Date: Fri, 24 Jul 2026 00:54:05 +0530 Subject: [PATCH 3/5] Input: zinitix - add support for modes 0 and 1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260724-zinitix-modes-v1-3-f6df7d86a878@disroot.org> References: <20260724-zinitix-modes-v1-0-f6df7d86a878@disroot.org> In-Reply-To: <20260724-zinitix-modes-v1-0-f6df7d86a878@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 Zinitix touchscreens have three modes, numbered 0 to 2. The driver implements mode 2, and leaves out modes 0 and 1. The difference in the touchscreen modes is the schema of the event data. Implement modes 0 and 1 in the driver, along with their event structs. Maintain a common, canonical event struct which is to be the superset of the mode-specific structs. With that, introduce functions to convert the mode event info to the canonical format. Signed-off-by: Kaustabh Chakraborty --- drivers/input/touchscreen/zinitix.c | 138 ++++++++++++++++++++++++++++++++= +--- 1 file changed, 130 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscree= n/zinitix.c index fdcb80f52c91..42010f23445e 100644 --- a/drivers/input/touchscreen/zinitix.c +++ b/drivers/input/touchscreen/zinitix.c @@ -145,7 +145,37 @@ struct point_coord { u8 angle; }; =20 +struct point_coord_mode0 { + __le16 x; + __le16 y; + u8 width; + u8 sub_status; +}; + struct touch_event { + __le16 status; + __le16 event_flag; + u8 finger_mask; + u8 time_stamp; + struct point_coord point_coord[MAX_SUPPORTED_FINGER_NUM]; +}; + +struct touch_event_mode0 { + __le16 status; + u8 finger_mask; + u8 time_stamp; + struct point_coord_mode0 point_coord[MAX_SUPPORTED_FINGER_NUM]; +}; + +struct touch_event_mode1 { + __le16 status; + __le16 event_flag; + u8 finger_mask; + u8 time_stamp; + struct point_coord_mode0 point_coord[MAX_SUPPORTED_FINGER_NUM]; +}; + +struct touch_event_mode2 { __le16 status; u8 finger_mask; u8 time_stamp; @@ -440,6 +470,103 @@ static void zinitix_report_keys(struct bt541_ts_data = *bt541, u16 icon_events) bt541->keycodes[i], icon_events & BIT(i)); } =20 +static int zinitix_read_point_status_mode0(struct bt541_ts_data *bt541, + struct touch_event *event) +{ + struct touch_event_mode0 event_mode0; + int ret; + int i; + + ret =3D zinitix_read_data(bt541->client, ZINITIX_POINT_STATUS_REG, + &event_mode0, sizeof(struct touch_event_mode0)); + if (ret) + return ret; + + event->status =3D event_mode0.status; + event->finger_mask =3D event_mode0.finger_mask; + event->time_stamp =3D event_mode0.time_stamp; + + for (i =3D 0; i < ARRAY_SIZE(event_mode0.point_coord); i++) { + event->point_coord[i].x =3D event_mode0.point_coord[i].x; + event->point_coord[i].y =3D event_mode0.point_coord[i].y; + event->point_coord[i].width =3D event_mode0.point_coord[i].width; + event->point_coord[i].sub_status =3D event_mode0.point_coord[i].sub_stat= us; + } + + return 0; +} + +static int zinitix_read_point_status_mode1(struct bt541_ts_data *bt541, + struct touch_event *event) +{ + struct touch_event_mode1 event_mode1; + int ret; + int i; + + ret =3D zinitix_read_data(bt541->client, ZINITIX_POINT_STATUS_REG, + &event_mode1, sizeof(struct touch_event_mode1)); + if (ret) + return ret; + + event->status =3D event_mode1.status; + event->event_flag =3D event_mode1.event_flag; + event->finger_mask =3D event_mode1.finger_mask; + event->time_stamp =3D event_mode1.time_stamp; + + for (i =3D 0; i < ARRAY_SIZE(event_mode1.point_coord); i++) { + event->point_coord[i].x =3D event_mode1.point_coord[i].x; + event->point_coord[i].y =3D event_mode1.point_coord[i].y; + event->point_coord[i].width =3D event_mode1.point_coord[i].width; + event->point_coord[i].sub_status =3D event_mode1.point_coord[i].sub_stat= us; + } + + return 0; +} + +static int zinitix_read_point_status_mode2(struct bt541_ts_data *bt541, + struct touch_event *event) +{ + struct touch_event_mode2 event_mode2; + int ret; + int i; + + ret =3D zinitix_read_data(bt541->client, ZINITIX_POINT_STATUS_REG, + &event_mode2, sizeof(struct touch_event_mode2)); + if (ret) + return ret; + + event->status =3D event_mode2.status; + event->finger_mask =3D event_mode2.finger_mask; + event->time_stamp =3D event_mode2.time_stamp; + + for (i =3D 0; i < ARRAY_SIZE(event_mode2.point_coord); i++) { + event->point_coord[i].x =3D event_mode2.point_coord[i].x; + event->point_coord[i].y =3D event_mode2.point_coord[i].y; + event->point_coord[i].width =3D event_mode2.point_coord[i].width; + event->point_coord[i].sub_status =3D event_mode2.point_coord[i].sub_stat= us; + event->point_coord[i].minor_width =3D event_mode2.point_coord[i].minor_w= idth; + event->point_coord[i].angle =3D event_mode2.point_coord[i].angle; + } + + return 0; +} +static int zinitix_read_point_status(struct bt541_ts_data *bt541, + struct touch_event *event) +{ + switch (bt541->zinitix_mode) { + case 0: + return zinitix_read_point_status_mode0(bt541, event); + case 1: + return zinitix_read_point_status_mode1(bt541, event); + case 2: + return zinitix_read_point_status_mode2(bt541, event); + default: + dev_err(&bt541->client->dev, "Mode %d is unsupported\n", + bt541->zinitix_mode); + return -EINVAL; + } +} + static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler) { struct bt541_ts_data *bt541 =3D bt541_handler; @@ -451,8 +578,7 @@ static irqreturn_t zinitix_ts_irq_handler(int irq, void= *bt541_handler) =20 memset(&touch_event, 0, sizeof(struct touch_event)); =20 - error =3D zinitix_read_data(bt541->client, ZINITIX_POINT_STATUS_REG, - &touch_event, sizeof(struct touch_event)); + error =3D zinitix_read_point_status(bt541, &touch_event); if (error) { dev_err(&client->dev, "Failed to read in touchpoint struct\n"); goto out; @@ -682,13 +808,9 @@ static int zinitix_ts_probe(struct i2c_client *client) bt541->zinitix_mode =3D DEFAULT_TOUCH_POINT_MODE; } =20 - if (bt541->zinitix_mode !=3D 2) { - /* - * If there are devices that don't support mode 2, support - * for other modes (0, 1) will be needed. - */ + if (bt541->zinitix_mode > 2) { dev_err(&client->dev, - "Malformed zinitix,mode property, must be 2 (supplied: %d)\n", + "Malformed zinitix,mode property, must be 0, 1, or 2 (supplied: %d)\n", bt541->zinitix_mode); return -EINVAL; } --=20 2.54.0 From nobody Fri Jul 24 04:54:16 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D5593AEF46; Thu, 23 Jul 2026 19:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834695; cv=none; b=c8oCu5O2fTO4o8L/5HmfDNl7wo+X9VwRLRSTqErBw53RE4kgwLMREh2wCKxk9jtYyQFdLT2d222IcMh0j/Ub8Ncwpu78qnidRcRxYEjmXcLz56QAVrVV0Pn4YwvUjZGcfl7SEm29qOgEkvSTeEPA5UpfoWpryWSIvMw0YIUBcWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834695; c=relaxed/simple; bh=oP/7/X7LVlKSo31gPcRHpIls0+Y5eEnnq2IMVb1d09A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GZtIse6r20tomQ+QZyUxF4VEz4B0H+j16ZO7bFqRcPiumzs8nxmqkPW+2SWEuXc3RN4tY334J1sMTVXtI0/egThfn7R1szA+6XY+Vr6rWEmH3vs9f5vk8duVfmESjS1ACGPGyw4kA+6dGZEL22QTkzvnzM0cluDZxDOaUBEdKeQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=cJX8wSix; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="cJX8wSix" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id BB82586176; Thu, 23 Jul 2026 21:24:52 +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 Kx9-QDcAPgB7; Thu, 23 Jul 2026 21:24:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1784834692; bh=oP/7/X7LVlKSo31gPcRHpIls0+Y5eEnnq2IMVb1d09A=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=cJX8wSixDcZlYpafzz1Ajks9wZevumryo+7OSeGV8H+BHiUtZrk1ioDb5lePCUcZv 27jaZTXPeKF4c2L+9uWympNTpInMLNT4j3HeXCey192y4EHuU1bkRU0jW7b+uEXIoc quv5pX5h8lX80Z3ib5rhGuMx9E9Xnal/T3Pnh4EhbHSweX5ge9wwMrwvCh2T5RnTmv rDCG3t2iGd4f8RvLLz/WKyEl6EVLimHiTsJSHgRmQ1ymc/8/uE2SXHIi7EeMLBjkzb eN58TVDBLMSyZh5o9I3FrTZHq+qWrzc3aiqOGKDcBS2yHOzLtOEuqICFmnm7V1FQTf qHd34NCs+xp8g== From: Kaustabh Chakraborty Date: Fri, 24 Jul 2026 00:54:06 +0530 Subject: [PATCH 4/5] dt-bindings: input/ts/zinitix: document mode 0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260724-zinitix-modes-v1-4-f6df7d86a878@disroot.org> References: <20260724-zinitix-modes-v1-0-f6df7d86a878@disroot.org> In-Reply-To: <20260724-zinitix-modes-v1-0-f6df7d86a878@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 Zinitix touchscreens support three modes, numbered 0 to 2. These modes differ based on their event report schema. The devicetree schema does not mention mode 0, thus does not consider it as a valid state. Add it. Signed-off-by: Kaustabh Chakraborty --- .../devicetree/bindings/input/touchscreen/zinitix,bt400.yaml | 4 = ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/input/touchscreen/zinitix,bt= 400.yaml b/Documentation/devicetree/bindings/input/touchscreen/zinitix,bt40= 0.yaml index f1ce837b16df..9b51212ea9b9 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/zinitix,bt400.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/zinitix,bt400.yaml @@ -76,9 +76,9 @@ properties: zinitix,mode: description: Mode of reporting touch points. Some modes may not work with a particular ts firmware for unknown reasons. Available modes a= re - 1 and 2. Mode 2 is the default and preferred. + 0, 1, and 2. Mode 2 is the default and preferred. $ref: /schemas/types.yaml#/definitions/uint32 - enum: [1, 2] + enum: [0, 1, 2] =20 linux,keycodes: description: --=20 2.54.0 From nobody Fri Jul 24 04:54:16 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5A6641A922; Thu, 23 Jul 2026 19:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834702; cv=none; b=YTSGmbLd5i2VAcFcHyiGs1/MH1Cq3qS5xDBvHq96TGt5Deo7b2Exy/8nnLlGVnP3VuKW+DMpaMj+oR0pqKZxQIhPoiLcsEekIO7NcBz+3unm9Y10Bl7U+VVdS2005D1tlsVD0Mz6VYYsTPqchJn4bThbehIoTeR0+xCxCTbORM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784834702; c=relaxed/simple; bh=DmJPtAysp709Y2CnVk1sHYjZws6rXevfNZSuuVeapIw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qEQW9CfdIy5QeV+pEbaCqyd79Z1JYZ1Hcwr2luOg9drSQeHNVnk5dID4Yq7TQBBQ+PWIzKOZNMtQit+wAzaT31iEuE1zJemqp0yEj3HapWzuVrajP/8yXYd096v4oNPSowylGCpGuUIateRpaByiHrgpr5GbLtWNZEXpwZWpx6Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=OMArMF+Y; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="OMArMF+Y" Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 587388005E; Thu, 23 Jul 2026 21:24:59 +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 jwqy4N3yN4_h; Thu, 23 Jul 2026 21:24:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1784834698; bh=DmJPtAysp709Y2CnVk1sHYjZws6rXevfNZSuuVeapIw=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=OMArMF+Y0VidHl1WBfhFAOGK2iB01e/08BE/oT0emnrLGJxLYSlyn+gRUEMeUWKgA HWqAQeyUdYMaemT8A2XY6qOzpI1ojPZilyKv1SX06HJUF0crwZqhkJBvsBqNSbFkEl kCh7sE/9TeNrOKSdJ0y4aTXjBJm528X5AF9bGVbJlGVuuLdbHQTi2HPpEXphPEq+/7 vLdvEMgYGFdc2zXRf+hZUrf3A87sltZEqhSxLo3Jes3i7lPm48IqVoQY9RhGDAHkYq 1uFAn5P7uYxGX76JxbEEKzjLamHKiLyTIcH175nnHwz59vFy/A8w+3Gyj89Ez+H81q QOxJ5GBdpdSjg== From: Kaustabh Chakraborty Date: Fri, 24 Jul 2026 00:54:07 +0530 Subject: [PATCH 5/5] arm64: dts: exynos7870-j6lte: set mode 0 as default for zinitix touchscreen Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260724-zinitix-modes-v1-5-f6df7d86a878@disroot.org> References: <20260724-zinitix-modes-v1-0-f6df7d86a878@disroot.org> In-Reply-To: <20260724-zinitix-modes-v1-0-f6df7d86a878@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 The ZT7548 chip in the Galaxy J6 is actually able to support mode 2 (the recommended mode) just fine. However, the downstream kernel driver utilizes mode 0. This creates a problem in the aftermarket world where fake touch digitizers only implement the bare minimum functionality, as used by the downstream driver, to compromise on cost, which leads to such chips implementing mode 0 only. To ensure touch works on those devices, set the default mode to 0. Signed-off-by: Kaustabh Chakraborty --- arch/arm64/boot/dts/exynos/exynos7870-j6lte.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/exynos7870-j6lte.dts b/arch/arm64/b= oot/dts/exynos/exynos7870-j6lte.dts index de30d0970336..bd8f798c9810 100644 --- a/arch/arm64/boot/dts/exynos/exynos7870-j6lte.dts +++ b/arch/arm64/boot/dts/exynos/exynos7870-j6lte.dts @@ -424,6 +424,8 @@ touchscreen@20 { touchscreen-size-y =3D <1480>; =20 vdd-supply =3D <&vdd_ldo34>; + + zinitix,mode =3D <0>; }; }; =20 --=20 2.54.0