drm/ingenic: Use simple encoder
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 5 Mar 2020 15:59:37 +0000 (16:59 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 2 Apr 2020 12:16:45 +0000 (14:16 +0200)
The ingenic driver uses an empty implementation for its encoder. Replace
the code with the generic simple encoder.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-10-tzimmermann@suse.de
drivers/gpu/drm/ingenic/ingenic-drm.c

index a9bc6623b488c552d1054bddb6a8c6f0b25347dd..7f3f869f57b3fd9f11f41fdaf5515cf6f96779ce 100644 (file)
@@ -29,6 +29,7 @@
 #include <drm/drm_plane.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
 #define JZ_REG_LCD_CFG                         0x00
@@ -583,10 +584,6 @@ static const struct drm_mode_config_funcs ingenic_drm_mode_config_funcs = {
        .atomic_commit          = drm_atomic_helper_commit,
 };
 
-static const struct drm_encoder_funcs ingenic_drm_encoder_funcs = {
-       .destroy                = drm_encoder_cleanup,
-};
-
 static void ingenic_drm_free_dma_hwdesc(void *d)
 {
        struct ingenic_drm *priv = d;
@@ -725,8 +722,8 @@ static int ingenic_drm_probe(struct platform_device *pdev)
        drm_encoder_helper_add(&priv->encoder,
                               &ingenic_drm_encoder_helper_funcs);
 
-       ret = drm_encoder_init(drm, &priv->encoder, &ingenic_drm_encoder_funcs,
-                              DRM_MODE_ENCODER_DPI, NULL);
+       ret = drm_simple_encoder_init(drm, &priv->encoder,
+                                     DRM_MODE_ENCODER_DPI);
        if (ret) {
                dev_err(dev, "Failed to init encoder: %i", ret);
                return ret;