diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 36 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 13 | ||||
-rw-r--r-- | drivers/video/omap2/dss/output.c | 44 |
3 files changed, 87 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 038876a68d1..70eaa8f70e9 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -781,7 +781,7 @@ static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr) | |||
781 | } | 781 | } |
782 | } | 782 | } |
783 | 783 | ||
784 | void dss_mgr_start_update(struct omap_overlay_manager *mgr) | 784 | static void dss_mgr_start_update_compat(struct omap_overlay_manager *mgr) |
785 | { | 785 | { |
786 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | 786 | struct mgr_priv_data *mp = get_mgr_priv(mgr); |
787 | unsigned long flags; | 787 | unsigned long flags; |
@@ -1021,7 +1021,7 @@ static void dss_setup_fifos(void) | |||
1021 | } | 1021 | } |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | int dss_mgr_enable(struct omap_overlay_manager *mgr) | 1024 | static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr) |
1025 | { | 1025 | { |
1026 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | 1026 | struct mgr_priv_data *mp = get_mgr_priv(mgr); |
1027 | unsigned long flags; | 1027 | unsigned long flags; |
@@ -1071,7 +1071,7 @@ err: | |||
1071 | return r; | 1071 | return r; |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | void dss_mgr_disable(struct omap_overlay_manager *mgr) | 1074 | static void dss_mgr_disable_compat(struct omap_overlay_manager *mgr) |
1075 | { | 1075 | { |
1076 | struct mgr_priv_data *mp = get_mgr_priv(mgr); | 1076 | struct mgr_priv_data *mp = get_mgr_priv(mgr); |
1077 | unsigned long flags; | 1077 | unsigned long flags; |
@@ -1208,7 +1208,7 @@ static void dss_apply_mgr_timings(struct omap_overlay_manager *mgr, | |||
1208 | mp->extra_info_dirty = true; | 1208 | mp->extra_info_dirty = true; |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | void dss_mgr_set_timings(struct omap_overlay_manager *mgr, | 1211 | static void dss_mgr_set_timings_compat(struct omap_overlay_manager *mgr, |
1212 | const struct omap_video_timings *timings) | 1212 | const struct omap_video_timings *timings) |
1213 | { | 1213 | { |
1214 | unsigned long flags; | 1214 | unsigned long flags; |
@@ -1236,7 +1236,7 @@ static void dss_apply_mgr_lcd_config(struct omap_overlay_manager *mgr, | |||
1236 | mp->extra_info_dirty = true; | 1236 | mp->extra_info_dirty = true; |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, | 1239 | static void dss_mgr_set_lcd_config_compat(struct omap_overlay_manager *mgr, |
1240 | const struct dss_lcd_mgr_config *config) | 1240 | const struct dss_lcd_mgr_config *config) |
1241 | { | 1241 | { |
1242 | unsigned long flags; | 1242 | unsigned long flags; |
@@ -1501,13 +1501,21 @@ err: | |||
1501 | return r; | 1501 | return r; |
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | static const struct dss_mgr_ops apply_mgr_ops = { | ||
1505 | .start_update = dss_mgr_start_update_compat, | ||
1506 | .enable = dss_mgr_enable_compat, | ||
1507 | .disable = dss_mgr_disable_compat, | ||
1508 | .set_timings = dss_mgr_set_timings_compat, | ||
1509 | .set_lcd_config = dss_mgr_set_lcd_config_compat, | ||
1510 | }; | ||
1511 | |||
1504 | static int compat_refcnt; | 1512 | static int compat_refcnt; |
1505 | static DEFINE_MUTEX(compat_init_lock); | 1513 | static DEFINE_MUTEX(compat_init_lock); |
1506 | 1514 | ||
1507 | int omapdss_compat_init(void) | 1515 | int omapdss_compat_init(void) |
1508 | { | 1516 | { |
1509 | struct platform_device *pdev = dss_get_core_pdev(); | 1517 | struct platform_device *pdev = dss_get_core_pdev(); |
1510 | int i; | 1518 | int i, r; |
1511 | 1519 | ||
1512 | mutex_lock(&compat_init_lock); | 1520 | mutex_lock(&compat_init_lock); |
1513 | 1521 | ||
@@ -1548,10 +1556,24 @@ int omapdss_compat_init(void) | |||
1548 | ovl->get_device = &dss_ovl_get_device; | 1556 | ovl->get_device = &dss_ovl_get_device; |
1549 | } | 1557 | } |
1550 | 1558 | ||
1559 | r = dss_install_mgr_ops(&apply_mgr_ops); | ||
1560 | if (r) | ||
1561 | goto err_mgr_ops; | ||
1562 | |||
1551 | out: | 1563 | out: |
1552 | mutex_unlock(&compat_init_lock); | 1564 | mutex_unlock(&compat_init_lock); |
1553 | 1565 | ||
1554 | return 0; | 1566 | return 0; |
1567 | |||
1568 | err_mgr_ops: | ||
1569 | dss_uninit_overlay_managers(pdev); | ||
1570 | dss_uninit_overlays(pdev); | ||
1571 | |||
1572 | compat_refcnt--; | ||
1573 | |||
1574 | mutex_unlock(&compat_init_lock); | ||
1575 | |||
1576 | return r; | ||
1555 | } | 1577 | } |
1556 | EXPORT_SYMBOL(omapdss_compat_init); | 1578 | EXPORT_SYMBOL(omapdss_compat_init); |
1557 | 1579 | ||
@@ -1564,6 +1586,8 @@ void omapdss_compat_uninit(void) | |||
1564 | if (--compat_refcnt > 0) | 1586 | if (--compat_refcnt > 0) |
1565 | goto out; | 1587 | goto out; |
1566 | 1588 | ||
1589 | dss_uninstall_mgr_ops(); | ||
1590 | |||
1567 | dss_uninit_overlay_managers(pdev); | 1591 | dss_uninit_overlay_managers(pdev); |
1568 | dss_uninit_overlays(pdev); | 1592 | dss_uninit_overlays(pdev); |
1569 | out: | 1593 | out: |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 9ce798645b2..5cc13ea2b5a 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -523,4 +523,17 @@ static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr) | |||
523 | } | 523 | } |
524 | #endif | 524 | #endif |
525 | 525 | ||
526 | struct dss_mgr_ops { | ||
527 | void (*start_update)(struct omap_overlay_manager *mgr); | ||
528 | int (*enable)(struct omap_overlay_manager *mgr); | ||
529 | void (*disable)(struct omap_overlay_manager *mgr); | ||
530 | void (*set_timings)(struct omap_overlay_manager *mgr, | ||
531 | const struct omap_video_timings *timings); | ||
532 | void (*set_lcd_config)(struct omap_overlay_manager *mgr, | ||
533 | const struct dss_lcd_mgr_config *config); | ||
534 | }; | ||
535 | |||
536 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); | ||
537 | void dss_uninstall_mgr_ops(void); | ||
538 | |||
526 | #endif | 539 | #endif |
diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c index 1a84b79d558..9527ee6a769 100644 --- a/drivers/video/omap2/dss/output.c +++ b/drivers/video/omap2/dss/output.c | |||
@@ -113,3 +113,47 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id) | |||
113 | 113 | ||
114 | return NULL; | 114 | return NULL; |
115 | } | 115 | } |
116 | |||
117 | static const struct dss_mgr_ops *dss_mgr_ops; | ||
118 | |||
119 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops) | ||
120 | { | ||
121 | if (dss_mgr_ops) | ||
122 | return -EBUSY; | ||
123 | |||
124 | dss_mgr_ops = mgr_ops; | ||
125 | |||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | void dss_uninstall_mgr_ops(void) | ||
130 | { | ||
131 | dss_mgr_ops = NULL; | ||
132 | } | ||
133 | |||
134 | void dss_mgr_set_timings(struct omap_overlay_manager *mgr, | ||
135 | const struct omap_video_timings *timings) | ||
136 | { | ||
137 | dss_mgr_ops->set_timings(mgr, timings); | ||
138 | } | ||
139 | |||
140 | void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, | ||
141 | const struct dss_lcd_mgr_config *config) | ||
142 | { | ||
143 | dss_mgr_ops->set_lcd_config(mgr, config); | ||
144 | } | ||
145 | |||
146 | int dss_mgr_enable(struct omap_overlay_manager *mgr) | ||
147 | { | ||
148 | return dss_mgr_ops->enable(mgr); | ||
149 | } | ||
150 | |||
151 | void dss_mgr_disable(struct omap_overlay_manager *mgr) | ||
152 | { | ||
153 | dss_mgr_ops->disable(mgr); | ||
154 | } | ||
155 | |||
156 | void dss_mgr_start_update(struct omap_overlay_manager *mgr) | ||
157 | { | ||
158 | dss_mgr_ops->start_update(mgr); | ||
159 | } | ||