]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panel: sw43408: Separate reset sequence into own function
authorDavid Heidelberg <david@ixit.cz>
Sun, 14 Dec 2025 14:51:20 +0000 (15:51 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Tue, 16 Dec 2025 10:21:33 +0000 (11:21 +0100)
Splitting reset() from prepare() follows clean coding practices and lets
us potentially make reset optional in the future for flicker-less
takeover from a bootloader or framebuffer driver where the panel is
already configured.

Signed-off-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251214-pixel-3-v7-4-b1c0cf6f224d@ixit.cz
drivers/gpu/drm/panel/panel-lg-sw43408.c

index dcca7873acf8ee1a5211333d9b651f91a9048576..ed9c7452ea846fdab0db0e9c62620b0c9a77b0a7 100644 (file)
@@ -119,6 +119,16 @@ static int sw43408_program(struct drm_panel *panel)
        return ctx.accum_err;
 }
 
+static void sw43408_reset(struct sw43408_panel *ctx)
+{
+       gpiod_set_value(ctx->reset_gpio, 0);
+       usleep_range(9000, 10000);
+       gpiod_set_value(ctx->reset_gpio, 1);
+       usleep_range(1000, 2000);
+       gpiod_set_value(ctx->reset_gpio, 0);
+       usleep_range(9000, 10000);
+}
+
 static int sw43408_prepare(struct drm_panel *panel)
 {
        struct sw43408_panel *ctx = to_panel_info(panel);
@@ -130,12 +140,7 @@ static int sw43408_prepare(struct drm_panel *panel)
 
        usleep_range(5000, 6000);
 
-       gpiod_set_value(ctx->reset_gpio, 0);
-       usleep_range(9000, 10000);
-       gpiod_set_value(ctx->reset_gpio, 1);
-       usleep_range(1000, 2000);
-       gpiod_set_value(ctx->reset_gpio, 0);
-       usleep_range(9000, 10000);
+       sw43408_reset(ctx);
 
        ret = sw43408_program(panel);
        if (ret)