aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-03-23 12:18:37 -0400
committerPhilipp Zabel <p.zabel@pengutronix.de>2017-04-04 04:59:08 -0400
commit3d1df96ad46856ce850be5ac112eab919cbe1cab (patch)
treef9d131ab505d72d3beb55fb39e1513371eacf22d
parent30310c835f3ebfefcf83f006981faa66d73bd810 (diff)
drm/imx: merge imx-drm-core and ipuv3-crtc in one module
While it is possible to hook other CRTC implementations into imx-drm in practice there are none yet and the option to disable ipuv3-crtc support has been hidden for a long time. Now that the imx-drm-core has learned to deal with some of the specifics of IPUv3 there is a cyclic dependency between both parts. To get rid of this and to decimate the Kconfig maze a bit, simply merge both parts into one module. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r--drivers/gpu/drm/imx/Kconfig7
-rw-r--r--drivers/gpu/drm/imx/Makefile3
-rw-r--r--drivers/gpu/drm/imx/imx-drm-core.c18
-rw-r--r--drivers/gpu/drm/imx/imx-drm.h2
-rw-r--r--drivers/gpu/drm/imx/ipuv3-crtc.c8
5 files changed, 21 insertions, 17 deletions
diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig
index f2c9ae822149..c9e439c82241 100644
--- a/drivers/gpu/drm/imx/Kconfig
+++ b/drivers/gpu/drm/imx/Kconfig
@@ -31,13 +31,6 @@ config DRM_IMX_LDB
31 Choose this to enable the internal LVDS Display Bridge (LDB) 31 Choose this to enable the internal LVDS Display Bridge (LDB)
32 found on i.MX53 and i.MX6 processors. 32 found on i.MX53 and i.MX6 processors.
33 33
34config DRM_IMX_IPUV3
35 tristate
36 depends on DRM_IMX
37 depends on IMX_IPUV3_CORE
38 default y if DRM_IMX=y
39 default m if DRM_IMX=m
40
41config DRM_IMX_HDMI 34config DRM_IMX_HDMI
42 tristate "Freescale i.MX DRM HDMI" 35 tristate "Freescale i.MX DRM HDMI"
43 select DRM_DW_HDMI 36 select DRM_DW_HDMI
diff --git a/drivers/gpu/drm/imx/Makefile b/drivers/gpu/drm/imx/Makefile
index f3ecd8903d97..16ecef33e008 100644
--- a/drivers/gpu/drm/imx/Makefile
+++ b/drivers/gpu/drm/imx/Makefile
@@ -1,5 +1,5 @@
1 1
2imxdrm-objs := imx-drm-core.o 2imxdrm-objs := imx-drm-core.o ipuv3-crtc.o ipuv3-plane.o
3 3
4obj-$(CONFIG_DRM_IMX) += imxdrm.o 4obj-$(CONFIG_DRM_IMX) += imxdrm.o
5 5
@@ -7,6 +7,5 @@ obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) += parallel-display.o
7obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o 7obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
8obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o 8obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
9 9
10imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o
11obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o 10obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o
12obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o 11obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index b6dbcd17f1e6..bf77f4c2ffc0 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -431,7 +431,23 @@ static struct platform_driver imx_drm_pdrv = {
431 .of_match_table = imx_drm_dt_ids, 431 .of_match_table = imx_drm_dt_ids,
432 }, 432 },
433}; 433};
434module_platform_driver(imx_drm_pdrv); 434
435static struct platform_driver * const drivers[] = {
436 &imx_drm_pdrv,
437 &ipu_drm_driver,
438};
439
440static int __init imx_drm_init(void)
441{
442 return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
443}
444module_init(imx_drm_init);
445
446static void __exit imx_drm_exit(void)
447{
448 platform_unregister_drivers(drivers, ARRAY_SIZE(drivers));
449}
450module_exit(imx_drm_exit);
435 451
436MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); 452MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
437MODULE_DESCRIPTION("i.MX drm driver core"); 453MODULE_DESCRIPTION("i.MX drm driver core");
diff --git a/drivers/gpu/drm/imx/imx-drm.h b/drivers/gpu/drm/imx/imx-drm.h
index 295434b199db..f6dd64be9cd5 100644
--- a/drivers/gpu/drm/imx/imx-drm.h
+++ b/drivers/gpu/drm/imx/imx-drm.h
@@ -29,6 +29,8 @@ int imx_drm_init_drm(struct platform_device *pdev,
29 int preferred_bpp); 29 int preferred_bpp);
30int imx_drm_exit_drm(void); 30int imx_drm_exit_drm(void);
31 31
32extern struct platform_driver ipu_drm_driver;
33
32void imx_drm_mode_config_init(struct drm_device *drm); 34void imx_drm_mode_config_init(struct drm_device *drm);
33 35
34struct drm_gem_cma_object *imx_drm_fb_get_obj(struct drm_framebuffer *fb); 36struct drm_gem_cma_object *imx_drm_fb_get_obj(struct drm_framebuffer *fb);
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index dab9d50ffd8c..5456c15d962c 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -465,16 +465,10 @@ static int ipu_drm_remove(struct platform_device *pdev)
465 return 0; 465 return 0;
466} 466}
467 467
468static struct platform_driver ipu_drm_driver = { 468struct platform_driver ipu_drm_driver = {
469 .driver = { 469 .driver = {
470 .name = "imx-ipuv3-crtc", 470 .name = "imx-ipuv3-crtc",
471 }, 471 },
472 .probe = ipu_drm_probe, 472 .probe = ipu_drm_probe,
473 .remove = ipu_drm_remove, 473 .remove = ipu_drm_remove,
474}; 474};
475module_platform_driver(ipu_drm_driver);
476
477MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
478MODULE_DESCRIPTION(DRIVER_DESC);
479MODULE_LICENSE("GPL");
480MODULE_ALIAS("platform:imx-ipuv3-crtc");