]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
OMAPDSS: VENC: Maintain our own timings field in driver data
authorArchit Taneja <archit@ti.com>
Fri, 20 Jul 2012 10:45:44 +0000 (16:15 +0530)
committerArchit Taneja <archit@ti.com>
Wed, 15 Aug 2012 10:20:50 +0000 (15:50 +0530)
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>
drivers/video/omap2/dss/venc.c
drivers/video/omap2/dss/venc_panel.c

index ffca542a2242e9b6920205e95472e3b9c4821112..d96025e2ca7a660a3a6db1076b6ef1dcc009f5a7 100644 (file)
@@ -300,6 +300,8 @@ static struct {
        struct regulator *vdda_dac_reg;
 
        struct clk      *tv_dac_clk;
+
+       struct omap_video_timings timings;
 } venc;
 
 static inline void venc_write_reg(int idx, u32 val)
@@ -432,7 +434,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
                goto err0;
 
        venc_reset();
-       venc_write_config(venc_timings_to_config(&dssdev->panel.timings));
+       venc_write_config(venc_timings_to_config(&venc.timings));
 
        dss_set_venc_output(dssdev->phy.venc.type);
        dss_set_dac_pwrdn_bgz(1);
@@ -449,7 +451,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
 
        venc_write_reg(VENC_OUTPUT_CONTROL, l);
 
-       dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings);
+       dss_mgr_set_timings(dssdev->manager, &venc.timings);
 
        r = regulator_enable(venc.vdda_dac_reg);
        if (r)
@@ -556,10 +558,10 @@ void omapdss_venc_set_timings(struct omap_dss_device *dssdev,
        mutex_lock(&venc.venc_lock);
 
        /* Reset WSS data when the TV standard changes. */
-       if (memcmp(&dssdev->panel.timings, timings, sizeof(*timings)))
+       if (memcmp(&venc.timings, timings, sizeof(*timings)))
                venc.wss_data = 0;
 
-       dssdev->panel.timings = *timings;
+       venc.timings = *timings;
 
        if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
                int r;
@@ -606,7 +608,7 @@ int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
 
        mutex_lock(&venc.venc_lock);
 
-       config = venc_timings_to_config(&dssdev->panel.timings);
+       config = venc_timings_to_config(&venc.timings);
 
        /* Invert due to VENC_L21_WC_CTL:INV=1 */
        venc.wss_data = (wss ^ 0xfffff) << 8;
index cfed9077d2fb560b4813d17765049f4c29e14ba9..80963697d384c1b353def21f76a3c280d64ed331 100644 (file)
@@ -127,6 +127,8 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
                goto err;
        }
 
+       omapdss_venc_set_timings(dssdev, &dssdev->panel.timings);
+
        r = omapdss_venc_display_enable(dssdev);
        if (r)
                goto err;
@@ -183,6 +185,7 @@ static void venc_panel_set_timings(struct omap_dss_device *dssdev,
        mutex_lock(&venc_panel.lock);
 
        omapdss_venc_set_timings(dssdev, timings);
+       dssdev->panel.timings = *timings;
 
        mutex_unlock(&venc_panel.lock);
 }