Skip to contentSkip to conversation

drm/panel: ronbo-rb070d30: Use mipi_dsi_*_multi() functions

PATCH Applied Hsieh Hung-En 3 participants 3 messages Sep 29 – Oct 2

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/panel: ronbo-rb070d30: Use mipi_dsi_*_multi() functions

Replace the deprecated mipi_dsi_dcs_exit_sleep_mode() and mipi_dsi_dcs_enter_sleep_mode() calls in the enable and disable callbacks with their _multi variants, as suggested in Documentation/gpu/todo.rst.

The callbacks retain the same return values. The new helpers additionally log an error if the command fails.

---

Notes:
Compile-tested on arm64 with W=1; not tested on hardware.

 drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +6 -2
index c3fbc459c..ebe6352db 100644
@@ -75,15 +75,19 @@ static int rb070d30_panel_unprepare(struct drm_panel *panel)
 static int rb070d30_panel_enable(struct drm_panel *panel)
 {
 	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
 
-	return mipi_dsi_dcs_exit_sleep_mode(ctx->dsi);
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	return dsi_ctx.accum_err;
 }
 
 static int rb070d30_panel_disable(struct drm_panel *panel)
 {
 	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
 
-	return mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
+	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+	return dsi_ctx.accum_err;
 }
 
 /* Default timings */
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 8 lines · Hsieh Hung-En

Replace the deprecated mipi_dsi_dcs_exit_sleep_mode() and mipi_dsi_dcs_enter_sleep_mode() calls in the enable and disable callbacks with their _multi variants, as suggested in Documentation/gpu/todo.rst.

The callbacks retain the same return values. The new helpers additionally log an error if the command fails.

Quoted 8 lines

---

Notes:
Compile-tested on arm64 with W=1; not tested on hardware.

 drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

_multi doesn't buy us much here, but this is still something we want to do so we can (eventually) remove the old functions. Thus:

I'll be at a conference next week and will probably wait until I get back before applying, just in case there are problems. So unless someone else applies in the meantime (or other issues come up), I'll try to land in ~2 weeks.

Quoted 14 lines
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +3 -1
index c3fbc459c..ebe6352db 100644
@@ -75,15 +75,19 @@ static int rb070d30_panel_unprepare(struct drm_panel *panel)
 static int rb070d30_panel_enable(struct drm_panel *panel)
 {
        struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
+       struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
 
-       return mipi_dsi_dcs_exit_sleep_mode(ctx->dsi);
+       mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+       return dsi_ctx.accum_err;
 }

drivers/gpu/drm/panel/panel-ronbo-rb070d30.c static int rb070d30_panel_unprepare(struct drm_panel *panel) · line 91

Quoted 10 lines
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +3 -1
 
 static int rb070d30_panel_disable(struct drm_panel *panel)
 {
        struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
+       struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
 
-       return mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
+       mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+       return dsi_ctx.accum_err;
 }

nit: not new for your change, but it's probably better if rb070d30_panel_disable() ignores the error here and always returns 0. We often ignore errors in disable(), especially when unprepare() will power the panel off anyway. If you wanted to send a followup patch fixing that, it would be nice. ;-)

-Doug

maintainer Applied
#2 lore raw
In reply to Hsieh Hung-En

Hi,

Quoted 8 lines · Hsieh Hung-En

Replace the deprecated mipi_dsi_dcs_exit_sleep_mode() and mipi_dsi_dcs_enter_sleep_mode() calls in the enable and disable callbacks with their _multi variants, as suggested in Documentation/gpu/todo.rst.

The callbacks retain the same return values. The new helpers additionally log an error if the command fails.

[...]

Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)

[1/1] drm/panel: ronbo-rb070d30: Use mipi_dsi_*_multi() functions

      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/f5c3d702f4ccd1e953436c6a16e542e232a743ea
Signature · 1 line
Neil