diff options
author | Archit Taneja <archit@ti.com> | 2012-08-16 08:25:15 +0200 |
---|---|---|
committer | Archit Taneja <archit@ti.com> | 2012-08-16 14:40:17 +0200 |
commit | febe2905d08b238f4ee2eb7e99c402bf85f0f70f (patch) | |
tree | f3f51e80ff2695550ccc7ae203d447c9979c6817 /drivers/video/omap2/dss/venc.c | |
parent | OMAPDSS: RFBI: Maitain copy of rfbi timings in driver data (diff) | |
download | linux-febe2905d08b238f4ee2eb7e99c402bf85f0f70f.tar.xz linux-febe2905d08b238f4ee2eb7e99c402bf85f0f70f.zip |
OMAPDSS: VENC: Maintain copy of venc type in driver data
The VENC driver currently relies on the omap_dss_device struct to configure the
venc type. This makes the VENC interface driver dependent on the omap_dss_device
struct.
Make the VENC driver data maintain it's own 'venc type' field. A panel driver
is expected to call omapdss_venc_set_type() before enabling the interface or
changing the type via display sysfs attributes.
Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/venc.c')
-rw-r--r-- | drivers/video/omap2/dss/venc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c index d96025e2ca7a..2d90fcf7e8f9 100644 --- a/drivers/video/omap2/dss/venc.c +++ b/drivers/video/omap2/dss/venc.c @@ -302,6 +302,7 @@ static struct { struct clk *tv_dac_clk; struct omap_video_timings timings; + enum omap_dss_venc_type type; } venc; static inline void venc_write_reg(int idx, u32 val) @@ -436,12 +437,12 @@ static int venc_power_on(struct omap_dss_device *dssdev) venc_reset(); venc_write_config(venc_timings_to_config(&venc.timings)); - dss_set_venc_output(dssdev->phy.venc.type); + dss_set_venc_output(venc.type); dss_set_dac_pwrdn_bgz(1); l = 0; - if (dssdev->phy.venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) + if (venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) l |= 1 << 1; else /* S-Video */ l |= (1 << 0) | (1 << 2); @@ -628,6 +629,16 @@ err: return r; } +void omapdss_venc_set_type(struct omap_dss_device *dssdev, + enum omap_dss_venc_type type) +{ + mutex_lock(&venc.venc_lock); + + venc.type = type; + + mutex_unlock(&venc.venc_lock); +} + static int __init venc_init_display(struct omap_dss_device *dssdev) { DSSDBG("init_display\n"); |