Skip to content

Commit 46f3cea

Browse files
hsinyi527atseanpaul
authored andcommitted
drm/panel: panel-innolux: set display off in innolux_panel_unprepare
Move mipi_dsi_dcs_set_display_off() from innolux_panel_disable() to innolux_panel_unprepare(), so they are consistent with innolux_panel_enable() and innolux_panel_prepare(). This also fixes some mode check and irq timeout issue in MTK dsi code. Since some dsi code (e.g. mtk_dsi) have following call trace: 1. drm_panel_disable(), which calls innolux_panel_disable() 2. switch to cmd mode 3. drm_panel_unprepare(), which calls innolux_panel_unprepare() However, mtk_dsi needs to be in cmd mode to be able to send commands (e.g. mipi_dsi_dcs_set_display_off() and mipi_dsi_dcs_enter_sleep_mode()), so we need these functions to be called after the switch to cmd mode happens, i.e. in innolux_panel_unprepare. Signed-off-by: Hsin-Yi, Wang <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent da279eb commit 46f3cea

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/gpu/drm/panel/panel-innolux-p079zca.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,12 @@ static inline struct innolux_panel *to_innolux_panel(struct drm_panel *panel)
7070
static int innolux_panel_disable(struct drm_panel *panel)
7171
{
7272
struct innolux_panel *innolux = to_innolux_panel(panel);
73-
int err;
7473

7574
if (!innolux->enabled)
7675
return 0;
7776

7877
backlight_disable(innolux->backlight);
7978

80-
err = mipi_dsi_dcs_set_display_off(innolux->link);
81-
if (err < 0)
82-
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
83-
err);
84-
8579
innolux->enabled = false;
8680

8781
return 0;
@@ -95,6 +89,11 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
9589
if (!innolux->prepared)
9690
return 0;
9791

92+
err = mipi_dsi_dcs_set_display_off(innolux->link);
93+
if (err < 0)
94+
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
95+
err);
96+
9897
err = mipi_dsi_dcs_enter_sleep_mode(innolux->link);
9998
if (err < 0) {
10099
DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n",

0 commit comments

Comments
 (0)