diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-10 10:26:45 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-07 17:05:53 +0200 |
commit | 8dd2491a4216778a81668581041ba1c06453ed6c (patch) | |
tree | 9f33e6a52bb4b7adc781de3763e6c87304c25a4f /drivers/video/omap2/dss/apply.c | |
parent | 6b6f1edfdb6c41e630e4a70d64a8e8817b3170c2 (diff) | |
download | op-kernel-dev-8dd2491a4216778a81668581041ba1c06453ed6c.zip op-kernel-dev-8dd2491a4216778a81668581041ba1c06453ed6c.tar.gz |
OMAPDSS: add omapdss_compat_init()
Add two new exported functions, omapdss_compat_init and
omapdss_compat_uninit, which are to be used by omapfb, omap_vout to
enable compatibility mode for omapdss. The functions are called by
omapdss internally for now, and moved to other drivers later.
The compatibility mode is implemented fully in the following patches.
For now, enabling compat mode only sets up the private data in apply.c.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/apply.c')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 4a5cc5c..ba13432 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -18,6 +18,7 @@ #define DSS_SUBSYS_NAME "APPLY" #include <linux/kernel.h> +#include <linux/module.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/jiffies.h> @@ -131,7 +132,7 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr) return &dss_data.mgr_priv_data_array[mgr->id]; } -void dss_apply_init(void) +static void apply_init_priv(void) { const int num_ovls = dss_feat_get_num_ovls(); struct mgr_priv_data *mp; @@ -1463,3 +1464,33 @@ err: return r; } +static int compat_refcnt; +static DEFINE_MUTEX(compat_init_lock); + +int omapdss_compat_init(void) +{ + mutex_lock(&compat_init_lock); + + if (compat_refcnt++ > 0) + goto out; + + apply_init_priv(); + +out: + mutex_unlock(&compat_init_lock); + + return 0; +} +EXPORT_SYMBOL(omapdss_compat_init); + +void omapdss_compat_uninit(void) +{ + mutex_lock(&compat_init_lock); + + if (--compat_refcnt > 0) + goto out; + +out: + mutex_unlock(&compat_init_lock); +} +EXPORT_SYMBOL(omapdss_compat_uninit); |