]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/drm-panel-panel-innolux-set-display-off-in-innolux_p.patch
Linux 4.9.170
[thirdparty/kernel/stable-queue.git] / queue-4.14 / drm-panel-panel-innolux-set-display-off-in-innolux_p.patch
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
5
6 [ Upstream commit 46f3ceaffa81e846677bca8668e0ad40e643cffd ]
7
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().
11
12 This also fixes some mode check and irq timeout issue in MTK dsi code.
13
14 Since some dsi code (e.g. mtk_dsi) have following call trace:
15 1. drm_panel_disable(), which calls innolux_panel_disable()
16 2. switch to cmd mode
17 3. drm_panel_unprepare(), which calls innolux_panel_unprepare()
18
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.
23
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>
28 ---
29 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 11 +++++------
30 1 file changed, 5 insertions(+), 6 deletions(-)
31
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)
38 {
39 struct innolux_panel *innolux = to_innolux_panel(panel);
40 - int err;
41
42 if (!innolux->enabled)
43 return 0;
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);
47
48 - err = mipi_dsi_dcs_set_display_off(innolux->link);
49 - if (err < 0)
50 - DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
51 - err);
52 -
53 innolux->enabled = false;
54
55 return 0;
56 @@ -66,6 +60,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
57 if (!innolux->prepared)
58 return 0;
59
60 + err = mipi_dsi_dcs_set_display_off(innolux->link);
61 + if (err < 0)
62 + DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
63 + err);
64 +
65 err = mipi_dsi_dcs_enter_sleep_mode(innolux->link);
66 if (err < 0) {
67 DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n",
68 --
69 2.19.1
70