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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813204106.580141-3-nm@ti.com>
Date: Wed, 13 Aug 2025 15:41:05 -0500
From: Nishanth Menon <nm@...com>
To: Conor Dooley <conor+dt@...nel.org>,
        Krzysztof Kozlowski
	<krzk+dt@...nel.org>,
        Rob Herring <robh@...nel.org>, David Airlie
	<airlied@...il.com>,
        Maxime Ripard <mripard@...nel.org>,
        Laurent Pinchart
	<Laurent.pinchart@...asonboard.com>,
        Neil Armstrong
	<neil.armstrong@...aro.org>
CC: <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <dri-devel@...ts.freedesktop.org>,
        Robert Nelson <robertcnelson@...il.com>,
        Jason Kridner <jkridner@...gleboard.org>, <afd@...com>,
        Nishanth Menon
	<nm@...com>
Subject: [PATCH V2 2/3] drm/bridge: it66121: Convert the vid/pid entries into a list

The IT66122 is a drop in replacement for the IT66122. The part is
register compatible with what we use of the IT66121. The only relevant
change being the PID is now 0x0622 vs 0x0612. Add this extra PID so
probe does not fail during the PID check with these new parts.

Since production flow can result in multiple devices as the part gets
replaced, prepare for a match list that allows introducing additional
vid/pid matches for the same device profile.

Signed-off-by: Nishanth Menon <nm@...com>
---
New Patch
- This sets up the stage for introducing it66122 support

 drivers/gpu/drm/bridge/ite-it66121.c | 29 ++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
index aa7b1dcc5d70..208e118df0e2 100644
--- a/drivers/gpu/drm/bridge/ite-it66121.c
+++ b/drivers/gpu/drm/bridge/ite-it66121.c
@@ -289,9 +289,13 @@ enum chip_id {
 	ID_IT66121,
 };
 
+struct it66121_device_id {
+	u16 vid, pid;
+};
+
 struct it66121_chip_info {
 	enum chip_id id;
-	u16 vid, pid;
+	struct it66121_device_id device_id[]; /* NULL terminated List */
 };
 
 struct it66121_ctx {
@@ -1511,6 +1515,7 @@ static int it66121_probe(struct i2c_client *client)
 	int ret;
 	struct it66121_ctx *ctx;
 	struct device *dev = &client->dev;
+	const struct it66121_device_id *device_id;
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
 		dev_err(dev, "I2C check functionality failed.\n");
@@ -1574,11 +1579,15 @@ static int it66121_probe(struct i2c_client *client)
 	revision_id = FIELD_GET(IT66121_REVISION_MASK, device_ids[1]);
 	device_ids[1] &= IT66121_DEVICE_ID1_MASK;
 
-	if ((vendor_ids[1] << 8 | vendor_ids[0]) != ctx->info->vid ||
-	    (device_ids[1] << 8 | device_ids[0]) != ctx->info->pid) {
-		return -ENODEV;
+	for (device_id = ctx->info->device_id; device_id->vid; device_id++) {
+		if ((vendor_ids[1] << 8 | vendor_ids[0]) == device_id->vid &&
+		    (device_ids[1] << 8 | device_ids[0]) == device_id->pid)
+			break;
 	}
 
+	if (!device_id->vid)
+		return -ENODEV;
+
 	ctx->bridge.of_node = dev->of_node;
 	ctx->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
 	ctx->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID;
@@ -1614,14 +1623,18 @@ static void it66121_remove(struct i2c_client *client)
 
 static const struct it66121_chip_info it66121_chip_info = {
 	.id = ID_IT66121,
-	.vid = 0x4954,
-	.pid = 0x0612,
+	.device_id = {
+		{.vid = 0x4954, .pid = 0x0612 },
+		{ }
+	},
 };
 
 static const struct it66121_chip_info it6610_chip_info = {
 	.id = ID_IT6610,
-	.vid = 0xca00,
-	.pid = 0x0611,
+	.device_id = {
+		{ .vid = 0xca00, .pid = 0x0611},
+		{ }
+	},
 };
 
 static const struct of_device_id it66121_dt_match[] = {
-- 
2.47.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