aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2012-03-16 05:47:08 -0400
committerDave Airlie <airlied@redhat.com>2012-03-20 05:40:23 -0400
commit132a5b915f41f88356662c14c6866550ce2a08b6 (patch)
tree64fbfe5a1ee00b97b9c2adef47f8983b6c63791e /drivers/gpu/drm/exynos
parent3ab09435d5fbad63842cd2749f95deec336eb566 (diff)
drm/exynos: remove module of exynos drm subdrv
The exynos drm driver has several subdrv. They each can be module but it causes unfixed probe order of exynodr drm driver and each subdrv. It also needs some weird codes such as exynos_drm_fbdev_reinit and exynos_drm_mode_group_reinit. This patch can remove weird codes and clear codes through we doesn't modularity each subdrv. Also this removes unnecessary codes related module. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r--drivers/gpu/drm/exynos/Kconfig8
-rw-r--r--drivers/gpu/drm/exynos/Makefile10
-rw-r--r--drivers/gpu/drm/exynos/exynos_ddc.c1
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_connector.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_core.c112
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_crtc.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.c52
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.h12
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_encoder.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fb.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fbdev.c86
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c20
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gem.c4
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_hdmi.c87
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c9
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c7
16 files changed, 77 insertions, 355 deletions
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index b9e5266c341b..9a9850afe2f0 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -1,7 +1,6 @@
1config DRM_EXYNOS 1config DRM_EXYNOS
2 tristate "DRM Support for Samsung SoC EXYNOS Series" 2 tristate "DRM Support for Samsung SoC EXYNOS Series"
3 depends on DRM && PLAT_SAMSUNG 3 depends on DRM && PLAT_SAMSUNG
4 default n
5 select DRM_KMS_HELPER 4 select DRM_KMS_HELPER
6 select FB_CFB_FILLRECT 5 select FB_CFB_FILLRECT
7 select FB_CFB_COPYAREA 6 select FB_CFB_COPYAREA
@@ -12,16 +11,13 @@ config DRM_EXYNOS
12 If M is selected the module will be called exynosdrm. 11 If M is selected the module will be called exynosdrm.
13 12
14config DRM_EXYNOS_FIMD 13config DRM_EXYNOS_FIMD
15 tristate "Exynos DRM FIMD" 14 bool "Exynos DRM FIMD"
16 depends on DRM_EXYNOS && !FB_S3C 15 depends on DRM_EXYNOS && !FB_S3C
17 default n
18 help 16 help
19 Choose this option if you want to use Exynos FIMD for DRM. 17 Choose this option if you want to use Exynos FIMD for DRM.
20 If M is selected, the module will be called exynos_drm_fimd
21 18
22config DRM_EXYNOS_HDMI 19config DRM_EXYNOS_HDMI
23 tristate "Exynos DRM HDMI" 20 bool "Exynos DRM HDMI"
24 depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV 21 depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
25 help 22 help
26 Choose this option if you want to use Exynos HDMI for DRM. 23 Choose this option if you want to use Exynos HDMI for DRM.
27 If M is selected, the module will be called exynos_drm_hdmi
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index 395e69c9a96e..5331fa33e13a 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -8,7 +8,9 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o exynos_drm_connector.o \
8 exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \ 8 exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \
9 exynos_drm_plane.o 9 exynos_drm_plane.o
10 10
11obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o 11exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o
12obj-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o 12exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \
13obj-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o exynos_ddc.o \ 13 exynos_ddc.o exynos_hdmiphy.o \
14 exynos_hdmiphy.o exynos_drm_hdmi.o 14 exynos_drm_hdmi.o
15
16obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o
diff --git a/drivers/gpu/drm/exynos/exynos_ddc.c b/drivers/gpu/drm/exynos/exynos_ddc.c
index 84b614fe26fd..7e1051d07f1f 100644
--- a/drivers/gpu/drm/exynos/exynos_ddc.c
+++ b/drivers/gpu/drm/exynos/exynos_ddc.c
@@ -55,4 +55,3 @@ struct i2c_driver ddc_driver = {
55 .remove = __devexit_p(s5p_ddc_remove), 55 .remove = __devexit_p(s5p_ddc_remove),
56 .command = NULL, 56 .command = NULL,
57}; 57};
58EXPORT_SYMBOL(ddc_driver);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index ebdd71d50685..a5d65912f4d5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -348,9 +348,3 @@ err_connector:
348 kfree(exynos_connector); 348 kfree(exynos_connector);
349 return NULL; 349 return NULL;
350} 350}
351
352MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
353MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
354MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
355MODULE_DESCRIPTION("Samsung SoC DRM Connector Driver");
356MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_core.c b/drivers/gpu/drm/exynos/exynos_drm_core.c
index d08a55896d50..937b0597c8b3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_core.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_core.c
@@ -32,7 +32,6 @@
32#include "exynos_drm_connector.h" 32#include "exynos_drm_connector.h"
33#include "exynos_drm_fbdev.h" 33#include "exynos_drm_fbdev.h"
34 34
35static DEFINE_MUTEX(exynos_drm_mutex);
36static LIST_HEAD(exynos_drm_subdrv_list); 35static LIST_HEAD(exynos_drm_subdrv_list);
37static struct drm_device *drm_dev; 36static struct drm_device *drm_dev;
38 37
@@ -116,13 +115,10 @@ int exynos_drm_device_register(struct drm_device *dev)
116 if (!dev) 115 if (!dev)
117 return -EINVAL; 116 return -EINVAL;
118 117
119 if (drm_dev) { 118 drm_dev = dev;
120 DRM_ERROR("Already drm device were registered\n");
121 return -EBUSY;
122 }
123 119
124 mutex_lock(&exynos_drm_mutex);
125 list_for_each_entry_safe(subdrv, n, &exynos_drm_subdrv_list, list) { 120 list_for_each_entry_safe(subdrv, n, &exynos_drm_subdrv_list, list) {
121 subdrv->drm_dev = dev;
126 err = exynos_drm_subdrv_probe(dev, subdrv); 122 err = exynos_drm_subdrv_probe(dev, subdrv);
127 if (err) { 123 if (err) {
128 DRM_DEBUG("exynos drm subdrv probe failed.\n"); 124 DRM_DEBUG("exynos drm subdrv probe failed.\n");
@@ -130,9 +126,6 @@ int exynos_drm_device_register(struct drm_device *dev)
130 } 126 }
131 } 127 }
132 128
133 drm_dev = dev;
134 mutex_unlock(&exynos_drm_mutex);
135
136 return 0; 129 return 0;
137} 130}
138EXPORT_SYMBOL_GPL(exynos_drm_device_register); 131EXPORT_SYMBOL_GPL(exynos_drm_device_register);
@@ -143,86 +136,28 @@ int exynos_drm_device_unregister(struct drm_device *dev)
143 136
144 DRM_DEBUG_DRIVER("%s\n", __FILE__); 137 DRM_DEBUG_DRIVER("%s\n", __FILE__);
145 138
146 if (!dev || dev != drm_dev) { 139 if (!dev) {
147 WARN(1, "Unexpected drm device unregister!\n"); 140 WARN(1, "Unexpected drm device unregister!\n");
148 return -EINVAL; 141 return -EINVAL;
149 } 142 }
150 143
151 mutex_lock(&exynos_drm_mutex);
152 list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) 144 list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list)
153 exynos_drm_subdrv_remove(dev, subdrv); 145 exynos_drm_subdrv_remove(dev, subdrv);
154 146
155 drm_dev = NULL; 147 drm_dev = NULL;
156 mutex_unlock(&exynos_drm_mutex);
157 148
158 return 0; 149 return 0;
159} 150}
160EXPORT_SYMBOL_GPL(exynos_drm_device_unregister); 151EXPORT_SYMBOL_GPL(exynos_drm_device_unregister);
161 152
162static int exynos_drm_mode_group_reinit(struct drm_device *dev)
163{
164 struct drm_mode_group *group = &dev->primary->mode_group;
165 uint32_t *id_list = group->id_list;
166 int ret;
167
168 DRM_DEBUG_DRIVER("%s\n", __FILE__);
169
170 ret = drm_mode_group_init_legacy_group(dev, group);
171 if (ret < 0)
172 return ret;
173
174 kfree(id_list);
175 return 0;
176}
177
178int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) 153int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
179{ 154{
180 int err;
181
182 DRM_DEBUG_DRIVER("%s\n", __FILE__); 155 DRM_DEBUG_DRIVER("%s\n", __FILE__);
183 156
184 if (!subdrv) 157 if (!subdrv)
185 return -EINVAL; 158 return -EINVAL;
186 159
187 mutex_lock(&exynos_drm_mutex);
188 if (drm_dev) {
189 err = exynos_drm_subdrv_probe(drm_dev, subdrv);
190 if (err) {
191 DRM_ERROR("failed to probe exynos drm subdrv\n");
192 mutex_unlock(&exynos_drm_mutex);
193 return err;
194 }
195
196 /* setup possible_clones. */
197 exynos_drm_encoder_setup(drm_dev);
198
199 /*
200 * if any specific driver such as fimd or hdmi driver called
201 * exynos_drm_subdrv_register() later than drm_load(),
202 * the fb helper should be re-initialized and re-configured.
203 */
204 err = exynos_drm_fbdev_reinit(drm_dev);
205 if (err) {
206 DRM_ERROR("failed to reinitialize exynos drm fbdev\n");
207 exynos_drm_subdrv_remove(drm_dev, subdrv);
208 mutex_unlock(&exynos_drm_mutex);
209 return err;
210 }
211
212 err = exynos_drm_mode_group_reinit(drm_dev);
213 if (err) {
214 DRM_ERROR("failed to reinitialize mode group\n");
215 exynos_drm_fbdev_fini(drm_dev);
216 exynos_drm_subdrv_remove(drm_dev, subdrv);
217 mutex_unlock(&exynos_drm_mutex);
218 return err;
219 }
220 }
221
222 subdrv->drm_dev = drm_dev;
223
224 list_add_tail(&subdrv->list, &exynos_drm_subdrv_list); 160 list_add_tail(&subdrv->list, &exynos_drm_subdrv_list);
225 mutex_unlock(&exynos_drm_mutex);
226 161
227 return 0; 162 return 0;
228} 163}
@@ -230,46 +165,13 @@ EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register);
230 165
231int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv) 166int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)
232{ 167{
233 int ret = -EFAULT;
234
235 DRM_DEBUG_DRIVER("%s\n", __FILE__); 168 DRM_DEBUG_DRIVER("%s\n", __FILE__);
236 169
237 if (!subdrv) { 170 if (!subdrv)
238 DRM_DEBUG("Unexpected exynos drm subdrv unregister!\n"); 171 return -EINVAL;
239 return ret;
240 }
241
242 mutex_lock(&exynos_drm_mutex);
243 if (drm_dev) {
244 exynos_drm_subdrv_remove(drm_dev, subdrv);
245 list_del(&subdrv->list);
246
247 /*
248 * fb helper should be updated once a sub driver is released
249 * to re-configure crtc and connector and also to re-setup
250 * drm framebuffer.
251 */
252 ret = exynos_drm_fbdev_reinit(drm_dev);
253 if (ret < 0) {
254 DRM_ERROR("failed fb helper reinit.\n");
255 goto fail;
256 }
257 172
258 ret = exynos_drm_mode_group_reinit(drm_dev); 173 list_del(&subdrv->list);
259 if (ret < 0) {
260 DRM_ERROR("failed drm mode group reinit.\n");
261 goto fail;
262 }
263 }
264 174
265fail: 175 return 0;
266 mutex_unlock(&exynos_drm_mutex);
267 return ret;
268} 176}
269EXPORT_SYMBOL_GPL(exynos_drm_subdrv_unregister); 177EXPORT_SYMBOL_GPL(exynos_drm_subdrv_unregister);
270
271MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
272MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
273MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
274MODULE_DESCRIPTION("Samsung SoC DRM Core Driver");
275MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
index 2d9a0e630d7f..3486ffed0bf0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c
@@ -430,9 +430,3 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
430 exynos_drm_fn_encoder(private->crtc[crtc], &crtc, 430 exynos_drm_fn_encoder(private->crtc[crtc], &crtc,
431 exynos_drm_disable_vblank); 431 exynos_drm_disable_vblank);
432} 432}
433
434MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
435MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
436MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
437MODULE_DESCRIPTION("Samsung SoC DRM CRTC Driver");
438MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index d359cb4b7b88..903fcf0f05c7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -266,9 +266,49 @@ static struct platform_driver exynos_drm_platform_driver = {
266 266
267static int __init exynos_drm_init(void) 267static int __init exynos_drm_init(void)
268{ 268{
269 int ret;
270
269 DRM_DEBUG_DRIVER("%s\n", __FILE__); 271 DRM_DEBUG_DRIVER("%s\n", __FILE__);
270 272
271 return platform_driver_register(&exynos_drm_platform_driver); 273#ifdef CONFIG_DRM_EXYNOS_FIMD
274 ret = platform_driver_register(&fimd_driver);
275 if (ret < 0)
276 goto out_fimd;
277#endif
278
279#ifdef CONFIG_DRM_EXYNOS_HDMI
280 ret = platform_driver_register(&hdmi_driver);
281 if (ret < 0)
282 goto out_hdmi;
283 ret = platform_driver_register(&mixer_driver);
284 if (ret < 0)
285 goto out_mixer;
286 ret = platform_driver_register(&exynos_drm_common_hdmi_driver);
287 if (ret < 0)
288 goto out_common_hdmi;
289#endif
290
291 ret = platform_driver_register(&exynos_drm_platform_driver);
292 if (ret < 0)
293 goto out;
294
295 return 0;
296
297out:
298#ifdef CONFIG_DRM_EXYNOS_HDMI
299 platform_driver_unregister(&exynos_drm_common_hdmi_driver);
300out_common_hdmi:
301 platform_driver_unregister(&mixer_driver);
302out_mixer:
303 platform_driver_unregister(&hdmi_driver);
304out_hdmi:
305#endif
306
307#ifdef CONFIG_DRM_EXYNOS_FIMD
308 platform_driver_unregister(&fimd_driver);
309out_fimd:
310#endif
311 return ret;
272} 312}
273 313
274static void __exit exynos_drm_exit(void) 314static void __exit exynos_drm_exit(void)
@@ -276,6 +316,16 @@ static void __exit exynos_drm_exit(void)
276 DRM_DEBUG_DRIVER("%s\n", __FILE__); 316 DRM_DEBUG_DRIVER("%s\n", __FILE__);
277 317
278 platform_driver_unregister(&exynos_drm_platform_driver); 318 platform_driver_unregister(&exynos_drm_platform_driver);
319
320#ifdef CONFIG_DRM_EXYNOS_HDMI
321 platform_driver_unregister(&exynos_drm_common_hdmi_driver);
322 platform_driver_unregister(&mixer_driver);
323 platform_driver_unregister(&hdmi_driver);
324#endif
325
326#ifdef CONFIG_DRM_EXYNOS_FIMD
327 platform_driver_unregister(&fimd_driver);
328#endif
279} 329}
280 330
281module_init(exynos_drm_init); 331module_init(exynos_drm_init);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 4115a9f61d21..f8bac0eb2cb2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -262,15 +262,15 @@ int exynos_drm_device_unregister(struct drm_device *dev);
262 * this function would be called by sub drivers such as display controller 262 * this function would be called by sub drivers such as display controller
263 * or hdmi driver to register this sub driver object to exynos drm driver 263 * or hdmi driver to register this sub driver object to exynos drm driver
264 * and when a sub driver is registered to exynos drm driver a probe callback 264 * and when a sub driver is registered to exynos drm driver a probe callback
265 * of the sub driver is called and creates its own encoder and connector 265 * of the sub driver is called and creates its own encoder and connector.
266 * and then fb helper and drm mode group would be re-initialized.
267 */ 266 */
268int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv); 267int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv);
269 268
270/* 269/* this function removes subdrv list from exynos drm driver */
271 * this function removes subdrv list from exynos drm driver and fb helper
272 * and drm mode group would be re-initialized.
273 */
274int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *drm_subdrv); 270int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *drm_subdrv);
275 271
272extern struct platform_driver fimd_driver;
273extern struct platform_driver hdmi_driver;
274extern struct platform_driver mixer_driver;
275extern struct platform_driver exynos_drm_common_hdmi_driver;
276#endif 276#endif
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
index 45ca732858fb..22786765d405 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c
@@ -442,9 +442,3 @@ void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data)
442 if (overlay_ops && overlay_ops->disable) 442 if (overlay_ops && overlay_ops->disable)
443 overlay_ops->disable(manager->dev, zpos); 443 overlay_ops->disable(manager->dev, zpos);
444} 444}
445
446MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
447MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
448MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
449MODULE_DESCRIPTION("Samsung SoC DRM Encoder Driver");
450MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 3733fe6723d3..c38c8f468fa3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -211,9 +211,3 @@ void exynos_drm_mode_config_init(struct drm_device *dev)
211 211
212 dev->mode_config.funcs = &exynos_drm_mode_config_funcs; 212 dev->mode_config.funcs = &exynos_drm_mode_config_funcs;
213} 213}
214
215MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
216MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
217MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
218MODULE_DESCRIPTION("Samsung SoC DRM FB Driver");
219MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index b5dcd5384781..d5586cc75163 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -316,89 +316,3 @@ void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
316 316
317 drm_fb_helper_restore_fbdev_mode(private->fb_helper); 317 drm_fb_helper_restore_fbdev_mode(private->fb_helper);
318} 318}
319
320int exynos_drm_fbdev_reinit(struct drm_device *dev)
321{
322 struct exynos_drm_private *private = dev->dev_private;
323 struct drm_fb_helper *fb_helper;
324 int ret;
325
326 if (!private)
327 return -EINVAL;
328
329 /*
330 * if all sub drivers were unloaded then num_connector is 0
331 * so at this time, the framebuffers also should be destroyed.
332 */
333 if (!dev->mode_config.num_connector) {
334 exynos_drm_fbdev_fini(dev);
335 return 0;
336 }
337
338 fb_helper = private->fb_helper;
339
340 if (fb_helper) {
341 struct list_head temp_list;
342
343 INIT_LIST_HEAD(&temp_list);
344
345 /*
346 * fb_helper is reintialized but kernel fb is reused
347 * so kernel_fb_list need to be backuped and restored
348 */
349 if (!list_empty(&fb_helper->kernel_fb_list))
350 list_replace_init(&fb_helper->kernel_fb_list,
351 &temp_list);
352
353 drm_fb_helper_fini(fb_helper);
354
355 ret = drm_fb_helper_init(dev, fb_helper,
356 dev->mode_config.num_crtc, MAX_CONNECTOR);
357 if (ret < 0) {
358 DRM_ERROR("failed to initialize drm fb helper\n");
359 return ret;
360 }
361
362 if (!list_empty(&temp_list))
363 list_replace(&temp_list, &fb_helper->kernel_fb_list);
364
365 ret = drm_fb_helper_single_add_all_connectors(fb_helper);
366 if (ret < 0) {
367 DRM_ERROR("failed to add fb helper to connectors\n");
368 goto err;
369 }
370
371 ret = drm_fb_helper_initial_config(fb_helper, PREFERRED_BPP);
372 if (ret < 0) {
373 DRM_ERROR("failed to set up hw configuration.\n");
374 goto err;
375 }
376 } else {
377 /*
378 * if drm_load() failed whem drm load() was called prior
379 * to specific drivers, fb_helper must be NULL and so
380 * this fuction should be called again to re-initialize and
381 * re-configure the fb helper. it means that this function
382 * has been called by the specific drivers.
383 */
384 ret = exynos_drm_fbdev_init(dev);
385 }
386
387 return ret;
388
389err:
390 /*
391 * if drm_load() failed when drm load() was called prior
392 * to specific drivers, the fb_helper must be NULL and so check it.
393 */
394 if (fb_helper)
395 drm_fb_helper_fini(fb_helper);
396
397 return ret;
398}
399
400MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
401MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
402MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
403MODULE_DESCRIPTION("Samsung SoC DRM FBDEV Driver");
404MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 360adf2bba04..101d64c7a9be 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -1012,7 +1012,7 @@ static const struct dev_pm_ops fimd_pm_ops = {
1012 SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL) 1012 SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL)
1013}; 1013};
1014 1014
1015static struct platform_driver fimd_driver = { 1015struct platform_driver fimd_driver = {
1016 .probe = fimd_probe, 1016 .probe = fimd_probe,
1017 .remove = __devexit_p(fimd_remove), 1017 .remove = __devexit_p(fimd_remove),
1018 .driver = { 1018 .driver = {
@@ -1021,21 +1021,3 @@ static struct platform_driver fimd_driver = {
1021 .pm = &fimd_pm_ops, 1021 .pm = &fimd_pm_ops,
1022 }, 1022 },
1023}; 1023};
1024
1025static int __init fimd_init(void)
1026{
1027 return platform_driver_register(&fimd_driver);
1028}
1029
1030static void __exit fimd_exit(void)
1031{
1032 platform_driver_unregister(&fimd_driver);
1033}
1034
1035module_init(fimd_init);
1036module_exit(fimd_exit);
1037
1038MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
1039MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
1040MODULE_DESCRIPTION("Samsung DRM FIMD Driver");
1041MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index b5c6f3cfc698..fa1aa94a3d8e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -735,7 +735,3 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
735 735
736 return ret; 736 return ret;
737} 737}
738
739MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
740MODULE_DESCRIPTION("Samsung SoC DRM GEM Module");
741MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
index ed86bddf81da..14eb26b0ba1c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c
@@ -38,7 +38,6 @@ struct drm_hdmi_context {
38 struct exynos_drm_subdrv subdrv; 38 struct exynos_drm_subdrv subdrv;
39 struct exynos_drm_hdmi_context *hdmi_ctx; 39 struct exynos_drm_hdmi_context *hdmi_ctx;
40 struct exynos_drm_hdmi_context *mixer_ctx; 40 struct exynos_drm_hdmi_context *mixer_ctx;
41 struct work_struct work;
42}; 41};
43 42
44void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops 43void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
@@ -49,7 +48,6 @@ void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops
49 if (display_ops) 48 if (display_ops)
50 hdmi_display_ops = display_ops; 49 hdmi_display_ops = display_ops;
51} 50}
52EXPORT_SYMBOL(exynos_drm_display_ops_register);
53 51
54void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops 52void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
55 *manager_ops) 53 *manager_ops)
@@ -59,7 +57,6 @@ void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
59 if (manager_ops) 57 if (manager_ops)
60 hdmi_manager_ops = manager_ops; 58 hdmi_manager_ops = manager_ops;
61} 59}
62EXPORT_SYMBOL(exynos_drm_manager_ops_register);
63 60
64void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops 61void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
65 *overlay_ops) 62 *overlay_ops)
@@ -69,7 +66,6 @@ void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
69 if (overlay_ops) 66 if (overlay_ops)
70 hdmi_overlay_ops = overlay_ops; 67 hdmi_overlay_ops = overlay_ops;
71} 68}
72EXPORT_SYMBOL(exynos_drm_overlay_ops_register);
73 69
74static bool drm_hdmi_is_connected(struct device *dev) 70static bool drm_hdmi_is_connected(struct device *dev)
75{ 71{
@@ -277,7 +273,6 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
277 struct drm_hdmi_context *ctx; 273 struct drm_hdmi_context *ctx;
278 struct platform_device *pdev = to_platform_device(dev); 274 struct platform_device *pdev = to_platform_device(dev);
279 struct exynos_drm_common_hdmi_pd *pd; 275 struct exynos_drm_common_hdmi_pd *pd;
280 int ret;
281 276
282 DRM_DEBUG_KMS("%s\n", __FILE__); 277 DRM_DEBUG_KMS("%s\n", __FILE__);
283 278
@@ -298,26 +293,13 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
298 return -EFAULT; 293 return -EFAULT;
299 } 294 }
300 295
301 ret = platform_driver_register(&hdmi_driver);
302 if (ret) {
303 DRM_DEBUG_KMS("failed to register hdmi driver.\n");
304 return ret;
305 }
306
307 ret = platform_driver_register(&mixer_driver);
308 if (ret) {
309 DRM_DEBUG_KMS("failed to register mixer driver.\n");
310 goto err_hdmidrv;
311 }
312
313 ctx = get_ctx_from_subdrv(subdrv); 296 ctx = get_ctx_from_subdrv(subdrv);
314 297
315 ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *) 298 ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *)
316 to_context(pd->hdmi_dev); 299 to_context(pd->hdmi_dev);
317 if (!ctx->hdmi_ctx) { 300 if (!ctx->hdmi_ctx) {
318 DRM_DEBUG_KMS("hdmi context is null.\n"); 301 DRM_DEBUG_KMS("hdmi context is null.\n");
319 ret = -EFAULT; 302 return -EFAULT;
320 goto err_mixerdrv;
321 } 303 }
322 304
323 ctx->hdmi_ctx->drm_dev = drm_dev; 305 ctx->hdmi_ctx->drm_dev = drm_dev;
@@ -326,42 +308,12 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
326 to_context(pd->mixer_dev); 308 to_context(pd->mixer_dev);
327 if (!ctx->mixer_ctx) { 309 if (!ctx->mixer_ctx) {
328 DRM_DEBUG_KMS("mixer context is null.\n"); 310 DRM_DEBUG_KMS("mixer context is null.\n");
329 ret = -EFAULT; 311 return -EFAULT;
330 goto err_mixerdrv;
331 } 312 }
332 313
333 ctx->mixer_ctx->drm_dev = drm_dev; 314 ctx->mixer_ctx->drm_dev = drm_dev;
334 315
335 return 0; 316 return 0;
336
337err_mixerdrv:
338 platform_driver_unregister(&mixer_driver);
339err_hdmidrv:
340 platform_driver_unregister(&hdmi_driver);
341 return ret;
342}
343
344static void hdmi_subdrv_remove(struct drm_device *drm_dev)
345{
346 DRM_DEBUG_KMS("%s\n", __FILE__);
347
348 platform_driver_unregister(&hdmi_driver);
349 platform_driver_unregister(&mixer_driver);
350}
351
352static void exynos_drm_hdmi_late_probe(struct work_struct *work)
353{
354 struct drm_hdmi_context *ctx = container_of(work,
355 struct drm_hdmi_context, work);
356
357 /*
358 * this function calls subdrv->probe() so this must be called
359 * after probe context.
360 *
361 * PS. subdrv->probe() will call platform_driver_register() to probe
362 * hdmi and mixer driver.
363 */
364 exynos_drm_subdrv_register(&ctx->subdrv);
365} 317}
366 318
367static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev) 319static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
@@ -381,7 +333,6 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
381 subdrv = &ctx->subdrv; 333 subdrv = &ctx->subdrv;
382 334
383 subdrv->probe = hdmi_subdrv_probe; 335 subdrv->probe = hdmi_subdrv_probe;
384 subdrv->remove = hdmi_subdrv_remove;
385 subdrv->manager.pipe = -1; 336 subdrv->manager.pipe = -1;
386 subdrv->manager.ops = &drm_hdmi_manager_ops; 337 subdrv->manager.ops = &drm_hdmi_manager_ops;
387 subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops; 338 subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops;
@@ -390,9 +341,7 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
390 341
391 platform_set_drvdata(pdev, subdrv); 342 platform_set_drvdata(pdev, subdrv);
392 343
393 INIT_WORK(&ctx->work, exynos_drm_hdmi_late_probe); 344 exynos_drm_subdrv_register(subdrv);
394
395 schedule_work(&ctx->work);
396 345
397 return 0; 346 return 0;
398} 347}
@@ -428,7 +377,7 @@ static int __devexit exynos_drm_hdmi_remove(struct platform_device *pdev)
428 return 0; 377 return 0;
429} 378}
430 379
431static struct platform_driver exynos_drm_common_hdmi_driver = { 380struct platform_driver exynos_drm_common_hdmi_driver = {
432 .probe = exynos_drm_hdmi_probe, 381 .probe = exynos_drm_hdmi_probe,
433 .remove = __devexit_p(exynos_drm_hdmi_remove), 382 .remove = __devexit_p(exynos_drm_hdmi_remove),
434 .driver = { 383 .driver = {
@@ -437,31 +386,3 @@ static struct platform_driver exynos_drm_common_hdmi_driver = {
437 .pm = &hdmi_pm_ops, 386 .pm = &hdmi_pm_ops,
438 }, 387 },
439}; 388};
440
441static int __init exynos_drm_hdmi_init(void)
442{
443 int ret;
444
445 DRM_DEBUG_KMS("%s\n", __FILE__);
446
447 ret = platform_driver_register(&exynos_drm_common_hdmi_driver);
448 if (ret) {
449 DRM_DEBUG_KMS("failed to register hdmi common driver.\n");
450 return ret;
451 }
452
453 return ret;
454}
455
456static void __exit exynos_drm_hdmi_exit(void)
457{
458 platform_driver_unregister(&exynos_drm_common_hdmi_driver);
459}
460
461module_init(exynos_drm_hdmi_init);
462module_exit(exynos_drm_hdmi_exit);
463
464MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
465MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
466MODULE_DESCRIPTION("Samsung SoC DRM HDMI Driver");
467MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 6fe1e8993c92..3fe5b2e72f1e 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1998,14 +1998,12 @@ void hdmi_attach_ddc_client(struct i2c_client *ddc)
1998 if (ddc) 1998 if (ddc)
1999 hdmi_ddc = ddc; 1999 hdmi_ddc = ddc;
2000} 2000}
2001EXPORT_SYMBOL(hdmi_attach_ddc_client);
2002 2001
2003void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy) 2002void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)
2004{ 2003{
2005 if (hdmiphy) 2004 if (hdmiphy)
2006 hdmi_hdmiphy = hdmiphy; 2005 hdmi_hdmiphy = hdmiphy;
2007} 2006}
2008EXPORT_SYMBOL(hdmi_attach_hdmiphy_client);
2009 2007
2010static int __devinit hdmi_probe(struct platform_device *pdev) 2008static int __devinit hdmi_probe(struct platform_device *pdev)
2011{ 2009{
@@ -2188,10 +2186,3 @@ struct platform_driver hdmi_driver = {
2188 .pm = &hdmi_pm_ops, 2186 .pm = &hdmi_pm_ops,
2189 }, 2187 },
2190}; 2188};
2191EXPORT_SYMBOL(hdmi_driver);
2192
2193MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
2194MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
2195MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
2196MODULE_DESCRIPTION("Samsung DRM HDMI core Driver");
2197MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 45cbe3f38225..f42c43741b6d 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1113,10 +1113,3 @@ struct platform_driver mixer_driver = {
1113 .probe = mixer_probe, 1113 .probe = mixer_probe,
1114 .remove = __devexit_p(mixer_remove), 1114 .remove = __devexit_p(mixer_remove),
1115}; 1115};
1116EXPORT_SYMBOL(mixer_driver);
1117
1118MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
1119MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
1120MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
1121MODULE_DESCRIPTION("Samsung DRM HDMI mixer Driver");
1122MODULE_LICENSE("GPL");