aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-07-20 06:45:44 -0400
committerArchit Taneja <archit@ti.com>2012-08-15 06:20:50 -0400
commita5abf4721b5d27357d6a9623bde02ad44cffd40f (patch)
treec4a652a840e997a5c0f201cb877d32988a0991bc /drivers/video/omap2/dss
parent156fd99e92c30b0a894f7f4874c6901bfdc65c44 (diff)
OMAPDSS: VENC: Maintain our own timings field in driver data
The VENC driver currently relies on the timings in omap_dss_device struct to configure the DISPC and VENC blocks accordingly. This makes the VENC interface driver dependent on the omap_dss_device struct. Make the VENC driver data maintain it's own timings field. The panel driver is expected to call omapdss_venc_set_timings() to set these timings before the panel is enabled. Call omapdss_venc_set_timings() before enabling venc output, this is done to atleast have the venc output configured to the panel's default timings if the DSS user didn't explicitly call the venc panel driver's set_timings op. Make the VENC panel driver configure the new timings is the omap_dss_device struct(dssdev->panel.timings). The VENC driver is responsible for maintaining only it's own copy of timings. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss')
-rw-r--r--drivers/video/omap2/dss/venc.c12
-rw-r--r--drivers/video/omap2/dss/venc_panel.c3
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index ffca542a2242..d96025e2ca7a 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -300,6 +300,8 @@ static struct {
300 struct regulator *vdda_dac_reg; 300 struct regulator *vdda_dac_reg;
301 301
302 struct clk *tv_dac_clk; 302 struct clk *tv_dac_clk;
303
304 struct omap_video_timings timings;
303} venc; 305} venc;
304 306
305static inline void venc_write_reg(int idx, u32 val) 307static inline void venc_write_reg(int idx, u32 val)
@@ -432,7 +434,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
432 goto err0; 434 goto err0;
433 435
434 venc_reset(); 436 venc_reset();
435 venc_write_config(venc_timings_to_config(&dssdev->panel.timings)); 437 venc_write_config(venc_timings_to_config(&venc.timings));
436 438
437 dss_set_venc_output(dssdev->phy.venc.type); 439 dss_set_venc_output(dssdev->phy.venc.type);
438 dss_set_dac_pwrdn_bgz(1); 440 dss_set_dac_pwrdn_bgz(1);
@@ -449,7 +451,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
449 451
450 venc_write_reg(VENC_OUTPUT_CONTROL, l); 452 venc_write_reg(VENC_OUTPUT_CONTROL, l);
451 453
452 dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings); 454 dss_mgr_set_timings(dssdev->manager, &venc.timings);
453 455
454 r = regulator_enable(venc.vdda_dac_reg); 456 r = regulator_enable(venc.vdda_dac_reg);
455 if (r) 457 if (r)
@@ -556,10 +558,10 @@ void omapdss_venc_set_timings(struct omap_dss_device *dssdev,
556 mutex_lock(&venc.venc_lock); 558 mutex_lock(&venc.venc_lock);
557 559
558 /* Reset WSS data when the TV standard changes. */ 560 /* Reset WSS data when the TV standard changes. */
559 if (memcmp(&dssdev->panel.timings, timings, sizeof(*timings))) 561 if (memcmp(&venc.timings, timings, sizeof(*timings)))
560 venc.wss_data = 0; 562 venc.wss_data = 0;
561 563
562 dssdev->panel.timings = *timings; 564 venc.timings = *timings;
563 565
564 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { 566 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
565 int r; 567 int r;
@@ -606,7 +608,7 @@ int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
606 608
607 mutex_lock(&venc.venc_lock); 609 mutex_lock(&venc.venc_lock);
608 610
609 config = venc_timings_to_config(&dssdev->panel.timings); 611 config = venc_timings_to_config(&venc.timings);
610 612
611 /* Invert due to VENC_L21_WC_CTL:INV=1 */ 613 /* Invert due to VENC_L21_WC_CTL:INV=1 */
612 venc.wss_data = (wss ^ 0xfffff) << 8; 614 venc.wss_data = (wss ^ 0xfffff) << 8;
diff --git a/drivers/video/omap2/dss/venc_panel.c b/drivers/video/omap2/dss/venc_panel.c
index cfed9077d2fb..80963697d384 100644
--- a/drivers/video/omap2/dss/venc_panel.c
+++ b/drivers/video/omap2/dss/venc_panel.c
@@ -127,6 +127,8 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
127 goto err; 127 goto err;
128 } 128 }
129 129
130 omapdss_venc_set_timings(dssdev, &dssdev->panel.timings);
131
130 r = omapdss_venc_display_enable(dssdev); 132 r = omapdss_venc_display_enable(dssdev);
131 if (r) 133 if (r)
132 goto err; 134 goto err;
@@ -183,6 +185,7 @@ static void venc_panel_set_timings(struct omap_dss_device *dssdev,
183 mutex_lock(&venc_panel.lock); 185 mutex_lock(&venc_panel.lock);
184 186
185 omapdss_venc_set_timings(dssdev, timings); 187 omapdss_venc_set_timings(dssdev, timings);
188 dssdev->panel.timings = *timings;
186 189
187 mutex_unlock(&venc_panel.lock); 190 mutex_unlock(&venc_panel.lock);
188} 191}