lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1443114161-7965-3-git-send-email-thierry.reding@gmail.com>
Date:	Thu, 24 Sep 2015 19:02:38 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	dri-devel@...ts.freedesktop.org
Cc:	linux-kernel@...r.kernel.org,
	Philipp Zabel <p.zabel@...gutronix.de>
Subject: [PATCH 3/6] drm/imx: Build monolithic driver

From: Thierry Reding <treding@...dia.com>

There's no use building the individual drivers as separate modules
because they are all only useful if combined into a single DRM/KMS
device.

Cc: Philipp Zabel <p.zabel@...gutronix.de>
Signed-off-by: Thierry Reding <treding@...dia.com>
---
 drivers/gpu/drm/imx/Kconfig            | 15 +++++++--------
 drivers/gpu/drm/imx/Makefile           | 17 +++++++----------
 drivers/gpu/drm/imx/dw_hdmi-imx.c      |  4 +---
 drivers/gpu/drm/imx/imx-drm-core.c     | 22 +++++++++++++++++++++-
 drivers/gpu/drm/imx/imx-drm.h          |  6 ++++++
 drivers/gpu/drm/imx/imx-ldb.c          |  4 +---
 drivers/gpu/drm/imx/imx-tve.c          |  4 +---
 drivers/gpu/drm/imx/ipuv3-crtc.c       |  3 +--
 drivers/gpu/drm/imx/parallel-display.c |  4 +---
 9 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig
index 2b81a417cf29..999c21ba94b7 100644
--- a/drivers/gpu/drm/imx/Kconfig
+++ b/drivers/gpu/drm/imx/Kconfig
@@ -11,7 +11,7 @@ config DRM_IMX
 	  enable i.MX graphics support
 
 config DRM_IMX_FB_HELPER
-	tristate "provide legacy framebuffer /dev/fb0"
+	bool "provide legacy framebuffer /dev/fb0"
 	select DRM_KMS_CMA_HELPER
 	depends on DRM_IMX
 	help
@@ -20,13 +20,13 @@ config DRM_IMX_FB_HELPER
 	  and also for applications using the legacy framebuffer API
 
 config DRM_IMX_PARALLEL_DISPLAY
-	tristate "Support for parallel displays"
+	bool "Support for parallel displays"
 	select DRM_PANEL
 	depends on DRM_IMX
 	select VIDEOMODE_HELPERS
 
 config DRM_IMX_TVE
-	tristate "Support for TV and VGA displays"
+	bool "Support for TV and VGA displays"
 	depends on DRM_IMX
 	select REGMAP_MMIO
 	help
@@ -34,7 +34,7 @@ config DRM_IMX_TVE
 	  found on i.MX53 processors.
 
 config DRM_IMX_LDB
-	tristate "Support for LVDS displays"
+	bool "Support for LVDS displays"
 	depends on DRM_IMX && MFD_SYSCON
 	select DRM_PANEL
 	help
@@ -42,14 +42,13 @@ config DRM_IMX_LDB
 	  found on i.MX53 and i.MX6 processors.
 
 config DRM_IMX_IPUV3
-	tristate
+	bool
 	depends on DRM_IMX
 	depends on IMX_IPUV3_CORE
-	default y if DRM_IMX=y
-	default m if DRM_IMX=m
+	default y
 
 config DRM_IMX_HDMI
-	tristate "Freescale i.MX DRM HDMI"
+	bool "Freescale i.MX DRM HDMI"
 	select DRM_DW_HDMI
 	depends on DRM_IMX
 	help
diff --git a/drivers/gpu/drm/imx/Makefile b/drivers/gpu/drm/imx/Makefile
index f3ecd8903d97..48b3844928d9 100644
--- a/drivers/gpu/drm/imx/Makefile
+++ b/drivers/gpu/drm/imx/Makefile
@@ -1,12 +1,9 @@
+imx-drm-y := imx-drm-core.o
 
-imxdrm-objs := imx-drm-core.o
+imx-drm-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) += parallel-display.o
+imx-drm-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
+imx-drm-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
+imx-drm-$(CONFIG_DRM_IMX_IPUV3) += ipuv3-crtc.o ipuv3-plane.o
+imx-drm-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o
 
