From 3220034b12153252499365aef03c5a69f714d1be Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Tue, 15 Dec 2020 12:45:56 +0200 Subject: [PATCH] drm/omap: dsi: lp/hs switching support for transfer() Integrate low-power / high-speed bus switching into transfer function and drop the omapdrm specific enable_hs() callback. Signed-off-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-24-tomi.valkeinen@ti.com --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 +++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 9 +++++++-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 8534d0633e37..6a32a0402fa3 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -269,7 +269,7 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) return 0; src->ops->enable(src); - src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); + ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; r = _dsicm_enable_te(ddata, true); if (r) { @@ -573,7 +573,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); - src->ops->dsi.enable_hs(src, ddata->dsi->channel, false); + ddata->dsi->mode_flags |= MIPI_DSI_MODE_LPM; r = dsicm_sleep_out(ddata); if (r) @@ -616,7 +616,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ddata->intro_printed = true; } - src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); + ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; return 0; err: diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index bf7bee0b9334..501784137708 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -329,6 +329,7 @@ struct dsi_data { int irq; bool is_enabled; + bool in_lp_mode; struct clk *dss_clk; struct regmap *syscon; @@ -2433,6 +2434,8 @@ static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, /* start the DDR clock by sending a NULL packet */ if (dsi->vm_timings.ddr_clk_always_on && enable) dsi_vc_send_null(dsi, channel); + + dsi->in_lp_mode = !enable; } static void dsi_vc_flush_long_data(struct dsi_data *dsi, int channel) @@ -4690,6 +4693,10 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, struct dsi_data *dsi = host_to_omap(host); struct omap_dss_device *dssdev = &dsi->output; + if (!!(msg->flags & MIPI_DSI_MSG_USE_LPM) != dsi->in_lp_mode) + dsi_vc_enable_hs(dssdev, msg->channel, + !(msg->flags & MIPI_DSI_MSG_USE_LPM)); + switch (msg->type) { case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM: case MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM: @@ -4750,8 +4757,6 @@ static const struct omap_dss_device_ops dsi_ops = { .disable = dsi_display_disable, - .enable_hs = dsi_vc_enable_hs, - .set_config = dsi_set_config, .enable_video_output = dsi_enable_video_output, diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 2f57f95862bf..513bb1549b1a 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -291,8 +291,6 @@ struct omapdss_dsi_ops { int (*set_config)(struct omap_dss_device *dssdev, const struct omap_dss_dsi_config *cfg); - void (*enable_hs)(struct omap_dss_device *dssdev, int channel, - bool enable); int (*enable_te)(struct omap_dss_device *dssdev, bool enable); int (*update)(struct omap_dss_device *dssdev, int channel, -- 2.11.0