Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions arch/arm64/boot/dts/qcom/sm8250-pico4-phoenix.dts
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,10 @@
gpio-reserved-ranges = <24 2>, <27 2>, <30 2>, <64 1>, <66 1>, <73 1>,
<88 3>, <112 2>, <120 5>, <146 34>;

/* The panels dark from the kernel's start (panel_enable_off below). */
pinctrl-0 = <&panel_enable_off>;
pinctrl-names = "default";

/*
* The GD32 MCU's control lines, set as the stock serial driver sets them when it probes
* the MCU's UART (boot-gpio, reset-gpio and sync-gpio of the stock tree's
Expand Down Expand Up @@ -835,6 +839,21 @@
line-name = "display-avdd-off";
};

/*
* The panels' enable line (29), which the bootloader leaves high, low from the kernel's
* start: mdss's reset ends the scanout of the bootloader's splash, and lit panels without
* video show grey. A state of the pin controller itself applies when it probes, right after
* the PDC (0.17 s), before the display's clock controller, the SMMUs and mdss; the panel
* driver takes the line as it finds it and raises it once the panels show its picture.
*/
panel_enable_off: panel-enable-off-state {
pins = "gpio29";
function = "gpio";
drive-strength = <2>;
bias-disable;
output-low;
};

/* The GD32 MCU's UART, two wires as in the stock tree (its control lines are the hogs above). */
qup_uart1_default: qup-uart1-default-state {
pins = "gpio6", "gpio7";
Expand Down
16 changes: 11 additions & 5 deletions drivers/gpu/drm/panel/panel-pico4-ls026b3sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,16 @@ static int pico4_enable(struct drm_panel *panel)
{
struct pico4_panel *ctx = to_pico4_panel(panel);

gpiod_direction_output(ctx->backlight, !backlight_is_blank(ctx->bl));
ctx->enabled = true;
ctx->dimmed = backlight_is_blank(ctx->bl);
if (!ctx->lit) {
ctx->lit = true;
schedule_delayed_work(&ctx->first_light, msecs_to_jiffies(300));
if (ctx->lit) {
gpiod_direction_output(ctx->backlight, !ctx->dimmed);
return 0;
}
/* Lit now, the lenses would glow black until the first light: the line stays low until then. */
gpiod_direction_output(ctx->backlight, 0);
ctx->lit = true;
schedule_delayed_work(&ctx->first_light, msecs_to_jiffies(300));
return 0;
}

Expand Down Expand Up @@ -419,7 +422,10 @@ static int pico4_probe(struct mipi_dsi_device *dsi)
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), ctx->supplies);
if (ret)
return dev_err_probe(dev, ret, "supplies\n");
/* As the bootloader left them: the panels show its splash until the first modeset. */
/*
* Reset and VIO as the bootloader left them, until the first modeset; the enable line is
* low from the kernel's start (the tree's pin state), the lenses dark since mdss's reset.
*/
ctx->reset = devm_gpiod_get(dev, "reset", GPIOD_ASIS);
if (IS_ERR(ctx->reset))
return dev_err_probe(dev, PTR_ERR(ctx->reset), "reset gpio\n");
Expand Down
Loading