summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_hdmi.c
diff options
context:
space:
mode:
authorGustavo Padovan2015-08-06 01:24:20 +0200
committerInki Dae2015-08-16 03:23:37 +0200
commita2986e8032bddbe237ed16e2e26c71f5416cd5fd (patch)
treee52b61cf865f2a2bec677b148852bb597fefb62a /drivers/gpu/drm/exynos/exynos_hdmi.c
parentdrm/exynos: remove exynos_encoder's .commit() op (diff)
downloadkernel-qcow2-linux-a2986e8032bddbe237ed16e2e26c71f5416cd5fd.tar.gz
kernel-qcow2-linux-a2986e8032bddbe237ed16e2e26c71f5416cd5fd.tar.xz
kernel-qcow2-linux-a2986e8032bddbe237ed16e2e26c71f5416cd5fd.zip
drm/exynos: remove exynos_drm_create_enc_conn()
This functions was just hiding the encoder and connector creation in a way that was less clean than if we get rid of it. For example, exynos_encoder ops had .create_connector() defined only because we were handing off the encoder and connector creation to exynos_drm_create_enc_conn(). Without this function we can directly call the create_connector function internally in the code, without the need of any vtable access. It also does some refactoring in the code like creating a bind function for dpi devices. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_hdmi.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 11bac50f3a8e..148e42fe1a51 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -44,6 +44,7 @@
#include "exynos_drm_drv.h"
#include "exynos_drm_crtc.h"
+#include "exynos_drm_encoder.h"
#include "exynos_mixer.h"
#include <linux/gpio.h>
@@ -1783,7 +1784,6 @@ static void hdmi_disable(struct exynos_drm_encoder *encoder)
}
static struct exynos_drm_encoder_ops hdmi_encoder_ops = {
- .create_connector = hdmi_create_connector,
.mode_fixup = hdmi_mode_fixup,
.mode_set = hdmi_mode_set,
.enable = hdmi_enable,
@@ -1917,11 +1917,26 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
{
struct drm_device *drm_dev = data;
struct hdmi_context *hdata = dev_get_drvdata(dev);
+ struct exynos_drm_encoder *exynos_encoder = &hdata->encoder;
+ int ret;
hdata->drm_dev = drm_dev;
- return exynos_drm_create_enc_conn(drm_dev, &hdata->encoder,
- EXYNOS_DISPLAY_TYPE_HDMI);
+ ret = exynos_drm_encoder_create(drm_dev, exynos_encoder,
+ EXYNOS_DISPLAY_TYPE_HDMI);
+ if (ret) {
+ DRM_ERROR("failed to create encoder\n");
+ return ret;
+ }
+
+ ret = hdmi_create_connector(exynos_encoder);
+ if (ret) {
+ DRM_ERROR("failed to create connector ret = %d\n", ret);
+ drm_encoder_cleanup(&exynos_encoder->base);
+ return ret;
+ }
+
+ return 0;
}
static void hdmi_unbind(struct device *dev, struct device *master, void *data)