Commit 5f0cc92f authored by David Heidelberg's avatar David Heidelberg Committed by Neil Armstrong
Browse files

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: default avatarDavid Heidelberg <david@ixit.cz>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251214-pixel-3-v7-4-b1c0cf6f224d@ixit.cz
parent be85d412
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -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)