flush_delayed_work(&hdmi->delay_work);\r
// When HDMI 1.1V and 2.5V power off, DDC channel will be pull down, current is produced\r
// from VCC_IO which is pull up outside soc. We need to switch DDC IO to GPIO.\r
-// rk2928_mux_api_set(GPIO0A7_I2C3_SDA_HDMI_DDCSDA_NAME, GPIO0A_GPIO0A7);\r
-// rk2928_mux_api_set(GPIO0A6_I2C3_SCL_HDMI_DDCSCL_NAME, GPIO0A_GPIO0A6);\r
+ rk30_mux_api_set(GPIO0A7_I2C3_SDA_HDMI_DDCSDA_NAME, GPIO0A_GPIO0A7);\r
+ rk30_mux_api_set(GPIO0A6_I2C3_SCL_HDMI_DDCSCL_NAME, GPIO0A_GPIO0A6);\r
return;\r
}\r
\r
hdmi_dbg(hdmi->dev, "hdmi exit early resume\n");\r
mutex_lock(&hdmi->enable_mutex);\r
\r
-// rk2928_mux_api_set(GPIO0A7_I2C3_SDA_HDMI_DDCSDA_NAME, GPIO0A_HDMI_DDCSDA);\r
-// rk2928_mux_api_set(GPIO0A6_I2C3_SCL_HDMI_DDCSCL_NAME, GPIO0A_HDMI_DDCSCL);\r
+ rk30_mux_api_set(GPIO0A7_I2C3_SDA_HDMI_DDCSDA_NAME, GPIO0A_HDMI_DDCSDA);\r
+ rk30_mux_api_set(GPIO0A6_I2C3_SCL_HDMI_DDCSCL_NAME, GPIO0A_HDMI_DDCSCL);\r
\r
hdmi->suspend = 0;\r
rk2928_hdmi_initial();\r
unsigned int value;\r
\r
// Remap HDMI IO Pin\r
-// rk2928_mux_api_set(GPIO0A7_I2C3_SDA_HDMI_DDCSDA_NAME, GPIO0A_HDMI_DDCSDA);\r
-// rk2928_mux_api_set(GPIO0A6_I2C3_SCL_HDMI_DDCSCL_NAME, GPIO0A_HDMI_DDCSCL);\r
-// rk2928_mux_api_set(GPIO0B7_HDMI_HOTPLUGIN_NAME, GPIO0B_HDMI_HOTPLUGIN);\r
+ rk30_mux_api_set(GPIO0A7_I2C3_SDA_HDMI_DDCSDA_NAME, GPIO0A_HDMI_DDCSDA);\r
+ rk30_mux_api_set(GPIO0A6_I2C3_SCL_HDMI_DDCSCL_NAME, GPIO0A_HDMI_DDCSCL);\r
+ rk30_mux_api_set(GPIO0B7_HDMI_HOTPLUGIN_NAME, GPIO0B_HDMI_HOTPLUGIN);\r
\r
// Select LCDC0 as video source and enabled.\r
// value = (HDMI_SOURCE_DEFAULT << 14) | (1 << 30);\r
}\r
hdmi->xscale = 95;\r
hdmi->yscale = 95;\r
-#if 0 \r
- hdmi->hclk = clk_get(NULL,"hclk_hdmi");\r
+#if 1 \r
+ hdmi->hclk = clk_get(NULL,"pclk_hdmi");\r
if(IS_ERR(hdmi->hclk))\r
{\r
dev_err(hdmi->dev, "Unable to get hdmi hclk\n");\r
static void rk2928_hdmi_set_pwr_mode(int mode)
{
+ int c=0;
hdmi_dbg(hdmi->dev,"%s \n",__FUNCTION__);
if(hdmi->pwr_mode == mode)
- return;
+ return;
switch(mode){
case NORMAL:
rk2928_hdmi_sys_power_down();
- HDMIWrReg(0xe3, 0x82);
- HDMIWrReg(0xe5, 0x00);
- HDMIWrReg(0xe4, 0x00);
- HDMIWrReg(0xe7, 0x00);
- HDMIWrReg(0xe1, 0x8e);
+ HDMIWrReg(0xe0, 0x0a);
+ HDMIWrReg(0xe1, 0x03);
+ HDMIWrReg(0xe2, 0x99);
+ HDMIWrReg(0xe3, 0x0f);
+ HDMIWrReg(0xe4, 0x00);
+ HDMIWrReg(0xec, 0x02);
HDMIWrReg(0xce, 0x00);
HDMIWrReg(0xce, 0x01);
rk2928_hdmi_av_mute(1);
case LOWER_PWR:
rk2928_hdmi_av_mute(0);
rk2928_hdmi_sys_power_down();
- HDMIWrReg(0xe3, 0x02);
- HDMIWrReg(0xe5, 0x1c);
- HDMIWrReg(0xe1, 0x8c);
- HDMIWrReg(0xe7, 0x04);
- HDMIWrReg(0xe4, 0x03);
+ HDMIWrReg(0xe0, 0x0a);
+ HDMIWrReg(0xe1, 0x03);
+ HDMIWrReg(0xe2, 0x99);
+ HDMIWrReg(0xe3, 0x0f);
+ HDMIWrReg(0xe4, 0x00);
+ HDMIWrReg(0xec, 0x02);
break;
default:
hdmi_dbg(hdmi->dev,"unkown rk2928 hdmi pwr mode %d\n",mode);
else {
hdmi_dbg(hdmi->dev, "[%s] sucess output DVI.\n", __FUNCTION__);
}
- // Power on TMDS
- HDMIWrReg(PHY_PRE_EMPHASIS, v_PRE_EMPHASIS(0) | v_TMDS_PWRDOWN(0)); // TMDS power on
-
- // Enable TMDS
- value = HDMIRdReg(PHY_DRIVER);
- value |= v_TX_ENABLE(1);
- HDMIWrReg(PHY_DRIVER, value);
return 0;
}
interrupt1 = HDMIRdReg(INTERRUPT_STATUS1);
HDMIWrReg(INTERRUPT_STATUS1, interrupt1);
#if 1
- hdmi_dbg(hdmi->dev, "[%s] interrupt1 %02x interrupt2 %02x \n",\
- __FUNCTION__, interrupt1, interrupt2);
+ hdmi_dbg(hdmi->dev, "[%s] interrupt1 %02x \n",\
+ __FUNCTION__, interrupt1);
#endif
if(interrupt1 & m_INT_HOTPLUG ){
if(hdmi->state == HDMI_SLEEP)
return IRQ_HANDLED;
}
+static void rk2928_hdmi_reset(void)
+{
+ writel_relaxed(0x00010001,RK2928_CRU_BASE+ 0x128);
+ msleep(100);
+ writel_relaxed(0x00010000, RK2928_CRU_BASE + 0x128);
+ rk2928_hdmi_set_pwr_mode(NORMAL);
+}
+
int rk2928_hdmi_initial(void)
{
int rc = HDMI_ERROR_SUCESS;
hdmi->config_audio = rk2928_hdmi_config_audio;
hdmi->detect_hotplug = rk2928_hdmi_detect_hotplug;
hdmi->read_edid = rk2928_hdmi_read_edid;
- // internal hclk = hdmi_hclk/20
- //HDMIWrReg(0x800, HDMI_INTERANL_CLK_DIV);
+
+ rk2928_hdmi_reset();
if(hdmi->hdcp_power_on_cb)
rc = hdmi->hdcp_power_on_cb();