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