Re: [PATCH v4 2/2] drm/panel: Add driver for Novatek NT36523

Jianhua Lu
2023-03-10T18:07:26Z

On Fri, Mar 10, 2023 at 09:21:44PM +0800, Jianhua Lu wrote:
> Add a driver for panels using the Novatek NT36523 display driver IC.
...
> +
> +static int nt36523_get_modes(struct drm_panel *panel,
> + struct drm_connector *connector)
> +{
> + struct panel_info *pinfo = to_panel_info(panel);
> + int i;
> +
> + for (i =0; i < pinfo->desc->num_modes; i++) {
s/i =0/i = 0/, I forget to run checkpatch, sorry. I will fix it in v5
> + const struct drm_display_mode *m = &pinfo->desc->modes[i];
> + struct drm_display_mode *mode;
> + mode = drm_mode_duplicate(connector->dev, m);
> + if (!mode) {
> + dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
> + m->hdisplay, m->vdisplay, drm_mode_vrefresh(m));
> + return -ENOMEM;
> + }
> + mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> + drm_mode_set_name(mode);
> + drm_mode_probed_add(connector, mode);
> + }
> +
> + connector->display_info.width_mm = pinfo->desc->width_mm;
> + connector->display_info.height_mm = pinfo->desc->height_mm;
> + connector->display_info.bpc = pinfo->desc->bpc;
> +
> + return pinfo->desc->num_modes;
> +}
>
>