Commit febe2905 authored by Archit Taneja's avatar Archit Taneja

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: default avatarArchit Taneja <archit@ti.com>
parent 6e883324
...@@ -477,6 +477,8 @@ int omapdss_venc_check_timings(struct omap_dss_device *dssdev, ...@@ -477,6 +477,8 @@ int omapdss_venc_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct omap_video_timings *timings);
u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev); u32 omapdss_venc_get_wss(struct omap_dss_device *dssdev);
int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss); 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);
int venc_panel_init(void); int venc_panel_init(void);
void venc_panel_exit(void); void venc_panel_exit(void);
......
...@@ -302,6 +302,7 @@ static struct { ...@@ -302,6 +302,7 @@ static struct {
struct clk *tv_dac_clk; struct clk *tv_dac_clk;
struct omap_video_timings timings; struct omap_video_timings timings;
enum omap_dss_venc_type type;
} venc; } venc;
static inline void venc_write_reg(int idx, u32 val) static inline void venc_write_reg(int idx, u32 val)
...@@ -436,12 +437,12 @@ static int venc_power_on(struct omap_dss_device *dssdev) ...@@ -436,12 +437,12 @@ static int venc_power_on(struct omap_dss_device *dssdev)
venc_reset(); venc_reset();
venc_write_config(venc_timings_to_config(&venc.timings)); 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); dss_set_dac_pwrdn_bgz(1);
l = 0; l = 0;
if (dssdev->phy.venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE) if (venc.type == OMAP_DSS_VENC_TYPE_COMPOSITE)
l |= 1 << 1; l |= 1 << 1;
else /* S-Video */ else /* S-Video */
l |= (1 << 0) | (1 << 2); l |= (1 << 0) | (1 << 2);
...@@ -628,6 +629,16 @@ int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss) ...@@ -628,6 +629,16 @@ int omapdss_venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
return r; 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) static int __init venc_init_display(struct omap_dss_device *dssdev)
{ {
DSSDBG("init_display\n"); DSSDBG("init_display\n");
......
...@@ -68,6 +68,7 @@ static ssize_t display_output_type_store(struct device *dev, ...@@ -68,6 +68,7 @@ static ssize_t display_output_type_store(struct device *dev,
if (dssdev->phy.venc.type != new_type) { if (dssdev->phy.venc.type != new_type) {
dssdev->phy.venc.type = new_type; dssdev->phy.venc.type = new_type;
omapdss_venc_set_type(dssdev, new_type);
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
omapdss_venc_display_disable(dssdev); omapdss_venc_display_disable(dssdev);
omapdss_venc_display_enable(dssdev); omapdss_venc_display_enable(dssdev);
...@@ -128,6 +129,7 @@ static int venc_panel_enable(struct omap_dss_device *dssdev) ...@@ -128,6 +129,7 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
} }
omapdss_venc_set_timings(dssdev, &dssdev->panel.timings); omapdss_venc_set_timings(dssdev, &dssdev->panel.timings);
omapdss_venc_set_type(dssdev, dssdev->phy.venc.type);
r = omapdss_venc_display_enable(dssdev); r = omapdss_venc_display_enable(dssdev);
if (r) if (r)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment