aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@nokia.com>2010-01-08 10:14:53 -0500
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-02-24 07:31:27 -0500
commita2faee84f6d8e35150d60514c6638d223509fa13 (patch)
tree6af54db0ab5a67c0fc068146cf03c77f85225d41
parent3f71cbe736e7e9909559fcc4463f43e4b4b348a8 (diff)
OMAP: DSS2: move enable/disable_channel to overlay manager
Move enable/disable_channel() from omap_dss_device to overlay manager. This is part of a larger patch-set, which moves the control from omapdss driver to the display driver. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-rw-r--r--arch/arm/plat-omap/include/plat/display.h3
-rw-r--r--drivers/video/omap2/dss/dispc.c24
-rw-r--r--drivers/video/omap2/dss/dpi.c14
-rw-r--r--drivers/video/omap2/dss/dsi.c2
-rw-r--r--drivers/video/omap2/dss/dss.h4
-rw-r--r--drivers/video/omap2/dss/manager.c17
-rw-r--r--drivers/video/omap2/dss/rfbi.c2
-rw-r--r--drivers/video/omap2/dss/sdi.c14
-rw-r--r--drivers/video/omap2/dss/venc.c4
9 files changed, 61 insertions, 23 deletions
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 059b35cfd125..f05098dd5d5c 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -371,6 +371,9 @@ struct omap_overlay_manager {
371 int (*apply)(struct omap_overlay_manager *mgr); 371 int (*apply)(struct omap_overlay_manager *mgr);
372 int (*wait_for_go)(struct omap_overlay_manager *mgr); 372 int (*wait_for_go)(struct omap_overlay_manager *mgr);
373 int (*wait_for_vsync)(struct omap_overlay_manager *mgr); 373 int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
374
375 int (*enable)(struct omap_overlay_manager *mgr);
376 int (*disable)(struct omap_overlay_manager *mgr);
374}; 377};
375 378
376struct omap_dss_device { 379struct omap_dss_device {
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 212cb800a5d2..5a5c31c163c7 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1725,7 +1725,7 @@ static void _enable_lcd_out(bool enable)
1725 REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 0, 0); 1725 REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 0, 0);
1726} 1726}
1727 1727
1728void dispc_enable_lcd_out(bool enable) 1728static void dispc_enable_lcd_out(bool enable)
1729{ 1729{
1730 struct completion frame_done_completion; 1730 struct completion frame_done_completion;
1731 bool is_on; 1731 bool is_on;
@@ -1772,7 +1772,7 @@ static void _enable_digit_out(bool enable)
1772 REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 1, 1); 1772 REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 1, 1);
1773} 1773}
1774 1774
1775void dispc_enable_digit_out(bool enable) 1775static void dispc_enable_digit_out(bool enable)
1776{ 1776{
1777 struct completion frame_done_completion; 1777 struct completion frame_done_completion;
1778 int r; 1778 int r;
@@ -1836,6 +1836,26 @@ void dispc_enable_digit_out(bool enable)
1836 enable_clocks(0); 1836 enable_clocks(0);
1837} 1837}
1838 1838
1839bool dispc_is_channel_enabled(enum omap_channel channel)
1840{
1841 if (channel == OMAP_DSS_CHANNEL_LCD)
1842 return !!REG_GET(DISPC_CONTROL, 0, 0);
1843 else if (channel == OMAP_DSS_CHANNEL_DIGIT)
1844 return !!REG_GET(DISPC_CONTROL, 1, 1);
1845 else
1846 BUG();
1847}
1848
1849void dispc_enable_channel(enum omap_channel channel, bool enable)
1850{
1851 if (channel == OMAP_DSS_CHANNEL_LCD)
1852 dispc_enable_lcd_out(enable);
1853 else if (channel == OMAP_DSS_CHANNEL_DIGIT)
1854 dispc_enable_digit_out(enable);
1855 else
1856 BUG();
1857}
1858
1839void dispc_lcd_enable_signal_polarity(bool act_high) 1859void dispc_lcd_enable_signal_polarity(bool act_high)
1840{ 1860{
1841 enable_clocks(1); 1861 enable_clocks(1);
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index c5091ed12a7d..77b95577ab30 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -194,7 +194,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
194 194
195 mdelay(2); 195 mdelay(2);
196 196
197 dispc_enable_lcd_out(1); 197 dssdev->manager->enable(dssdev->manager);
198 198
199 r = dssdev->driver->enable(dssdev); 199 r = dssdev->driver->enable(dssdev);
200 if (r) 200 if (r)
@@ -205,7 +205,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
205 return 0; 205 return 0;
206 206
207err6: 207err6:
208 dispc_enable_lcd_out(0); 208 dssdev->manager->disable(dssdev->manager);
209err5: 209err5:
210#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL 210#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
211 dsi_pll_uninit(); 211 dsi_pll_uninit();
@@ -235,7 +235,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev)
235 235
236 dssdev->driver->disable(dssdev); 236 dssdev->driver->disable(dssdev);
237 237
238 dispc_enable_lcd_out(0); 238 dssdev->manager->disable(dssdev->manager);
239 239
240#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL 240#ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
241 dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK); 241 dss_select_dispc_clk_source(DSS_SRC_DSS1_ALWON_FCLK);
@@ -263,7 +263,7 @@ static int dpi_display_suspend(struct omap_dss_device *dssdev)
263 if (dssdev->driver->suspend) 263 if (dssdev->driver->suspend)
264 dssdev->driver->suspend(dssdev); 264 dssdev->driver->suspend(dssdev);
265 265
266 dispc_enable_lcd_out(0); 266 dssdev->manager->disable(dssdev->manager);
267 267
268 dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); 268 dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
269 269
@@ -292,7 +292,7 @@ static int dpi_display_resume(struct omap_dss_device *dssdev)
292 292
293 dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); 293 dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1);
294 294
295 dispc_enable_lcd_out(1); 295 dssdev->manager->enable(dssdev->manager);
296 296
297 if (dssdev->driver->resume) 297 if (dssdev->driver->resume)
298 dssdev->driver->resume(dssdev); 298 dssdev->driver->resume(dssdev);
@@ -383,10 +383,10 @@ static int dpi_display_set_update_mode(struct omap_dss_device *dssdev,
383 return -EINVAL; 383 return -EINVAL;
384 384
385 if (mode == OMAP_DSS_UPDATE_DISABLED) { 385 if (mode == OMAP_DSS_UPDATE_DISABLED) {
386 dispc_enable_lcd_out(0); 386 dssdev->manager->disable(dssdev->manager);
387 dpi.update_enabled = 0; 387 dpi.update_enabled = 0;
388 } else { 388 } else {
389 dispc_enable_lcd_out(1); 389 dssdev->manager->enable(dssdev->manager);
390 dpi.update_enabled = 1; 390 dpi.update_enabled = 1;
391 } 391 }
392 392
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 82733d18c0ac..b478a506e038 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3013,7 +3013,7 @@ static int dsi_update_thread(void *data)
3013 x, y, w, h); 3013 x, y, w, h);
3014 3014
3015 dispc_enable_sidle(); 3015 dispc_enable_sidle();
3016 dispc_enable_lcd_out(0); 3016 device->manager->disable(device->manager);
3017 3017
3018 dsi_reset_tx_fifo(0); 3018 dsi_reset_tx_fifo(0);
3019 } else { 3019 } else {
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 3713dc698259..24326a5fd292 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -324,8 +324,8 @@ int dispc_setup_plane(enum omap_plane plane,
324 324
325bool dispc_go_busy(enum omap_channel channel); 325bool dispc_go_busy(enum omap_channel channel);
326void dispc_go(enum omap_channel channel); 326void dispc_go(enum omap_channel channel);
327void dispc_enable_lcd_out(bool enable); 327void dispc_enable_channel(enum omap_channel channel, bool enable);
328void dispc_enable_digit_out(bool enable); 328bool dispc_is_channel_enabled(enum omap_channel channel);
329int dispc_enable_plane(enum omap_plane plane, bool enable); 329int dispc_enable_plane(enum omap_plane plane, bool enable);
330void dispc_enable_replication(enum omap_plane plane, bool enable); 330void dispc_enable_replication(enum omap_plane plane, bool enable);
331 331
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 486cd4aec652..4ede519c0a31 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -1077,7 +1077,7 @@ void dss_start_update(struct omap_dss_device *dssdev)
1077 mc->shadow_dirty = false; 1077 mc->shadow_dirty = false;
1078 } 1078 }
1079 1079
1080 dispc_enable_lcd_out(1); 1080 dssdev->manager->enable(dssdev->manager);
1081} 1081}
1082 1082
1083static void dss_apply_irq_handler(void *data, u32 mask) 1083static void dss_apply_irq_handler(void *data, u32 mask)
@@ -1364,6 +1364,18 @@ static void omap_dss_mgr_get_info(struct omap_overlay_manager *mgr,
1364 *info = mgr->info; 1364 *info = mgr->info;
1365} 1365}
1366 1366
1367static int dss_mgr_enable(struct omap_overlay_manager *mgr)
1368{
1369 dispc_enable_channel(mgr->id, 1);
1370 return 0;
1371}
1372
1373static int dss_mgr_disable(struct omap_overlay_manager *mgr)
1374{
1375 dispc_enable_channel(mgr->id, 0);
1376 return 0;
1377}
1378
1367static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager) 1379static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
1368{ 1380{
1369 ++num_managers; 1381 ++num_managers;
@@ -1409,6 +1421,9 @@ int dss_init_overlay_managers(struct platform_device *pdev)
1409 mgr->wait_for_go = &dss_mgr_wait_for_go; 1421 mgr->wait_for_go = &dss_mgr_wait_for_go;
1410 mgr->wait_for_vsync = &dss_mgr_wait_for_vsync; 1422 mgr->wait_for_vsync = &dss_mgr_wait_for_vsync;
1411 1423
1424 mgr->enable = &dss_mgr_enable;
1425 mgr->disable = &dss_mgr_disable;
1426
1412 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC; 1427 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC;
1413 1428
1414 dss_overlay_setup_dispc_manager(mgr); 1429 dss_overlay_setup_dispc_manager(mgr);
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index b936495c065d..6b9cd767c7c1 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -382,7 +382,7 @@ void rfbi_transfer_area(u16 width, u16 height,
382 382
383 dispc_set_lcd_size(width, height); 383 dispc_set_lcd_size(width, height);
384 384
385 dispc_enable_lcd_out(1); 385 dispc_enable_channel(OMAP_DSS_CHANNEL_LCD, true);
386 386
387 rfbi.framedone_callback = callback; 387 rfbi.framedone_callback = callback;
388 rfbi.framedone_callback_data = data; 388 rfbi.framedone_callback_data = data;
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index c24f307d3da1..5f852edd4cbc 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -119,7 +119,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
119 mdelay(2); 119 mdelay(2);
120 } 120 }
121 121
122 dispc_enable_lcd_out(1); 122 dssdev->manager->enable(dssdev->manager);
123 123
124 if (dssdev->driver->enable) { 124 if (dssdev->driver->enable) {
125 r = dssdev->driver->enable(dssdev); 125 r = dssdev->driver->enable(dssdev);
@@ -133,7 +133,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
133 133
134 return 0; 134 return 0;
135err3: 135err3:
136 dispc_enable_lcd_out(0); 136 dssdev->manager->disable(dssdev->manager);
137err2: 137err2:
138 dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); 138 dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1);
139err1: 139err1:
@@ -156,7 +156,7 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)
156 if (dssdev->driver->disable) 156 if (dssdev->driver->disable)
157 dssdev->driver->disable(dssdev); 157 dssdev->driver->disable(dssdev);
158 158
159 dispc_enable_lcd_out(0); 159 dssdev->manager->disable(dssdev->manager);
160 160
161 dss_sdi_disable(); 161 dss_sdi_disable();
162 162
@@ -175,7 +175,7 @@ static int sdi_display_suspend(struct omap_dss_device *dssdev)
175 if (dssdev->driver->suspend) 175 if (dssdev->driver->suspend)
176 dssdev->driver->suspend(dssdev); 176 dssdev->driver->suspend(dssdev);
177 177
178 dispc_enable_lcd_out(0); 178 dssdev->manager->disable(dssdev->manager);
179 179
180 dss_sdi_disable(); 180 dss_sdi_disable();
181 181
@@ -200,7 +200,7 @@ static int sdi_display_resume(struct omap_dss_device *dssdev)
200 goto err; 200 goto err;
201 mdelay(2); 201 mdelay(2);
202 202
203 dispc_enable_lcd_out(1); 203 dssdev->manager->enable(dssdev->manager);
204 204
205 if (dssdev->driver->resume) 205 if (dssdev->driver->resume)
206 dssdev->driver->resume(dssdev); 206 dssdev->driver->resume(dssdev);
@@ -220,10 +220,10 @@ static int sdi_display_set_update_mode(struct omap_dss_device *dssdev,
220 return -EINVAL; 220 return -EINVAL;
221 221
222 if (mode == OMAP_DSS_UPDATE_DISABLED) { 222 if (mode == OMAP_DSS_UPDATE_DISABLED) {
223 dispc_enable_lcd_out(0); 223 dssdev->manager->disable(dssdev->manager);
224 sdi.update_enabled = 0; 224 sdi.update_enabled = 0;
225 } else { 225 } else {
226 dispc_enable_lcd_out(1); 226 dssdev->manager->enable(dssdev->manager);
227 sdi.update_enabled = 1; 227 sdi.update_enabled = 1;
228 } 228 }
229 229
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 44b4998c2052..4e6bd1dc8021 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -538,7 +538,7 @@ static void venc_power_on(struct omap_dss_device *dssdev)
538 if (dssdev->platform_enable) 538 if (dssdev->platform_enable)
539 dssdev->platform_enable(dssdev); 539 dssdev->platform_enable(dssdev);
540 540
541 dispc_enable_digit_out(1); 541 dssdev->manager->enable(dssdev->manager);
542} 542}
543 543
544static void venc_power_off(struct omap_dss_device *dssdev) 544static void venc_power_off(struct omap_dss_device *dssdev)
@@ -546,7 +546,7 @@ static void venc_power_off(struct omap_dss_device *dssdev)
546 venc_write_reg(VENC_OUTPUT_CONTROL, 0); 546 venc_write_reg(VENC_OUTPUT_CONTROL, 0);
547 dss_set_dac_pwrdn_bgz(0); 547 dss_set_dac_pwrdn_bgz(0);
548 548
549 dispc_enable_digit_out(0); 549 dssdev->manager->disable(dssdev->manager);
550 550
551 if (dssdev->platform_disable) 551 if (dssdev->platform_disable)
552 dssdev->platform_disable(dssdev); 552 dssdev->platform_disable(dssdev);