diff options
| author | Archit Taneja <archit@ti.com> | 2012-08-16 02:26:31 -0400 |
|---|---|---|
| committer | Archit Taneja <archit@ti.com> | 2012-08-16 09:17:52 -0400 |
| commit | 89e7195634e563b72288bf13ef4dbdf4709d2d08 (patch) | |
| tree | 8f786f5c3510ca8a70725e5c914ec5ad2ae4171c | |
| parent | febe2905d08b238f4ee2eb7e99c402bf85f0f70f (diff) | |
OMAPDSS: VENC: Maintian copy of video output polarity info in private data
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>
| -rw-r--r-- | drivers/video/omap2/dss/dss.h | 2 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/venc.c | 13 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/venc_panel.c | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index c17d298b0474..41c00dc63cc5 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
| @@ -479,6 +479,8 @@ u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev); | |||
| 479 | int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss); | 479 | int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss); |
| 480 | void omapdss_venc_set_type(struct omap_dss_device *dssdev, | 480 | void omapdss_venc_set_type(struct omap_dss_device *dssdev, |
| 481 | enum omap_dss_venc_type type); | 481 | enum omap_dss_venc_type type); |
| 482 | void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev, | ||
| 483 | bool invert_polarity); | ||
| 482 | int venc_panel_init(void); | 484 | int venc_panel_init(void); |
| 483 | void venc_panel_exit(void); | 485 | void venc_panel_exit(void); |
| 484 | 486 | ||
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index 2d90fcf7e8f9..7d3eef8a010f 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c | |||
| @@ -303,6 +303,7 @@ static struct { | |||
| 303 | 303 | ||
| 304 | struct omap_video_timings timings; | 304 | struct omap_video_timings timings; |
| 305 | enum omap_dss_venc_type type; | 305 | enum omap_dss_venc_type type; |
| 306 | bool invert_polarity; | ||
| 306 | } venc; | 307 | } venc; |
| 307 | 308 | ||
| 308 | static inline void venc_write_reg(int idx, u32 val) | 309 | static inline void venc_write_reg(int idx, u32 val) |
| @@ -447,7 +448,7 @@ static int venc_power_on(struct omap_dss_device *dssdev) | |||
| 447 | else /* S-Video */ | 448 | else /* S-Video */ |
| 448 | l |= (1 << 0) | (1 << 2); | 449 | l |= (1 << 0) | (1 << 2); |
| 449 | 450 | ||
| 450 | if (dssdev->phy.venc.invert_polarity == false) | 451 | if (venc.invert_polarity == false) |
| 451 | l |= 1 << 3; | 452 | l |= 1 << 3; |
| 452 | 453 | ||
| 453 | venc_write_reg(VENC_OUTPUT_CONTROL, l); | 454 | venc_write_reg(VENC_OUTPUT_CONTROL, l); |
| @@ -639,6 +640,16 @@ void omapdss_venc_set_type(struct omap_dss_device *dssdev, | |||
| 639 | mutex_unlock(&venc.venc_lock); | 640 | mutex_unlock(&venc.venc_lock); |
| 640 | } | 641 | } |
| 641 | 642 | ||
| 643 | void omapdss_venc_invert_vid_out_polarity(struct omap_dss_device *dssdev, | ||
| 644 | bool invert_polarity) | ||
| 645 | { | ||
| 646 | mutex_lock(&venc.venc_lock); | ||
| 647 | |||
| 648 | venc.invert_polarity = invert_polarity; | ||
| 649 | |||
| 650 | mutex_unlock(&venc.venc_lock); | ||
| 651 | } | ||
| 652 | |||
| 642 | static int __init venc_init_display(struct omap_dss_device *dssdev) | 653 | static int __init venc_init_display(struct omap_dss_device *dssdev) |
| 643 | { | 654 | { |
| 644 | DSSDBG("init_display\n"); | 655 | DSSDBG("init_display\n"); |
diff --git a/drivers/video/omap2/dss/venc_panel.c b/drivers/video/omap2/dss/venc_panel.c index ef213618a25c..d55b8784ecfd 100644 --- a/drivers/video/omap2/dss/venc_panel.c +++ b/drivers/video/omap2/dss/venc_panel.c | |||
| @@ -130,6 +130,8 @@ static int venc_panel_enable(struct omap_dss_device *dssdev) | |||
| 130 | 130 | ||
| 131 | omapdss_venc_set_timings(dssdev, &dssdev->panel.timings); | 131 | omapdss_venc_set_timings(dssdev, &dssdev->panel.timings); |
| 132 | omapdss_venc_set_type(dssdev, dssdev->phy.venc.type); | 132 | omapdss_venc_set_type(dssdev, dssdev->phy.venc.type); |
| 133 | omapdss_venc_invert_vid_out_polarity(dssdev, | ||
| 134 | dssdev->phy.venc.invert_polarity); | ||
| 133 | 135 | ||
| 134 | r = omapdss_venc_display_enable(dssdev); | 136 | r = omapdss_venc_display_enable(dssdev); |
| 135 | if (r) | 137 | if (r) |
