On Tue, Jun 10, 2025 at 09:09:21PM +0200, Luca Weiss wrote:
> Add support for the 2160x1080 LCD panel from DJN (98-03057-6598B-I)
> bundled with a HX83112B driver IC, as found on the Fairphone 3
> smartphone.
> 
> Reviewed-by: Dmitry Baryshkov <[email protected]>
> Signed-off-by: Luca Weiss <[email protected]>
> ---
>  drivers/gpu/drm/panel/Kconfig                |  10 +
>  drivers/gpu/drm/panel/Makefile               |   1 +
>  drivers/gpu/drm/panel/panel-himax-hx83112b.c | 430 
> +++++++++++++++++++++++++++
>  3 files changed, 441 insertions(+)

> +static int hx83112b_probe(struct mipi_dsi_device *dsi)
> +{
> +     struct device *dev = &dsi->dev;
> +     struct hx83112b_panel *ctx;
> +     int ret;
> +
> +     ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> +     if (!ctx)
> +             return -ENOMEM;
> +
> +     ret = devm_regulator_bulk_get_const(dev,
> +                                         ARRAY_SIZE(hx83112b_supplies),
> +                                         hx83112b_supplies,
> +                                         &ctx->supplies);
> +     if (ret < 0)
> +             return ret;
> +
> +     ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
> +     if (IS_ERR(ctx->reset_gpio))
> +             return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
> +                                  "Failed to get reset-gpios\n");
> +
> +     ctx->dsi = dsi;
> +     mipi_dsi_set_drvdata(dsi, ctx);
> +
> +     dsi->lanes = 4;
> +     dsi->format = MIPI_DSI_FMT_RGB888;
> +     dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST |
> +                       MIPI_DSI_CLOCK_NON_CONTINUOUS |
> +                       MIPI_DSI_MODE_VIDEO_NO_HSA | MIPI_DSI_MODE_LPM;
> +
> +     drm_panel_init(&ctx->panel, dev, &hx83112b_panel_funcs,
> +                    DRM_MODE_CONNECTOR_DSI);

Please switch to devm_drm_panel_alloc(). LGTM otherwise.

> +     ctx->panel.prepare_prev_first = true;
> +
> +     ctx->panel.backlight = hx83112b_create_backlight(dsi);
> +     if (IS_ERR(ctx->panel.backlight))
> +             return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
> +                                  "Failed to create backlight\n");
> +
> +     drm_panel_add(&ctx->panel);
> +
> +     ret = mipi_dsi_attach(dsi);
> +     if (ret < 0) {
> +             drm_panel_remove(&ctx->panel);
> +             return dev_err_probe(dev, ret, "Failed to attach to DSI 
> host\n");
> +     }
> +
> +     return 0;
> +}
> +

-- 
With best wishes
Dmitry

Reply via email to