aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-23 06:45:07 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-07 10:05:54 -0500
commit6abae7a18a8c9dbec96915eb924dc06288a47b02 (patch)
tree763f5cf9b3c75af99df86f8501092d43d590a82e /drivers/video/omap2
parent0c49ff747a4656e24b8990764f5ee4cd047ee982 (diff)
OMAPDSS: move ovl function setup to apply.c
Most of the functions that are assigned to the fields in ovl struct are in apply.c. By moving the function pointer setup into apply.c we can make these functions static. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/apply.c37
-rw-r--r--drivers/video/omap2/dss/dss.h12
-rw-r--r--drivers/video/omap2/dss/overlay.c17
3 files changed, 29 insertions, 37 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 98cebe30318a..038876a68d1a 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -416,6 +416,13 @@ static void wait_pending_extra_info_updates(void)
416 DSSWARN("timeout in wait_pending_extra_info_updates\n"); 416 DSSWARN("timeout in wait_pending_extra_info_updates\n");
417} 417}
418 418
419static inline struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl)
420{
421 return ovl->manager ?
422 (ovl->manager->output ? ovl->manager->output->device : NULL) :
423 NULL;
424}
425
419static inline struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr) 426static inline struct omap_dss_device *dss_mgr_get_device(struct omap_overlay_manager *mgr)
420{ 427{
421 return mgr->output ? mgr->output->device : NULL; 428 return mgr->output ? mgr->output->device : NULL;
@@ -516,7 +523,7 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
516 return r; 523 return r;
517} 524}
518 525
519int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) 526static int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
520{ 527{
521 unsigned long timeout = msecs_to_jiffies(500); 528 unsigned long timeout = msecs_to_jiffies(500);
522 struct ovl_priv_data *op; 529 struct ovl_priv_data *op;
@@ -1248,7 +1255,7 @@ out:
1248 spin_unlock_irqrestore(&data_lock, flags); 1255 spin_unlock_irqrestore(&data_lock, flags);
1249} 1256}
1250 1257
1251int dss_ovl_set_info(struct omap_overlay *ovl, 1258static int dss_ovl_set_info(struct omap_overlay *ovl,
1252 struct omap_overlay_info *info) 1259 struct omap_overlay_info *info)
1253{ 1260{
1254 struct ovl_priv_data *op = get_ovl_priv(ovl); 1261 struct ovl_priv_data *op = get_ovl_priv(ovl);
@@ -1269,7 +1276,7 @@ int dss_ovl_set_info(struct omap_overlay *ovl,
1269 return 0; 1276 return 0;
1270} 1277}
1271 1278
1272void dss_ovl_get_info(struct omap_overlay *ovl, 1279static void dss_ovl_get_info(struct omap_overlay *ovl,
1273 struct omap_overlay_info *info) 1280 struct omap_overlay_info *info)
1274{ 1281{
1275 struct ovl_priv_data *op = get_ovl_priv(ovl); 1282 struct ovl_priv_data *op = get_ovl_priv(ovl);
@@ -1282,7 +1289,7 @@ void dss_ovl_get_info(struct omap_overlay *ovl,
1282 spin_unlock_irqrestore(&data_lock, flags); 1289 spin_unlock_irqrestore(&data_lock, flags);
1283} 1290}
1284 1291
1285int dss_ovl_set_manager(struct omap_overlay *ovl, 1292static int dss_ovl_set_manager(struct omap_overlay *ovl,
1286 struct omap_overlay_manager *mgr) 1293 struct omap_overlay_manager *mgr)
1287{ 1294{
1288 struct ovl_priv_data *op = get_ovl_priv(ovl); 1295 struct ovl_priv_data *op = get_ovl_priv(ovl);
@@ -1334,7 +1341,7 @@ err:
1334 return r; 1341 return r;
1335} 1342}
1336 1343
1337int dss_ovl_unset_manager(struct omap_overlay *ovl) 1344static int dss_ovl_unset_manager(struct omap_overlay *ovl)
1338{ 1345{
1339 struct ovl_priv_data *op = get_ovl_priv(ovl); 1346 struct ovl_priv_data *op = get_ovl_priv(ovl);
1340 unsigned long flags; 1347 unsigned long flags;
@@ -1394,7 +1401,7 @@ err:
1394 return r; 1401 return r;
1395} 1402}
1396 1403
1397bool dss_ovl_is_enabled(struct omap_overlay *ovl) 1404static bool dss_ovl_is_enabled(struct omap_overlay *ovl)
1398{ 1405{
1399 struct ovl_priv_data *op = get_ovl_priv(ovl); 1406 struct ovl_priv_data *op = get_ovl_priv(ovl);
1400 unsigned long flags; 1407 unsigned long flags;
@@ -1409,7 +1416,7 @@ bool dss_ovl_is_enabled(struct omap_overlay *ovl)
1409 return e; 1416 return e;
1410} 1417}
1411 1418
1412int dss_ovl_enable(struct omap_overlay *ovl) 1419static int dss_ovl_enable(struct omap_overlay *ovl)
1413{ 1420{
1414 struct ovl_priv_data *op = get_ovl_priv(ovl); 1421 struct ovl_priv_data *op = get_ovl_priv(ovl);
1415 unsigned long flags; 1422 unsigned long flags;
@@ -1459,7 +1466,7 @@ err1:
1459 return r; 1466 return r;
1460} 1467}
1461 1468
1462int dss_ovl_disable(struct omap_overlay *ovl) 1469static int dss_ovl_disable(struct omap_overlay *ovl)
1463{ 1470{
1464 struct ovl_priv_data *op = get_ovl_priv(ovl); 1471 struct ovl_priv_data *op = get_ovl_priv(ovl);
1465 unsigned long flags; 1472 unsigned long flags;
@@ -1527,6 +1534,20 @@ int omapdss_compat_init(void)
1527 mgr->get_device = &dss_mgr_get_device; 1534 mgr->get_device = &dss_mgr_get_device;
1528 } 1535 }
1529 1536
1537 for (i = 0; i < omap_dss_get_num_overlays(); i++) {
1538 struct omap_overlay *ovl = omap_dss_get_overlay(i);
1539
1540 ovl->is_enabled = &dss_ovl_is_enabled;
1541 ovl->enable = &dss_ovl_enable;
1542 ovl->disable = &dss_ovl_disable;
1543 ovl->set_manager = &dss_ovl_set_manager;
1544 ovl->unset_manager = &dss_ovl_unset_manager;
1545 ovl->set_overlay_info = &dss_ovl_set_info;
1546 ovl->get_overlay_info = &dss_ovl_get_info;
1547 ovl->wait_for_go = &dss_mgr_wait_for_go_ovl;
1548 ovl->get_device = &dss_ovl_get_device;
1549 }
1550
1530out: 1551out:
1531 mutex_unlock(&compat_init_lock); 1552 mutex_unlock(&compat_init_lock);
1532 1553
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 9e093bc81b5f..9ce798645b2d 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 */
181int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl);
182void dss_mgr_start_update(struct omap_overlay_manager *mgr); 181void dss_mgr_start_update(struct omap_overlay_manager *mgr);
183int dss_mgr_enable(struct omap_overlay_manager *mgr); 182int dss_mgr_enable(struct omap_overlay_manager *mgr);
184void dss_mgr_disable(struct omap_overlay_manager *mgr); 183void dss_mgr_disable(struct omap_overlay_manager *mgr);
@@ -187,17 +186,6 @@ void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
187void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, 186void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
188 const struct dss_lcd_mgr_config *config); 187 const struct dss_lcd_mgr_config *config);
189 188
190bool dss_ovl_is_enabled(struct omap_overlay *ovl);
191int dss_ovl_enable(struct omap_overlay *ovl);
192int dss_ovl_disable(struct omap_overlay *ovl);
193int dss_ovl_set_info(struct omap_overlay *ovl,
194 struct omap_overlay_info *info);
195void dss_ovl_get_info(struct omap_overlay *ovl,
196 struct omap_overlay_info *info);
197int dss_ovl_set_manager(struct omap_overlay *ovl,
198 struct omap_overlay_manager *mgr);
199int dss_ovl_unset_manager(struct omap_overlay *ovl);
200
201/* output */ 189/* output */
202void dss_register_output(struct omap_dss_output *out); 190void dss_register_output(struct omap_dss_output *out);
203void dss_unregister_output(struct omap_dss_output *out); 191void dss_unregister_output(struct omap_dss_output *out);
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 45f4994bc6b0..eccde322c28a 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -38,13 +38,6 @@
38static int num_overlays; 38static int num_overlays;
39static struct omap_overlay *overlays; 39static struct omap_overlay *overlays;
40 40
41static inline struct omap_dss_device *dss_ovl_get_device(struct omap_overlay *ovl)
42{
43 return ovl->manager ?
44 (ovl->manager->output ? ovl->manager->output->device : NULL) :
45 NULL;
46}
47
48int omap_dss_get_num_overlays(void) 41int omap_dss_get_num_overlays(void)
49{ 42{
50 return num_overlays; 43 return num_overlays;
@@ -93,16 +86,6 @@ void dss_init_overlays(struct platform_device *pdev)
93 break; 86 break;
94 } 87 }
95 88
96 ovl->is_enabled = &dss_ovl_is_enabled;
97 ovl->enable = &dss_ovl_enable;
98 ovl->disable = &dss_ovl_disable;
99 ovl->set_manager = &dss_ovl_set_manager;
100 ovl->unset_manager = &dss_ovl_unset_manager;
101 ovl->set_overlay_info = &dss_ovl_set_info;
102 ovl->get_overlay_info = &dss_ovl_get_info;
103 ovl->wait_for_go = &dss_mgr_wait_for_go_ovl;
104 ovl->get_device = &dss_ovl_get_device;
105
106 ovl->caps = dss_feat_get_overlay_caps(ovl->id); 89 ovl->caps = dss_feat_get_overlay_caps(ovl->id);
107 ovl->supported_modes = 90 ovl->supported_modes =
108 dss_feat_get_supported_color_modes(ovl->id); 91 dss_feat_get_supported_color_modes(ovl->id);