]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
OMAPDSS: VENC: Maintian copy of video output polarity info in private data
authorArchit Taneja <archit@ti.com>
Thu, 16 Aug 2012 06:26:31 +0000 (11:56 +0530)
committerArchit Taneja <archit@ti.com>
Thu, 16 Aug 2012 13:17:52 +0000 (18:47 +0530)
The VENC driver currently relies on the omap_dss_device struct to configure the
video output polarity. This makes the VENC interface driver dependent on the
omap_dss_device struct.

Make the VENC driver data maintain it's own polarity field. A panel driver
is expected to call omapdss_venc_invert_vid_out_polarity() before enabling the
interface.

Signed-off-by: Archit Taneja <archit@ti.com>
drivers/video/omap2/dss/dss.h
drivers/video/omap2/dss/venc.c
drivers/video/omap2/dss/venc_panel.c

index c17d298b04745f9af28e383d7fd4b087611502c7..41c00dc63cc588bf8cb1191373cf6d5dea168dfe 100644 (file)
@@ -479,6 +479,8 @@ u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev);
 int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss);
 void omapdss_venc_set_type(struct omap_dss_device *dssdev,
                enum omap_dss_venc_type type);
+void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev,
+               bool invert_polarity);
 int venc_panel_init(void);
 void venc_panel_exit(void);
 
index 2d90fcf7e8f98d525cc2b1bf2b126de4305d040f..7d3eef8a010f96a992f8ab05818ccb48d9513ce0 100644 (file)
@@ -303,6 +303,7 @@ static struct {
 
        struct omap_video_timings timings;
        enum omap_dss_venc_type type;
+       bool invert_polarity;
 } venc;
 
 static inline void venc_write_reg(int idx, u32 val)
@@ -447,7 +448,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
        else /* S-Video */
                l |= (1 << 0) | (1 << 2);
 
-       if (dssdev->phy.venc.invert_polarity == false)
+       if (venc.invert_polarity == false)
                l |= 1 << 3;
 
        venc_write_reg(VENC_OUTPUT_CONTROL, l);
@@ -639,6 +640,16 @@ void omapdss_venc_set_type(struct omap_dss_device *dssdev,
        mutex_unlock(&venc.venc_lock);
 }
 
+void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev,
+               bool invert_polarity)
+{
+       mutex_lock(&venc.venc_lock);
+
+       venc.invert_polarity = invert_polarity;
+
+       mutex_unlock(&venc.venc_lock);
+}
+
 static int __init venc_init_display(struct omap_dss_device *dssdev)
 {
        DSSDBG("init_display\n");
index ef213618a25c732055a452f8bfe5de97513aa704..d55b8784ecfde6ddfa184a6d86f5a5d659f5b9c4 100644 (file)
@@ -130,6 +130,8 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
 
        omapdss_venc_set_timings(dssdev, &dssdev->panel.timings);
        omapdss_venc_set_type(dssdev, dssdev->phy.venc.type);
+       omapdss_venc_invert_vid_out_polarity(dssdev,
+               dssdev->phy.venc.invert_polarity);
 
        r = omapdss_venc_display_enable(dssdev);
        if (r)