From: David Heidelberg Date: Sun, 14 Dec 2025 14:51:20 +0000 (+0100) Subject: drm/panel: sw43408: Separate reset sequence into own function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f0cc92fa0dab7cbb999dedc653f5857a62b2022;p=thirdparty%2Fkernel%2Flinux.git drm/panel: sw43408: Separate reset sequence into own function 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 Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patch.msgid.link/20251214-pixel-3-v7-4-b1c0cf6f224d@ixit.cz --- diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c index dcca7873acf8e..ed9c7452ea846 100644 --- a/drivers/gpu/drm/panel/panel-lg-sw43408.c +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c @@ -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)