Skip to content

Commit 5efa824

Browse files
committed
drm/panel: ilitek-ili9881c: move display_on/_off dcs calls to (un-)prepare
At least for panel-bridges, the atomic_enable call is defined as being called right after the preceding element in the display pipe is enabled. It is also stated that "The bridge can assume that the display pipe (i.e. clocks and timing signals) feeding it is running when this callback is called" This means the DSI controller driving this display would have already switched over to video-mode from command mode and thus dcs functions should not be called anymore at this point. This caused a non-working display for me, when trying to enable the rk3576 dsi controller using a display using this controller. Therefore move the display_on/off calls the more appropriate prepare/unprepare callbacks. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20250707164906.1445288-3-heiko@sntech.de
1 parent 6c66eba commit 5efa824

1 file changed

Lines changed: 7 additions & 20 deletions

File tree

drivers/gpu/drm/panel/panel-ilitek-ili9881c.c

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,35 +1509,24 @@ static int ili9881c_prepare(struct drm_panel *panel)
15091509
if (ret)
15101510
goto disable_power;
15111511

1512-
return 0;
1513-
1514-
disable_power:
1515-
regulator_disable(ctx->power);
1516-
return ret;
1517-
}
1518-
1519-
static int ili9881c_enable(struct drm_panel *panel)
1520-
{
1521-
struct ili9881c *ctx = panel_to_ili9881c(panel);
1522-
15231512
msleep(120);
15241513

1525-
mipi_dsi_dcs_set_display_on(ctx->dsi);
1514+
ret = mipi_dsi_dcs_set_display_on(ctx->dsi);
1515+
if (ret)
1516+
goto disable_power;
15261517

15271518
return 0;
1528-
}
15291519

1530-
static int ili9881c_disable(struct drm_panel *panel)
1531-
{
1532-
struct ili9881c *ctx = panel_to_ili9881c(panel);
1533-
1534-
return mipi_dsi_dcs_set_display_off(ctx->dsi);
1520+
disable_power:
1521+
regulator_disable(ctx->power);
1522+
return ret;
15351523
}
15361524

15371525
static int ili9881c_unprepare(struct drm_panel *panel)
15381526
{
15391527
struct ili9881c *ctx = panel_to_ili9881c(panel);
15401528

1529+
mipi_dsi_dcs_set_display_off(ctx->dsi);
15411530
mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
15421531
regulator_disable(ctx->power);
15431532
gpiod_set_value_cansleep(ctx->reset, 1);
@@ -1710,8 +1699,6 @@ static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *pan
17101699
static const struct drm_panel_funcs ili9881c_funcs = {
17111700
.prepare = ili9881c_prepare,
17121701
.unprepare = ili9881c_unprepare,
1713-
.enable = ili9881c_enable,
1714-
.disable = ili9881c_disable,
17151702
.get_modes = ili9881c_get_modes,
17161703
.get_orientation = ili9881c_get_orientation,
17171704
};

0 commit comments

Comments
 (0)