Re: [PATCH v2 03/11] drm/panel: Add LGD LH599QH3-EDB1 panel driver for Sony Xperia XZ3

Marijn Suijten
2025-12-29T11:21:47Z

On 2025-12-26 14:12:25, Linus Walleij wrote:
...
> > +static int lgd_lh599qh3_edb1_program(struct lgd_lh599qh3_edb1 *ctx)
> > +{
> > + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> > +
> > + dsi_ctx.dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> > +
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);
>
> Clearly an "unlock" sequence.
>
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x02, 0x01);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x59, 0x01);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY,
> > + WRITE_CONTROL_DISPLAY_BACKLIGHT);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x57, 0x20, 0x80, 0xde, 0x60, 0x00);
> > + mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, 1440 - 1);
> > + mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, 2880 - 1);
> > +
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00);
> > +
> > + mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
> > +
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x7f, 0x5a, 0x5a);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
> > + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x5a, 0x5a);
>
> Cleary another copy of the "unlock" sequence.
>
> Can you break it out to a subroutine?
> lgd_lh599qh3_edb1_unlock()?

Sure, though unsure where the "lock" sequence resides (and why it needs to be
unlocked twice, unless this was autogenerated and is unnecessary, or implies a
"flush" of sorts) or why it looks so familiar to the Samsung panels.

Will rename it to lgd_lh599qh3_edb1_unlock_multi() and pass it a
mipi_dsi_multi_context so that no extra return-code handling needs to be
implemented.

> +/- this nitpick:
> Reviewed-by: Linus Walleij <linusw@kernel.org>

Just making sure, you reviewed the SOFEF01 driver with your Linaro address,
which one do you prefer or should I keep this distinction?

- Marijn