]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/panel: st7703: Enter sleep after display off
authorOndrej Jirman <megous@megous.com>
Wed, 1 Jul 2020 16:29:25 +0000 (18:29 +0200)
committerSam Ravnborg <sam@ravnborg.org>
Wed, 1 Jul 2020 17:25:42 +0000 (19:25 +0200)
The datasheet suggests to issue sleep in after display off
as a part of the panel's shutdown sequence.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200701162928.1638874-11-megous@megous.com
drivers/gpu/drm/panel/panel-sitronix-st7703.c

index dadb482b244d41f97355b157833115f31bb244f5..7750179bca607d5821663d795192bdf9e9d768a2 100644 (file)
@@ -393,8 +393,19 @@ static int st7703_disable(struct drm_panel *panel)
 {
        struct st7703 *ctx = panel_to_st7703(panel);
        struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+       int ret;
+
+       ret = mipi_dsi_dcs_set_display_off(dsi);
+       if (ret < 0)
+               DRM_DEV_ERROR(ctx->dev,
+                             "Failed to turn off the display: %d\n", ret);
 
-       return mipi_dsi_dcs_set_display_off(dsi);
+       ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
+       if (ret < 0)
+               DRM_DEV_ERROR(ctx->dev,
+                             "Failed to enter sleep mode: %d\n", ret);
+
+       return 0;
 }
 
 static int st7703_unprepare(struct drm_panel *panel)