c04aede83398d34f20ca51ae6846625be037bf88
[openwrt/staging/ansuel.git] /
1 From c0dd62d0bc48c0d9e833116ea2696cc000633897 Mon Sep 17 00:00:00 2001
2 From: Yangbo Lu <yangbo.lu@nxp.com>
3 Date: Mon, 2 Mar 2020 13:46:39 +0800
4 Subject: [PATCH] Revert "drm/imx: Revert a patch which merges imx-drm-core and
5 ipuv3-crtc in one module"
6
7 This reverts commit 1e7f3c4066d9afb4bc036b9d4b6f5b18f3c918c7.
8 ---
9 drivers/gpu/drm/imx/Kconfig | 7 -------
10 drivers/gpu/drm/imx/Makefile | 4 +---
11 drivers/gpu/drm/imx/imx-drm-core.c | 18 +++++++++++++++++-
12 drivers/gpu/drm/imx/imx-drm.h | 2 ++
13 drivers/gpu/drm/imx/ipuv3-crtc.c | 8 +-------
14 5 files changed, 21 insertions(+), 18 deletions(-)
15
16 --- a/drivers/gpu/drm/imx/Kconfig
17 +++ b/drivers/gpu/drm/imx/Kconfig
18 @@ -33,13 +33,6 @@ config DRM_IMX_LDB
19 Choose this to enable the internal LVDS Display Bridge (LDB)
20 found on i.MX53 and i.MX6 processors.
21
22 -config DRM_IMX_IPUV3
23 - tristate
24 - depends on DRM_IMX
25 - depends on IMX_IPUV3_CORE
26 - default y if DRM_IMX=y
27 - default m if DRM_IMX=m
28 -
29 config DRM_IMX_HDMI
30 tristate "Freescale i.MX DRM HDMI"
31 select DRM_DW_HDMI
32 --- a/drivers/gpu/drm/imx/Makefile
33 +++ b/drivers/gpu/drm/imx/Makefile
34 @@ -1,6 +1,6 @@
35 # SPDX-License-Identifier: GPL-2.0
36
37 -imxdrm-objs := imx-drm-core.o
38 +imxdrm-objs := imx-drm-core.o ipuv3-crtc.o ipuv3-plane.o
39
40 obj-$(CONFIG_DRM_IMX) += imxdrm.o
41
42 @@ -8,7 +8,5 @@ obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) +
43 obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
44 obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
45
46 -imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o
47 -obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o
48 obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o
49 obj-$(CONFIG_DRM_IMX_CDNS_MHDP) += cdn-mhdp-imxdrv.o cdn-mhdp-dp-phy.o cdn-mhdp-hdmi-phy.o cdn-mhdp-imx8qm.o cdn-mhdp-ls1028a.o
50 --- a/drivers/gpu/drm/imx/imx-drm-core.c
51 +++ b/drivers/gpu/drm/imx/imx-drm-core.c
52 @@ -361,7 +361,23 @@ static struct platform_driver imx_drm_pd
53 .of_match_table = imx_drm_dt_ids,
54 },
55 };
56 -module_platform_driver(imx_drm_pdrv);
57 +
58 +static struct platform_driver * const drivers[] = {
59 + &imx_drm_pdrv,
60 + &ipu_drm_driver,
61 +};
62 +
63 +static int __init imx_drm_init(void)
64 +{
65 + return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
66 +}
67 +module_init(imx_drm_init);
68 +
69 +static void __exit imx_drm_exit(void)
70 +{
71 + platform_unregister_drivers(drivers, ARRAY_SIZE(drivers));
72 +}
73 +module_exit(imx_drm_exit);
74
75 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
76 MODULE_DESCRIPTION("i.MX drm driver core");
77 --- a/drivers/gpu/drm/imx/imx-drm.h
78 +++ b/drivers/gpu/drm/imx/imx-drm.h
79 @@ -28,6 +28,8 @@ int imx_drm_init_drm(struct platform_dev
80 int preferred_bpp);
81 int imx_drm_exit_drm(void);
82
83 +extern struct platform_driver ipu_drm_driver;
84 +
85 void imx_drm_mode_config_init(struct drm_device *drm);
86
87 struct drm_gem_cma_object *imx_drm_fb_get_obj(struct drm_framebuffer *fb);
88 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c
89 +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
90 @@ -492,16 +492,10 @@ static int ipu_drm_remove(struct platfor
91 return 0;
92 }
93
94 -static struct platform_driver ipu_drm_driver = {
95 +struct platform_driver ipu_drm_driver = {
96 .driver = {
97 .name = "imx-ipuv3-crtc",
98 },
99 .probe = ipu_drm_probe,
100 .remove = ipu_drm_remove,
101 };
102 -module_platform_driver(ipu_drm_driver);
103 -
104 -MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
105 -MODULE_DESCRIPTION(DRIVER_DESC);
106 -MODULE_LICENSE("GPL");
107 -MODULE_ALIAS("platform:imx-ipuv3-crtc");