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>
This commit is contained in:
Joonyoung Shim 2012-03-16 18:47:08 +09:00 коммит произвёл Dave Airlie
Родитель 3ab09435d5
Коммит 132a5b915f
16 изменённых файлов: 77 добавлений и 355 удалений

Просмотреть файл

@ -1,7 +1,6 @@
config DRM_EXYNOS config DRM_EXYNOS
tristate "DRM Support for Samsung SoC EXYNOS Series" tristate "DRM Support for Samsung SoC EXYNOS Series"
depends on DRM && PLAT_SAMSUNG depends on DRM && PLAT_SAMSUNG
default n
select DRM_KMS_HELPER select DRM_KMS_HELPER
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
@ -12,16 +11,13 @@ config DRM_EXYNOS
If M is selected the module will be called exynosdrm. If M is selected the module will be called exynosdrm.
config DRM_EXYNOS_FIMD config DRM_EXYNOS_FIMD
tristate "Exynos DRM FIMD" bool "Exynos DRM FIMD"
depends on DRM_EXYNOS && !FB_S3C depends on DRM_EXYNOS && !FB_S3C
default n
help help
Choose this option if you want to use Exynos FIMD for DRM. Choose this option if you want to use Exynos FIMD for DRM.
If M is selected, the module will be called exynos_drm_fimd
config DRM_EXYNOS_HDMI config DRM_EXYNOS_HDMI
tristate "Exynos DRM HDMI" bool "Exynos DRM HDMI"
depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
help help
Choose this option if you want to use Exynos HDMI for DRM. Choose this option if you want to use Exynos HDMI for DRM.
If M is selected, the module will be called exynos_drm_hdmi

Просмотреть файл

@ -8,7 +8,9 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o exynos_drm_connector.o \
exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \ exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \
exynos_drm_plane.o exynos_drm_plane.o
obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o
obj-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o \
obj-$(CONFIG_DRM_EXYNOS_HDMI) += exynos_hdmi.o exynos_mixer.o exynos_ddc.o \ exynos_ddc.o exynos_hdmiphy.o \
exynos_hdmiphy.o exynos_drm_hdmi.o exynos_drm_hdmi.o
obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o

Просмотреть файл

@ -55,4 +55,3 @@ struct i2c_driver ddc_driver = {
.remove = __devexit_p(s5p_ddc_remove), .remove = __devexit_p(s5p_ddc_remove),
.command = NULL, .command = NULL,
}; };
EXPORT_SYMBOL(ddc_driver);

Просмотреть файл

