Skip to content

Commit 1afe397

Browse files
Ondrej Jirmangregkh
Ondrej Jirman
authored andcommitted
drm/panel: st7703: Pick different reset sequence
[ Upstream commit d12d635 ] 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 <[email protected]> Signed-off-by: Frank Oltmanns <[email protected]> Reported-by: Samuel Holland <[email protected]> Reviewed-by: Guido Günther <[email protected]> Tested-by: Guido Günther <[email protected]> Signed-off-by: Guido Günther <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 70f831f commit 1afe397

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

drivers/gpu/drm/panel/panel-sitronix-st7703.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -506,29 +506,30 @@ static int st7703_prepare(struct drm_panel *panel)
506506
return 0;
507507

508508
dev_dbg(ctx->dev, "Resetting the panel\n");
509-
ret = regulator_enable(ctx->vcc);
509+
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
510+
511+
ret = regulator_enable(ctx->iovcc);
510512
if (ret < 0) {
511-
dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret);
513+
dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
512514
return ret;
513515
}
514-
ret = regulator_enable(ctx->iovcc);
516+
517+
ret = regulator_enable(ctx->vcc);
515518
if (ret < 0) {
516-
dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret);
517-
goto disable_vcc;
519+
dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret);
520+
regulator_disable(ctx->iovcc);
521+
return ret;
518522
}
519523

520-
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
521-
usleep_range(20, 40);
524+
/* Give power supplies time to stabilize before deasserting reset. */
525+
usleep_range(10000, 20000);
526+
522527
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
523-
msleep(20);
528+
usleep_range(15000, 20000);
524529

525530
ctx->prepared = true;
526531

527532
return 0;
528-
529-
disable_vcc:
530-
regulator_disable(ctx->vcc);
531-
return ret;
532533
}
533534

534535
static const u32 mantix_bus_formats[] = {

0 commit comments

Comments
 (0)