lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250923-ft5452-v1-1-c9bc51608b7f@sigxcpu.org>
Date: Tue, 23 Sep 2025 15:42:09 +0200
From: Guido Günther <agx@...xcpu.org>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org, 
 phone-devel@...r.kernel.org, 
 Guido Günther <agx@...xcpu.org>
Subject: [PATCH] Input: edt-ft5x06 - Detect ft5452

Detect the chip that is used in lots of smart phone models
by different vendors (e.g. Xiaomi and SHIFT).

We don't derive any properties from it yet but spare lots of people
adding this code to figure out if their panel actually uses this chip.

Signed-off-by: Guido Günther <agx@...xcpu.org>
---
I hope we can add more values to the chip-id switch once we identify
them.
---
 drivers/input/touchscreen/edt-ft5x06.c | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index bf498bd4dea9651ac939fe137b1c0f05e8557962..c0f98d622970846f47a61afa7ec042886a7b95d5 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -57,6 +57,9 @@
 #define EV_REGISTER_OFFSET_Y		0x45
 #define EV_REGISTER_OFFSET_X		0x46
 
+#define EV_REGISTER_CHIP_ID_H		0xA3
+#define EV_REGISTER_CHIP_ID_L		0x9F
+
 #define NO_REGISTER			0xff
 
 #define WORK_REGISTER_OPMODE		0x3c
@@ -849,6 +852,18 @@ static void edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata)
 
 #endif /* CONFIG_DEBUGFS */
 
+static int edt_ft5x06_ts_check_chip_id(struct edt_ft5x06_ts_data *tsdata)
+{
+	int val, id;
+
+	regmap_read(tsdata->regmap, EV_REGISTER_CHIP_ID_H, &val);
+	id = val << 8;
+	regmap_read(tsdata->regmap, EV_REGISTER_CHIP_ID_L, &val);
+	id |= val;
+
+	return id;
+}
+
 static int edt_ft5x06_ts_identify(struct i2c_client *client,
 				  struct edt_ft5x06_ts_data *tsdata)
 {
@@ -857,6 +872,7 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
 	int error;
 	char *model_name = tsdata->name;
 	char *fw_version = tsdata->fw_version;
+	int chipid;
 
 	/* see what we find if we assume it is a M06 *
 	 * if we get less than EDT_NAME_LEN, we don't want
@@ -962,9 +978,18 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
 				 "EVERVISION-FT5726NEi");
 			break;
 		default:
-			snprintf(model_name, EDT_NAME_LEN,
-				 "generic ft5x06 (%02x)",
-				 rdbuf[0]);
+			chipid = edt_ft5x06_ts_check_chip_id(tsdata);
+			dev_dbg(&client->dev, "Chip ID = 0x%x", chipid);
+			switch (chipid) {
+			case 0x5452:
+				snprintf(model_name, EDT_NAME_LEN,
+					 "ft%04x", chipid);
+				break;
+			default:
+				snprintf(model_name, EDT_NAME_LEN,
+					 "generic ft5x06 (%02x)",
+					 rdbuf[0]);
+			}
 			break;
 		}
 	}

---
base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
change-id: 20250923-ft5452-7b2fb75bf380

Best regards,
-- 
Guido Günther <agx@...xcpu.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