@ -348,9 +348,3 @@ err_connector:
kfree(exynos_connector); kfree(exynos_connector);
return NULL; return NULL;
} }
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM Connector Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -32,7 +32,6 @@
#include "exynos_drm_connector.h" #include "exynos_drm_connector.h"
#include "exynos_drm_fbdev.h" #include "exynos_drm_fbdev.h"
static DEFINE_MUTEX(exynos_drm_mutex);
static LIST_HEAD(exynos_drm_subdrv_list); static LIST_HEAD(exynos_drm_subdrv_list);
static struct drm_device *drm_dev; static struct drm_device *drm_dev;
@ -116,13 +115,10 @@ int exynos_drm_device_register(struct drm_device *dev)
if (!dev) if (!dev)
return -EINVAL; return -EINVAL;
if (drm_dev) { drm_dev = dev;
DRM_ERROR("Already drm device were registered\n");
return -EBUSY;
}
mutex_lock(&exynos_drm_mutex);
list_for_each_entry_safe(subdrv, n, &exynos_drm_subdrv_list, list) { list_for_each_entry_safe(subdrv, n, &exynos_drm_subdrv_list, list) {
subdrv->drm_dev = dev;
err = exynos_drm_subdrv_probe(dev, subdrv); err = exynos_drm_subdrv_probe(dev, subdrv);
if (err) { if (err) {
DRM_DEBUG("exynos drm subdrv probe failed.\n"); DRM_DEBUG("exynos drm subdrv probe failed.\n");
@ -130,9 +126,6 @@ int exynos_drm_device_register(struct drm_device *dev)
} }
} }
drm_dev = dev;
mutex_unlock(&exynos_drm_mutex);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(exynos_drm_device_register); EXPORT_SYMBOL_GPL(exynos_drm_device_register);
@ -143,86 +136,28 @@ int exynos_drm_device_unregister(struct drm_device *dev)
DRM_DEBUG_DRIVER("%s\n", __FILE__); DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!dev || dev != drm_dev) { if (!dev) {
WARN(1, "Unexpected drm device unregister!\n"); WARN(1, "Unexpected drm device unregister!\n");
return -EINVAL; return -EINVAL;
} }
mutex_lock(&exynos_drm_mutex);
list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list) list_for_each_entry(subdrv, &exynos_drm_subdrv_list, list)
exynos_drm_subdrv_remove(dev, subdrv); exynos_drm_subdrv_remove(dev, subdrv);
drm_dev = NULL; drm_dev = NULL;
mutex_unlock(&exynos_drm_mutex);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(exynos_drm_device_unregister); EXPORT_SYMBOL_GPL(exynos_drm_device_unregister);
static int exynos_drm_mode_group_reinit(struct drm_device *dev)
{
struct drm_mode_group *group = &dev->primary->mode_group;
uint32_t *id_list = group->id_list;
int ret;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
ret = drm_mode_group_init_legacy_group(dev, group);
if (ret < 0)
return ret;
kfree(id_list);
return 0;
}
int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
{ {
int err;
DRM_DEBUG_DRIVER("%s\n", __FILE__); DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!subdrv) if (!subdrv)
return -EINVAL; return -EINVAL;
mutex_lock(&exynos_drm_mutex);
if (drm_dev) {
err = exynos_drm_subdrv_probe(drm_dev, subdrv);
if (err) {
DRM_ERROR("failed to probe exynos drm subdrv\n");
mutex_unlock(&exynos_drm_mutex);
return err;
}
/* setup possible_clones. */
exynos_drm_encoder_setup(drm_dev);
/*
* if any specific driver such as fimd or hdmi driver called
* exynos_drm_subdrv_register() later than drm_load(),
* the fb helper should be re-initialized and re-configured.
*/
err = exynos_drm_fbdev_reinit(drm_dev);
if (err) {
DRM_ERROR("failed to reinitialize exynos drm fbdev\n");
exynos_drm_subdrv_remove(drm_dev, subdrv);
mutex_unlock(&exynos_drm_mutex);
return err;
}
err = exynos_drm_mode_group_reinit(drm_dev);
if (err) {
DRM_ERROR("failed to reinitialize mode group\n");
exynos_drm_fbdev_fini(drm_dev);
exynos_drm_subdrv_remove(drm_dev, subdrv);
mutex_unlock(&exynos_drm_mutex);
return err;
}
}
subdrv->drm_dev = drm_dev;
list_add_tail(&subdrv->list, &exynos_drm_subdrv_list); list_add_tail(&subdrv->list, &exynos_drm_subdrv_list);
mutex_unlock(&exynos_drm_mutex);
return 0; return 0;
} }
@ -230,46 +165,13 @@ EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register);
int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv) int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)
{ {
int ret = -EFAULT;
DRM_DEBUG_DRIVER("%s\n", __FILE__); DRM_DEBUG_DRIVER("%s\n", __FILE__);
if (!subdrv) { if (!subdrv)
DRM_DEBUG("Unexpected exynos drm subdrv unregister!\n"); return -EINVAL;
return ret;
}
mutex_lock(&exynos_drm_mutex); list_del(&subdrv->list);
if (drm_dev) {
exynos_drm_subdrv_remove(drm_dev, subdrv);
list_del(&subdrv->list);
/* return 0;
* fb helper should be updated once a sub driver is released
* to re-configure crtc and connector and also to re-setup
* drm framebuffer.
*/
ret = exynos_drm_fbdev_reinit(drm_dev);
if (ret < 0) {
DRM_ERROR("failed fb helper reinit.\n");
goto fail;
}
ret = exynos_drm_mode_group_reinit(drm_dev);
if (ret < 0) {
DRM_ERROR("failed drm mode group reinit.\n");
goto fail;
}
}
fail:
mutex_unlock(&exynos_drm_mutex);
return ret;
} }
EXPORT_SYMBOL_GPL(exynos_drm_subdrv_unregister); EXPORT_SYMBOL_GPL(exynos_drm_subdrv_unregister);
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM Core Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -430,9 +430,3 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
exynos_drm_fn_encoder(private->crtc[crtc], &crtc, exynos_drm_fn_encoder(private->crtc[crtc], &crtc,
exynos_drm_disable_vblank); exynos_drm_disable_vblank);
} }
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM CRTC Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -266,9 +266,49 @@ static struct platform_driver exynos_drm_platform_driver = {
static int __init exynos_drm_init(void) static int __init exynos_drm_init(void)
{ {
int ret;
DRM_DEBUG_DRIVER("%s\n", __FILE__); DRM_DEBUG_DRIVER("%s\n", __FILE__);
return platform_driver_register(&exynos_drm_platform_driver); #ifdef CONFIG_DRM_EXYNOS_FIMD
ret = platform_driver_register(&fimd_driver);
if (ret < 0)
goto out_fimd;
#endif
#ifdef CONFIG_DRM_EXYNOS_HDMI
ret = platform_driver_register(&hdmi_driver);
if (ret < 0)
goto out_hdmi;
ret = platform_driver_register(&mixer_driver);
if (ret < 0)
goto out_mixer;
ret = platform_driver_register(&exynos_drm_common_hdmi_driver);
if (ret < 0)
goto out_common_hdmi;
#endif
ret = platform_driver_register(&exynos_drm_platform_driver);
if (ret < 0)
goto out;
return 0;
out:
#ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
out_common_hdmi:
platform_driver_unregister(&mixer_driver);
out_mixer:
platform_driver_unregister(&hdmi_driver);
out_hdmi:
#endif
#ifdef CONFIG_DRM_EXYNOS_FIMD
platform_driver_unregister(&fimd_driver);
out_fimd:
#endif
return ret;
} }
static void __exit exynos_drm_exit(void) static void __exit exynos_drm_exit(void)
@ -276,6 +316,16 @@ static void __exit exynos_drm_exit(void)
DRM_DEBUG_DRIVER("%s\n", __FILE__); DRM_DEBUG_DRIVER("%s\n", __FILE__);
platform_driver_unregister(&exynos_drm_platform_driver); platform_driver_unregister(&exynos_drm_platform_driver);
#ifdef CONFIG_DRM_EXYNOS_HDMI
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
platform_driver_unregister(&mixer_driver);
platform_driver_unregister(&hdmi_driver);
#endif
#ifdef CONFIG_DRM_EXYNOS_FIMD
platform_driver_unregister(&fimd_driver);
#endif
} }
module_init(exynos_drm_init); module_init(exynos_drm_init);

