1 From 8ca103041a5c4c31b8bf79f50ec4812ff0361823 Mon Sep 17 00:00:00 2001
2 From: "Hsin-Yi, Wang" <hsinyi@chromium.org>
3 Date: Wed, 9 Jan 2019 14:59:22 +0800
4 Subject: drm/panel: panel-innolux: set display off in innolux_panel_unprepare
6 [ Upstream commit 46f3ceaffa81e846677bca8668e0ad40e643cffd ]
8 Move mipi_dsi_dcs_set_display_off() from innolux_panel_disable()
9 to innolux_panel_unprepare(), so they are consistent with
10 innolux_panel_enable() and innolux_panel_prepare().
12 This also fixes some mode check and irq timeout issue in MTK dsi code.
14 Since some dsi code (e.g. mtk_dsi) have following call trace:
15 1. drm_panel_disable(), which calls innolux_panel_disable()
17 3. drm_panel_unprepare(), which calls innolux_panel_unprepare()
19 However, mtk_dsi needs to be in cmd mode to be able to send commands
20 (e.g. mipi_dsi_dcs_set_display_off() and mipi_dsi_dcs_enter_sleep_mode()),
21 so we need these functions to be called after the switch to cmd mode happens,
22 i.e. in innolux_panel_unprepare.
24 Signed-off-by: Hsin-Yi, Wang <hsinyi@chromium.org>
25 Signed-off-by: Sean Paul <seanpaul@chromium.org>
26 Link: https://patchwork.freedesktop.org/patch/msgid/20190109065922.231753-1-hsinyi@chromium.org
27 Signed-off-by: Sasha Levin <sashal@kernel.org>
29 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 11 +++++------
30 1 file changed, 5 insertions(+), 6 deletions(-)
32 diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
33 index 6ba93449fcfb..58b67e0cc385 100644
34 --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
35 +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
36 @@ -40,7 +40,6 @@ static inline struct innolux_panel *to_innolux_panel(struct drm_panel *panel)
37 static int innolux_panel_disable(struct drm_panel *panel)
39 struct innolux_panel *innolux = to_innolux_panel(panel);
42 if (!innolux->enabled)
44 @@ -48,11 +47,6 @@ static int innolux_panel_disable(struct drm_panel *panel)
45 innolux->backlight->props.power = FB_BLANK_POWERDOWN;
46 backlight_update_status(innolux->backlight);
48 - err = mipi_dsi_dcs_set_display_off(innolux->link);
50 - DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
53 innolux->enabled = false;
56 @@ -66,6 +60,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
57 if (!innolux->prepared)
60 + err = mipi_dsi_dcs_set_display_off(innolux->link);
62 + DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
65 err = mipi_dsi_dcs_enter_sleep_mode(innolux->link);
67 DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n",