OMAPDSS: split overlay manager creation

Split the function that creates overlay manager structs into two: one
that creates just the structs, and one that creates the sysfs files for
the manager.

This will help us use the overlay manager structs with omapdrm in the
following patches, while still leaving the sysfs files out.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Tomi Valkeinen 2013-05-14 10:53:21 +03:00
parent be8e8e1c62
commit 7f7cdbd688
4 changed files with 34 additions and 12 deletions

View File

@ -1577,7 +1577,8 @@ int omapdss_compat_init(void)
apply_init_priv();
dss_init_overlay_managers(pdev);
dss_init_overlay_managers();
dss_init_overlay_managers_sysfs(pdev);
dss_init_overlays(pdev);
for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) {
@ -1640,7 +1641,8 @@ int omapdss_compat_init(void)
dss_uninstall_mgr_ops();
err_mgr_ops:
dss_uninit_overlay_managers(pdev);
dss_uninit_overlay_managers_sysfs(pdev);
dss_uninit_overlay_managers();
dss_uninit_overlays(pdev);
compat_refcnt--;
@ -1668,7 +1670,8 @@ void omapdss_compat_uninit(void)
dss_uninstall_mgr_ops();
dss_uninit_overlay_managers(pdev);
dss_uninit_overlay_managers_sysfs(pdev);
dss_uninit_overlay_managers();
dss_uninit_overlays(pdev);
out:
mutex_unlock(&compat_init_lock);

View File

@ -194,8 +194,10 @@ void display_uninit_sysfs(struct platform_device *pdev,
struct omap_dss_device *dssdev);
/* manager */
int dss_init_overlay_managers(struct platform_device *pdev);
void dss_uninit_overlay_managers(struct platform_device *pdev);
int dss_init_overlay_managers(void);
void dss_uninit_overlay_managers(void);
int dss_init_overlay_managers_sysfs(struct platform_device *pdev);
void dss_uninit_overlay_managers_sysfs(struct platform_device *pdev);
int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
const struct omap_overlay_manager_info *info);
int dss_mgr_check_timings(struct omap_overlay_manager *mgr,

View File

@ -511,4 +511,6 @@ void dss_manager_kobj_uninit(struct omap_overlay_manager *mgr)
{
kobject_del(&mgr->kobj);
kobject_put(&mgr->kobj);
memset(&mgr->kobj, 0, sizeof(mgr->kobj));
}

View File

@ -36,9 +36,9 @@
static int num_managers;
static struct omap_overlay_manager *managers;
int dss_init_overlay_managers(struct platform_device *pdev)
int dss_init_overlay_managers(void)
{
int i, r;
int i;
num_managers = dss_feat_get_num_mgrs();
@ -76,6 +76,17 @@ int dss_init_overlay_managers(struct platform_device *pdev)
dss_feat_get_supported_outputs(mgr->id);
INIT_LIST_HEAD(&mgr->overlays);
}
return 0;
}
int dss_init_overlay_managers_sysfs(struct platform_device *pdev)
{
int i, r;
for (i = 0; i < num_managers; ++i) {
struct omap_overlay_manager *mgr = &managers[i];
r = dss_manager_kobj_init(mgr, pdev);
if (r)
@ -85,18 +96,22 @@ int dss_init_overlay_managers(struct platform_device *pdev)
return 0;
}
void dss_uninit_overlay_managers(struct platform_device *pdev)
void dss_uninit_overlay_managers(void)
{
kfree(managers);
managers = NULL;
num_managers = 0;
}
void dss_uninit_overlay_managers_sysfs(struct platform_device *pdev)
{
int i;
for (i = 0; i < num_managers; ++i) {
struct omap_overlay_manager *mgr = &managers[i];
dss_manager_kobj_uninit(mgr);
}
kfree(managers);
managers = NULL;
num_managers = 0;
}
int omap_dss_get_num_overlay_managers(void)