All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Jirman <megous@megous.com>
To: "David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Robert Chiras" <robert.chiras@nxp.com>
Cc: Ondrej Jirman <megous@megous.com>,
	Samuel Holland <samuel@sholland.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] drm/panel: st7703: Make the sleep exit timing match the spec
Date: Thu, 16 Jul 2020 14:37:52 +0200	[thread overview]
Message-ID: <20200716123753.3552425-2-megous@megous.com> (raw)
In-Reply-To: <20200716123753.3552425-1-megous@megous.com>

The driver seemed to try to make the total cumulative time of all delays
across the whole power up sequence to sum up to 120ms.

The datasheet on the other hand specifies that there needs to be 120ms
delay after the sleep out command, not after reset as the driver
assumes.

Lastly, the delay between init commands and the sleep exit command is
not necessary. (not specified anywhere)

Reported-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index 8996ced2b721..45833e6a0f4f 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -291,7 +291,6 @@ static int xbd599_init_sequence(struct st7703 *ctx)
 	dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP,
 			  0x07, /* VREF_SEL = 4.2V */
 			  0x07  /* NVREF_SEL = 4.2V */);
-	msleep(20);
 
 	dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM,
 			  0x2C, /* VCOMDC_F = -0.67V */
@@ -369,16 +368,14 @@ static int st7703_enable(struct drm_panel *panel)
 		return ret;
 	}
 
-	msleep(20);
-
 	ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
 	if (ret < 0) {
 		DRM_DEV_ERROR(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
 		return ret;
 	}
 
-	/* Panel is operational 120 msec after reset */
-	msleep(60);
+	/* Dsiplay on can be issued 120 msec after sleep out */
+	msleep(120);
 
 	ret = mipi_dsi_dcs_set_display_on(dsi);
 	if (ret)
-- 
2.27.0


WARNING: multiple messages have this Message-ID (diff)
From: Ondrej Jirman <megous@megous.com>
To: "David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Guido Günther" <agx@sigxcpu.org>,
	"Robert Chiras" <robert.chiras@nxp.com>
Cc: Ondrej Jirman <megous@megous.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Samuel Holland <samuel@sholland.org>
Subject: [PATCH 1/2] drm/panel: st7703: Make the sleep exit timing match the spec
Date: Thu, 16 Jul 2020 14:37:52 +0200	[thread overview]
Message-ID: <20200716123753.3552425-2-megous@megous.com> (raw)
In-Reply-To: <20200716123753.3552425-1-megous@megous.com>

The driver seemed to try to make the total cumulative time of all delays
across the whole power up sequence to sum up to 120ms.

The datasheet on the other hand specifies that there needs to be 120ms
delay after the sleep out command, not after reset as the driver
assumes.

Lastly, the delay between init commands and the sleep exit command is
not necessary. (not specified anywhere)

Reported-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index 8996ced2b721..45833e6a0f4f 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -291,7 +291,6 @@ static int xbd599_init_sequence(struct st7703 *ctx)
 	dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP,
 			  0x07, /* VREF_SEL = 4.2V */
 			  0x07  /* NVREF_SEL = 4.2V */);
-	msleep(20);
 
 	dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM,
 			  0x2C, /* VCOMDC_F = -0.67V */
@@ -369,16 +368,14 @@ static int st7703_enable(struct drm_panel *panel)
 		return ret;
 	}
 
-	msleep(20);
-
 	ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
 	if (ret < 0) {
 		DRM_DEV_ERROR(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
 		return ret;
 	}
 
-	/* Panel is operational 120 msec after reset */
-	msleep(60);
+	/* Dsiplay on can be issued 120 msec after sleep out */
+	msleep(120);
 
 	ret = mipi_dsi_dcs_set_display_on(dsi);
 	if (ret)
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-07-16 12:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 12:37 [PATCH 0/2] Fix st7703 panel initialization failures Ondrej Jirman
2020-07-16 12:37 ` Ondrej Jirman
2020-07-16 12:37 ` Ondrej Jirman [this message]
2020-07-16 12:37   ` [PATCH 1/2] drm/panel: st7703: Make the sleep exit timing match the spec Ondrej Jirman
2020-07-16 12:37 ` [PATCH 2/2] drm/panel: st7703: Fix the power up sequence of the panel Ondrej Jirman
2020-07-16 12:37   ` Ondrej Jirman
2020-07-16 14:08 ` [PATCH 0/2] Fix st7703 panel initialization failures Guido Günther
2020-07-16 14:08   ` Guido Günther
2020-07-16 14:32   ` Ondřej Jirman
2020-07-16 14:32     ` Ondřej Jirman
2020-07-18 17:31     ` Guido Günther
2020-07-18 17:31       ` Guido Günther
2020-07-18 17:42       ` Ondřej Jirman
2020-07-18 17:42         ` Ondřej Jirman
2020-07-29 15:48         ` Guido Günther
2020-07-29 15:48           ` Guido Günther
2020-07-30 13:41           ` Ondřej Jirman
2020-07-30 13:41             ` Ondřej Jirman
2020-08-01 11:04             ` Guido Günther
2020-08-01 11:04               ` Guido Günther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200716123753.3552425-2-megous@megous.com \
    --to=megous@megous.com \
    --cc=agx@sigxcpu.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.chiras@nxp.com \
    --cc=sam@ravnborg.org \
    --cc=samuel@sholland.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.