summaryrefslogtreecommitdiff
path: root/drivers/video/omap2/dss/hdmi.c
diff options
context:
space:
mode:
authorMythri P K <mythripk@ti.com>2011-09-08 19:06:26 +0530
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 16:16:34 +0300
commit60634a28bc5467ade316574c4aa728c5bff7947e (patch)
tree61f6c6f5b3ebf78bd69316d462d618d39b50697d /drivers/video/omap2/dss/hdmi.c
parent176b578b1a0e1b7ccdc746c3962f2a56aaf45456 (diff)
OMAP4: DSS2: HDMI: Function pointer approach to call
HDMI IP fundamentally has replaceable core PHY and PLL blocks. These blocks might vary across OMAP's but the end functionality such as to enable or disable PLL, PHY, function to read EDID would remain the same. Thus to make the current hdmi DSS driver compatible with different OMAP's having different IP blocks( A combination of different core, PHY, PLL blocks), function pointer approach is introduced. With function pointer, relevant IP dependent functions are mapped to the generic functions used by DSS during the initialization based on the OMAP compiled. Thus making hdmi DSS driver IP agnostic. Signed-off-by: Mythri P K <mythripk@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/hdmi.c')
-rw-r--r--drivers/video/omap2/dss/hdmi.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 5afc51bc618..8cef940b501 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -186,6 +186,7 @@ int hdmi_init_display(struct omap_dss_device *dssdev)
{
DSSDBG("init_display\n");
+ dss_init_hdmi_ip_ops(&hdmi.ip_data);
return 0;
}
@@ -366,7 +367,7 @@ static void hdmi_read_edid(struct omap_video_timings *dp)
memset(hdmi.edid, 0, HDMI_EDID_MAX_LENGTH);
if (!hdmi.edid_set)
- ret = ti_hdmi_4xxx_read_edid(&hdmi.ip_data, hdmi.edid,
+ ret = hdmi.ip_data.ops->read_edid(&hdmi.ip_data, hdmi.edid,
HDMI_EDID_MAX_LENGTH);
if (!ret) {
if (!memcmp(hdmi.edid, edid_header, sizeof(edid_header))) {
@@ -480,16 +481,16 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data);
- ti_hdmi_4xxx_wp_video_start(&hdmi.ip_data, 0);
+ hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
/* config the PLL and PHY hdmi_set_pll_pwrfirst */
- r = ti_hdmi_4xxx_pll_enable(&hdmi.ip_data);
+ r = hdmi.ip_data.ops->pll_enable(&hdmi.ip_data);
if (r) {
DSSDBG("Failed to lock PLL\n");
goto err;
}
- r = ti_hdmi_4xxx_phy_enable(&hdmi.ip_data);
+ r = hdmi.ip_data.ops->phy_enable(&hdmi.ip_data);
if (r) {
DSSDBG("Failed to start PHY\n");
goto err;
@@ -497,7 +498,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
hdmi.ip_data.cfg.cm.mode = hdmi.mode;
hdmi.ip_data.cfg.cm.code = hdmi.code;
- ti_hdmi_4xxx_basic_configure(&hdmi.ip_data);
+ hdmi.ip_data.ops->video_configure(&hdmi.ip_data);
/* Make selection of HDMI in DSS */
dss_select_hdmi_venc_clk_source(DSS_HDMI_M_PCLK);
@@ -519,7 +520,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
dispc_mgr_enable(OMAP_DSS_CHANNEL_DIGIT, 1);
- ti_hdmi_4xxx_wp_video_start(&hdmi.ip_data, 1);
+ hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 1);
return 0;
err:
@@ -531,9 +532,9 @@ static void hdmi_power_off(struct omap_dss_device *dssdev)
{
dispc_mgr_enable(OMAP_DSS_CHANNEL_DIGIT, 0);
- ti_hdmi_4xxx_wp_video_start(&hdmi.ip_data, 0);
- ti_hdmi_4xxx_phy_disable(&hdmi.ip_data);
- ti_hdmi_4xxx_pll_disable(&hdmi.ip_data);
+ hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
+ hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
+ hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
hdmi_runtime_put();
hdmi.edid_set = 0;