From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Ondrej Jirman" <megi@xff.cz>,
"Frank Oltmanns" <frank@oltmanns.dev>,
"Samuel Holland" <samuel@sholland.org>,
"Guido Günther" <agx@sigxcpu.org>,
"Sasha Levin" <sashal@kernel.org>,
neil.armstrong@linaro.org, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
daniel@ffwll.ch, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 5.10 09/11] drm/panel: st7703: Pick different reset sequence
Date: Tue, 7 Nov 2023 07:30:42 -0500 [thread overview]
Message-ID: <20231107123100.3762796-9-sashal@kernel.org> (raw)
In-Reply-To: <20231107123100.3762796-1-sashal@kernel.org>
From: Ondrej Jirman <megi@xff.cz>
[ Upstream commit d12d635bb03c7cb4830acb641eb176ee9ff2aa89 ]
Switching to a different reset sequence, enabling IOVCC before enabling
VCC.
There also needs to be a delay after enabling the supplies and before
deasserting the reset. The datasheet specifies 1ms after the supplies
reach the required voltage. Use 10-20ms to also give the power supplies
some time to reach the required voltage, too.
This fixes intermittent panel initialization failures and screen
corruption during resume from sleep on panel xingbangda,xbd599 (e.g.
used in PinePhone).
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Reported-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Tested-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230211171748.36692-2-frank@oltmanns.dev
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 25 ++++++++++---------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index c22e7c49e0778..67e1da0a7db53 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -428,29 +428,30 @@ static int st7703_prepare(struct drm_panel *panel)
return 0;
dev_dbg(ctx->dev, "Resetting the panel\n");
- ret = regulator_enable(ctx->vcc);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+
+ ret = regulator_enable(ctx->iovcc);
if (ret < 0) {
- dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret);
+ dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
return ret;
}
- ret = regulator_enable(ctx->iovcc);
+
+ ret = regulator_enable(ctx->vcc);
if (ret < 0) {
- dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
- goto disable_vcc;
+ dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret);
+ regulator_disable(ctx->iovcc);
+ return ret;
}
- gpiod_set_value_cansleep(ctx->reset_gpio, 1);
- usleep_range(20, 40);
+ /* Give power supplies time to stabilize before deasserting reset. */
+ usleep_range(10000, 20000);
+
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
- msleep(20);
+ usleep_range(15000, 20000);
ctx->prepared = true;
return 0;
-
-disable_vcc:
- regulator_disable(ctx->vcc);
- return ret;
}
static int st7703_get_modes(struct drm_panel *panel,
--
2.42.0
next prev parent reply other threads:[~2023-11-07 13:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 12:30 [PATCH AUTOSEL 5.10 01/11] drm/komeda: drop all currently held locks if deadlock happens Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 02/11] drm/msm/dp: skip validity check for DP CTS EDID checksum Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 03/11] drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 04/11] drm/radeon: Fix UBSAN array-index-out-of-bounds for Radeon HD 5430 Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 05/11] drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 06/11] drm/amdgpu: Fix potential null pointer derefernce Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 07/11] drm/panel: fix a possible null pointer dereference Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 08/11] drm/panel/panel-tpo-tpg110: " Sasha Levin
2023-11-07 12:30 ` Sasha Levin [this message]
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 10/11] drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL Sasha Levin
2023-11-07 12:30 ` [PATCH AUTOSEL 5.10 11/11] selftests/efivarfs: create-read: fix a resource leak Sasha Levin
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=20231107123100.3762796-9-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=agx@sigxcpu.org \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=frank@oltmanns.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=megi@xff.cz \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=samuel@sholland.org \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox