diff mbox series

[v2,RESEND,2/4] drm/tegra: dsi: Clear enable register if powered by bootloader

Message ID 20221128162851.110611-2-diogo.ivo@tecnico.ulisboa.pt (mailing list archive)
State New, archived
Headers show
Series Add JDI LPM102A188A display panel support | expand

Commit Message

Diogo Ivo Nov. 28, 2022, 4:28 p.m. UTC
In cases where the DSI module is left on by the bootloader
some panels may fail to initialize if the enable register is not cleared
before the panel's initialization sequence is sent, so clear it if that
is the case. 

Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
---
Changes in v2:
 - detect if the DSI module is on based on the register value,
   instead of a DT property.
 - remove Display Controller clear, since it is redundant.

 drivers/gpu/drm/tegra/dsi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Thierry Reding April 4, 2023, 12:15 p.m. UTC | #1
From: Thierry Reding <treding@nvidia.com>

On Mon, 28 Nov 2022 16:28:49 +0000, Diogo Ivo wrote:
> In cases where the DSI module is left on by the bootloader
> some panels may fail to initialize if the enable register is not cleared
> before the panel's initialization sequence is sent, so clear it if that
> is the case.
> 
> 

Applied, thanks!

[2/4] drm/tegra: dsi: Clear enable register if powered by bootloader
      commit: 588ed52d31ab37c5ac86816911f6428d2de265a6

Best regards,
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index de1333dc0d86..5954676a7ab1 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -912,6 +912,15 @@  static void tegra_dsi_encoder_enable(struct drm_encoder *encoder)
 	u32 value;
 	int err;
 
+	/* If the bootloader enabled DSI it needs to be disabled
+	 * in order for the panel initialization commands to be
+	 * properly sent.
+	 */
+	value = tegra_dsi_readl(dsi, DSI_POWER_CONTROL);
+
+	if (value & DSI_POWER_CONTROL_ENABLE)
+		tegra_dsi_disable(dsi);
+
 	err = tegra_dsi_prepare(dsi);
 	if (err < 0) {
 		dev_err(dsi->dev, "failed to prepare: %d\n", err);