Re: [PATCH v2 2/2] drm/panel: Add support for SONY JDI Synaptics panel

From: Marijn Suijten
Date: Sat Jun 05 2021 - 08:19:38 EST


On Sat, 5 Jun 2021 at 12:49, Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxx> wrote:
>
> From: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxxx>
>
> This commit adds support for Synaptics+JDI display panels
> used in SONY Xperia X, X Compact, X Performance, XZ and XZs
> smartphones.
>
> Due to the nature of phone manufacturing, it is impossible
> to retrieve the actual panel names, hence the replacement
> ones, detailing the devices they are used on.
>
> Co-developed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxx>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxxx>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxx>
> ---
> drivers/gpu/drm/panel/Kconfig | 10 +
> drivers/gpu/drm/panel/Makefile | 1 +
> .../gpu/drm/panel/panel-sony-synaptics-jdi.c | 511 ++++++++++++++++++
> 3 files changed, 522 insertions(+)
> create mode 100644 drivers/gpu/drm/panel/panel-sony-synaptics-jdi.c
>
[..]
> diff --git a/drivers/gpu/drm/panel/panel-sony-synaptics-jdi.c b/drivers/gpu/drm/panel/panel-sony-synaptics-jdi.c
> new file mode 100644
> index 000000000000..2b1972dea58a
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-sony-synaptics-jdi.c
> @@ -0,0 +1,511 @@
[..]
> +struct synaptics_jdi_panel {
> + struct drm_panel base;
> + struct mipi_dsi_device *dsi;
> +
> + struct backlight_device *backlight;

As mentioned in pre-review, don't forget to actually probe the
backlight. It is not necessary to store the backlight (anymore), it
is already kept in base->backli Something like this should work:

rc = drm_panel_of_backlight(&synaptics_jdi_panel->base);
if (rc)
return dev_err_probe(dev, rc,
"cannot register of backlight\n");

> + struct regulator_bulk_data supplies[5];
> +
> + struct gpio_desc *pan_reset_gpio;
> + struct gpio_desc *ts_reset_gpio;
> +
> + bool prepared;
> + bool enabled;
> +
> + const struct synaptics_jdi_panel_desc *desc;
> +};

Thanks!