mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 19:20:26 -04:00
drm/panel: ilitek-ili9882t: use wrapped MIPI DCS functions
Remove conditional code and always use mipi_dsi_dcs_*multi() wrappers to simplify driver's init/exit code. Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240512-dsi-panels-upd-api-v2-4-e31ca14d102e@linaro.org Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240512-dsi-panels-upd-api-v2-4-e31ca14d102e@linaro.org
This commit is contained in:
committed by
Neil Armstrong
parent
91329f9212
commit
510ba36e86
@@ -402,19 +402,15 @@ static int starry_ili9882t_init(struct ili9882t *ili)
|
||||
mipi_dsi_dcs_write_seq_multi(&ctx, 0x92, 0x22);
|
||||
|
||||
ili9882t_switch_page(&ctx, 0x00);
|
||||
mipi_dsi_dcs_write_seq_multi(&ctx, MIPI_DCS_EXIT_SLEEP_MODE);
|
||||
if (ctx.accum_err)
|
||||
return ctx.accum_err;
|
||||
mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
|
||||
|
||||
msleep(120);
|
||||
mipi_dsi_msleep(&ctx, 120);
|
||||
|
||||
mipi_dsi_dcs_write_seq_multi(&ctx, MIPI_DCS_SET_DISPLAY_ON);
|
||||
if (ctx.accum_err)
|
||||
return ctx.accum_err;
|
||||
mipi_dsi_dcs_set_display_on_multi(&ctx);
|
||||
|
||||
msleep(20);
|
||||
mipi_dsi_msleep(&ctx, 20);
|
||||
|
||||
return 0;
|
||||
return ctx.accum_err;
|
||||
};
|
||||
|
||||
static inline struct ili9882t *to_ili9882t(struct drm_panel *panel)
|
||||
@@ -422,43 +418,21 @@ static inline struct ili9882t *to_ili9882t(struct drm_panel *panel)
|
||||
return container_of(panel, struct ili9882t, base);
|
||||
}
|
||||
|
||||
static int ili9882t_enter_sleep_mode(struct ili9882t *ili)
|
||||
{
|
||||
struct mipi_dsi_device *dsi = ili->dsi;
|
||||
int ret;
|
||||
|
||||
dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
|
||||
|
||||
ret = mipi_dsi_dcs_set_display_off(dsi);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ili9882t_disable(struct drm_panel *panel)
|
||||
{
|
||||
struct ili9882t *ili = to_ili9882t(panel);
|
||||
struct mipi_dsi_multi_context ctx = { .dsi = ili->dsi };
|
||||
int ret;
|
||||
|
||||
ili9882t_switch_page(&ctx, 0x00);
|
||||
if (ctx.accum_err)
|
||||
return ctx.accum_err;
|
||||
|
||||
ret = ili9882t_enter_sleep_mode(ili);
|
||||
if (ret < 0) {
|
||||
dev_err(panel->dev, "failed to set panel off: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
ili->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
|
||||
|
||||
msleep(150);
|
||||
mipi_dsi_dcs_set_display_off_multi(&ctx);
|
||||
mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
|
||||
|
||||
return 0;
|
||||
mipi_dsi_msleep(&ctx, 150);
|
||||
|
||||
return ctx.accum_err;
|
||||
}
|
||||
|
||||
static int ili9882t_unprepare(struct drm_panel *panel)
|
||||
|
||||
Reference in New Issue
Block a user