From nobody Mon Sep 28 12:33:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3761D37DE8D; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; cv=none; b=JaqPNY4ohV5xfng6ySMGke0dU0cs39usbYinvn+6MsZ2dLjqz0ABY62DI00klLtCutNPPfdWwzCs/fPTLu27GY14AimC6ONAUjPDfYJA/4nSja+32Wdr2Kk5KT7q3fw6daihLBvthP+b93JHwxxACXtBi4pyr98S6JlmN0FyCHI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; c=relaxed/simple; bh=D2WiEeFJgdwBgx9vAcBPOVfTaJ4IumBKUU8pUzV5LT8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E+UJoehQTy2JsWAZytvXF92XxH3x9TI+9ebd5wGjFbzws6QeeiKLk1ecoCeAbBzfr9Xg+TvO20aJ7AmZ/kwqcRVBIuPNvMBrXd2W1fYXzQC+bOIM9Qj8pXOyhiOTIvQagY7Yvi9360bq34zuO0jwupVL4cjUSuzXPEf40CJ6ruc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OUP3X90D; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OUP3X90D" Received: by smtp.kernel.org (Postfix) with ESMTPS id E53CEC19425; Fri, 21 Aug 2026 21:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1787347845; bh=D2WiEeFJgdwBgx9vAcBPOVfTaJ4IumBKUU8pUzV5LT8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OUP3X90Dg1/npWVr/jTdZ5XOU0JYkizsr/xbG62FiAORr2+/2kxVr36dj4vQpVMjj 72QolOpgIaPqgr4uXR4HyW00Z1FNboCwg/LMaM1DO+RZIvpmQBwI2Yn0MjKrc3aASU QIUqyANvJzXekurQr0sMUgNulgsKzGu9TiAZEWg87fWJAFqRrZcXB0/tg/3nD3F8zF 7XL/H8JzAQ2vR9ise/ESY8Pc05Sa4xYO3c/sGFuUCmDLujw+eL8kq55QIXyQgM75Fy 6Uk5bieZaIwWG5uz03HcheCBPxzLfrooffV6+gQyHKixo98DGVfso2DxfnSZ6TGlze z24VAG5AKrcIQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C52FDC5DF8C; Fri, 21 Aug 2026 21:30:44 +0000 (UTC) From: Markuss Broks via B4 Relay Date: Sat, 22 Aug 2026 00:30:13 +0300 Subject: [PATCH 1/5] dt-bindings: input: touchscreen: imagis: add compatible for IST4050 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: <20260822-imagis-40xx-v1-1-73e6d6cdf110@gmail.com> References: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> In-Reply-To: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markuss Broks X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787347843; l=1341; i=markuss.broks@gmail.com; s=20260803; h=from:subject:message-id; bh=ahOo7S90s3tZfiW1uCTczaPqe2x3GvRSghoncYd1BfU=; b=vij2L/ojde48sCdrTdTqRx9Vk5WGLeJURfP5sA9sTzQU9NVGMgvd4KKIYi24vqjcwuXf3bRHr ZawcK2b2VMlB9AkTk/VqlAkWfnGQqgDJ9CSz7rRHYf4eUv8RRpac0As X-Developer-Key: i=markuss.broks@gmail.com; a=ed25519; pk=oKzGUTm30BCDqinRMpiHQqByOx1mp2mwmhg80Mv7Zg4= X-Endpoint-Received: by B4 Relay for markuss.broks@gmail.com/20260803 with auth_id=911 X-Original-From: Markuss Broks Reply-To: markuss.broks@gmail.com From: Markuss Broks The IST4050 is a touchscreen IC of the Imagis IST40xx family. It shares the register interface with IST3038C, but uses a different, event-based touch reporting format and does not have touch keys. The binding no longer covers only the IST30XXC family, so generalize its title as well. Signed-off-by: Markuss Broks Acked-by: Conor Dooley --- .../devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml | 3= ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/touchscreen/imagis,ist= 3038c.yaml b/Documentation/devicetree/bindings/input/touchscreen/imagis,ist= 3038c.yaml index dfaffbc398d3..a4f3e2f0cf45 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.y= aml +++ b/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.y= aml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/input/touchscreen/imagis,ist3038c.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# =20 -title: Imagis IST30XXC family touchscreen controller +title: Imagis touchscreen controller =20 maintainers: - Markuss Broks @@ -20,6 +20,7 @@ properties: - imagis,ist3038b - imagis,ist3038c - imagis,ist3038h + - imagis,ist4050 =20 reg: maxItems: 1 --=20 2.55.0 From nobody Mon Sep 28 12:33:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 376AC3806B5; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; cv=none; b=oi+lU0lCNXDlaEADKWsfChcJDGDmwzoaAQP3XT6B7/uQtlQI4QacRu7+5B7dT26QmwkC7ROTMkEI1F0a+k44VcMbdSMCARkk4XTS0514mJT2PKooMLocOFuFomef1NL9xoMAoGsIJwvKBs2p58H2aZUeFCP9wdYuRATWO5vcm3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; c=relaxed/simple; bh=YYQpmxoUDJklr9fi4c17eF6VqKaZew/1JC8NWvw/BrU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UwIWU+xagB0cSOZDr/EjfH8His9FhYQ6lFZ/AvFhO3w6tUIK4DauKYllY6vHZtywbCHmhW/v85MMW65ORmlc8hOhr7+MVp8ZZs9qSbi+9tb7u0dViAby7fRq7wXZ5GBk/WnE+z77nenN9Lk0cVDooQW3N1Qq3mKfTlwFL6YXTLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lvgDhGnB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lvgDhGnB" Received: by smtp.kernel.org (Postfix) with ESMTPS id F1578C2BCFB; Fri, 21 Aug 2026 21:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1787347845; bh=YYQpmxoUDJklr9fi4c17eF6VqKaZew/1JC8NWvw/BrU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=lvgDhGnBbP7nk3/+w2+DS5/WqMxu4JXfCcHnjnc41eo3TU2wviBg/EDSdeYze9Woz UhNNpGuJJRCPKvhXDXOCkAZC2m5nuVz7xnw2sS32MAAOFdqW+ANSOJrnIA6YrSkWG1 Mqgu19r1Wa0Ch7d1Be42/Z0EmUgta+SVLd0MGQV/e6We0RIijKCgCsE3yBC8wgdouk dtHDZvj1gW7iQJ2E6/9f44auOtGREmKwjdYVIouWjAyrek1Uhw+qh/zQsrRmLc6xof a00BPwcVu9UmaJirJXn/Fz4GTiCJERdgOHINnH0AQo6csHa07uM2VI+KQsWbdAYRsd 0Wbn/aa+DV7qQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7FFDC5DF9B; Fri, 21 Aug 2026 21:30:44 +0000 (UTC) From: Markuss Broks via B4 Relay Date: Sat, 22 Aug 2026 00:30:14 +0300 Subject: [PATCH 2/5] Input: imagis - do not report coordinates of released contacts 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: <20260822-imagis-40xx-v1-2-73e6d6cdf110@gmail.com> References: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> In-Reply-To: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markuss Broks X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787347843; l=1815; i=markuss.broks@gmail.com; s=20260803; h=from:subject:message-id; bh=/89QleBijrj8h5epT76LuQ4gCzsyr6Wpor71MQ0Dksk=; b=WLXIrjwJPs3d2Z4zlM11Ew5aCBf3PVpRFXqhiA2baum1Dmyb8XqOjM3KcPsvPDi3BhRSRxI68 wX0r8R52Mh7CXL0qcIHse3c1+kpKqLqk1Zp3VlFemqNRZ1VhaJmsHvq X-Developer-Key: i=markuss.broks@gmail.com; a=ed25519; pk=oKzGUTm30BCDqinRMpiHQqByOx1mp2mwmhg80Mv7Zg4= X-Endpoint-Received: by B4 Relay for markuss.broks@gmail.com/20260803 with auth_id=911 X-Original-From: Markuss Broks Reply-To: markuss.broks@gmail.com From: Markuss Broks The position and the contact area are currently reported even for contacts which are being released. The slot has already been deactivated at that point, so these events carry no information for userspace. Report the position and the contact area only for active contacts. This also prepares the driver for the IST40xx family: its per-contact records carry an event type in the bits which hold the contact area on the currently supported chips, so release records must not be parsed for coordinates or the contact area. Signed-off-by: Markuss Broks --- drivers/input/touchscreen/imagis.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen= /imagis.c index 7bbb00beec3b..7cc91f97c06e 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -127,6 +127,8 @@ static irqreturn_t imagis_interrupt(int irq, void *dev_= id) finger_pressed =3D FIELD_GET(IST3038C_FINGER_STATUS_MASK, intr_message); =20 for (i =3D 0; i < finger_count; i++) { + bool pressed; + if (ts->tdata->protocol_b) error =3D imagis_i2c_read_reg(ts, ts->tdata->touch_coord_cmd + (i * 4), @@ -141,9 +143,13 @@ static irqreturn_t imagis_interrupt(int irq, void *dev= _id) goto out; } =20 + pressed =3D finger_pressed & BIT(i); + input_mt_slot(ts->input_dev, i); - input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, - finger_pressed & BIT(i)); + input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, pressed); + if (!pressed) + continue; + touchscreen_report_pos(ts->input_dev, &ts->prop, FIELD_GET(IST3038C_X_MASK, finger_status), FIELD_GET(IST3038C_Y_MASK, finger_status), --=20 2.55.0 From nobody Mon Sep 28 12:33:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46D553002B3; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; cv=none; b=oWJ/QmG3vRN4uIbagNgnFdN2rkQxUjgUKjUmFFPiZ590Oo9rpput+Ar9dyWyOfzdGT9wV9lMtQHgjXpL4j2gtaUZFtqF5+bTgHnuiohaEX/Ucpu8CAzP/33svN32JYvqul1OyzDR/3y0umo3rI9blVlV5eeAdxUQtdJSTKl1AXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; c=relaxed/simple; bh=9K+o0qOH6VZK2UnK4AHRlWVpMQgG3iSkVHNlb8og+hI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C6CIb/hEC2UDTiKE14iksslezGRrwoav1GaodXktW8SqknNz68VVYJAMrGXWPhLTe+FwFZxOUD5ghxKTvpRSdl8dG4hbYazXeL4BETzAjjfLc+1IzKuNRb0f1hxKZ2Br5hYuu42dlgAwkWnC2DpRqkVBG9hFPuhxqCTEJRjOUZU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iU9P9PZM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iU9P9PZM" Received: by smtp.kernel.org (Postfix) with ESMTPS id 1100DC2BCFC; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1787347845; bh=9K+o0qOH6VZK2UnK4AHRlWVpMQgG3iSkVHNlb8og+hI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=iU9P9PZMmx0YrhIkDV994Px8JUiW94/yaWdLW2i4tkyeangKMqnsXKvnbpqI7E6C+ DFmdL0VpG8R1aN/h6t2eW9PIecjXdAIjIdK4abKur9KnzI07ayssYtcwpZO3zCfaXy UOmoAd5oyIIxt2gjym9sDNx0e/7TzBErMONNymvpFuo719ZylM8tkDh6h5Hx6WgPjc KveOfldtQI1kFokot8cboscwBfymBQorzf9ChTHxXj0AFFhvTYIOvwXE5BTcfnp46+ F4CdtocbOprz0fsIGysLXU3g4Ix27rRWThiV5ay2cMYSSmWE7lfC/fGwViZoSUogdH 1OM8J7COEHQ4A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8B6AC5DF9C; Fri, 21 Aug 2026 21:30:44 +0000 (UTC) From: Markuss Broks via B4 Relay Date: Sat, 22 Aug 2026 00:30:15 +0300 Subject: [PATCH 3/5] Input: imagis - replace the protocol_b flag with a protocol enum 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: <20260822-imagis-40xx-v1-3-73e6d6cdf110@gmail.com> References: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> In-Reply-To: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markuss Broks X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787347843; l=3691; i=markuss.broks@gmail.com; s=20260803; h=from:subject:message-id; bh=kllTREbKM7MPt6EgqVJAPrfjFuWKJEaN3O2mls6UtuE=; b=QYzkDd9z2iAFsYaVTIAB9W+xbs2cVUPDasvPtIbc9ySO3G5gxnRyUirYatexynCkNRm4b+uS+ xI4lgZNEmxfBS8rcNWOg4ENDy/QUWD7phfbln3k3W3MKeQtuDBDxPV2 X-Developer-Key: i=markuss.broks@gmail.com; a=ed25519; pk=oKzGUTm30BCDqinRMpiHQqByOx1mp2mwmhg80Mv7Zg4= X-Endpoint-Received: by B4 Relay for markuss.broks@gmail.com/20260803 with auth_id=911 X-Original-From: Markuss Broks Reply-To: markuss.broks@gmail.com From: Markuss Broks The driver tells the two supported touch reporting formats apart with the protocol_b flag. The naming is unfortunate: "protocol B" is the format of the IST30XXC series, while the B-suffixed chips use the unnamed other format. Adding support for the IST40xx family is about to introduce a third format, at which point a collection of booleans gets easy to misuse. Replace the flag with an enum which describes each reporting format: IMAGIS_PROTOCOL_SHARED_REGISTER for the single coordinate register shared by all contacts (IST3038, IST3038B and IST3038H), and IMAGIS_PROTOCOL_PER_CONTACT_REGISTERS for one coordinate register per contact (IST3032C and IST3038C). No functional change intended. Signed-off-by: Markuss Broks --- drivers/input/touchscreen/imagis.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen= /imagis.c index 7cc91f97c06e..6552d97efe32 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -44,12 +44,19 @@ #define IST3038C_FINGER_STATUS_MASK GENMASK(9, 0) #define IST3032C_KEY_STATUS_MASK GENMASK(20, 16) =20 +enum imagis_protocol { + /* one coordinate register shared by all contacts */ + IMAGIS_PROTOCOL_SHARED_REGISTER, + /* one coordinate register per contact */ + IMAGIS_PROTOCOL_PER_CONTACT_REGISTERS, +}; + struct imagis_properties { unsigned int interrupt_msg_cmd; unsigned int touch_coord_cmd; unsigned int whoami_cmd; unsigned int whoami_val; - bool protocol_b; + enum imagis_protocol protocol; bool touch_keys_supported; }; =20 @@ -129,7 +136,7 @@ static irqreturn_t imagis_interrupt(int irq, void *dev_= id) for (i =3D 0; i < finger_count; i++) { bool pressed; =20 - if (ts->tdata->protocol_b) + if (ts->tdata->protocol =3D=3D IMAGIS_PROTOCOL_PER_CONTACT_REGISTERS) error =3D imagis_i2c_read_reg(ts, ts->tdata->touch_coord_cmd + (i * 4), &finger_status); @@ -410,8 +417,8 @@ static const struct imagis_properties imagis_3032c_data= =3D { .touch_coord_cmd =3D IST3038C_REG_TOUCH_COORD, .whoami_cmd =3D IST3038C_REG_CHIPID, .whoami_val =3D IST3032C_WHOAMI, + .protocol =3D IMAGIS_PROTOCOL_PER_CONTACT_REGISTERS, .touch_keys_supported =3D true, - .protocol_b =3D true, }; =20 static const struct imagis_properties imagis_3038_data =3D { @@ -419,6 +426,7 @@ static const struct imagis_properties imagis_3038_data = =3D { .touch_coord_cmd =3D IST30XX_REG_STATUS, .whoami_cmd =3D IST30XX_REG_CHIPID, .whoami_val =3D IST3038_WHOAMI, + .protocol =3D IMAGIS_PROTOCOL_SHARED_REGISTER, .touch_keys_supported =3D true, }; =20 @@ -427,6 +435,7 @@ static const struct imagis_properties imagis_3038b_data= =3D { .touch_coord_cmd =3D IST30XX_REG_STATUS, .whoami_cmd =3D IST3038B_REG_CHIPID, .whoami_val =3D IST3038B_WHOAMI, + .protocol =3D IMAGIS_PROTOCOL_SHARED_REGISTER, }; =20 static const struct imagis_properties imagis_3038c_data =3D { @@ -434,7 +443,7 @@ static const struct imagis_properties imagis_3038c_data= =3D { .touch_coord_cmd =3D IST3038C_REG_TOUCH_COORD, .whoami_cmd =3D IST3038C_REG_CHIPID, .whoami_val =3D IST3038C_WHOAMI, - .protocol_b =3D true, + .protocol =3D IMAGIS_PROTOCOL_PER_CONTACT_REGISTERS, }; =20 static const struct imagis_properties imagis_3038h_data =3D { @@ -442,6 +451,7 @@ static const struct imagis_properties imagis_3038h_data= =3D { .touch_coord_cmd =3D IST3038C_REG_TOUCH_COORD, .whoami_cmd =3D IST3038C_REG_CHIPID, .whoami_val =3D IST3038H_WHOAMI, + .protocol =3D IMAGIS_PROTOCOL_SHARED_REGISTER, }; =20 static const struct of_device_id imagis_of_match[] =3D { --=20 2.55.0 From nobody Mon Sep 28 12:33:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B59239EF1C; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; cv=none; b=heY09pV7p4G3hD+5ANpQerLb/zffBwOJUtVXffdLqJoJ/9j+sJIZcnkGzLJioc5inbjXxDNJeh3fv6DSD7+smYrjda4FwvnO4NDuT31D1ReF9hTsmkzcEp6pbt+gIlAJLSrEuoKGcrp0+mHA6j8Zt7r3I2tfvH7o/CMLRsrH/b8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; c=relaxed/simple; bh=p2S3IYvzW9HBaNZTdf+/qhKil6rJJLwJwZyWnJWPmAc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qNi2ST0F3X18Akmwd6v0LoItUs2O6ceqgdcwfWfws9za56s10Q7q+sOP65FUci74KKSzBcMbnHsxnTxcNM66Gz4BzEUJz2EJUxKigiBYpoudDaqCZXNVn3/Pzqy26Ba7NSg5CrW+aCq84zW0Gxp6vVry/IHZ2Bqg7uZuuehOG/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mDVNdC+U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mDVNdC+U" Received: by smtp.kernel.org (Postfix) with ESMTPS id 226A2C2BCFD; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1787347845; bh=p2S3IYvzW9HBaNZTdf+/qhKil6rJJLwJwZyWnJWPmAc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=mDVNdC+U32xkxL2F6rrIynVGUG4hk/90jZVgJY89u4q/mgQG38XfkhzRGQzIOdmzX j5r0KHqeUqQJ5xF9K6Jqj43b5QWjsnssDYEgWSpA12RYUU9DKgqQz8wRbn1ALEnZWL AHauCBT78ZtSBJseLru3892SrH98k0oqW3+oVdDb7bzlxlEECB2u4xP/fg6BNeF5OR EZv2Qy7SVNfyqyaAar0t7QAgwH6yIzvZstNO98DfNFSP0G22KvipARPP6VC1I5qm1I oyNa8y1GTjLIvUj2Xs/Vi72OoopL0ayKWYDs3j9jWGmXuFM+ykpJD9xxs/wk+FgGR6 nUK5xGmQoTW8w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08C67C5DF97; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) From: Markuss Broks via B4 Relay Date: Sat, 22 Aug 2026 00:30:16 +0300 Subject: [PATCH 4/5] Input: imagis - add support for the IST40xx touch reporting format 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: <20260822-imagis-40xx-v1-4-73e6d6cdf110@gmail.com> References: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> In-Reply-To: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markuss Broks X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787347843; l=4630; i=markuss.broks@gmail.com; s=20260803; h=from:subject:message-id; bh=nhgSejXLaeik0yd9gYDsbPQiM2+SayHHbjInSk+Mj6E=; b=7C43MGJhylrJewIzJXjOOWCV8q3FUHf60NP5sZPEmAV/ZaBKvKPCELcF/BeihPZX/gflkBDrV V0QHEAQ9cvQDiHgO/vrVQkQfwEo3JR/wYuPMZ4oFwX4jRqsaysdJkns X-Developer-Key: i=markuss.broks@gmail.com; a=ed25519; pk=oKzGUTm30BCDqinRMpiHQqByOx1mp2mwmhg80Mv7Zg4= X-Endpoint-Received: by B4 Relay for markuss.broks@gmail.com/20260803 with auth_id=911 X-Original-From: Markuss Broks Reply-To: markuss.broks@gmail.com From: Markuss Broks Chips of the Imagis IST40xx family share the register interface and the coordinate format with IST3038C, but report touches differently: the per-contact records are 8 bytes apart, and instead of pairing the record index with a "pressed" bitmask from the interrupt message, each record carries a hardware-assigned touch ID (1-based, bits 31:28) and an event type (press or release, bits 27:24). The event type occupies the bits which hold the contact area on IST3038C, and no contact area is available in the coordinate word. Add an IMAGIS_PROTOCOL_TOUCH_EVENTS variant for this format: derive the contact slot from the touch ID instead of the record index, translate press/release events into the contact state, ignore records with an out-of-range touch ID or an unknown event type, and do not declare the ABS_MT_TOUCH_MAJOR axis. Signed-off-by: Markuss Broks --- drivers/input/touchscreen/imagis.c | 49 +++++++++++++++++++++++++++++++++-= ---- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen= /imagis.c index 6552d97efe32..5254cccdd653 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -44,11 +44,18 @@ #define IST3038C_FINGER_STATUS_MASK GENMASK(9, 0) #define IST3032C_KEY_STATUS_MASK GENMASK(20, 16) =20 +#define IST40XX_TOUCH_ID_MASK GENMASK(31, 28) +#define IST40XX_TOUCH_EVENT_MASK GENMASK(27, 24) +#define IST40XX_TOUCH_EVENT_PRESS 1 +#define IST40XX_TOUCH_EVENT_RELEASE 2 + enum imagis_protocol { /* one coordinate register shared by all contacts */ IMAGIS_PROTOCOL_SHARED_REGISTER, /* one coordinate register per contact */ IMAGIS_PROTOCOL_PER_CONTACT_REGISTERS, + /* one record per contact, carrying a touch ID and an event type */ + IMAGIS_PROTOCOL_TOUCH_EVENTS, }; =20 struct imagis_properties { @@ -134,9 +141,14 @@ static irqreturn_t imagis_interrupt(int irq, void *dev= _id) finger_pressed =3D FIELD_GET(IST3038C_FINGER_STATUS_MASK, intr_message); =20 for (i =3D 0; i < finger_count; i++) { + unsigned int slot =3D i; bool pressed; =20 - if (ts->tdata->protocol =3D=3D IMAGIS_PROTOCOL_PER_CONTACT_REGISTERS) + if (ts->tdata->protocol =3D=3D IMAGIS_PROTOCOL_TOUCH_EVENTS) + error =3D imagis_i2c_read_reg(ts, + ts->tdata->touch_coord_cmd + (i * 8), + &finger_status); + else if (ts->tdata->protocol =3D=3D IMAGIS_PROTOCOL_PER_CONTACT_REGISTER= S) error =3D imagis_i2c_read_reg(ts, ts->tdata->touch_coord_cmd + (i * 4), &finger_status); @@ -150,9 +162,31 @@ static irqreturn_t imagis_interrupt(int irq, void *dev= _id) goto out; } =20 - pressed =3D finger_pressed & BIT(i); + if (ts->tdata->protocol =3D=3D IMAGIS_PROTOCOL_TOUCH_EVENTS) { + unsigned int id =3D FIELD_GET(IST40XX_TOUCH_ID_MASK, + finger_status); + + if (!id || id > IST3038C_MAX_FINGER_NUM) + continue; + + slot =3D id - 1; + + switch (FIELD_GET(IST40XX_TOUCH_EVENT_MASK, + finger_status)) { + case IST40XX_TOUCH_EVENT_PRESS: + pressed =3D true; + break; + case IST40XX_TOUCH_EVENT_RELEASE: + pressed =3D false; + break; + default: + continue; + } + } else { + pressed =3D finger_pressed & BIT(i); + } =20 - input_mt_slot(ts->input_dev, i); + input_mt_slot(ts->input_dev, slot); input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, pressed); if (!pressed) continue; @@ -161,8 +195,10 @@ static irqreturn_t imagis_interrupt(int irq, void *dev= _id) FIELD_GET(IST3038C_X_MASK, finger_status), FIELD_GET(IST3038C_Y_MASK, finger_status), true); - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, - FIELD_GET(IST3038C_AREA_MASK, finger_status)); + if (ts->tdata->protocol !=3D IMAGIS_PROTOCOL_TOUCH_EVENTS) + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, + FIELD_GET(IST3038C_AREA_MASK, + finger_status)); } =20 key_pressed =3D FIELD_GET(IST3032C_KEY_STATUS_MASK, intr_message); @@ -255,7 +291,8 @@ static int imagis_init_input_dev(struct imagis_ts *ts) =20 input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_X); input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_Y); - input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 16, 0, 0); + if (ts->tdata->protocol !=3D IMAGIS_PROTOCOL_TOUCH_EVENTS) + input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 16, 0, 0); if (ts->tdata->touch_keys_supported) { ts->num_keycodes =3D of_property_read_variable_u32_array( ts->client->dev.of_node, "linux,keycodes", --=20 2.55.0 From nobody Mon Sep 28 12:33:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65F6A3C2BBE; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; cv=none; b=tLAUv0XvN0J4TiKJtJD4jO6aItDr8J7fO03kT4s99NwNfSvDsLfpN/9/Z/5m1X4FiF66Z3LDnu1+lHMPzdmC6baHhrEIjw0XY+c4+lUOIn2J6aeFWslZNWoNdHGT5a0I8vOVa5pZSJalWif4MhE2Tp+7AumokO3M3m+tUJMSlTw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787347845; c=relaxed/simple; bh=eEtSFkQ1r4h92neMD9WAjhSengBMVp7TXE0CHsypDoE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WLRgqP6FsUn1L0yN2yXI6oT/m/4xDhtzks3ORRuFQFu0unT7rLfTabGgofm8dy9daA9kdaxA0tTA7gr7ZAcGOJRYWo6HuDtHTGZeTo3mBNOq3fQv9/y3iLfUl7uZxNhzLLakgxB49nSDauM3SaOjwBNhFJX+/Utfxkp/ExTCHVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YQXuaxLt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YQXuaxLt" Received: by smtp.kernel.org (Postfix) with ESMTPS id 30B7DC2BCF7; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1787347845; bh=eEtSFkQ1r4h92neMD9WAjhSengBMVp7TXE0CHsypDoE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YQXuaxLtvPx7F0/+e9DYUhjoDeAHToc4F43G+7El3WJukltuKgjDaVo13SG31ZRuY SbPj/jMHazq2wJ3n4/mfGwsFGwQoydaBOuIxcgNXqTRWa1+a9D0xK7bZTpubNGrQBf gN/T+/epsJ8Ya3pm/DcUdswI/fle+juPf/zXLLl7jP0hFJHi9jhJFcQX0rvwP4BKqp tiKum0GwbnMVHbPMsGZSpmWrmLTuIG72hyxcUPJwI7VpzaH3ccWiYVagSbI66sb6ul /1qCv0K2+uJr26d8TJ+HZrlZy5Bc73v+k2fy5UUg5Yt4iTB53o0azDD/3AAI2zyl63 pvPLyiwcvJDoQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D4C7C5DF9B; Fri, 21 Aug 2026 21:30:45 +0000 (UTC) From: Markuss Broks via B4 Relay Date: Sat, 22 Aug 2026 00:30:17 +0300 Subject: [PATCH 5/5] Input: imagis - add support for IST4050 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: <20260822-imagis-40xx-v1-5-73e6d6cdf110@gmail.com> References: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> In-Reply-To: <20260822-imagis-40xx-v1-0-73e6d6cdf110@gmail.com> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Markuss Broks X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787347843; l=2500; i=markuss.broks@gmail.com; s=20260803; h=from:subject:message-id; bh=UyRIydLek5fXGaLKcikWjx0AWVlXprKtHklwuZw8lBY=; b=ctEYCAqRbPnvqlBuV9ssbb0NokAiCtEwBZaZLprPpKtNGM6pUchmWwzrYqwGTF08a/9khUvHn sXYecFl38uFCXfbSRwgzL6s5/GhLQD3fjtBewApPhS2AaFAv33tqbRa X-Developer-Key: i=markuss.broks@gmail.com; a=ed25519; pk=oKzGUTm30BCDqinRMpiHQqByOx1mp2mwmhg80Mv7Zg4= X-Endpoint-Received: by B4 Relay for markuss.broks@gmail.com/20260803 with auth_id=911 X-Original-From: Markuss Broks Reply-To: markuss.broks@gmail.com From: Markuss Broks The Imagis IST4050 shares the register interface and the power-up sequence with IST3038C, and reports touches using the IST40xx touch reporting format. Its chip ID register reads back 0x4050. Also mention the IST40xx family in the Kconfig help text, and refer to the older chips as IST30xx, since the driver supports more than the C variants. Signed-off-by: Markuss Broks --- drivers/input/touchscreen/Kconfig | 2 +- drivers/input/touchscreen/imagis.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/= Kconfig index 9b9ae8ac3f7f..96fdc4384a75 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -705,7 +705,7 @@ config TOUCHSCREEN_IMAGIS tristate "Imagis touchscreen support" depends on I2C help - Say Y here if you have an Imagis IST30xxC touchscreen. + Say Y here if you have an Imagis IST30xx or IST40xx touchscreen. If unsure, say N. =20 To compile this driver as a module, choose M here: the diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen= /imagis.c index 5254cccdd653..9bf5afd43848 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -23,6 +23,7 @@ #define IST3032C_WHOAMI 0x32c #define IST3038C_WHOAMI 0x38c #define IST3038H_WHOAMI 0x38d +#define IST4050_WHOAMI 0x4050 =20 #define IST3038B_REG_CHIPID 0x30 #define IST3038B_WHOAMI 0x30380b @@ -491,12 +492,21 @@ static const struct imagis_properties imagis_3038h_da= ta =3D { .protocol =3D IMAGIS_PROTOCOL_SHARED_REGISTER, }; =20 +static const struct imagis_properties imagis_4050_data =3D { + .interrupt_msg_cmd =3D IST3038C_REG_INTR_MESSAGE, + .touch_coord_cmd =3D IST3038C_REG_TOUCH_COORD, + .whoami_cmd =3D IST3038C_REG_CHIPID, + .whoami_val =3D IST4050_WHOAMI, + .protocol =3D IMAGIS_PROTOCOL_TOUCH_EVENTS, +}; + static const struct of_device_id imagis_of_match[] =3D { { .compatible =3D "imagis,ist3032c", .data =3D &imagis_3032c_data }, { .compatible =3D "imagis,ist3038", .data =3D &imagis_3038_data }, { .compatible =3D "imagis,ist3038b", .data =3D &imagis_3038b_data }, { .compatible =3D "imagis,ist3038c", .data =3D &imagis_3038c_data }, { .compatible =3D "imagis,ist3038h", .data =3D &imagis_3038h_data }, + { .compatible =3D "imagis,ist4050", .data =3D &imagis_4050_data }, { }, }; MODULE_DEVICE_TABLE(of, imagis_of_match); --=20 2.55.0