summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-04-13 17:05:32 +0300
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>2026-04-18 02:10:37 +0300
commit917e888d38fa1e81781da39daceffad41e9d2109 (patch)
tree4bb279c96378d00325262c96e1d2410f6e0b86c3
parentdd0d0a487172bbe9626efc59a43d5dfbea64cdd4 (diff)
downloadlinux-917e888d38fa1e81781da39daceffad41e9d2109.tar.xz
drm/panel: himax-hx8394: simplify hx8394_enable()
Simplify hx8394_enable() function by using hx8394_disable() instead of open-coding it and mipi_dsi_msleep() instead of manual checks. Reviewed-by: Linus Walleij <linusw@kernel.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patch.msgid.link/20260413-waveshare-dsi-touch-v3-9-3aeb53022c32@oss.qualcomm.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
-rw-r--r--drivers/gpu/drm/panel/panel-himax-hx8394.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/drivers/gpu/drm/panel/panel-himax-hx8394.c b/drivers/gpu/drm/panel/panel-himax-hx8394.c
index d64f3521eb15..1f23c50b6661 100644
--- a/drivers/gpu/drm/panel/panel-himax-hx8394.c
+++ b/drivers/gpu/drm/panel/panel-himax-hx8394.c
@@ -618,47 +618,34 @@ static const struct hx8394_panel_desc hl055fhav028c_desc = {
.init_sequence = hl055fhav028c_init_sequence,
};
-static int hx8394_enable(struct drm_panel *panel)
+static int hx8394_disable(struct drm_panel *panel)
{
struct hx8394 *ctx = panel_to_hx8394(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
- int ret;
-
- ctx->desc->init_sequence(&dsi_ctx);
-
- mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
-
- if (dsi_ctx.accum_err)
- return dsi_ctx.accum_err;
- /* Panel is operational 120 msec after reset */
- msleep(120);
-
- mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
- if (dsi_ctx.accum_err)
- goto sleep_in;
-
- return 0;
-
-sleep_in:
- ret = dsi_ctx.accum_err;
- dsi_ctx.accum_err = 0;
- /* This will probably fail, but let's try orderly power off anyway. */
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
- mipi_dsi_msleep(&dsi_ctx, 50);
+ mipi_dsi_msleep(&dsi_ctx, 50); /* about 3 frames */
- return ret;
+ return dsi_ctx.accum_err;
}
-static int hx8394_disable(struct drm_panel *panel)
+static int hx8394_enable(struct drm_panel *panel)
{
struct hx8394 *ctx = panel_to_hx8394(panel);
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
- mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
- mipi_dsi_msleep(&dsi_ctx, 50); /* about 3 frames */
+ ctx->desc->init_sequence(&dsi_ctx);
+
+ mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+
+ /* Panel is operational 120 msec after reset */
+ mipi_dsi_msleep(&dsi_ctx, 120);
+
+ mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+ if (dsi_ctx.accum_err)
+ hx8394_disable(panel);
return dsi_ctx.accum_err;
}