From nobody Sat Oct 4 14:13:13 2025 Received: from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234]) (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 75EF3277C8E; Fri, 15 Aug 2025 03:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229279; cv=none; b=rTAiBbINtDrl6FGZ2Mx2kvLWQJ0iSoGbjexSxJz3YowbeCpg6I0fx7XBX9WOY8zssQWa3NAF8fYEqr9MKzcM6k81As8dVmgtsA7t5uvvehhsAYEZYoRb3bJPJdz6yJttNVmF/3E2UJmJYsayiByU/6LsTPlFAqw38F4jZcICdeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229279; c=relaxed/simple; bh=TsBqCmyguoqmJGeuD2guEZjGyjejQEzomefUgzSZ85I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NW2ZXMh0HqEjSozLmkkhpf2j+s5Y1peiz7QCMA1K/cudKOGdqI7QCSEtXh8xO2ahQWz1hy/i6ejf4pijGwe9ABibAxDUNRUDp38BIVKJYG1XD0xXlmX93iLwZH/kImwZmC9Y6Th36ru4CWYoStCG58LbhsaqEGW+Yqd6yFg9eis= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=LfPY3zRs; arc=none smtp.client-ip=198.47.23.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="LfPY3zRs" Received: from lelvem-sh02.itg.ti.com ([10.180.78.226]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57F3f9ei2075242; Thu, 14 Aug 2025 22:41:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1755229269; bh=LijDDfJj/HnoCFvNR7KrheABUM4ZJ0FRRu4mRC43Pq0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LfPY3zRsxyCwRu0QikM8lIR+jhzIorh6Q5s68vuND4v54nq647I429JXcWhw+f4dR 1j2IANOhNbn4MMiZhEfPgnD5P7GjhGK3NL3nb91E8G0XJSJ3SwjY8A3J6iGONd7ZyL uAF+fshiCl5WaCPARnl6sxxQ50YBH0WnEaGmXJbU= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelvem-sh02.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57F3f9G22167606 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 14 Aug 2025 22:41:09 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 14 Aug 2025 22:41:08 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 14 Aug 2025 22:41:08 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57F3f8gh419041; Thu, 14 Aug 2025 22:41:08 -0500 From: Nishanth Menon To: Conor Dooley , Krzysztof Kozlowski , Rob Herring , David Airlie , Maxime Ripard , Laurent Pinchart , Neil Armstrong CC: , , , Robert Nelson , Jason Kridner , , , , Nishanth Menon , Krzysztof Kozlowski Subject: [PATCH V3 1/4] dt-bindings: display: bridge: it66121: Add compatible string for IT66122 Date: Thu, 14 Aug 2025 22:41:02 -0500 Message-ID: <20250815034105.1276548-2-nm@ti.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250815034105.1276548-1-nm@ti.com> References: <20250815034105.1276548-1-nm@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" Add a new ite,it66122 compatible string to the IT66121 binding documentation, since the two chips are practically same except for id register difference. Signed-off-by: Nishanth Menon Acked-by: Krzysztof Kozlowski --- Changes in V3: * None. V2: https://lore.kernel.org/all/20250813204106.580141-2-nm@ti.com/ V1: https://lore.kernel.org/all/20250813190835.344563-2-nm@ti.com/ .../devicetree/bindings/display/bridge/ite,it66121.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/bridge/ite,it66121.y= aml b/Documentation/devicetree/bindings/display/bridge/ite,it66121.yaml index a7eb2603691f..c99b67f0bb73 100644 --- a/Documentation/devicetree/bindings/display/bridge/ite,it66121.yaml +++ b/Documentation/devicetree/bindings/display/bridge/ite,it66121.yaml @@ -19,6 +19,7 @@ properties: compatible: enum: - ite,it66121 + - ite,it66122 - ite,it6610 =20 reg: --=20 2.47.0 From nobody Sat Oct 4 14:13:13 2025 Received: from fllvem-ot03.ext.ti.com (fllvem-ot03.ext.ti.com [198.47.19.245]) (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 4C8982BD036; Fri, 15 Aug 2025 03:41:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.245 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229280; cv=none; b=dlonNBLN262UamCGNE/j/i/oWBS6PcBtdKZw/ULZ8AOleRVlwGThc3/EylGqShdlTe+JnBT/lifqFRgMFlTaNBIB6n7yocO2V2zyV7wV/XhxavlEmeP29HFpeH4pcR6qwNyMPierrKQZdzV0pcgOuUDZDOUmM3o1Ymr8KcGWMcg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229280; c=relaxed/simple; bh=+KU6s7tl9gT9+nYznVg/VenN8mmXVQnVYfq1Z4LTC6U=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E8yhwJ83mMY1CzWecbjttN5YYtIsIVmTXeAiAMrTj/WfrYCwp1wBdD/ODk/qme/8bgL0pA0hK2Tcd+OybxvSELvSiMEZbGNqq2EY3mtXH7AaYBghIZMXF0u//kvxFyaJp5hTO/+VGD3E8XJ9SPHOSQTNPN0ERqlpD4XtylbNAnA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=ku8606TQ; arc=none smtp.client-ip=198.47.19.245 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="ku8606TQ" Received: from lelvem-sh01.itg.ti.com ([10.180.77.71]) by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57F3f9Oh2020870; Thu, 14 Aug 2025 22:41:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1755229269; bh=LO5HxuXALDqfyHHXLVDosjnwOK7dNZOgW400xHdjvXo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ku8606TQsSHeM/ASzK58n3kNtEq8eQ0Lq3qyRkbh5JrTfCUcV0OJ6fUpvObvZocVo Z1aa2Kn2t8AEGDnRZp/+i5MAU5eDAyrnUwOdrEaDiS36XJLHHP1AHH43diCyk9GHzS CfcE8VHc4dyyhdUeIDQBzlwlXbSvyXF3AyQzc9bc= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelvem-sh01.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57F3f8wL1320963 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 14 Aug 2025 22:41:09 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 14 Aug 2025 22:41:08 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 14 Aug 2025 22:41:08 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57F3f8Pl727654; Thu, 14 Aug 2025 22:41:08 -0500 From: Nishanth Menon To: Conor Dooley , Krzysztof Kozlowski , Rob Herring , David Airlie , Maxime Ripard , Laurent Pinchart , Neil Armstrong CC: , , , Robert Nelson , Jason Kridner , , , , Nishanth Menon Subject: [PATCH V3 2/4] drm/bridge: it66121: Drop ftrace like dev_dbg() prints Date: Thu, 14 Aug 2025 22:41:03 -0500 Message-ID: <20250815034105.1276548-3-nm@ti.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250815034105.1276548-1-nm@ti.com> References: <20250815034105.1276548-1-nm@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" Drop the ftrace like dev_dbg() that checkpatch --strict complains about: WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "%s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "%s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "%s\n", __func__); Signed-off-by: Nishanth Menon Reviewed-by: Andrew Davis Reviewed-by: Dmitry Baryshkov --- Changes in V3: * New patch drivers/gpu/drm/bridge/ite-it66121.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/= ite-it66121.c index aa7b1dcc5d70..9b8ed2fae2f4 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -1384,8 +1384,6 @@ static int it66121_audio_startup(struct device *dev, = void *data) int ret; struct it66121_ctx *ctx =3D dev_get_drvdata(dev); =20 - dev_dbg(dev, "%s\n", __func__); - mutex_lock(&ctx->lock); ret =3D it661221_audio_output_enable(ctx, true); if (ret) @@ -1401,8 +1399,6 @@ static void it66121_audio_shutdown(struct device *dev= , void *data) int ret; struct it66121_ctx *ctx =3D dev_get_drvdata(dev); =20 - dev_dbg(dev, "%s\n", __func__); - mutex_lock(&ctx->lock); ret =3D it661221_audio_output_enable(ctx, false); if (ret) @@ -1479,8 +1475,6 @@ static int it66121_audio_codec_init(struct it66121_ct= x *ctx, struct device *dev) .no_capture_mute =3D 1, }; =20 - dev_dbg(dev, "%s\n", __func__); - if (!of_property_present(dev->of_node, "#sound-dai-cells")) { dev_info(dev, "No \"#sound-dai-cells\", no audio\n"); return 0; --=20 2.47.0 From nobody Sat Oct 4 14:13:13 2025 Received: from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234]) (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 AEC9F29AB03; Fri, 15 Aug 2025 03:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229279; cv=none; b=tE2QwSh37aGSH9TraisODwbj4rWvVRBQRr5T35I0byIhz2H5BQqsvk151Hq9yCPpfDr78irgvWlw59csC/4CTE7ixjeY3TpJEHsXNzhj6QW0JUWk9lZzpw0pMhIavln9vQxOUeUIBnFkZ8W+daub3vvrVLmod7a1wonCd3RKxLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229279; c=relaxed/simple; bh=edpH8p2dKu0/cF+27JdfVc0km+Qss/izUAxkkcnnpIY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Vw7S6xU1eLDA++5PvZ+EyEWuHwwZz8qbpfkMrqkMXzQc1qmAkTW674/NRNFForsCKsl/anITH9ZGjGKEdxQVDtJ/BXC81AJaZe8l/dTsNPAT9egtZpYN5OvBUiWXpu3e+FP+e1rZbeEdHto4cHIX9C28f+wHS7qlhjmH/nz6tJk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=mwbFUclC; arc=none smtp.client-ip=198.47.23.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="mwbFUclC" Received: from lelvem-sh02.itg.ti.com ([10.180.78.226]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57F3f99U2075246; Thu, 14 Aug 2025 22:41:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1755229269; bh=4S7IzZ4Y96uVKyGenuT6kGnX7hpM01vMbn6HqLdY6Sk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mwbFUclCtf96deijoFoXnSGQhnTQCWoyaU4cvhlXqSdBIYWD1mSAMDtE6N08flmwt P6mr7FAbKk1dbxjfyAzJ8lIu6GKiOfDU4+5Q//sn9cUD3YthvgSJTGZ9pKAB/0ImIw XrCcqsHdkPOvUd6xT0KOQNJEB3uPTEXCtfBmmxBI= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelvem-sh02.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57F3f92b2167609 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 14 Aug 2025 22:41:09 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 14 Aug 2025 22:41:08 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 14 Aug 2025 22:41:08 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57F3f85h727657; Thu, 14 Aug 2025 22:41:08 -0500 From: Nishanth Menon To: Conor Dooley , Krzysztof Kozlowski , Rob Herring , David Airlie , Maxime Ripard , Laurent Pinchart , Neil Armstrong CC: , , , Robert Nelson , Jason Kridner , , , , Nishanth Menon Subject: [PATCH V3 3/4] drm/bridge: it66121: Use vid/pid to detect the type of chip Date: Thu, 14 Aug 2025 22:41:04 -0500 Message-ID: <20250815034105.1276548-4-nm@ti.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250815034105.1276548-1-nm@ti.com> References: <20250815034105.1276548-1-nm@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" The driver knows exactly which version of the chip is present since the vid/pid is used to enforce a compatibility. Given that some devices like IT66121 has potentially been replaced with IT66122 mid production for many platforms, it makes no sense to use the vid/pid as an enforcement for compatibility. Instead, let us detect the ID of the actual chip in use by matching the corresponding vid/pid. This also allows for some future compatibility to be checked only against a restricted set of vid/pid. While at this, fix up a bit of formatting errors reported by checkpatch warning, and since the ctx info just requires the id, drop storing the entire chip_info pointer. Signed-off-by: Nishanth Menon Reviewed-by: Andrew Davis --- Changes in V3: * Converted the patch to lookup ID based on vid/pid match rather than enforcing vid/pid match per compatible. * Squashed a formating fix for pre-existing checkpatch --strict warning V2: https://lore.kernel.org/all/20250813204106.580141-3-nm@ti.com/ drivers/gpu/drm/bridge/ite-it66121.c | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/= ite-it66121.c index 9b8ed2fae2f4..5ac9631bcd9a 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -312,7 +312,7 @@ struct it66121_ctx { u8 swl; bool auto_cts; } audio; - const struct it66121_chip_info *info; + enum chip_id id; }; =20 static const struct regmap_range_cfg it66121_regmap_banks[] =3D { @@ -402,7 +402,7 @@ static int it66121_configure_afe(struct it66121_ctx *ct= x, if (ret) return ret; =20 - if (ctx->info->id =3D=3D ID_IT66121) { + if (ctx->id =3D=3D ID_IT66121) { ret =3D regmap_write_bits(ctx->regmap, IT66121_AFE_IP_REG, IT66121_AFE_IP_EC1, 0); if (ret) @@ -428,7 +428,7 @@ static int it66121_configure_afe(struct it66121_ctx *ct= x, if (ret) return ret; =20 - if (ctx->info->id =3D=3D ID_IT66121) { + if (ctx->id =3D=3D ID_IT66121) { ret =3D regmap_write_bits(ctx->regmap, IT66121_AFE_IP_REG, IT66121_AFE_IP_EC1, IT66121_AFE_IP_EC1); @@ -449,7 +449,7 @@ static int it66121_configure_afe(struct it66121_ctx *ct= x, if (ret) return ret; =20 - if (ctx->info->id =3D=3D ID_IT6610) { + if (ctx->id =3D=3D ID_IT6610) { ret =3D regmap_write_bits(ctx->regmap, IT66121_AFE_XP_REG, IT6610_AFE_XP_BYPASS, IT6610_AFE_XP_BYPASS); @@ -599,7 +599,7 @@ static int it66121_bridge_attach(struct drm_bridge *bri= dge, if (ret) return ret; =20 - if (ctx->info->id =3D=3D ID_IT66121) { + if (ctx->id =3D=3D ID_IT66121) { ret =3D regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, IT66121_CLK_BANK_PWROFF_RCLK, 0); if (ret) @@ -748,7 +748,7 @@ static int it66121_bridge_check(struct drm_bridge *brid= ge, { struct it66121_ctx *ctx =3D container_of(bridge, struct it66121_ctx, brid= ge); =20 - if (ctx->info->id =3D=3D ID_IT6610) { + if (ctx->id =3D=3D ID_IT6610) { /* The IT6610 only supports these settings */ bridge_state->input_bus_cfg.flags |=3D DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE; @@ -802,7 +802,7 @@ void it66121_bridge_mode_set(struct drm_bridge *bridge, if (regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, IT66121_HDMI_MODE_HD= MI)) goto unlock; =20 - if (ctx->info->id =3D=3D ID_IT66121 && + if (ctx->id =3D=3D ID_IT66121 && regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, IT66121_CLK_BANK_PWROFF_TXCLK, IT66121_CLK_BANK_PWROFF_TXCLK)) { @@ -815,7 +815,7 @@ void it66121_bridge_mode_set(struct drm_bridge *bridge, if (it66121_configure_afe(ctx, adjusted_mode)) goto unlock; =20 - if (ctx->info->id =3D=3D ID_IT66121 && + if (ctx->id =3D=3D ID_IT66121 && regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, IT66121_CLK_BANK_PWROFF_TXCLK, 0)) { goto unlock; @@ -1505,6 +1505,7 @@ static int it66121_probe(struct i2c_client *client) int ret; struct it66121_ctx *ctx; struct device *dev =3D &client->dev; + const struct it66121_chip_info *chip_info; =20 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(dev, "I2C check functionality failed.\n"); @@ -1522,7 +1523,7 @@ static int it66121_probe(struct i2c_client *client) =20 ctx->dev =3D dev; ctx->client =3D client; - ctx->info =3D i2c_get_match_data(client); + chip_info =3D i2c_get_match_data(client); =20 of_property_read_u32(ep, "bus-width", &ctx->bus_width); of_node_put(ep); @@ -1568,11 +1569,17 @@ static int it66121_probe(struct i2c_client *client) revision_id =3D FIELD_GET(IT66121_REVISION_MASK, device_ids[1]); device_ids[1] &=3D IT66121_DEVICE_ID1_MASK; =20 - if ((vendor_ids[1] << 8 | vendor_ids[0]) !=3D ctx->info->vid || - (device_ids[1] << 8 | device_ids[0]) !=3D ctx->info->pid) { - return -ENODEV; + for (; chip_info->vid; chip_info++) { + if ((vendor_ids[1] << 8 | vendor_ids[0]) =3D=3D chip_info->vid && + (device_ids[1] << 8 | device_ids[0]) =3D=3D chip_info->pid) { + ctx->id =3D chip_info->id; + break; + } } =20 + if (!chip_info->vid) + return -ENODEV; + ctx->bridge.of_node =3D dev->of_node; ctx->bridge.type =3D DRM_MODE_CONNECTOR_HDMIA; ctx->bridge.ops =3D DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID; @@ -1606,28 +1613,22 @@ static void it66121_remove(struct i2c_client *clien= t) mutex_destroy(&ctx->lock); } =20 -static const struct it66121_chip_info it66121_chip_info =3D { - .id =3D ID_IT66121, - .vid =3D 0x4954, - .pid =3D 0x0612, -}; - -static const struct it66121_chip_info it6610_chip_info =3D { - .id =3D ID_IT6610, - .vid =3D 0xca00, - .pid =3D 0x0611, +static const struct it66121_chip_info it66xx_chip_info[] =3D { + {.id =3D ID_IT66121, .vid =3D 0x4954, .pid =3D 0x0612 }, + {.id =3D ID_IT6610, .vid =3D 0xca00, .pid =3D 0x0611 }, + { } }; =20 static const struct of_device_id it66121_dt_match[] =3D { - { .compatible =3D "ite,it66121", &it66121_chip_info }, - { .compatible =3D "ite,it6610", &it6610_chip_info }, + { .compatible =3D "ite,it66121", &it66xx_chip_info }, + { .compatible =3D "ite,it6610", &it66xx_chip_info }, { } }; MODULE_DEVICE_TABLE(of, it66121_dt_match); =20 static const struct i2c_device_id it66121_id[] =3D { - { "it66121", (kernel_ulong_t) &it66121_chip_info }, - { "it6610", (kernel_ulong_t) &it6610_chip_info }, + { "it66121", (kernel_ulong_t)&it66xx_chip_info }, + { "it6610", (kernel_ulong_t)&it66xx_chip_info }, { } }; MODULE_DEVICE_TABLE(i2c, it66121_id); --=20 2.47.0 From nobody Sat Oct 4 14:13:13 2025 Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) (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 472D721C9F2; Fri, 15 Aug 2025 03:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.235 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229279; cv=none; b=OjckHth8OnAQ+PYbVWu71S3oWfaSFXKmOO/lG/nLgO1gtlrec/vEyaD+tY+k1upWoogBmibML52nC7mh3Vfp2BY42Q2enuE7jwU9OZtLy4cqNpDyCI3ncv5yAHwWpEzgSAdhKbHZu5nawjPUvsHcSrZqA/DRpyw6VhWR3yF3TQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755229279; c=relaxed/simple; bh=LZ2oIlScxMjEVE6sXZQIp9eGC6mhAMoZRGIJjY9WN+Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QMWfcxOMaRWdMsokzWwepN0ibC3VzvQm6rHIv84uyuRn+1G0jpa1UkgR7LoZSbcWH/06DxRQMKDldt2k6+f+qr3gPjFHncWQBJNZqX4gnYPCpr98OiBv9fBaiUukT8G+IdM5PzR3HoESwYhqtfnG5uVFqRsbTHMmYK9BzbH52qY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=vAcSgHgd; arc=none smtp.client-ip=198.47.23.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="vAcSgHgd" Received: from lelvem-sh01.itg.ti.com ([10.180.77.71]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57F3f99E2526244; Thu, 14 Aug 2025 22:41:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1755229269; bh=0nnpdAsOqPmBlFg4DS1pedpp234rEjm3RCMYFwuD8kk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vAcSgHgd28beLrAuWTo2dKUj3yNnZ4aw21dE5eBoQnPqe7LPLo3ntLaRGA1kvUq0i HYyyYEhOCLXsmn4nEfuoPsn5at7rfOVAuBOJ4dLJvv+BV2kQocM0KY3LisrQNA3Fwv IdX0mzC6ZgCMgW9hEJzNcgzT5mCP4nZSQ6vgBXew= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelvem-sh01.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57F3f9Wf1320969 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 14 Aug 2025 22:41:09 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 14 Aug 2025 22:41:08 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 14 Aug 2025 22:41:08 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57F3f82p727660; Thu, 14 Aug 2025 22:41:08 -0500 From: Nishanth Menon To: Conor Dooley , Krzysztof Kozlowski , Rob Herring , David Airlie , Maxime Ripard , Laurent Pinchart , Neil Armstrong CC: , , , Robert Nelson , Jason Kridner , , , , Nishanth Menon Subject: [PATCH V3 4/4] drm/bridge: it66121: Add minimal it66122 support Date: Thu, 14 Aug 2025 22:41:05 -0500 Message-ID: <20250815034105.1276548-5-nm@ti.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250815034105.1276548-1-nm@ti.com> References: <20250815034105.1276548-1-nm@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" The IT66122 is a pin compatible replacement for the IT66122. Based on empirical testing, the new device looks to be compatible with IT66121. However due to a lack of public data sheet at this time beyond overall feature list[1] (which seems to add additional features vs ITT66121), it is hard to determine that additional register operations required to enable additional features. So, introduce the device as a new compatible that we will detect based on vid/pid match, with explicit id that can be used to extend the driver capability as information becomes available later on. [1] https://www.ite.com.tw/en/product/cate1/IT66122 Signed-off-by: Nishanth Menon Reviewed-by: Andrew Davis --- Changes in V3: * Dropped the claim that it is 1-1 replacement of IT66121. * Based on emperical test result[2], introduce the same configuration of IT66121, but provide ID as suggested by Devarsh to allow for future expansion of functionality. NOTE: I did consider the possibility of converting the chip_id into a bitfield, but decided it is over-engineering, so kept the enum. [2] https://github.com/beagleboard/linux/commits/v6.1.83-ti-rt-r40 V2: https://lore.kernel.org/all/20250813204106.580141-4-nm@ti.com/ drivers/gpu/drm/bridge/ite-it66121.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/= ite-it66121.c index 5ac9631bcd9a..a108d287722d 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -287,6 +287,7 @@ enum chip_id { ID_IT6610, ID_IT66121, + ID_IT66122, }; =20 struct it66121_chip_info { @@ -402,7 +403,7 @@ static int it66121_configure_afe(struct it66121_ctx *ct= x, if (ret) return ret; =20 - if (ctx->id =3D=3D ID_IT66121) { + if (ctx->id =3D=3D ID_IT66121 || ctx->id =3D=3D ID_IT66122) { ret =3D regmap_write_bits(ctx->regmap, IT66121_AFE_IP_REG, IT66121_AFE_IP_EC1, 0); if (ret) @@ -428,7 +429,7 @@ static int it66121_configure_afe(struct it66121_ctx *ct= x, if (ret) return ret; =20 - if (ctx->id =3D=3D ID_IT66121) { + if (ctx->id =3D=3D ID_IT66121 || ctx->id =3D=3D ID_IT66122) { ret =3D regmap_write_bits(ctx->regmap, IT66121_AFE_IP_REG, IT66121_AFE_IP_EC1, IT66121_AFE_IP_EC1); @@ -599,7 +600,7 @@ static int it66121_bridge_attach(struct drm_bridge *bri= dge, if (ret) return ret; =20 - if (ctx->id =3D=3D ID_IT66121) { + if (ctx->id =3D=3D ID_IT66121 || ctx->id =3D=3D ID_IT66122) { ret =3D regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, IT66121_CLK_BANK_PWROFF_RCLK, 0); if (ret) @@ -802,7 +803,7 @@ void it66121_bridge_mode_set(struct drm_bridge *bridge, if (regmap_write(ctx->regmap, IT66121_HDMI_MODE_REG, IT66121_HDMI_MODE_HD= MI)) goto unlock; =20 - if (ctx->id =3D=3D ID_IT66121 && + if ((ctx->id =3D=3D ID_IT66121 || ctx->id =3D=3D ID_IT66122) && regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, IT66121_CLK_BANK_PWROFF_TXCLK, IT66121_CLK_BANK_PWROFF_TXCLK)) { @@ -815,7 +816,7 @@ void it66121_bridge_mode_set(struct drm_bridge *bridge, if (it66121_configure_afe(ctx, adjusted_mode)) goto unlock; =20 - if (ctx->id =3D=3D ID_IT66121 && + if ((ctx->id =3D=3D ID_IT66121 || ctx->id =3D=3D ID_IT66122) && regmap_write_bits(ctx->regmap, IT66121_CLK_BANK_REG, IT66121_CLK_BANK_PWROFF_TXCLK, 0)) { goto unlock; @@ -1614,12 +1615,14 @@ static void it66121_remove(struct i2c_client *clien= t) } =20 static const struct it66121_chip_info it66xx_chip_info[] =3D { + {.id =3D ID_IT66122, .vid =3D 0x4954, .pid =3D 0x0622 }, {.id =3D ID_IT66121, .vid =3D 0x4954, .pid =3D 0x0612 }, {.id =3D ID_IT6610, .vid =3D 0xca00, .pid =3D 0x0611 }, { } }; =20 static const struct of_device_id it66121_dt_match[] =3D { + { .compatible =3D "ite,it66122", &it66xx_chip_info }, { .compatible =3D "ite,it66121", &it66xx_chip_info }, { .compatible =3D "ite,it6610", &it66xx_chip_info }, { } @@ -1627,6 +1630,7 @@ static const struct of_device_id it66121_dt_match[] = =3D { MODULE_DEVICE_TABLE(of, it66121_dt_match); =20 static const struct i2c_device_id it66121_id[] =3D { + { "it66122", (kernel_ulong_t)&it66xx_chip_info }, { "it66121", (kernel_ulong_t)&it66xx_chip_info }, { "it6610", (kernel_ulong_t)&it66xx_chip_info }, { } --=20 2.47.0