platform: msm_shared: hdmi: read edid before panel initialization

Enable ahb/core clocks first, then read edid of the TV to parse the
resolutions as it needs hardware register access. Add pll clock rates
to support different resolutions read from EDID. Initialize panel
info with the resolution data read from edid.

Change-Id: Id5a20083f05720c31dc11c21983d331a071437ca
diff --git a/target/msm8994/include/target/display.h b/target/msm8994/include/target/display.h
index d47bde9..41af60b 100644
--- a/target/msm8994/include/target/display.h
+++ b/target/msm8994/include/target/display.h
@@ -101,5 +101,6 @@
 int target_hdmi_panel_clock(uint8_t enable, struct msm_panel_info *pinfo);
 int target_hdmi_regulator_ctrl(uint8_t enable);
 int target_hdmi_gpio_ctrl(uint8_t enable);
+int target_hdmi_pll_clock(uint8_t enable, struct msm_panel_info *pinfo);
 
 
diff --git a/target/msm8994/target_display.c b/target/msm8994/target_display.c
index 6cf3653..851fc9a 100644
--- a/target/msm8994/target_display.c
+++ b/target/msm8994/target_display.c
@@ -33,6 +33,7 @@
 #include <err.h>
 #include <msm_panel.h>
 #include <mipi_dsi.h>
+#include <mdss_hdmi.h>
 #include <pm8x41.h>
 #include <pm8x41_wled.h>
 #include <qpnp_wled.h>
@@ -254,6 +255,22 @@
 	return ret;
 }
 
+int target_hdmi_pll_clock(uint8_t enable, struct msm_panel_info *pinfo)
+{
+	if (enable) {
+		hdmi_phy_reset();
+		hdmi_pll_config(pinfo->clk_rate);
+		hdmi_vco_enable();
+		hdmi_pixel_clk_enable(pinfo->clk_rate);
+	} else if(!target_cont_splash_screen()) {
+		/* Disable clocks if continuous splash off */
+		hdmi_pixel_clk_disable();
+		hdmi_vco_disable();
+	}
+
+	return NO_ERROR;
+}
+
 int target_panel_clock(uint8_t enable, struct msm_panel_info *pinfo)
 {
 	uint32_t ret = NO_ERROR;
diff --git a/target/target_display.c b/target/target_display.c
index ae014e1..fb96638 100644
--- a/target/target_display.c
+++ b/target/target_display.c
@@ -116,3 +116,8 @@
 {
 	return 0;
 }
+
+__WEAK int target_hdmi_pll_clock(uint8_t enable, struct msm_panel_info *pinfo)
+{
+	return 0;
+}