Skip to content

Commit 691674a

Browse files
Andy Yansuperna9999
authored andcommitted
drm/panel: raydium-rm67200: Move initialization from enable() to prepare stage
The DSI host has different modes in prepare() and enable() functions, prepare() is in LP command mode and enable() is in HS video mode. >From our experience, generally the initialization sequence needs to be sent in the LP command mode. Move the setup init function from enable() to prepare() to fix a display shift on rk3568 evb. Tested on rk3568/rk3576/rk3588 EVB. Signed-off-by: Andy Yan <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9414612 commit 691674a

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

drivers/gpu/drm/panel/panel-raydium-rm67200.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ static void w552793baa_setup(struct mipi_dsi_multi_context *ctx)
320320
static int raydium_rm67200_prepare(struct drm_panel *panel)
321321
{
322322
struct raydium_rm67200 *ctx = to_raydium_rm67200(panel);
323+
struct mipi_dsi_multi_context mctx = { .dsi = ctx->dsi };
323324
int ret;
324325

325326
ret = regulator_bulk_enable(ctx->num_supplies, ctx->supplies);
@@ -330,6 +331,12 @@ static int raydium_rm67200_prepare(struct drm_panel *panel)
330331

331332
msleep(60);
332333

334+
ctx->panel_info->panel_setup(&mctx);
335+
mipi_dsi_dcs_exit_sleep_mode_multi(&mctx);
336+
mipi_dsi_msleep(&mctx, 120);
337+
mipi_dsi_dcs_set_display_on_multi(&mctx);
338+
mipi_dsi_msleep(&mctx, 30);
339+
333340
return 0;
334341
}
335342

@@ -345,20 +352,6 @@ static int raydium_rm67200_unprepare(struct drm_panel *panel)
345352
return 0;
346353
}
347354

348-
static int raydium_rm67200_enable(struct drm_panel *panel)
349-
{
350-
struct raydium_rm67200 *rm67200 = to_raydium_rm67200(panel);
351-
struct mipi_dsi_multi_context ctx = { .dsi = rm67200->dsi };
352-
353-
rm67200->panel_info->panel_setup(&ctx);
354-
mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
355-
mipi_dsi_msleep(&ctx, 120);
356-
mipi_dsi_dcs_set_display_on_multi(&ctx);
357-
mipi_dsi_msleep(&ctx, 30);
358-
359-
return ctx.accum_err;
360-
}
361-
362355
static int raydium_rm67200_disable(struct drm_panel *panel)
363356
{
364357
struct raydium_rm67200 *rm67200 = to_raydium_rm67200(panel);
@@ -383,7 +376,6 @@ static const struct drm_panel_funcs raydium_rm67200_funcs = {
383376
.prepare = raydium_rm67200_prepare,
384377
.unprepare = raydium_rm67200_unprepare,
385378
.get_modes = raydium_rm67200_get_modes,
386-
.enable = raydium_rm67200_enable,
387379
.disable = raydium_rm67200_disable,
388380
};
389381

0 commit comments

Comments
 (0)