On 4/27/26 15:56, Guido Günther wrote:
No need to have separate functions now that prepare/unprepare only
handle powering on & off.
Following my comment on patch 1, just move the unprepare() one, keep the
power on in prepare().
Neil
Signed-off-by: Guido Günther <[email protected]>
---
drivers/gpu/drm/panel/panel-visionox-rm69299.c | 36 +++++++++-----------------
1 file changed, 12 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
index 3c92a6ceb8df..5c869d353368 100644
--- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -198,15 +198,25 @@ static int visionox_rm69299_disable(struct drm_panel
*panel)
return dsi_ctx.accum_err;
}
-static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+ struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+
+ gpiod_set_value(ctx->reset_gpio, 0);
+
+ return regulator_bulk_disable(ARRAY_SIZE(visionox_rm69299_supplies),
+ ctx->supplies);
+}
+
+static int visionox_rm69299_prepare(struct drm_panel *panel)
{
int ret;
+ struct visionox_rm69299 *ctx = panel_to_ctx(panel);
ret = regulator_bulk_enable(ARRAY_SIZE(visionox_rm69299_supplies),
ctx->supplies);
if (ret < 0)
return ret;
-
/*
* Reset sequence of visionox panel requires the panel to be
* out of reset for 10ms, followed by being held in reset
@@ -222,28 +232,6 @@ static int visionox_rm69299_power_on(struct
visionox_rm69299 *ctx)
return 0;
}
-static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
-{
- gpiod_set_value(ctx->reset_gpio, 0);
-
- return regulator_bulk_disable(ARRAY_SIZE(visionox_rm69299_supplies),
- ctx->supplies);
-}
-
-static int visionox_rm69299_unprepare(struct drm_panel *panel)
-{
- struct visionox_rm69299 *ctx = panel_to_ctx(panel);
-
- return visionox_rm69299_power_off(ctx);
-}
-
-static int visionox_rm69299_prepare(struct drm_panel *panel)
-{
- struct visionox_rm69299 *ctx = panel_to_ctx(panel);
-
- return visionox_rm69299_power_on(ctx);
-}
-
static const struct drm_display_mode visionox_rm69299_1080x2248_60hz = {
.name = "1080x2248",
.clock = 158695,