]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/panel: st7703: Fix timings when entering/exiting sleep
authorFrank Oltmanns <frank@oltmanns.dev>
Mon, 13 Feb 2023 12:32:38 +0000 (13:32 +0100)
committerGuido Günther <agx@sigxcpu.org>
Sun, 15 Oct 2023 12:23:00 +0000 (14:23 +0200)
Fix flickering of the pinephone's XDB599 panel that happens after
resume.

Extend the delay after issuing the command to exit sleep mode from 60 to
120 msec as per the controller's specification.

Introduce a 120 msec delay after issuing the command to enter sleep
mode. This is needed in order for the controller to reliably finalize
the sleep in sequence before switching of power supply.

In contrast to the JH057N panel, the XBD599 panel does not require a 20
msec delay after initialization and exiting sleep mode. Therefore, move
the delay into the already existing device specific initialization
function.

The XDB599 does not require a 20 msec delay between the SETBGP and
SETVCOM commands. Therefore, remove the delay from the device specific
initialization function.

Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Cc: Ondrej Jirman <megi@xff.cz>
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/20230213123238.76889-2-frank@oltmanns.dev
drivers/gpu/drm/panel/panel-sitronix-st7703.c

index 7bb723d445ade431cbbc17722c187c7d48e66108..79d56725b010977549bda14f4b8ba8bf432cd90a 100644 (file)
@@ -130,6 +130,7 @@ static int jh057n_init_sequence(struct st7703 *ctx)
                                   0x18, 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41,
                                   0x37, 0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10,
                                   0x11, 0x18);
+       msleep(20);
 
        return 0;
 }
@@ -276,7 +277,6 @@ static int xbd599_init_sequence(struct st7703 *ctx)
        mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP,
                               0x07, /* VREF_SEL = 4.2V */
                               0x07  /* NVREF_SEL = 4.2V */);
-       msleep(20);
 
        mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM,
                               0x2C, /* VCOMDC_F = -0.67V */
@@ -445,16 +445,14 @@ static int st7703_enable(struct drm_panel *panel)
                return ret;
        }
 
-       msleep(20);
-
        ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
        if (ret < 0) {
                dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret);
                return ret;
        }
 
-       /* Panel is operational 120 msec after reset */
-       msleep(60);
+       /* It takes the controller 120 msec to wake up after sleep. */
+       msleep(120);
 
        ret = mipi_dsi_dcs_set_display_on(dsi);
        if (ret)
@@ -479,6 +477,9 @@ static int st7703_disable(struct drm_panel *panel)
        if (ret < 0)
                dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret);
 
+       /* It takes the controller 120 msec to enter sleep mode. */
+       msleep(120);
+
        return 0;
 }