]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/panel: jadard-jd9365da-h3: use drm_connector_helper_get_modes_fixed
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Mon, 13 Apr 2026 14:05:34 +0000 (17:05 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Fri, 17 Apr 2026 23:10:37 +0000 (02:10 +0300)
Use existing helper instead of manually coding it.

Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260413-waveshare-dsi-touch-v3-11-3aeb53022c32@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/panel/Kconfig
drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c

index d6863b28ddc559056d791b7d48525869ab32b9e6..ba527b4d77372d7275e275ecfa40acc00535e03b 100644 (file)
@@ -337,6 +337,7 @@ config DRM_PANEL_JADARD_JD9365DA_H3
        depends on OF
        depends on DRM_MIPI_DSI
        depends on BACKLIGHT_CLASS_DEVICE
+       select DRM_KMS_HELPER
        help
          Say Y here if you want to enable support for Jadard JD9365DA-H3
          WXGA MIPI DSI panel. The panel support TFT dot matrix LCD with
index c33c611e03c0093d66dfb04fffc446d871e6aad1..1884ad2404cd6d70f74fd3ccf1144e89aeac7ccd 100644 (file)
@@ -12,6 +12,7 @@
 #include <drm/drm_modes.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_print.h>
+#include <drm/drm_probe_helper.h>
 
 #include <linux/gpio/consumer.h>
 #include <linux/delay.h>
@@ -149,24 +150,8 @@ static int jadard_get_modes(struct drm_panel *panel,
                            struct drm_connector *connector)
 {
        struct jadard *jadard = panel_to_jadard(panel);
-       const struct drm_display_mode *desc_mode = &jadard->desc->mode;
-       struct drm_display_mode *mode;
-
-       mode = drm_mode_duplicate(connector->dev, desc_mode);
-       if (!mode) {
-               DRM_DEV_ERROR(&jadard->dsi->dev, "failed to add mode %ux%ux@%u\n",
-                             desc_mode->hdisplay, desc_mode->vdisplay,
-                             drm_mode_vrefresh(desc_mode));
-               return -ENOMEM;
-       }
-
-       drm_mode_set_name(mode);
-       drm_mode_probed_add(connector, mode);
-
-       connector->display_info.width_mm = mode->width_mm;
-       connector->display_info.height_mm = mode->height_mm;
 
-       return 1;
+       return drm_connector_helper_get_modes_fixed(connector, &jadard->desc->mode);
 }
 
 static enum drm_panel_orientation jadard_panel_get_orientation(struct drm_panel *panel)