From nobody Thu Apr 2 19:01:00 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 5D35D3AF65D for ; Fri, 27 Mar 2026 10:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774606956; cv=none; b=JdDAh0Yz/sGVQh7ETUadEICa5ig/z9e8QRHfvogOvCUSEFfArvePwwV1QQWHlzz+Y2KkfwFOwX8rYR9NprjB1gO6K2a8onNTqwA/Gy8zAVuH6L+NJKZtZOXQlQLOYWCKZHkV0KYaPavZ/FF0hlNBWVkwbP4BA7AZGpIApxFvVgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774606956; c=relaxed/simple; bh=nEYzezcIAjmSLC9VcRjnoTGH7YY5s81VvSuJLMxj3K4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SjIQuVvl9t21g1Yd46/lc0K1jNmo5VE7W2GaTWqYA96Pvn1vR4wT0oR9M9TksodlOSC1HC7jWihjbiU+zUV8NmNconk6sRQFeaTfDDkuUQT1MlO/7YJG+LLq6UZ7EXNUvK6YNaYo2cwJmMWykprs8YbPgafYBoB2/eBlhfPu46k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=W2KiFWQo; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="W2KiFWQo" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2E23621D0; Fri, 27 Mar 2026 11:21:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1774606869; bh=nEYzezcIAjmSLC9VcRjnoTGH7YY5s81VvSuJLMxj3K4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=W2KiFWQo8SgA6uMpZLLn+CBLQbgeCMzKoqU3xzm+4rRlWo06MhM2IWZ/sECThr1ui 0f6VuOF0iqULc7yJTb7FJs05KoXiZ6zbkpZ8rHSzAR+bVgWku2Fve97B9Zdh4B0E7X o1lQ2LL4jzY53ITLOXKHGACsnREJAfZJuNmrursc= From: Tomi Valkeinen Date: Fri, 27 Mar 2026 12:21:54 +0200 Subject: [PATCH v2 06/12] drm/bridge: tc358762: Improve DPI enable handling 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: <20260327-tc358762-fixes-v2-6-3589d3c45f4a@ideasonboard.com> References: <20260327-tc358762-fixes-v2-0-3589d3c45f4a@ideasonboard.com> In-Reply-To: <20260327-tc358762-fixes-v2-0-3589d3c45f4a@ideasonboard.com> To: Marek Vasut , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tomi Valkeinen X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1676; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=nEYzezcIAjmSLC9VcRjnoTGH7YY5s81VvSuJLMxj3K4=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpxlpbPTZ/qbUjZzg3ReA+PLXEiSMaCwNzi0rLN PdsTFBgqK+JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCacZaWwAKCRD6PaqMvJYe 9TwLEACrxjCvccccwPlZDFpPVrWcRSF6BwiwxvZ12NBoq2eeoreb79IHe5CZcNqT3ImxPcN1zI8 t5OCj1YXG5ymoyWIH8sNjTQV4l3D8gX09olIxAYK37BJfUzZwA8oKHkRSOlR5RjcnRqQ8KrTZMD VTwnmddA+K9TQ3Juk/mUepyfJpKf6NRVxThgYazAI9Cay4+Fvcu8YUzMMhYiVDfkC0WjM49okRr JFdJYmNWMBd4UGWJV1KPehyCWxwiNh+cZKuEohW5n7iagJaf/rxzNoZzxVgYPf0PoLRotNTW8hB UWOYWNlXh0YmFkqaUS6VUyHk2208I172tPbSlQvcr1BH2MklCw+mUL8wbVq+WEguNApnZ3yChVK uLjotbVRFJObLOoQSr1f3xwlmkUrrZ2PCkoV5syDXVSTwubcoYEPNJ76KjRwYDrSwHnNEOTOe5K rhpeCB0AGkqPabbLtYpUR4lnO33ESF+M6sM0qiPcyzAdv3IKpvGfROPCT1QzY6b2KorXIDTs/yJ Eyo3HPN4u1DNE6hr82jQW6GDqRx/+C4rsZXas2uXBz1LLcLF1rDNtigdzxjwZ8O02/aMP0DAhUz 9JHHoRnJ70uE9dxEvqREDVTzKzYZ+i7KZiLjZ/woLAOohN+/0IPjuWjH/nqX00mA3+2K4n4npS2 yCaw3vF04NvhT1Q== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 The HW reset defaults has DPIENABLE bit as set. In the current driver we configure and enable various things while DPIENABLE is set. This results in a temporary DPI output with wrong timings, which may cause artifacts on the panel. Fix this by clearing DPIEANBLE as the first thing when we start to enable the display. DPIENABLE is set later with the rest of the LCDCTRL configuration, and at that time we have done all the other configurations. Also, for symmetry and possibly improving the DPI output at disable time, explicitly disable DPIENABLE when disabling the bridge. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358762.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc3= 58762.c index 52e2f3a73721..cc1c5ff42cbd 100644 --- a/drivers/gpu/drm/bridge/tc358762.c +++ b/drivers/gpu/drm/bridge/tc358762.c @@ -134,6 +134,12 @@ static int tc358762_init(struct tc358762 *ctx) { u32 lcdctrl; =20 + /* + * DPIENABLE has reset default of 1. Make sure we don't output on + * DPI until we have finished the coniguration. + */ + tc358762_write(ctx, LCDCTRL, 0); + tc358762_write(ctx, SYSCTRL, FIELD_PREP(SYSCTRL_DPIDATA_IO_MASK, SYSCTRL_DPIDATA_IO_4MA) | FIELD_PREP(SYSCTRL_DPISTB_IO_MASK, SYSCTRL_DPISTB_IO_4MA) | @@ -185,6 +191,9 @@ static void tc358762_post_disable(struct drm_bridge *br= idge, =20 ctx->pre_enabled =3D false; =20 + /* Turn off the DPI output */ + tc358762_write(ctx, LCDCTRL, 0); + if (ctx->reset_gpio) gpiod_set_value_cansleep(ctx->reset_gpio, 0); =20 --=20 2.43.0