aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-10 03:26:45 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-07 10:05:53 -0500
commit8dd2491a4216778a81668581041ba1c06453ed6c (patch)
tree9f33e6a52bb4b7adc781de3763e6c87304c25a4f
parent6b6f1edfdb6c41e630e4a70d64a8e8817b3170c2 (diff)
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>
-rw-r--r--drivers/video/omap2/dss/apply.c33
-rw-r--r--drivers/video/omap2/dss/core.c4
-rw-r--r--drivers/video/omap2/dss/dss.h1
-rw-r--r--include/video/omapdss.h3
4 files changed, 38 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 4a5cc5c64d4b..ba1343274bb7 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -18,6 +18,7 @@
18#define DSS_SUBSYS_NAME "APPLY" 18#define DSS_SUBSYS_NAME "APPLY"
19 19
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/module.h>
21#include <linux/slab.h> 22#include <linux/slab.h>
22#include <linux/spinlock.h> 23#include <linux/spinlock.h>
23#include <linux/jiffies.h> 24#include <linux/jiffies.h>
@@ -131,7 +132,7 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)
131 return &dss_data.mgr_priv_data_array[mgr->id]; 132 return &dss_data.mgr_priv_data_array[mgr->id];
132} 133}
133 134
134void dss_apply_init(void) 135static void apply_init_priv(void)
135{ 136{
136 const int num_ovls = dss_feat_get_num_ovls(); 137 const int num_ovls = dss_feat_get_num_ovls();
137 struct mgr_priv_data *mp; 138 struct mgr_priv_data *mp;
@@ -1463,3 +1464,33 @@ err:
1463 return r; 1464 return r;
1464} 1465}
1465 1466
1467static int compat_refcnt;
1468static DEFINE_MUTEX(compat_init_lock);
1469
1470int omapdss_compat_init(void)
1471{
1472 mutex_lock(&compat_init_lock);
1473
1474 if (compat_refcnt++ > 0)
1475 goto out;
1476
1477 apply_init_priv();
1478
1479out:
1480 mutex_unlock(&compat_init_lock);
1481
1482 return 0;
1483}
1484EXPORT_SYMBOL(omapdss_compat_init);
1485
1486void omapdss_compat_uninit(void)
1487{
1488 mutex_lock(&compat_init_lock);
1489
1490 if (--compat_refcnt > 0)
1491 goto out;
1492
1493out:
1494 mutex_unlock(&compat_init_lock);
1495}
1496EXPORT_SYMBOL(omapdss_compat_uninit);
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 5c5e59190586..86c743f5ed2e 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -232,7 +232,7 @@ static int __init omap_dss_probe(struct platform_device *pdev)
232 232
233 dss_features_init(omapdss_get_version()); 233 dss_features_init(omapdss_get_version());
234 234
235 dss_apply_init(); 235 omapdss_compat_init();
236 236
237 dss_init_overlay_managers(pdev); 237 dss_init_overlay_managers(pdev);
238 dss_init_overlays(pdev); 238 dss_init_overlays(pdev);
@@ -264,6 +264,8 @@ static int omap_dss_remove(struct platform_device *pdev)
264 dss_uninit_overlays(pdev); 264 dss_uninit_overlays(pdev);
265 dss_uninit_overlay_managers(pdev); 265 dss_uninit_overlay_managers(pdev);
266 266
267 omapdss_compat_uninit();
268
267 return 0; 269 return 0;
268} 270}
269 271
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index bdf843135661..9da3d61b8a56 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -178,7 +178,6 @@ void dss_copy_device_pdata(struct omap_dss_device *dst,
178 const struct omap_dss_device *src); 178 const struct omap_dss_device *src);
179 179
180/* apply */ 180/* apply */
181void dss_apply_init(void);
182int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr); 181int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr);
183int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl); 182int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl);
184void dss_mgr_start_update(struct omap_overlay_manager *mgr); 183void dss_mgr_start_update(struct omap_overlay_manager *mgr);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index b1248c2d36e1..a9402362d817 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -836,4 +836,7 @@ void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev,
836void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev, 836void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev,
837 struct rfbi_timings *timings); 837 struct rfbi_timings *timings);
838 838
839int omapdss_compat_init(void);
840void omapdss_compat_uninit(void);
841
839#endif 842#endif