-obj-$(CONFIG_DRM_IMX) += imxdrm.o
-
-obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) += parallel-display.o
-obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
-obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
-
-imx-ipuv3-crtc-objs  := ipuv3-crtc.o ipuv3-plane.o
-obj-$(CONFIG_DRM_IMX_IPUV3)	+= imx-ipuv3-crtc.o
-obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o
+obj-$(CONFIG_DRM_IMX) += imx-drm.o
diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c
index 644edf65dbe0..eacf32d36c7b 100644
--- a/drivers/gpu/drm/imx/dw_hdmi-imx.c
+++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c
@@ -271,7 +271,7 @@ static int dw_hdmi_imx_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct platform_driver dw_hdmi_imx_platform_driver = {
+struct platform_driver dw_hdmi_imx_platform_driver = {
 	.probe  = dw_hdmi_imx_probe,
 	.remove = dw_hdmi_imx_remove,
 	.driver = {
@@ -280,8 +280,6 @@ static struct platform_driver dw_hdmi_imx_platform_driver = {
 	},
 };
 
-module_platform_driver(dw_hdmi_imx_platform_driver);
-
 MODULE_AUTHOR("Andy Yan <andy.yan@...k-chips.com>");
 MODULE_AUTHOR("Yakir Yang <ykk@...k-chips.com>");
 MODULE_DESCRIPTION("IMX6 Specific DW-HDMI Driver Extension");
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 40950e15b759..4b49a7cb0a14 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -636,7 +636,27 @@ static struct platform_driver imx_drm_pdrv = {
 		.of_match_table = imx_drm_dt_ids,
 	},
 };
-module_platform_driver(imx_drm_pdrv);
+
+static struct platform_driver * const drivers[] = {
+	&ipu_drm_driver,
+	&imx_ldb_driver,
+	&imx_pd_driver,
+	&dw_hdmi_imx_platform_driver,
+	&imx_tve_driver,
+	&imx_drm_pdrv,
+};
+
+static int imx_drm_init(void)
+{
+	return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
+}
+module_init(imx_drm_init);
+
+static void imx_drm_exit(void)
+{
+	platform_unregister_drivers(drivers, ARRAY_SIZE(drivers));
+}
+module_exit(imx_drm_exit);
 
 MODULE_AUTHOR("Sascha Hauer <s.hauer@...gutronix.de>");
 MODULE_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 eebf0e2fefd0..87bdbf5cabb1 100644
--- a/drivers/gpu/drm/imx/imx-drm.h
+++ b/drivers/gpu/drm/imx/imx-drm.h
@@ -53,4 +53,10 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
 void imx_drm_connector_destroy(struct drm_connector *connector);
 void imx_drm_encoder_destroy(struct drm_encoder *encoder);
 
+extern struct platform_driver ipu_drm_driver;
+extern struct platform_driver imx_ldb_driver;
+extern struct platform_driver imx_pd_driver;
+extern struct platform_driver dw_hdmi_imx_platform_driver;
+extern struct platform_driver imx_tve_driver;
+
 #endif /* _IMX_DRM_H_ */
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index abacc8f67469..3fcb221accd7 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -673,7 +673,7 @@ static int imx_ldb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct platform_driver imx_ldb_driver = {
+struct platform_driver imx_ldb_driver = {
 	.probe		= imx_ldb_probe,
 	.remove		= imx_ldb_remove,
 	.driver		= {
@@ -682,8 +682,6 @@ static struct platform_driver imx_ldb_driver = {
 	},
 };
 
-module_platform_driver(imx_ldb_driver);
-
 MODULE_DESCRIPTION("i.MX LVDS driver");
 MODULE_AUTHOR("Sascha Hauer, Pengutronix");
 MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
index e671ad369416..cf6d0b171074 100644
--- a/drivers/gpu/drm/imx/imx-tve.c
+++ b/drivers/gpu/drm/imx/imx-tve.c
@@ -722,7 +722,7 @@ static const struct of_device_id imx_tve_dt_ids[] = {
 	{ /* sentinel */ }
 };
 
-static struct platform_driver imx_tve_driver = {
+struct platform_driver imx_tve_driver = {
 	.probe		= imx_tve_probe,
 	.remove		= imx_tve_remove,
 	.driver		= {
@@ -731,8 +731,6 @@ static struct platform_driver imx_tve_driver = {
 	},
 };
 
-module_platform_driver(imx_tve_driver);
-
 MODULE_DESCRIPTION("i.MX Television Encoder driver");
 MODULE_AUTHOR("Philipp Zabel, Pengutronix");
 MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index a10da8e011c2..af48ffee752f 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -501,14 +501,13 @@ static int ipu_drm_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct platform_driver ipu_drm_driver = {
+struct platform_driver ipu_drm_driver = {
 	.driver = {
 		.name = "imx-ipuv3-crtc",
 	},
 	.probe = ipu_drm_probe,
 	.remove = ipu_drm_remove,
 };
-module_platform_driver(ipu_drm_driver);
 
 MODULE_AUTHOR("Sascha Hauer <s.hauer@...gutronix.de>");
 MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index b4deb9cf9d71..ec61b5753bc6 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -295,7 +295,7 @@ static const struct of_device_id imx_pd_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, imx_pd_dt_ids);
 
-static struct platform_driver imx_pd_driver = {
+struct platform_driver imx_pd_driver = {
 	.probe		= imx_pd_probe,
 	.remove		= imx_pd_remove,
 	.driver		= {
@@ -304,8 +304,6 @@ static struct platform_driver imx_pd_driver = {
 	},
 };
 
-module_platform_driver(imx_pd_driver);
-
 MODULE_DESCRIPTION("i.MX parallel display driver");
 MODULE_AUTHOR("Sascha Hauer, Pengutronix");
 MODULE_LICENSE("GPL");
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