Просмотреть файл

@ -262,15 +262,15 @@ int exynos_drm_device_unregister(struct drm_device *dev);
* this function would be called by sub drivers such as display controller * this function would be called by sub drivers such as display controller
* or hdmi driver to register this sub driver object to exynos drm driver * or hdmi driver to register this sub driver object to exynos drm driver
* and when a sub driver is registered to exynos drm driver a probe callback * and when a sub driver is registered to exynos drm driver a probe callback
* of the sub driver is called and creates its own encoder and connector * of the sub driver is called and creates its own encoder and connector.
* and then fb helper and drm mode group would be re-initialized.
*/ */
int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv); int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv);
/* /* this function removes subdrv list from exynos drm driver */
* this function removes subdrv list from exynos drm driver and fb helper
* and drm mode group would be re-initialized.
*/
int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *drm_subdrv); int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *drm_subdrv);
extern struct platform_driver fimd_driver;
extern struct platform_driver hdmi_driver;
extern struct platform_driver mixer_driver;
extern struct platform_driver exynos_drm_common_hdmi_driver;
#endif #endif

Просмотреть файл

@ -442,9 +442,3 @@ void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data)
if (overlay_ops && overlay_ops->disable) if (overlay_ops && overlay_ops->disable)
overlay_ops->disable(manager->dev, zpos); overlay_ops->disable(manager->dev, zpos);
} }
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM Encoder Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -211,9 +211,3 @@ void exynos_drm_mode_config_init(struct drm_device *dev)
dev->mode_config.funcs = &exynos_drm_mode_config_funcs; dev->mode_config.funcs = &exynos_drm_mode_config_funcs;
} }
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM FB Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -316,89 +316,3 @@ void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
drm_fb_helper_restore_fbdev_mode(private->fb_helper); drm_fb_helper_restore_fbdev_mode(private->fb_helper);
} }
int exynos_drm_fbdev_reinit(struct drm_device *dev)
{
struct exynos_drm_private *private = dev->dev_private;
struct drm_fb_helper *fb_helper;
int ret;
if (!private)
return -EINVAL;
/*
* if all sub drivers were unloaded then num_connector is 0
* so at this time, the framebuffers also should be destroyed.
*/
if (!dev->mode_config.num_connector) {
exynos_drm_fbdev_fini(dev);
return 0;
}
fb_helper = private->fb_helper;
if (fb_helper) {
struct list_head temp_list;
INIT_LIST_HEAD(&temp_list);
/*
* fb_helper is reintialized but kernel fb is reused
* so kernel_fb_list need to be backuped and restored
*/
if (!list_empty(&fb_helper->kernel_fb_list))
list_replace_init(&fb_helper->kernel_fb_list,
&temp_list);
drm_fb_helper_fini(fb_helper);
ret = drm_fb_helper_init(dev, fb_helper,
dev->mode_config.num_crtc, MAX_CONNECTOR);
if (ret < 0) {
DRM_ERROR("failed to initialize drm fb helper\n");
return ret;
}
if (!list_empty(&temp_list))
list_replace(&temp_list, &fb_helper->kernel_fb_list);
ret = drm_fb_helper_single_add_all_connectors(fb_helper);
if (ret < 0) {
DRM_ERROR("failed to add fb helper to connectors\n");
goto err;
}
ret = drm_fb_helper_initial_config(fb_helper, PREFERRED_BPP);
if (ret < 0) {
DRM_ERROR("failed to set up hw configuration.\n");
goto err;
}
} else {
/*
* if drm_load() failed whem drm load() was called prior
* to specific drivers, fb_helper must be NULL and so
* this fuction should be called again to re-initialize and
* re-configure the fb helper. it means that this function
* has been called by the specific drivers.
*/
ret = exynos_drm_fbdev_init(dev);
}
return ret;
err:
/*
* if drm_load() failed when drm load() was called prior
* to specific drivers, the fb_helper must be NULL and so check it.
*/
if (fb_helper)
drm_fb_helper_fini(fb_helper);
return ret;
}
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM FBDEV Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -1012,7 +1012,7 @@ static const struct dev_pm_ops fimd_pm_ops = {
SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL) SET_RUNTIME_PM_OPS(fimd_runtime_suspend, fimd_runtime_resume, NULL)
}; };
static struct platform_driver fimd_driver = { struct platform_driver fimd_driver = {
.probe = fimd_probe, .probe = fimd_probe,
.remove = __devexit_p(fimd_remove), .remove = __devexit_p(fimd_remove),
.driver = { .driver = {
@ -1021,21 +1021,3 @@ static struct platform_driver fimd_driver = {
.pm = &fimd_pm_ops, .pm = &fimd_pm_ops,
}, },
}; };
static int __init fimd_init(void)
{
return platform_driver_register(&fimd_driver);
}
static void __exit fimd_exit(void)
{
platform_driver_unregister(&fimd_driver);
}
module_init(fimd_init);
module_exit(fimd_exit);
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_DESCRIPTION("Samsung DRM FIMD Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -735,7 +735,3 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
return ret; return ret;
} }
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM GEM Module");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -38,7 +38,6 @@ struct drm_hdmi_context {
struct exynos_drm_subdrv subdrv; struct exynos_drm_subdrv subdrv;
struct exynos_drm_hdmi_context *hdmi_ctx; struct exynos_drm_hdmi_context *hdmi_ctx;
struct exynos_drm_hdmi_context *mixer_ctx; struct exynos_drm_hdmi_context *mixer_ctx;
struct work_struct work;
}; };
void exynos_drm_display_ops_register(struct exynos_hdmi_display_ops void 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
if (display_ops) if (display_ops)
hdmi_display_ops = display_ops; hdmi_display_ops = display_ops;
} }
EXPORT_SYMBOL(exynos_drm_display_ops_register);
void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
*manager_ops) *manager_ops)
@ -59,7 +57,6 @@ void exynos_drm_manager_ops_register(struct exynos_hdmi_manager_ops
if (manager_ops) if (manager_ops)
hdmi_manager_ops = manager_ops; hdmi_manager_ops = manager_ops;
} }
EXPORT_SYMBOL(exynos_drm_manager_ops_register);
void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
*overlay_ops) *overlay_ops)
@ -69,7 +66,6 @@ void exynos_drm_overlay_ops_register(struct exynos_hdmi_overlay_ops
if (overlay_ops) if (overlay_ops)
hdmi_overlay_ops = overlay_ops; hdmi_overlay_ops = overlay_ops;
} }
EXPORT_SYMBOL(exynos_drm_overlay_ops_register);
static bool drm_hdmi_is_connected(struct device *dev) static bool drm_hdmi_is_connected(struct device *dev)
{ {
@ -277,7 +273,6 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
struct drm_hdmi_context *ctx; struct drm_hdmi_context *ctx;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct exynos_drm_common_hdmi_pd *pd; struct exynos_drm_common_hdmi_pd *pd;
int ret;
DRM_DEBUG_KMS("%s\n", __FILE__); DRM_DEBUG_KMS("%s\n", __FILE__);
@ -298,26 +293,13 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
return -EFAULT; return -EFAULT;
} }
ret = platform_driver_register(&hdmi_driver);
if (ret) {
DRM_DEBUG_KMS("failed to register hdmi driver.\n");
return ret;
}
ret = platform_driver_register(&mixer_driver);
if (ret) {
DRM_DEBUG_KMS("failed to register mixer driver.\n");
goto err_hdmidrv;
}
ctx = get_ctx_from_subdrv(subdrv); ctx = get_ctx_from_subdrv(subdrv);
ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *) ctx->hdmi_ctx = (struct exynos_drm_hdmi_context *)
to_context(pd->hdmi_dev); to_context(pd->hdmi_dev);
if (!ctx->hdmi_ctx) { if (!ctx->hdmi_ctx) {
DRM_DEBUG_KMS("hdmi context is null.\n"); DRM_DEBUG_KMS("hdmi context is null.\n");
ret = -EFAULT; return -EFAULT;
goto err_mixerdrv;
} }
ctx->hdmi_ctx->drm_dev = drm_dev; ctx->hdmi_ctx->drm_dev = drm_dev;
@ -326,42 +308,12 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
to_context(pd->mixer_dev); to_context(pd->mixer_dev);
if (!ctx->mixer_ctx) { if (!ctx->mixer_ctx) {
DRM_DEBUG_KMS("mixer context is null.\n"); DRM_DEBUG_KMS("mixer context is null.\n");
ret = -EFAULT; return -EFAULT;
goto err_mixerdrv;
} }
ctx->mixer_ctx->drm_dev = drm_dev; ctx->mixer_ctx->drm_dev = drm_dev;
return 0; return 0;
err_mixerdrv:
platform_driver_unregister(&mixer_driver);
err_hdmidrv:
platform_driver_unregister(&hdmi_driver);
return ret;
}
static void hdmi_subdrv_remove(struct drm_device *drm_dev)
{
DRM_DEBUG_KMS("%s\n", __FILE__);
platform_driver_unregister(&hdmi_driver);
platform_driver_unregister(&mixer_driver);
}
static void exynos_drm_hdmi_late_probe(struct work_struct *work)
{
struct drm_hdmi_context *ctx = container_of(work,
struct drm_hdmi_context, work);
/*
* this function calls subdrv->probe() so this must be called
* after probe context.
*
* PS. subdrv->probe() will call platform_driver_register() to probe
* hdmi and mixer driver.
*/
exynos_drm_subdrv_register(&ctx->subdrv);
} }
static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev) static 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)
subdrv = &ctx->subdrv; subdrv = &ctx->subdrv;
subdrv->probe = hdmi_subdrv_probe; subdrv->probe = hdmi_subdrv_probe;
subdrv->remove = hdmi_subdrv_remove;
subdrv->manager.pipe = -1; subdrv->manager.pipe = -1;
subdrv->manager.ops = &drm_hdmi_manager_ops; subdrv->manager.ops = &drm_hdmi_manager_ops;
subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops; subdrv->manager.overlay_ops = &drm_hdmi_overlay_ops;
@ -390,9 +341,7 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, subdrv); platform_set_drvdata(pdev, subdrv);
INIT_WORK(&ctx->work, exynos_drm_hdmi_late_probe); exynos_drm_subdrv_register(subdrv);
schedule_work(&ctx->work);
return 0; return 0;
} }
@ -428,7 +377,7 @@ static int __devexit exynos_drm_hdmi_remove(struct platform_device *pdev)
return 0; return 0;
} }
static struct platform_driver exynos_drm_common_hdmi_driver = { struct platform_driver exynos_drm_common_hdmi_driver = {
.probe = exynos_drm_hdmi_probe, .probe = exynos_drm_hdmi_probe,
.remove = __devexit_p(exynos_drm_hdmi_remove), .remove = __devexit_p(exynos_drm_hdmi_remove),
.driver = { .driver = {
@ -437,31 +386,3 @@ static struct platform_driver exynos_drm_common_hdmi_driver = {
.pm = &hdmi_pm_ops, .pm = &hdmi_pm_ops,
}, },
}; };
static int __init exynos_drm_hdmi_init(void)
{
int ret;
DRM_DEBUG_KMS("%s\n", __FILE__);
ret = platform_driver_register(&exynos_drm_common_hdmi_driver);
if (ret) {
DRM_DEBUG_KMS("failed to register hdmi common driver.\n");
return ret;
}
return ret;
}
static void __exit exynos_drm_hdmi_exit(void)
{
platform_driver_unregister(&exynos_drm_common_hdmi_driver);
}
module_init(exynos_drm_hdmi_init);
module_exit(exynos_drm_hdmi_exit);
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
MODULE_DESCRIPTION("Samsung SoC DRM HDMI Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -1998,14 +1998,12 @@ void hdmi_attach_ddc_client(struct i2c_client *ddc)
if (ddc) if (ddc)
hdmi_ddc = ddc; hdmi_ddc = ddc;
} }
EXPORT_SYMBOL(hdmi_attach_ddc_client);
void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy) void hdmi_attach_hdmiphy_client(struct i2c_client *hdmiphy)
{ {
if (hdmiphy) if (hdmiphy)
hdmi_hdmiphy = hdmiphy; hdmi_hdmiphy = hdmiphy;
} }
EXPORT_SYMBOL(hdmi_attach_hdmiphy_client);
static int __devinit hdmi_probe(struct platform_device *pdev) static int __devinit hdmi_probe(struct platform_device *pdev)
{ {
@ -2188,10 +2186,3 @@ struct platform_driver hdmi_driver = {
.pm = &hdmi_pm_ops, .pm = &hdmi_pm_ops,
}, },
}; };
EXPORT_SYMBOL(hdmi_driver);
MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_DESCRIPTION("Samsung DRM HDMI core Driver");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -1113,10 +1113,3 @@ struct platform_driver mixer_driver = {
.probe = mixer_probe, .probe = mixer_probe,
.remove = __devexit_p(mixer_remove), .remove = __devexit_p(mixer_remove),
}; };
EXPORT_SYMBOL(mixer_driver);
MODULE_AUTHOR("Seung-Woo Kim, <sw0312.kim@samsung.com>");
MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
MODULE_DESCRIPTION("Samsung DRM HDMI mixer Driver");
MODULE_LICENSE("GPL");